You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ud...@apache.org on 2016/03/16 10:10:19 UTC

incubator-geode git commit: GEODE-1053: Refactoring some test code. Updating Apache header for NamedCallable.java and NamedRunnable.java Updated httpcore.version in dependency-versions.properties

Repository: incubator-geode
Updated Branches:
  refs/heads/develop f7ca6346d -> 4d0dfc569


GEODE-1053: Refactoring some test code.
Updating Apache header for NamedCallable.java and NamedRunnable.java
Updated httpcore.version in dependency-versions.properties


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

Branch: refs/heads/develop
Commit: 4d0dfc569bf8dcdf1c3d98de0a7c8beceb2187f0
Parents: f7ca634
Author: Udo Kohlmeyer <uk...@pivotal.io>
Authored: Wed Mar 16 20:10:10 2016 +1100
Committer: Udo Kohlmeyer <uk...@pivotal.io>
Committed: Wed Mar 16 20:10:10 2016 +1100

----------------------------------------------------------------------
 ...stAPIOnRegionFunctionExecutionDUnitTest.java | 150 +++++++++----------
 .../web/controllers/RestAPITestBase.java        |  27 +++-
 ...tAPIsOnGroupsFunctionExecutionDUnitTest.java |  50 ++-----
 ...APIsOnMembersFunctionExecutionDUnitTest.java |  21 +--
 .../gemfire/test/dunit/NamedCallable.java       |  16 ++
 .../gemfire/test/dunit/NamedRunnable.java       |  16 ++
 gradle/dependency-versions.properties           |   2 +-
 7 files changed, 144 insertions(+), 138 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4d0dfc56/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 de7c97c..ed622e8 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
@@ -28,6 +28,7 @@ import com.gemstone.gemfire.internal.cache.PartitionAttributesImpl;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionTestHelper;
 import com.gemstone.gemfire.rest.internal.web.RestFunctionTemplate;
+import com.gemstone.gemfire.test.dunit.VM;
 import org.apache.http.client.methods.CloseableHttpResponse;
 
 import java.io.Serializable;
@@ -175,12 +176,6 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
     }
   }
 
