use of junitparams.Parameters in project geode by apache.
the class LuceneQueriesDUnitTest method verifySpaceQueriesFail.
@Test
@Parameters(method = "getListOfRegionTestTypes")
public void verifySpaceQueriesFail(RegionTestableType regionTestType) {
SerializableRunnableIF createIndex = () -> {
LuceneService luceneService = LuceneServiceProvider.get(getCache());
luceneService.createIndexFactory().addField("text").create(INDEX_NAME, REGION_NAME);
};
dataStore1.invoke(() -> initDataStore(createIndex, regionTestType));
dataStore2.invoke(() -> initDataStore(createIndex, regionTestType));
accessor.invoke(() -> initAccessor(createIndex, regionTestType));
putDataInRegion(accessor);
assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
executeTextSearchWithExpectedException(accessor, " ", "*", LuceneQueryException.class);
executeTextSearchWithExpectedException(accessor, " ", "text", LuceneQueryException.class);
executeTextSearchWithExpectedException(accessor, " ", "XXX", LuceneQueryException.class);
}
use of junitparams.Parameters in project geode by apache.
the class LuceneQueriesDUnitTest method verifyWaitForFlushedFunctionOnAccessor.
@Test
@Parameters(method = "getListOfRegionTestTypes")
public void verifyWaitForFlushedFunctionOnAccessor(RegionTestableType regionTestType) throws InterruptedException {
SerializableRunnableIF createIndex = () -> {
LuceneService luceneService = LuceneServiceProvider.get(getCache());
luceneService.createIndexFactory().addField("text").create(INDEX_NAME, REGION_NAME);
};
dataStore1.invoke(() -> initDataStore(createIndex, regionTestType));
dataStore2.invoke(() -> initDataStore(createIndex, regionTestType));
accessor.invoke(() -> initAccessor(createIndex, regionTestType));
dataStore1.invoke(() -> LuceneTestUtilities.pauseSender(getCache()));
dataStore2.invoke(() -> LuceneTestUtilities.pauseSender(getCache()));
putDataInRegion(accessor);
assertFalse(waitForFlushBeforeExecuteTextSearch(accessor, 200));
dataStore1.invoke(() -> LuceneTestUtilities.resumeSender(getCache()));
dataStore2.invoke(() -> LuceneTestUtilities.resumeSender(getCache()));
assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
executeTextSearch(accessor, "world", "text", 3);
executeTextSearch(accessor, "world", "noEntriesMapped", 0);
}
use of junitparams.Parameters in project geode by apache.
the class LuceneIndexCreationDUnitTest method verifyDifferentFieldsFails.
@Test
@Parameters({ "PARTITION" })
public void verifyDifferentFieldsFails(RegionTestableType regionType) {
SerializableRunnableIF createIndex1 = getFieldsIndexWithOneField();
dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
SerializableRunnableIF createIndex2 = getFieldsIndexWithTwoFields();
dataStore2.invoke(() -> initDataStore(createIndex2, regionType, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_FIELDS));
}
use of junitparams.Parameters in project geode by apache.
the class LuceneIndexCreationDUnitTest method verifyDifferentIndexesFails2.
@Test
@Parameters({ "PARTITION" })
public void verifyDifferentIndexesFails2(RegionTestableType regionType) {
SerializableRunnableIF createIndex1 = getFieldsIndexWithOneField();
dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
SerializableRunnableIF createIndex2 = () -> {
LuceneService luceneService = LuceneServiceProvider.get(getCache());
luceneService.createIndexFactory().addField("field1").create(INDEX_NAME, REGION_NAME);
luceneService.createIndexFactory().addField("field2").create(INDEX_NAME + "2", REGION_NAME);
};
dataStore2.invoke(() -> initDataStore(createIndex2, regionType, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_INDEXES_2));
}
use of junitparams.Parameters in project geode by apache.
the class LuceneIndexCreationDUnitTest method verifyDifferentFieldAnalyzerSizesFails1.
@Test
@Parameters({ "PARTITION" })
public void verifyDifferentFieldAnalyzerSizesFails1(RegionTestableType regionType) {
SerializableRunnableIF createIndex1 = getAnalyzersIndexWithTwoFields();
dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
SerializableRunnableIF createIndex2 = getAnalyzersIndexWithOneField();
dataStore2.invoke(() -> initDataStore(createIndex2, regionType, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_FIELDS_2));
}
Aggregations