Search in sources :

Example 36 with IgnoredException

use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.

the class MyFunctionException method testDistributedRegionFunctionExecutionWithFunctionInvocationTargetException.

@Test
public void testDistributedRegionFunctionExecutionWithFunctionInvocationTargetException() {
    // Empty
    createCacheInVm();
    normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    replicate2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    replicate3.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    registerFunction(new Boolean(true), new Integer(5));
    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(true), new Integer(5)));
    replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(true), new Integer(5)));
    replicate2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(true), new Integer(5)));
    replicate3.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(true), new Integer(5)));
    // add expected exception to avoid suspect strings
    final IgnoredException ex = IgnoredException.addIgnoredException("I have been thrown");
    replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.executeFunctionFunctionInvocationTargetException());
    ex.remove();
}
Also used : IgnoredException(org.apache.geode.test.dunit.IgnoredException) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest) Test(org.junit.Test)

Example 37 with IgnoredException

use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.

the class MyFunctionException method testDistributedRegionFunctionExecutionOnDataPolicyEmpty_ClientServer_FunctionInvocationTargetException_WithoutHA.

@Test
public void testDistributedRegionFunctionExecutionOnDataPolicyEmpty_ClientServer_FunctionInvocationTargetException_WithoutHA() {
    VM empty1 = replicate3;
    VM empty2 = normal;
    empty2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    replicate2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    empty1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    createCacheInClientVm();
    registerFunction(new Boolean(false), new Integer(0));
    Integer port1 = (Integer) empty1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createServer(DataPolicy.EMPTY));
    Integer port2 = (Integer) empty2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createServer(DataPolicy.EMPTY));
    replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createPeer(DataPolicy.REPLICATE));
    replicate2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createPeer(DataPolicy.REPLICATE));
    createClientAndPopulateClientRegion(DataPolicy.EMPTY, port1, port2);
    empty1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(false), new Integer(0)));
    empty2.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)));
    // add expected exception to avoid suspect strings
    final IgnoredException ex = IgnoredException.addIgnoredException("I have been thrown");
    executeFunctionFunctionInvocationTargetException_ClientServer_WithoutHA();
    ex.remove();
}
Also used : VM(org.apache.geode.test.dunit.VM) IgnoredException(org.apache.geode.test.dunit.IgnoredException) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest) Test(org.junit.Test)

Example 38 with IgnoredException

use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.

the class MyFunctionException method testDistributedRegionFunctionExecutionWithFunctionInvocationTargetExceptionForEmptyDataPolicy.

@Test
public void testDistributedRegionFunctionExecutionWithFunctionInvocationTargetExceptionForEmptyDataPolicy() {
    // Empty
    createCacheInVm();
    normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    replicate2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    replicate3.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    registerFunction(new Boolean(true), new Integer(5));
    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(true), new Integer(5)));
    replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(true), new Integer(5)));
    replicate2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(true), new Integer(5)));
    replicate3.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(true), new Integer(5)));
    // add expected exception to avoid suspect strings
    final IgnoredException ex = IgnoredException.addIgnoredException("I have been thrown");
    executeFunctionFunctionInvocationTargetException();
    ex.remove();
}
Also used : IgnoredException(org.apache.geode.test.dunit.IgnoredException) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest) Test(org.junit.Test)

Example 39 with IgnoredException

use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.

the class MyFunctionException method testDistributedRegionFunctionExecutionOnDataPolicyEmpty_ClientServer_FunctionInvocationTargetException.

@Test
public void testDistributedRegionFunctionExecutionOnDataPolicyEmpty_ClientServer_FunctionInvocationTargetException() {
    VM empty1 = replicate3;
    VM empty2 = normal;
    empty2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    replicate2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    empty1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
    createCacheInClientVm();
    registerFunction(new Boolean(true), new Integer(5));
    Integer port1 = (Integer) empty1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createServer(DataPolicy.EMPTY));
    Integer port2 = (Integer) empty2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createServer(DataPolicy.EMPTY));
    replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createPeer(DataPolicy.REPLICATE));
    replicate2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createPeer(DataPolicy.REPLICATE));
    createClientAndPopulateClientRegion(DataPolicy.EMPTY, port1, port2);
    empty1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(true), new Integer(5)));
    empty2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(true), new Integer(5)));
    replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(true), new Integer(5)));
    replicate2.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.registerFunction(new Boolean(true), new Integer(5)));
    // add expected exception to avoid suspect strings
    final IgnoredException ex = IgnoredException.addIgnoredException("I have been thrown");
    executeFunctionFunctionInvocationTargetException_ClientServer();
    ex.remove();
}
Also used : VM(org.apache.geode.test.dunit.VM) IgnoredException(org.apache.geode.test.dunit.IgnoredException) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest) Test(org.junit.Test)

Example 40 with IgnoredException

use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.

the class PRClientServerRegionFunctionExecutionSingleHopDUnitTest method testServerSingleKeyExecution_SocketTimeOut.

@Test
public void testServerSingleKeyExecution_SocketTimeOut() {
    createScenario();
    Function function = new TestFunction(true, TestFunction.TEST_FUNCTION_SOCKET_TIMEOUT);
    registerFunctionAtServer(function);
    isByName = Boolean.TRUE;
    // add expected exception for server going down after wait
    final IgnoredException expectedEx = IgnoredException.addIgnoredException(DistributedSystemDisconnectedException.class.getName(), server1);
    try {
        client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverSingleKeyExecutionSocketTimeOut(isByName));
    } finally {
        expectedEx.remove();
    }
}
Also used : Function(org.apache.geode.cache.execute.Function) TestFunction(org.apache.geode.internal.cache.functions.TestFunction) DistributedSystemDisconnectedException(org.apache.geode.distributed.DistributedSystemDisconnectedException) TestFunction(org.apache.geode.internal.cache.functions.TestFunction) IgnoredException(org.apache.geode.test.dunit.IgnoredException) ClientServerTest(org.apache.geode.test.junit.categories.ClientServerTest) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Aggregations

IgnoredException (org.apache.geode.test.dunit.IgnoredException)142 Test (org.junit.Test)89 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)71 Region (org.apache.geode.cache.Region)46 FlakyTest (org.apache.geode.test.junit.categories.FlakyTest)46 VM (org.apache.geode.test.dunit.VM)43 Host (org.apache.geode.test.dunit.Host)38 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)34 AttributesFactory (org.apache.geode.cache.AttributesFactory)30 ForceReattemptException (org.apache.geode.internal.cache.ForceReattemptException)28 PartitionAttributesFactory (org.apache.geode.cache.PartitionAttributesFactory)23 IOException (java.io.IOException)21 CacheClosedException (org.apache.geode.cache.CacheClosedException)21 LocalRegion (org.apache.geode.internal.cache.LocalRegion)20 PartitionOfflineException (org.apache.geode.cache.persistence.PartitionOfflineException)16 RMIException (org.apache.geode.test.dunit.RMIException)15 GatewaySender (org.apache.geode.cache.wan.GatewaySender)14 BucketRegion (org.apache.geode.internal.cache.BucketRegion)14 SerializableRunnable (org.apache.geode.test.dunit.SerializableRunnable)14 CacheXmlException (org.apache.geode.cache.CacheXmlException)12