-
Type:
Task
-
Status: Closed
-
Priority:
Minor
-
Resolution: Completed
-
Affects Version/s: None
-
Component/s: Search Infrastructure > Framework
-
Labels:
-
Branch Version/s:7.1.x
-
Backported to Branch:Committed
-
Epic/Theme:
-
Story Points:2
-
Epic Link:
-
Sprint:Search | S02 Sprint 2, Search | S02 Sprint 3, Search | S02 Sprint 4, Search | S02 Sprint 5, Search | S02 Sprint 6
-
Git Pull Request:
- Base classes in portal-search-test-util
- Unit tests in portal-search-elasticsearch6 and portal-search-solr7
- Unit tests use no Indexer, no IndexerPostProcessor. Just index documents directly and search.
- Only one integration test will be left using Indexer and IndexerPostProcessor.
- After all methods are converted, DocumentTest can be deleted.
Sort tests
New base class in com.liferay.portal.search.test.util.sort
com.liferay.portal.search.document.test.DocumentTest.testFirstNameSearchSortedBySingleDouble()
com.liferay.portal.search.document.test.DocumentTest.testFirstNameSearchSortedBySingleFloat()
com.liferay.portal.search.document.test.DocumentTest.testFirstNameSearchSortedBySingleInteger()
com.liferay.portal.search.document.test.DocumentTest.testFirstNameSearchSortedBySingleLong()
com.liferay.portal.search.document.test.DocumentTest.testLastNameSearchSortedBySingleDouble()
com.liferay.portal.search.document.test.DocumentTest.testLastNameSearchSortedBySingleFloat()
com.liferay.portal.search.document.test.DocumentTest.testLastNameSearchSortedBySingleInteger()
com.liferay.portal.search.document.test.DocumentTest.testLastNameSearchSortedBySingleLong()
Count tests
New base class in com.liferay.portal.search.test.util.count
com.liferay.portal.search.document.test.DocumentTest.testFirstNameSearchResultsCount1()
com.liferay.portal.search.document.test.DocumentTest.testFirstNameSearchResultsCount2()
com.liferay.portal.search.document.test.DocumentTest.testLastNameSearchResultsCount()
Relevance tests: First Name field
New base class in com.liferay.portal.search.test.util.mappings (NOT a copy of "*FieldQueryBuilderTestCase")
com.liferay.portal.search.document.test.DocumentTest.testFirstNamesSearchResults()
Must use the Liferay Type Mappings and the same field name as the original User indexer.
Relevance tests: Last Name field
New base class in com.liferay.portal.search.test.util.mappings (NOT a copy of "*FieldQueryBuilderTestCase")
com.liferay.portal.search.document.test.DocumentTest.testLastNameSearchResults()
Must use the Liferay Type Mappings and the same field name as the original User indexer.
IndexerPostProcessor test
This is the only integration test. (Everything above are unit tests)
Create a new integration test in portal-search-test / com.liferay.portal.search.indexer.test
In the test case, do it like this:
com.liferay.portal.search.document.test.DocumentTest.setUp()
To register a BaseIndexerPostProcessor into the User indexer.
No need to index all the same fields. It's enough to index just one additional field.
Test should search on the additional field like this:
com.liferay.portal.search.document.test.DocumentTest.checkSearchContext(SearchContext)
And assert the additional field is present.
Test case should: assert no match; register processor; assert match; unregister processor; assert no match again.
Use UserSearchFixture to create any Groups or Users.
- depends on
-
LPS-84895 Quarantine: Solr fails DocumentTest sorting integration tests
-
- Closed
-