SGF-173. Added NoResult methods to FunctionTemplate and checked for FunctionExecution exception related to Function.hasResult() = false

This commit is contained in:
David Turanski
2013-04-17 09:58:40 -04:00
parent 3258b0826d
commit 3a4f727334
7 changed files with 145 additions and 95 deletions

View File

@@ -69,6 +69,14 @@ public class FunctionIntegrationTests {
region.put("three",3);
}
@Test
public void testVoidReturnType() {
GemfireOnRegionOperations template = new GemfireOnRegionFunctionTemplate(region);
//Either way should work but the first one traps an exception if there is a result.
template.execute("noResult");
template.executeWithNoResult("noResult");
}
@Test
public void testOnRegionFunctionExecution() {
@@ -118,6 +126,8 @@ public class FunctionIntegrationTests {
Object result = template.executeAndExtract("arrays",new int[]{1,2,3,4,5});
assertTrue(result.getClass().getName(),result instanceof int[]);
}
/*
* This gets wrapped in a GemFire Function and registered on the forked server.
*/
@@ -151,8 +161,13 @@ public class FunctionIntegrationTests {
}
@GemfireFunction(id="arrays",batchSize=2)
public int[] collections(int[] args) {
public int[] collections(int[] args) {
return args;
}
@GemfireFunction
public void noResult() {
}
}
}