-  private void verifyAndResetInvocationCount(final int count) {
-    SampleFunction f = (SampleFunction) FunctionService
-        .getFunction(SampleFunction.Id);
-    assertEquals(count, f.invocationCount);
-  }
-
   private void createPeer(DataPolicy policy) {
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -241,37 +236,32 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
   }
 
   private void createCacheAndRegisterFunction() {
-    restURLs.add(vm0.invoke(() -> createCacheWithGroups(vm0, null)));
-    restURLs.add(vm1.invoke(() -> createCacheWithGroups(vm1, null)));
-    restURLs.add(vm2.invoke(() -> createCacheWithGroups(vm2, null)));
-    restURLs.add(vm3.invoke(() -> createCacheWithGroups(vm3, null)));
-
-    vm0.invoke(() -> FunctionService.registerFunction(new SampleFunction()));
-    vm1.invoke(() -> FunctionService.registerFunction(new SampleFunction()));
-    vm2.invoke(() -> FunctionService.registerFunction(new SampleFunction()));
-    vm3.invoke(() -> FunctionService.registerFunction(new SampleFunction()));
+    restURLs.add(vm0.invoke("createCacheWithGroups", () -> createCacheWithGroups(vm0, null)));
+    restURLs.add(vm1.invoke("createCacheWithGroups", () -> createCacheWithGroups(vm1, null)));
+    restURLs.add(vm2.invoke("createCacheWithGroups", () -> createCacheWithGroups(vm2, null)));
+    restURLs.add(vm3.invoke("createCacheWithGroups", () -> createCacheWithGroups(vm3, null)));
+
+    vm0.invoke("registerFunction(new SampleFunction())", () -> FunctionService.registerFunction(new SampleFunction()));
+    vm1.invoke("registerFunction(new SampleFunction())", () -> FunctionService.registerFunction(new SampleFunction()));
+    vm2.invoke("registerFunction(new SampleFunction())", () -> FunctionService.registerFunction(new SampleFunction()));
+    vm3.invoke("registerFunction(new SampleFunction())", () -> FunctionService.registerFunction(new SampleFunction()));
   }
 
   public void testOnRegionExecutionWithReplicateRegion() {
     createCacheAndRegisterFunction();
 
-    vm3.invoke(() -> createPeer(DataPolicy.EMPTY));
-    vm0.invoke(() -> createPeer(DataPolicy.REPLICATE));
-    vm1.invoke(() -> createPeer(DataPolicy.REPLICATE));
-    vm2.invoke(() -> createPeer(DataPolicy.REPLICATE));
+    vm3.invoke("createPeer", () -> createPeer(DataPolicy.EMPTY));
+    vm0.invoke("createPeer", () -> createPeer(DataPolicy.REPLICATE));
+    vm1.invoke("createPeer", () -> createPeer(DataPolicy.REPLICATE));
+    vm2.invoke("createPeer", () -> createPeer(DataPolicy.REPLICATE));
 
-    vm3.invoke(() -> populateRRRegion());
+    vm3.invoke("populateRRRegion", () -> populateRRRegion());
 
     CloseableHttpResponse response = executeFunctionThroughRestCall("SampleFunction", REPLICATE_REGION_NAME, null, null, null, null);
     assertEquals(200, response.getStatusLine().getStatusCode());
     assertNotNull(response.getEntity());
 
-    int c0 = vm0.invoke(() -> getInvocationCount());
-    int c1 = vm1.invoke(() -> getInvocationCount());
-    int c2 = vm2.invoke(() -> getInvocationCount());
-    int c3 = vm3.invoke(() -> getInvocationCount());
-
-    assertEquals(1, c0 + c1 + c2 + c3);
+    assertCorrectInvocationCount(1, vm0, vm1, vm2, vm3);
 
     // remove the expected exception
     restURLs.clear();
@@ -280,21 +270,15 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
   public void testOnRegionExecutionWithPartitionRegion() throws Exception {
     createCacheAndRegisterFunction();
 
-    vm0.invoke(() -> createPeerWithPR());
-    vm1.invoke(() -> createPeerWithPR());
-    vm2.invoke(() -> createPeerWithPR());
-    vm3.invoke(() -> createPeerWithPR());
+    createPeersWithPR(vm0, vm1, vm2, vm3);
 
-    vm3.invoke(() -> populatePRRegion());
+    vm3.invoke("populatePRRegion", () -> populatePRRegion());
 
     CloseableHttpResponse response = executeFunctionThroughRestCall("SampleFunction", PR_REGION_NAME, null, null, null, null);
     assertEquals(200, response.getStatusLine().getStatusCode());
     assertNotNull(response.getEntity());
 
-    vm0.invoke(() -> verifyAndResetInvocationCount(1));
-    vm1.invoke(() -> verifyAndResetInvocationCount(1));
-    vm2.invoke(() -> verifyAndResetInvocationCount(1));
-    vm3.invoke(() -> verifyAndResetInvocationCount(1));
+    assertCorrectInvocationCount(4, vm0, vm1, vm2, vm3);
 
     restURLs.clear();
   }
@@ -302,59 +286,67 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
   public void testOnRegionWithFilterExecutionWithPartitionRegion() throws Exception {
     createCacheAndRegisterFunction();
 
-    vm0.invoke(() -> createPeerWithPR());
-    vm1.invoke(() -> createPeerWithPR());
-    vm2.invoke(() -> createPeerWithPR());
-    vm3.invoke(() -> createPeerWithPR());
+    createPeersWithPR(vm0, vm1, vm2, vm3);
 
-    vm3.invoke(() -> populatePRRegion());
+    vm3.invoke("populatePRRegion",() -> populatePRRegion());
 
     CloseableHttpResponse response = executeFunctionThroughRestCall("SampleFunction", PR_REGION_NAME, "key2", null, null, null);
     assertEquals(200, response.getStatusLine().getStatusCode());
     assertNotNull(response.getEntity());
 
-    int c0 = vm0.invoke(() -> getInvocationCount());
-    int c1 = vm1.invoke(() -> getInvocationCount());
-    int c2 = vm2.invoke(() -> getInvocationCount());
-    int c3 = vm3.invoke(() -> getInvocationCount());
-
-    assertEquals(1, (c0 + c1 + c2 + c3));
+    assertCorrectInvocationCount(1, vm0, vm1, vm2, vm3);
 
     restURLs.clear();
   }
 
-//  public void testOnRegionWithFilterExecutionWithPartitionRegionJsonArgs() throws Exception {
-//    createCacheAndRegisterFunction();
-//
-//    vm0.invoke(() -> createPeerWithPR());
-//    vm1.invoke(() -> createPeerWithPR());
-//    vm2.invoke(() -> createPeerWithPR());
-//    vm3.invoke(() -> createPeerWithPR());
-//
-//    vm3.invoke(() -> populatePRRegion());
-//
-//    String jsonBody = "["
-//        + "{\"@type\": \"double\",\"@value\": 210}"
-//        + ",{\"@type\":\"com.gemstone.gemfire.web.rest.domain.Item\","
-//        + "\"itemNo\":\"599\",\"description\":\"Part X Free on Bumper Offer\","
-//        + "\"quantity\":\"2\","
-//        + "\"unitprice\":\"5\","
-//        + "\"totalprice\":\"10.00\"}"
-//        + "]";
-//
-//    CloseableHttpResponse response = executeFunctionThroughRestCall("SampleFunction", PR_REGION_NAME, null, jsonBody, null, null);
-//    assertEquals(200, response.getStatusLine().getStatusCode());
-//    assertNotNull(response.getEntity());
-//
-//    // Assert that only 1 node has executed the function.
-//    int c0 = vm0.invoke(() -> getInvocationCount());
-//    int c1 = vm1.invoke(() -> getInvocationCount());
-//    int c2 = vm2.invoke(() -> getInvocationCount());
-//    int c3 = vm3.invoke(() -> getInvocationCount());
-//
-//    assertEquals(1, (c0 + c1 + c2 + c3));
-//
-//    restURLs.clear();
-//  }
+  private void createPeersWithPR(VM... vms) {
+    for (int i = 0; i < vms.length; i++) {
+      vms[i].invoke("createPeerWithPR", () -> createPeerWithPR());
+    }
+  }
+
+  public void testOnRegionWithFilterExecutionWithPartitionRegionJsonArgs() throws Exception {
+    createCacheAndRegisterFunction();
+
+    createPeersWithPR(vm0, vm1, vm2, vm3);
+
+    vm3.invoke("populatePRRegion",() -> populatePRRegion());
+
+    String jsonBody = "["
+        + "{\"@type\": \"double\",\"@value\": 210}"
+        + ",{\"@type\":\"com.gemstone.gemfire.rest.internal.web.controllers.Item\","
+        + "\"itemNo\":\"599\",\"description\":\"Part X Free on Bumper Offer\","
+        + "\"quantity\":\"2\","
+        + "\"unitprice\":\"5\","
+        + "\"totalprice\":\"10.00\"}"
+        + "]";
+
+    CloseableHttpResponse response = executeFunctionThroughRestCall("SampleFunction", PR_REGION_NAME, null, jsonBody, null, null);
+    assertEquals(200, response.getStatusLine().getStatusCode());
+    assertNotNull(response.getEntity());
+
+    // Assert that only 1 node has executed the function.
+    assertCorrectInvocationCount(4, vm0, vm1, vm2, vm3);
+
+    jsonBody = "["
+        + "{\"@type\": \"double\",\"@value\": 220}"
+        + ",{\"@type\":\"com.gemstone.gemfire.rest.internal.web.controllers.Item\","
+        + "\"itemNo\":\"609\",\"description\":\"Part X Free on Bumper Offer\","
+        + "\"quantity\":\"3\","
+        + "\"unitprice\":\"9\","
+        + "\"totalprice\":\"12.00\"}"
+        + "]";
+
+    resetInvocationCounts(vm0,vm1,vm2,vm3);
+
+    response = executeFunctionThroughRestCall("SampleFunction", PR_REGION_NAME, "key2", jsonBody, null, null);
+    assertEquals(200, response.getStatusLine().getStatusCode());
+    assertNotNull(response.getEntity());
+
+    // Assert that only 1 node has executed the function.
+    assertCorrectInvocationCount(1, vm0, vm1, vm2, vm3);
+
+    restURLs.clear();
+  }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4d0dfc56/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
index 0d1fee8..ba709b7 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
@@ -18,6 +18,7 @@ package com.gemstone.gemfire.rest.internal.web.controllers;
 
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.execute.Function;
 import com.gemstone.gemfire.cache.execute.FunctionService;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
@@ -49,10 +50,10 @@ import java.util.Random;
 public class RestAPITestBase extends DistributedTestCase {
   protected Cache cache = null;
   protected List<String> restURLs = new ArrayList();
-  VM vm0 = null;
-  VM vm1 = null;
-  VM vm2 = null;
-  VM vm3 = null;
+  protected VM vm0 = null;
+  protected VM vm1 = null;
+  protected VM vm2 = null;
+  protected VM vm3 = null;
 
   public RestAPITestBase(String name) {
     super(name);
@@ -208,4 +209,22 @@ public class RestAPITestBase extends DistributedTestCase {
     return "";
   }
 
+  protected void assertCorrectInvocationCount(int expectedInvocationCount, VM... vms) {
+    int count = 0;
+    for (int i = 0; i < vms.length; i++) {
+      count += vms[i].invoke("getInvocationCount",() -> getInvocationCount());
+    }
+    assertEquals(expectedInvocationCount,count);
+  }
+
+  protected void resetInvocationCount() {
+    RestFunctionTemplate f = (RestFunctionTemplate) FunctionService.getFunction(getFunctionID());
+    f.invocationCount = 0;
+  }
+
+  protected void resetInvocationCounts(VM... vms) {
+    for (int i = 0; i < vms.length; i++) {
+      vms[i].invoke("resetInvocationCount", () -> resetInvocationCount());
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4d0dfc56/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java
index 5acaccb..0419c78 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java
@@ -21,6 +21,7 @@ import com.gemstone.gemfire.cache.execute.FunctionService;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.rest.internal.web.RestFunctionTemplate;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.VM;
 import org.apache.http.client.methods.CloseableHttpResponse;
 
 import java.util.ArrayList;
@@ -41,9 +42,14 @@ public class RestAPIsOnGroupsFunctionExecutionDUnitTest extends RestAPITestBase
     return OnGroupsFunction.Id;
   }
 
-  private void resetInvocationCount() {
-    OnGroupsFunction f = (OnGroupsFunction) FunctionService.getFunction(OnGroupsFunction.Id);
-    f.invocationCount = 0;
+  private void setupCacheWithGroupsAndFunction() {
+    restURLs.add(vm0.invoke("createCacheWithGroups", () -> createCacheWithGroups(vm0, "g0,gm")));
+    restURLs.add(vm1.invoke("createCacheWithGroups", () -> createCacheWithGroups(vm1, "g1")));
+    restURLs.add(vm2.invoke("createCacheWithGroups", () -> createCacheWithGroups(vm2, "g0,g1")));
+
+    vm0.invoke("registerFunction(new OnGroupsFunction())", () -> FunctionService.registerFunction(new OnGroupsFunction()));
+    vm1.invoke("registerFunction(new OnGroupsFunction())", () -> FunctionService.registerFunction(new OnGroupsFunction()));
+    vm2.invoke("registerFunction(new OnGroupsFunction())", () -> FunctionService.registerFunction(new OnGroupsFunction()));
   }
 
   public void testonGroupsExecutionOnAllMembers() {
@@ -54,25 +60,11 @@ public class RestAPIsOnGroupsFunctionExecutionDUnitTest extends RestAPITestBase
       assertHttpResponse(response, 200, 3);
     }
 
-    int c0 = vm0.invoke(() -> getInvocationCount());
-    int c1 = vm1.invoke(() -> getInvocationCount());
-    int c2 = vm2.invoke(() -> getInvocationCount());
-
-    assertEquals(30, (c0 + c1 + c2));
+    assertCorrectInvocationCount(30, vm0, vm1, vm2);
 
     restURLs.clear();
   }
 
-  private void setupCacheWithGroupsAndFunction() {
-    restURLs.add(vm0.invoke(() -> createCacheWithGroups(vm0, "g0,gm")));
-    restURLs.add(vm1.invoke(() -> createCacheWithGroups(vm1, "g1")));
-    restURLs.add(vm2.invoke(() -> createCacheWithGroups(vm2, "g0,g1")));
-
-    vm0.invoke(() -> FunctionService.registerFunction(new OnGroupsFunction()));
-    vm1.invoke(() -> FunctionService.registerFunction(new OnGroupsFunction()));
-    vm2.invoke(() -> FunctionService.registerFunction(new OnGroupsFunction()));
-  }
-
   public void testonGroupsExecutionOnAllMembersWithFilter() {
     setupCacheWithGroupsAndFunction();
 
@@ -82,11 +74,7 @@ public class RestAPIsOnGroupsFunctionExecutionDUnitTest extends RestAPITestBase
       assertHttpResponse(response, 500, 0);
     }
 
-    int c0 = vm0.invoke(() -> getInvocationCount());
-    int c1 = vm1.invoke(() -> getInvocationCount());
-    int c2 = vm2.invoke(() -> getInvocationCount());
-
-    assertEquals(0, (c0 + c1 + c2));
+    assertCorrectInvocationCount(0, vm0, vm1, vm2);
     restURLs.clear();
   }
 
@@ -98,11 +86,7 @@ public class RestAPIsOnGroupsFunctionExecutionDUnitTest extends RestAPITestBase
       CloseableHttpResponse response = executeFunctionThroughRestCall("OnGroupsFunction", null, null, null, "no%20such%20group", null);
       assertHttpResponse(response, 500, 0);
     }
-    int c0 = vm0.invoke(() -> getInvocationCount());
-    int c1 = vm1.invoke(() -> getInvocationCount());
-    int c2 = vm2.invoke(() -> getInvocationCount());
-
-    assertEquals(0, (c0 + c1 + c2));
+    assertCorrectInvocationCount(0, vm0, vm1, vm2);
 
     for (int i = 0; i < 5; i++) {
 
@@ -110,15 +94,9 @@ public class RestAPIsOnGroupsFunctionExecutionDUnitTest extends RestAPITestBase
       assertHttpResponse(response, 200, 1);
     }
 
-    c0 = vm0.invoke(() -> getInvocationCount());
-    c1 = vm1.invoke(() -> getInvocationCount());
-    c2 = vm2.invoke(() -> getInvocationCount());
-
-    assertEquals(5, (c0 + c1 + c2));
+    assertCorrectInvocationCount(5, vm0, vm1, vm2);
 
-    vm0.invoke(() -> resetInvocationCount());
-    vm1.invoke(() -> resetInvocationCount());
-    vm2.invoke(() -> resetInvocationCount());
+    resetInvocationCounts(vm0,vm1,vm2);
 
     restURLs.clear();
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4d0dfc56/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 7a994d6..f8bf20e 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
@@ -114,12 +114,7 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase
       assertHttpResponse(response, 200, 4);
     }
 
-    int c0 = vm0.invoke(() -> getInvocationCount());
-    int c1 = vm1.invoke(() -> getInvocationCount());
-    int c2 = vm2.invoke(() -> getInvocationCount());
-    int c3 = vm3.invoke(() -> getInvocationCount());
-
-    assertEquals(40, (c0 + c1 + c2 + c3));
+    assertCorrectInvocationCount(40,vm0,vm1,vm2,vm3);
 
     restURLs.clear();
   }
