use of junitparams.Parameters in project geode by apache.
the class EvictionDUnitTest method regionWithEvictionWithLocalDestroyMustNotbeAbleToCreateLuceneIndexes.
@Test
@Parameters(method = "getPartitionRedundantLocalDestroyEvictionRegionType")
public void regionWithEvictionWithLocalDestroyMustNotbeAbleToCreateLuceneIndexes(RegionTestableType regionTestType) {
SerializableRunnableIF createIndex = getSerializableRunnableIFCreateIndex();
dataStore1.invoke(() -> {
try {
initDataStore(createIndex, regionTestType);
} catch (UnsupportedOperationException e) {
assertEquals("Lucene indexes on regions with eviction and action local destroy are not supported", e.getMessage());
assertNull(getCache().getRegion(REGION_NAME));
}
});
}
use of junitparams.Parameters in project geode by apache.
the class ExpirationDUnitTest method regionWithExpirationSetMustAlsoRemoveLuceneIndexEntries.
@Test
@Parameters(method = "getPartitionRegionsWithExpirationSet")
public void regionWithExpirationSetMustAlsoRemoveLuceneIndexEntries(RegionTestableType regionTestType) {
SerializableRunnableIF createIndex = () -> {
LuceneService luceneService = LuceneServiceProvider.get(getCache());
luceneService.createIndexFactory().setFields("text").create(INDEX_NAME, REGION_NAME);
};
dataStore1.invoke(() -> initDataStore(createIndex, regionTestType));
dataStore2.invoke(() -> initDataStore(createIndex, regionTestType));
accessor.invoke(() -> initDataStore(createIndex, regionTestType));
accessor.invoke(() -> {
Cache cache = getCache();
Region region = cache.getRegion(REGION_NAME);
IntStream.range(0, NUM_BUCKETS).forEach(i -> region.put(i, new TestObject("hello world")));
});
assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
accessor.invoke(() -> Awaitility.await().atMost(EXPIRATION_TIMEOUT_SEC + EXTRA_WAIT_TIME_SEC, TimeUnit.SECONDS).until(() -> {
LuceneService luceneService = LuceneServiceProvider.get(getCache());
LuceneQuery<Integer, TestObject> luceneQuery = luceneService.createLuceneQueryFactory().setLimit(100).create(INDEX_NAME, REGION_NAME, "world", "text");
Collection luceneResultList = null;
try {
luceneResultList = luceneQuery.findKeys();
} catch (LuceneQueryException e) {
e.printStackTrace();
fail();
}
assertEquals(0, luceneResultList.size());
}));
}
use of junitparams.Parameters in project geode by apache.
the class LuceneIndexCreationDUnitTest method verifyDifferentFieldAnalyzerSizesFails2.
@Test
@Parameters({ "PARTITION" })
public void verifyDifferentFieldAnalyzerSizesFails2(RegionTestableType regionType) {
SerializableRunnableIF createIndex1 = getAnalyzersIndexWithOneField();
dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
SerializableRunnableIF createIndex2 = getAnalyzersIndexWithTwoFields();
dataStore2.invoke(() -> initDataStore(createIndex2, regionType, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_FIELDS));
}
use of junitparams.Parameters in project geode by apache.
the class LuceneIndexCreationDUnitTest method verifyThatIndexObjectsAreListedWhenPresentInTheSystem.
@Test
@Parameters(method = "parametersForMultipleIndexCreates")
public void verifyThatIndexObjectsAreListedWhenPresentInTheSystem(int numberOfIndexes, RegionTestableType regionType) {
SerializableRunnableIF createIndex = getMultipleIndexes(numberOfIndexes);
dataStore1.invoke(() -> initDataStore(createIndex, regionType));
dataStore1.invoke(() -> verifyIndexList(numberOfIndexes));
dataStore2.invoke(() -> initDataStore(createIndex, regionType));
dataStore2.invoke(() -> verifyIndexList(numberOfIndexes));
}
use of junitparams.Parameters in project geode by apache.
the class LuceneIndexCreationDUnitTest method verifyDifferentIndexesFails1.
@Test
@Parameters({ "PARTITION" })
public void verifyDifferentIndexesFails1(RegionTestableType regionType) {
SerializableRunnableIF createIndex1 = getFieldsIndexWithOneField();
dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
SerializableRunnableIF createIndex2 = () -> {
/* Do nothing */
};
dataStore2.invoke(() -> initDataStore(createIndex2, regionType, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_INDEXES_1));
}
Aggregations