Search in sources :

Example 26 with Parameters

use of junitparams.Parameters in project geode by apache.

the class RebalanceDUnitTest method returnCorrectResultsWhenBucketIsMovedAndMovedBackOnIndexUpdate.

@Test
@Parameters(method = "getListOfRegionTestTypes")
public void returnCorrectResultsWhenBucketIsMovedAndMovedBackOnIndexUpdate(RegionTestableType regionTestType) throws InterruptedException {
    final DistributedMember member1 = dataStore1.invoke(() -> getCache().getDistributedSystem().getDistributedMember());
    final DistributedMember member2 = dataStore2.invoke(() -> getCache().getDistributedSystem().getDistributedMember());
    addCallbackToMoveBucket(dataStore1, member2);
    addCallbackToMoveBucket(dataStore2, member1);
    putEntriesAndValidateQueryResults(regionTestType);
}
Also used : DistributedMember(org.apache.geode.distributed.DistributedMember) Parameters(junitparams.Parameters) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Example 27 with Parameters

use of junitparams.Parameters in project geode by apache.

the class RebalanceDUnitTest method returnCorrectResultsWhenRebalanceHappensAfterUpdates.

@Test
@Parameters(method = "getListOfRegionTestTypes")
public void returnCorrectResultsWhenRebalanceHappensAfterUpdates(RegionTestableType regionTestType) throws InterruptedException {
    SerializableRunnableIF createIndex = () -> {
        LuceneService luceneService = LuceneServiceProvider.get(getCache());
        luceneService.createIndexFactory().setFields("text").create(INDEX_NAME, REGION_NAME);
    };
    dataStore1.invoke(() -> initDataStore(createIndex, regionTestType));
    accessor.invoke(() -> initAccessor(createIndex, regionTestType));
    putEntryInEachBucket();
    dataStore2.invoke(() -> initDataStore(createIndex, regionTestType));
    assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
    rebalanceRegion(dataStore2);
    executeTextSearch(accessor, "world", "text", NUM_BUCKETS);
}
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 28 with Parameters

use of junitparams.Parameters in project geode by apache.

the class ClusterConfigurationIndexWithFromClauseDUnitTest method indexCreatedWithEntrySetInFromClauseMustPersist.

@Test
@Parameters(method = "getRegionTypes")
public void indexCreatedWithEntrySetInFromClauseMustPersist(RegionShortcut regionShortcut) throws Exception {
    MemberVM vm1 = lsRule.startServerVM(1, locator.getPort());
    gfshShellConnectionRule.connectAndVerify(locator);
    createRegionUsingGfsh(REGION_NAME, regionShortcut, null);
    createIndexUsingGfsh("\"" + REGION_NAME + ".entrySet() z\"", "z.key", INDEX_NAME);
    String serverName = vm1.getName();
    CommandStringBuilder csb = new CommandStringBuilder(CliStrings.LIST_MEMBER);
    gfshShellConnectionRule.executeAndVerifyCommand(csb.toString());
    lsRule.stopMember(1);
    lsRule.startServerVM(1, lsRule.getMember(0).getPort());
    ;
    verifyIndexRecreated(INDEX_NAME);
}
Also used : MemberVM(org.apache.geode.test.dunit.rules.MemberVM) CommandStringBuilder(org.apache.geode.management.internal.cli.util.CommandStringBuilder) Parameters(junitparams.Parameters) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Example 29 with Parameters

use of junitparams.Parameters in project geode by apache.

the class StatArchiveHandlerIntegrationTest method getRollingArchiveName_withOldArchives_rollsChildId.

@Test
@Parameters({ "1,1,false,false", "1,1,false,true", "1,1,true,false", "1,1,true,true", "1,10,false,false", "1,10,false,true", "1,10,true,false", "1,10,true,true", "10,1,false,false", "10,1,false,true", "10,1,true,false", "10,1,true,true", "10,10,false,false", "10,10,false,true", "10,10,true,false", "10,10,true,true" })
public void getRollingArchiveName_withOldArchives_rollsChildId(final int mainCount, final int childCount, final boolean archiveExists, final boolean archiveClosed) throws Exception {
    createEmptyArchiveFiles(this.dir, this.name, this.ext, mainCount, childCount);
    if (archiveExists) {
        this.archive.createNewFile();
    }
    StatArchiveHandler handler = new StatArchiveHandler(this.mockConfig, this.mockCollector, this.rollingFileHandler);
    File file = handler.getRollingArchiveName(this.archive, archiveClosed);
    assertThat(file).hasParent(this.dir).hasName(this.name + formatIds(mainCount, childCount + 1) + this.ext);
}
Also used : File(java.io.File) Parameters(junitparams.Parameters) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Example 30 with Parameters

use of junitparams.Parameters in project geode by apache.

the class StatArchiveHandlerIntegrationTest method getRollingArchiveName_withEmptyDir_createsFirstIds.

@Test
@Parameters({ "false,false,false", "false,false,true", "false,true,false", "false,true,true", "true,false,false", "true,false,true", "true,true,false", "true,true,true" })
public void getRollingArchiveName_withEmptyDir_createsFirstIds(final boolean archiveExists, final boolean archiveClosed, final boolean initMainId) throws Exception {
    if (archiveExists) {
        this.archive.createNewFile();
    }
    StatArchiveHandler handler = new StatArchiveHandler(this.mockConfig, this.mockCollector, this.rollingFileHandler);
    if (initMainId) {
        handler.initMainArchiveId(this.archive);
    }
    File file = handler.getRollingArchiveName(this.archive, archiveClosed);
    assertThat(file).hasParent(this.dir).hasName(this.name + formatIds(1, 1) + this.ext);
}
Also used : File(java.io.File) Parameters(junitparams.Parameters) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

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