geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [29/50] [abbrv] incubator-geode git commit: fixed GEODE-412.
Date Mon, 02 Nov 2015 21:52:55 GMT
fixed GEODE-412.


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

Branch: refs/heads/feature/GEODE-328
Commit: 791a4184bc1b97d02a1412e618fdb11c1e22dabf
Parents: ded1454
Author: Hitesh Khamesra <hkhamesra@pivotal.io>
Authored: Fri Oct 23 09:43:06 2015 -0700
Committer: Hitesh Khamesra <hkhamesra@pivotal.io>
Committed: Fri Oct 23 10:09:45 2015 -0700

----------------------------------------------------------------------
 .../OnGroupsFunctionExecutionDUnitTest.java     | 30 ++++++++++++++------
 1 file changed, 22 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/791a4184/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
index 9ea26f3..b2e0219 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
@@ -77,7 +77,9 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase
{
     public void execute(FunctionContext context) {
       getLogWriter().fine("SWAP:1:executing OnGroupsFunction:"+invocationCount);
       InternalDistributedSystem ds = InternalDistributedSystem.getConnectedInstance();
-      invocationCount++;
+      synchronized (OnGroupsFunction.class) {
+    	  invocationCount++;
+      }
       ArrayList<String> l = (ArrayList<String>) context.getArguments();
       if (l != null) {
         assertFalse(Collections.disjoint(l, ds.getDistributedMember().getGroups()));
@@ -136,9 +138,12 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase
{
       @Override
       public Object call() throws Exception {
         OnGroupsFunction f = (OnGroupsFunction) FunctionService.getFunction(OnGroupsFunction.Id);
-        assertEquals(count, f.invocationCount);
+        
         // assert succeeded, reset count
-        f.invocationCount = 0;
+        synchronized (OnGroupsFunction.class) {
+        	assertEquals(count, f.invocationCount);
+        	f.invocationCount = 0;
+        }
         return null;
       }
     });
@@ -149,8 +154,11 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase
{
       @Override
       public Object call() throws Exception {
         OnGroupsFunction f = (OnGroupsFunction) FunctionService.getFunction(OnGroupsFunction.Id);
-        int count = f.invocationCount;
-        f.invocationCount = 0;
+        int count  = 0 ;
+        synchronized (OnGroupsFunction.class) {
+        	count = f.invocationCount;
+        	f.invocationCount = 0;
+        }
         return count;
       }
     });
@@ -161,8 +169,12 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase
{
       @Override
       public Object call() throws Exception {
         OnGroupsFunction f = (OnGroupsFunction) FunctionService.getFunction(OnGroupsFunction.Id);
-        int count = f.invocationCount;
-        f.invocationCount = 0;
+        int count = 0;
+        synchronized (OnGroupsFunction.class) {
+        	count = f.invocationCount;
+            f.invocationCount = 0;
+		}
+        
         return count;
       }
     });
@@ -173,7 +185,9 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase
{
       @Override
       public Object call() throws Exception {
         OnGroupsFunction f = (OnGroupsFunction) FunctionService.getFunction(OnGroupsFunction.Id);
-        f.invocationCount = 0;
+        synchronized (OnGroupsFunction.class) {
+        	f.invocationCount = 0;
+		}
         return null;
       }
     });


Mime
View raw message