Search in sources :

Example 16 with Parameters

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);
}
Also used : SerializableRunnableIF(org.apache.geode.test.dunit.SerializableRunnableIF) Parameters(junitparams.Parameters) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Example 17 with Parameters

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);
}
Also used : SerializableRunnableIF(org.apache.geode.test.dunit.SerializableRunnableIF) Parameters(junitparams.Parameters) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Example 18 with Parameters

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));
}
Also used : SerializableRunnableIF(org.apache.geode.test.dunit.SerializableRunnableIF) Parameters(junitparams.Parameters) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Example 19 with Parameters

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));
}
Also used : SerializableRunnableIF(org.apache.geode.test.dunit.SerializableRunnableIF) Parameters(junitparams.Parameters) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Example 20 with Parameters

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));
}
Also used : SerializableRunnableIF(org.apache.geode.test.dunit.SerializableRunnableIF) Parameters(junitparams.Parameters) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Aggregations

Parameters (junitparams.Parameters)311 Test (org.junit.Test)311 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)55 DescriptorSet (com.spotify.protoman.descriptor.DescriptorSet)43 ValidationViolation (com.spotify.protoman.validation.ValidationViolation)43 SerializableRunnableIF (org.apache.geode.test.dunit.SerializableRunnableIF)41 QueryDataSource (org.apache.druid.query.QueryDataSource)30 TableDataSource (org.apache.druid.query.TableDataSource)30 GlobalTableDataSource (org.apache.druid.query.GlobalTableDataSource)26 DefaultDimensionSpec (org.apache.druid.query.dimension.DefaultDimensionSpec)26 CountAggregatorFactory (org.apache.druid.query.aggregation.CountAggregatorFactory)24 Method (java.lang.reflect.Method)19 LookupDataSource (org.apache.druid.query.LookupDataSource)19 IByteArrayKeyValueDatabase (org.aion.base.db.IByteArrayKeyValueDatabase)18 InternalSerializationService (com.hazelcast.internal.serialization.InternalSerializationService)17 DefaultSerializationServiceBuilder (com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder)13 MapTableField (com.hazelcast.sql.impl.schema.map.MapTableField)12 Owner (org.candlepin.model.Owner)12 Product (org.candlepin.model.Product)12 CommandResult (org.apache.geode.management.internal.cli.result.CommandResult)11