@@ -139,12 +134,7 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase
       assertHttpResponse(response, 200, 3);
     }
 
-    int c0 = vm0.invoke(() -> getInvocationCount());
-    int c1 = vm1.invoke(() -> getInvocationCount());
-    int c2 = vm2.invoke(() -> getInvocationCount());
-    int c3 = vm3.invoke(() -> getInvocationCount());
-
-    assertEquals(30, (c0 + c1 + c2 + c3));
+    assertCorrectInvocationCount(30,vm0,vm1,vm2,vm3);
 
     restURLs.clear();
   }
@@ -157,12 +147,7 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase
       assertHttpResponse(response, 500, 0);
     }
 
-    int c0 = vm0.invoke(() -> getInvocationCount());
-    int c1 = vm1.invoke(() -> getInvocationCount());
-    int c2 = vm2.invoke(() -> getInvocationCount());
-    int c3 = vm3.invoke(() -> getInvocationCount());
-
-    assertEquals(0, (c0 + c1 + c2 + c3));
+    assertCorrectInvocationCount(0,vm0,vm1,vm2,vm3);
 
     restURLs.clear();
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4d0dfc56/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/NamedCallable.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/NamedCallable.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/NamedCallable.java
index 66a3f38..67357d9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/NamedCallable.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/NamedCallable.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package com.gemstone.gemfire.test.dunit;
 
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4d0dfc56/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/NamedRunnable.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/NamedRunnable.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/NamedRunnable.java
index 8a7fe28..9c127b0 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/NamedRunnable.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/NamedRunnable.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package com.gemstone.gemfire.test.dunit;
 
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4d0dfc56/gradle/dependency-versions.properties
----------------------------------------------------------------------
diff --git a/gradle/dependency-versions.properties b/gradle/dependency-versions.properties
index f0738d7..7a5054b 100644
--- a/gradle/dependency-versions.properties
+++ b/gradle/dependency-versions.properties
@@ -46,7 +46,7 @@ hbase.version = 0.94.27
 hibernate.version = 3.5.5-Final
 hibernate-commons-annotations.version = 3.2.0.Final
 httpclient.version = 4.5.1
-httpcore.version = 4.4.4
+httpcore.version = 4.4.3
 httpunit.version = 1.7.2
 hsqldb.version = 2.0.0
 jackson.version = 2.2.0