use of org.apache.geode.internal.cache.functions.DistribuedRegionFunctionFunctionInvocationException in project geode by apache.
the class MyFunctionException method registerFunction.
public static void registerFunction(Boolean isHA, Integer retryCount) {
Function function = new DistribuedRegionFunctionFunctionInvocationException(isHA.booleanValue(), retryCount.intValue());
FunctionService.registerFunction(function);
}
use of org.apache.geode.internal.cache.functions.DistribuedRegionFunctionFunctionInvocationException in project geode by apache.
the class MyFunctionException method executeFunctionFunctionInvocationTargetExceptionWithoutHA.
public static void executeFunctionFunctionInvocationTargetExceptionWithoutHA() {
try {
ResultCollector rc1 = FunctionService.onRegion(region).setArguments(Boolean.TRUE).execute("DistribuedRegionFunctionFunctionInvocationException", true, false);
rc1.getResult();
fail("Function Invocation Target Exception should be thrown");
} catch (Exception e) {
e.printStackTrace();
if (!(e.getCause() instanceof FunctionInvocationTargetException)) {
fail("FunctionInvocationTargetException should be thrown");
}
}
}
use of org.apache.geode.internal.cache.functions.DistribuedRegionFunctionFunctionInvocationException in project geode by apache.
the class MyFunctionException method executeFunctionFunctionInvocationTargetException.
public static void executeFunctionFunctionInvocationTargetException() {
try {
ResultCollector rc1 = FunctionService.onRegion(region).setArguments(Boolean.TRUE).execute("DistribuedRegionFunctionFunctionInvocationException");
List list = (ArrayList) rc1.getResult();
assertEquals(5, list.get(0));
} catch (Exception e) {
e.printStackTrace();
Assert.fail("This is not expected Exception", e);
}
}
use of org.apache.geode.internal.cache.functions.DistribuedRegionFunctionFunctionInvocationException in project geode by apache.
the class MyFunctionException method executeFunctionFunctionInvocationTargetException_ClientServer.
public static void executeFunctionFunctionInvocationTargetException_ClientServer() {
try {
List list = (ArrayList) FunctionService.onRegion(region).setArguments(Boolean.TRUE).execute("DistribuedRegionFunctionFunctionInvocationException").getResult();
assertEquals(1, list.size());
assertEquals(5, list.get(0));
} catch (Exception e) {
e.printStackTrace();
Assert.fail("This is not expected Exception", e);
}
}
Aggregations