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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations