OPENDJ-2731 Middle and final substring indexes fail to return resulting in an unindexed search.
Improve unit tests on substring indexes.
Covers all three cases for wildcard substring filter specifications.
| | |
| | | assertThat(runSearch(request, false)).isEmpty(); |
| | | } |
| | | |
| | | @DataProvider |
| | | protected Object[][] subStringSearchFilter() |
| | | { |
| | | return new Object[][] { |
| | | // @formatter:off |
| | | { "sn=abadin*", 1}, |
| | | { "sn=*abadin*", 1}, |
| | | { "sn=*abadin", 0}, |
| | | { "sn=*adines", 1} |
| | | // @formatter:on |
| | | }; |
| | | } |
| | | |
| | | @Test(dataProvider = "subStringSearchFilter") |
| | | public void testFilterUsingSubStringSearch(final String filter, int numberOfEntries) throws Exception |
| | | { |
| | | SearchRequest request = newSearchRequest(testBaseDN, SearchScope.WHOLE_SUBTREE, filter); |
| | | assertThat(runSearch(request, false)).hasSize(numberOfEntries); |
| | | } |
| | | |
| | | @Test |
| | | public void testSearchIsConsideredUnindexedBasedOnLookThroughLimit() throws DirectoryException { |
| | | final int nbEntries = topEntries.size() + entries.size() + workEntries.size(); |
| | |
| | | } |
| | | |
| | | |
| | | @DataProvider(name = "userEntrySearchData") |
| | | @DataProvider |
| | | protected Object[][] userEntrySearchData() |
| | | { |
| | | return new Object[][] { |