geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject [1/2] incubator-geode git commit: GEODE-1053: Refactoring some test code.
Date Tue, 15 Mar 2016 18:54:02 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 22ab27067 -> e22cd9532


GEODE-1053: Refactoring some test code.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e22cd953
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e22cd953
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e22cd953

Branch: refs/heads/develop
Commit: e22cd9532946322c0a0829b755ab184cd08977fb
Parents: f217552
Author: Udo Kohlmeyer <ukohlmeyer@pivotal.io>
Authored: Wed Mar 9 20:06:49 2016 +1100
Committer: Udo Kohlmeyer <ukohlmeyer@pivotal.io>
Committed: Wed Mar 16 05:53:57 2016 +1100

----------------------------------------------------------------------
 ...stAPIOnRegionFunctionExecutionDUnitTest.java |  1 -
 ...APIsOnMembersFunctionExecutionDUnitTest.java | 26 ++++++++------------
 2 files changed, 10 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e22cd953/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java
b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java
index 63bd9fa..de7c97c 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java
@@ -36,7 +36,6 @@ import java.util.*;
 /**
  * Dunit Test to validate OnRegion function execution with REST APIs
  *
- * @author Nilkanth Patel
  * @since 8.0
  */
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e22cd953/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
index ac922ad..7a994d6 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
@@ -30,10 +30,6 @@ import org.apache.http.client.methods.CloseableHttpResponse;
 
 import java.util.Properties;
 
-/**
- * @author Nilkanth Patel
- */
-
 public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase {
 
   private static final long serialVersionUID = 1L;
@@ -111,10 +107,7 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase
   }
 
   public void testFunctionExecutionOnAllMembers() {
-    restURLs.add(vm0.invoke(() -> createCacheAndRegisterFunction(vm0, "m1")));
-    restURLs.add(vm1.invoke(() -> createCacheAndRegisterFunction(vm1, "m2")));
-    restURLs.add(vm2.invoke(() -> createCacheAndRegisterFunction(vm2, "m3")));
-    restURLs.add(vm3.invoke(() -> createCacheAndRegisterFunction(vm3, "m4")));
+    createCacheForVMs();
 
     for (int i = 0; i < 10; i++) {
       CloseableHttpResponse response = executeFunctionThroughRestCall("OnMembersFunction",null,null,null,null,null);
@@ -131,11 +124,15 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase
     restURLs.clear();
   }
 
+  private void createCacheForVMs() {
+    restURLs.add(vm0.invoke(() -> createCacheAndRegisterFunction(vm0, "m1")));
+    restURLs.add(vm1.invoke(() -> createCacheAndRegisterFunction(vm1, "m2")));
+    restURLs.add(vm2.invoke(() -> createCacheAndRegisterFunction(vm2, "m3")));
+    restURLs.add(vm3.invoke(() -> createCacheAndRegisterFunction(vm3, "m4")));
+  }
+
   public void testFunctionExecutionEOnSelectedMembers() {
-    restURLs.add((String) vm0.invoke(() -> createCacheAndRegisterFunction(vm0, "m1")));
-    restURLs.add((String) vm1.invoke(() -> createCacheAndRegisterFunction(vm1, "m2")));
-    restURLs.add((String) vm2.invoke(() -> createCacheAndRegisterFunction(vm2, "m3")));
-    restURLs.add((String) vm3.invoke(() -> createCacheAndRegisterFunction(vm3, "m4")));
+    createCacheForVMs();
 
     for (int i = 0; i < 10; i++) {
       CloseableHttpResponse response = executeFunctionThroughRestCall("OnMembersFunction",null,null,null,null,"m1,m2,m3");
@@ -153,10 +150,7 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase
   }
 
   public void testFunctionExecutionOnMembersWithFilter() {
-    restURLs.add((String) vm0.invoke(() -> createCacheAndRegisterFunction(vm0, "m1")));
-    restURLs.add((String) vm1.invoke(() -> createCacheAndRegisterFunction(vm1, "m2")));
-    restURLs.add((String) vm2.invoke(() -> createCacheAndRegisterFunction(vm2, "m3")));
-    restURLs.add((String) vm3.invoke(() -> createCacheAndRegisterFunction(vm3, "m4")));
+    createCacheForVMs();
 
     for (int i = 0; i < 10; i++) {
       CloseableHttpResponse response = executeFunctionThroughRestCall("OnMembersFunction",null,"key2",null,null,"m1,m2,m3");


Mime
View raw message