use of org.apache.geode.test.dunit.SerializableRunnableIF in project geode by apache.
the class LuceneIndexCreationDUnitTest method verifyDifferentFieldAnalyzersFails3.
@Test
@Parameters({ "PARTITION" })
public void verifyDifferentFieldAnalyzersFails3(RegionTestableType regionType) {
SerializableRunnableIF createIndex1 = getAnalyzersIndexWithNullField2();
dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
SerializableRunnableIF createIndex2 = getAnalyzersIndexWithNullField1();
dataStore2.invoke(() -> initDataStore(createIndex2, regionType, LuceneTestUtilities.CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_ANALYZERS_3));
}
use of org.apache.geode.test.dunit.SerializableRunnableIF in project geode by apache.
the class LuceneIndexCreationDUnitTest method verifyStandardAnalyzerAndNullOnSameFieldPasses2.
@Test
@Parameters("PARTITION")
public void verifyStandardAnalyzerAndNullOnSameFieldPasses2(RegionTestableType regionType) {
SerializableRunnableIF createIndex1 = getAnalyzersIndexWithTwoFields2();
dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
SerializableRunnableIF createIndex2 = getAnalyzersIndexWithNullField1();
dataStore2.invoke(() -> initDataStore(createIndex2, regionType));
}
use of org.apache.geode.test.dunit.SerializableRunnableIF in project geode by apache.
the class LuceneIndexCreationDUnitTest method verifyStandardAnalyzerAndNullOnSameFieldPasses.
@Test
@Parameters("PARTITION")
public void verifyStandardAnalyzerAndNullOnSameFieldPasses(RegionTestableType regionType) {
SerializableRunnableIF createIndex1 = getAnalyzersIndexWithNullField1();
dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
SerializableRunnableIF createIndex2 = getAnalyzersIndexWithTwoFields2();
dataStore2.invoke(() -> initDataStore(createIndex2, regionType));
}
use of org.apache.geode.test.dunit.SerializableRunnableIF in project geode by apache.
the class PartitionedRegionQueryDUnitTest method failToCreateIndexOnNode.
private void failToCreateIndexOnNode(final VM vmToFailCreationOn) {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
SerializableRunnableIF createPR = () -> {
Cache cache = getCache();
PartitionAttributesFactory paf = new PartitionAttributesFactory();
paf.setTotalNumBuckets(10);
cache.createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(paf.create()).create("region");
};
vm0.invoke(createPR);
vm1.invoke(createPR);
vm0.invoke(() -> {
Cache cache = getCache();
Region region = cache.getRegion("region");
IntStream.range(1, 10).forEach(i -> region.put(i, new NotDeserializableAsset(vmToFailCreationOn.getPid())));
});
vm0.invoke(() -> {
Cache cache = getCache();
try {
cache.getQueryService().createHashIndex("ContractDocumentIndex", "document", "/region");
fail("Should have thrown an exception");
} catch (Exception expected) {
}
});
vm1.invoke(() -> {
Cache cache = getCache();
Region region = cache.getRegion("region");
final AbstractIndex index = (AbstractIndex) cache.getQueryService().getIndex(region, "ContractDocumentIndex");
// be set.
if (index != null) {
assertFalse(index.isPopulated());
}
});
}
use of org.apache.geode.test.dunit.SerializableRunnableIF in project geode by apache.
the class FixedPRSinglehopDUnitTest method test_MetadataContents.
// 4 servers, 1 client connected to all 4 servers.
// Put data, get data and make the metadata stable.
// Now verify that metadata has all 8 buckets info.
// Now update and ensure the fetch service is never called.
// GEODE-1176: random ports, time sensitive, waitForCriterion
@Category(FlakyTest.class)
@Test
public void test_MetadataContents() {
final Host host = Host.getHost(0);
VM server1 = host.getVM(0);
VM server2 = host.getVM(1);
VM server3 = host.getVM(2);
VM server4 = host.getVM(3);
List<FixedPartitionAttributes> fpaList = new ArrayList<FixedPartitionAttributes>();
fpaList.add(FixedPartitionAttributes.createFixedPartition("Q1", true, 3));
fpaList.add(FixedPartitionAttributes.createFixedPartition("Q2", false, 3));
Integer port1 = (Integer) server1.invoke(() -> FixedPRSinglehopDUnitTest.createServer(false, fpaList));
fpaList.clear();
fpaList.add(FixedPartitionAttributes.createFixedPartition("Q3", true, 3));
fpaList.add(FixedPartitionAttributes.createFixedPartition("Q4", false, 3));
Integer port2 = (Integer) server2.invoke(() -> FixedPRSinglehopDUnitTest.createServer(false, fpaList));
fpaList.clear();
fpaList.add(FixedPartitionAttributes.createFixedPartition("Q2", true, 3));
fpaList.add(FixedPartitionAttributes.createFixedPartition("Q3", false, 3));
Integer port3 = (Integer) server3.invoke(() -> FixedPRSinglehopDUnitTest.createServer(false, fpaList));
fpaList.clear();
fpaList.add(FixedPartitionAttributes.createFixedPartition("Q4", true, 3));
fpaList.add(FixedPartitionAttributes.createFixedPartition("Q1", false, 3));
Integer port4 = (Integer) server4.invoke(() -> FixedPRSinglehopDUnitTest.createServer(false, fpaList));
createClient(port1, port2, port3, port4);
putIntoPartitionedRegions();
getFromPartitionedRegions();
SerializableRunnableIF printView = () -> FixedPRSinglehopDUnitTest.printView();
server1.invoke(printView);
server2.invoke(printView);
server3.invoke(printView);
server4.invoke(printView);
int totalBucketOnServer = 0;
SerializableCallableIF<Integer> getBucketCount = () -> FixedPRSinglehopDUnitTest.primaryBucketsOnServer();
totalBucketOnServer += server1.invoke(getBucketCount);
totalBucketOnServer += server2.invoke(getBucketCount);
totalBucketOnServer += server3.invoke(getBucketCount);
totalBucketOnServer += server4.invoke(getBucketCount);
verifyMetadata(totalBucketOnServer, 2);
updateIntoSinglePR(true);
}
Aggregations