use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.
the class MyGatewayEventSubstitutionFilter method createFixedPartitionedRegionWithAsyncEventQueue.
public static void createFixedPartitionedRegionWithAsyncEventQueue(String regionName, String asyncEventQueueId, String partitionName, final List<String> allPartitions, boolean offHeap) {
IgnoredException exp = IgnoredException.addIgnoredException(ForceReattemptException.class.getName());
IgnoredException exp1 = IgnoredException.addIgnoredException(PartitionOfflineException.class.getName());
try {
AttributesFactory fact = new AttributesFactory();
PartitionAttributesFactory pfact = new PartitionAttributesFactory();
pfact.setTotalNumBuckets(16);
pfact.addFixedPartitionAttributes(FixedPartitionAttributes.createFixedPartition(partitionName, true));
pfact.setPartitionResolver(new MyFixedPartitionResolver(allPartitions));
fact.setPartitionAttributes(pfact.create());
fact.setOffHeap(offHeap);
Region r = cache.createRegionFactory(fact.create()).addAsyncEventQueueId(asyncEventQueueId).create(regionName);
assertNotNull(r);
} finally {
exp.remove();
exp1.remove();
}
}
use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.
the class MyGatewayEventSubstitutionFilter method createColocatedPartitionedRegionWithAsyncEventQueue.
public static void createColocatedPartitionedRegionWithAsyncEventQueue(String regionName, String asyncEventQueueId, Integer totalNumBuckets, String colocatedWith) {
IgnoredException exp = IgnoredException.addIgnoredException(ForceReattemptException.class.getName());
IgnoredException exp1 = IgnoredException.addIgnoredException(PartitionOfflineException.class.getName());
try {
AttributesFactory fact = new AttributesFactory();
PartitionAttributesFactory pfact = new PartitionAttributesFactory();
pfact.setTotalNumBuckets(totalNumBuckets);
pfact.setColocatedWith(colocatedWith);
fact.setPartitionAttributes(pfact.create());
Region r = cache.createRegionFactory(fact.create()).addAsyncEventQueueId(asyncEventQueueId).create(regionName);
assertNotNull(r);
} finally {
exp.remove();
exp1.remove();
}
}
use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.
the class MyGatewayEventSubstitutionFilter method createReplicatedRegionWithAsyncEventQueue.
public static void createReplicatedRegionWithAsyncEventQueue(String regionName, String asyncQueueIds, Boolean offHeap) {
IgnoredException exp1 = IgnoredException.addIgnoredException(ForceReattemptException.class.getName());
try {
AttributesFactory fact = new AttributesFactory();
addAsyncEventQueueIds(fact, asyncQueueIds);
fact.setDataPolicy(DataPolicy.REPLICATE);
fact.setOffHeap(offHeap);
RegionFactory regionFactory = cache.createRegionFactory(fact.create());
Region r = regionFactory.create(regionName);
assertNotNull(r);
} finally {
exp1.remove();
}
}
use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.
the class MyFunctionException method testDistributedRegionFunctionExecutionWithFunctionInvocationTargetException_WithoutHA.
@Test
public void testDistributedRegionFunctionExecutionWithFunctionInvocationTargetException_WithoutHA() {
// Empty
createCacheInVm();
normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
replicate2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
replicate3.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
registerFunction(new Boolean(false), new Integer(0));
createPeer(DataPolicy.EMPTY);
populateRegion();
normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createPeer(DataPolicy.NORMAL));
replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createPeer(DataPolicy.REPLICATE));
replicate2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createPeer(DataPolicy.REPLICATE));
replicate3.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createPeer(DataPolicy.REPLICATE));
normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(false), new Integer(0)));
replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(false), new Integer(0)));
replicate2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(false), new Integer(0)));
replicate3.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(false), new Integer(0)));
// add expected exception to avoid suspect strings
final IgnoredException ex = IgnoredException.addIgnoredException("I have been thrown");
replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.executeFunctionFunctionInvocationTargetExceptionWithoutHA());
ex.remove();
}
use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.
the class MyFunctionException method testDistributedRegionFunctionExecutionWithFunctionInvocationTargetExceptionForEmptyDataPolicy_WithoutHA.
@Test
public void testDistributedRegionFunctionExecutionWithFunctionInvocationTargetExceptionForEmptyDataPolicy_WithoutHA() {
// Empty
createCacheInVm();
normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
replicate2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
replicate3.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
registerFunction(new Boolean(false), new Integer(0));
createPeer(DataPolicy.EMPTY);
populateRegion();
normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createPeer(DataPolicy.NORMAL));
replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createPeer(DataPolicy.REPLICATE));
replicate2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createPeer(DataPolicy.REPLICATE));
replicate3.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createPeer(DataPolicy.REPLICATE));
normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(false), new Integer(0)));
replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(false), new Integer(0)));
replicate2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(false), new Integer(0)));
replicate3.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(false), new Integer(0)));
// add expected exception to avoid suspect strings
final IgnoredException ex = IgnoredException.addIgnoredException("I have been thrown");
executeFunctionFunctionInvocationTargetExceptionWithoutHA();
ex.remove();
}
Aggregations