geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinmeil...@apache.org
Subject [48/64] [abbrv] incubator-geode git commit: GEODE-337 test now waits queue to be paused before starting the client again
Date Thu, 31 Mar 2016 15:23:11 GMT
GEODE-337 test now waits queue to be paused before starting the client again


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

Branch: refs/heads/feature/GEODE-17-2
Commit: 67f9d7ce0629fe00168ecd2bcdac0688befc0c76
Parents: beda814
Author: Hitesh Khamesra <hkhamesra@pivotal.io>
Authored: Tue Mar 29 11:39:16 2016 -0700
Committer: Hitesh Khamesra <hkhamesra@pivotal.io>
Committed: Wed Mar 30 13:19:23 2016 -0700

----------------------------------------------------------------------
 .../cache/tier/sockets/CacheClientProxy.java    |  2 +-
 .../management/ClientHealthStatsDUnitTest.java  | 34 ++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/67f9d7ce/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientProxy.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientProxy.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientProxy.java
index 42ad67b..63c05ca 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientProxy.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientProxy.java
@@ -795,7 +795,7 @@ public class CacheClientProxy implements ClientSession {
    *
    * @since 5.5
    */
-  protected boolean isPaused() {
+  public boolean isPaused() {
     return this._isPaused;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/67f9d7ce/geode-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
index 448bbdb..f1a67ba 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.management;
 
+import java.util.Collection;
+import java.util.Iterator;
 import java.util.Properties;
 
 import com.gemstone.gemfire.cache.Cache;
@@ -188,6 +190,8 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
     server.invoke(() -> ClientHealthStatsDUnitTest.doPuts());
     // close durable client
     client.invoke(() -> ClientHealthStatsDUnitTest.closeClientCache());
+    
+    server.invoke("verifyProxyHasBeenPaused", () -> verifyProxyHasBeenPaused() );
     // resume puts on server, add another 100.
     server.invokeAsync(() -> ClientHealthStatsDUnitTest.resumePuts());
     // start durable client
@@ -198,6 +202,36 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
     server.invoke(() -> ClientHealthStatsDUnitTest.verifyStats(port));
   }
   
+  private static void verifyProxyHasBeenPaused() {	  
+	  
+	  WaitCriterion criterion = new WaitCriterion() {
+      
+      @Override
+      public boolean done() {
+        CacheClientNotifier ccn = CacheClientNotifier.getInstance();
+        Collection<CacheClientProxy> ccProxies = ccn.getClientProxies();
+        
+        Iterator<CacheClientProxy> itr =  ccProxies.iterator();
+        
+        while(itr.hasNext()) {
+          CacheClientProxy ccp = itr.next(); 
+          System.out.println("proxy status " + ccp.getState());
+          if(ccp.isPaused())
+            return true;
+        }
+        return false;
+      }
+      
+      @Override
+      public String description() {
+        // TODO Auto-generated method stub
+        return "Proxy has not paused yet";
+      }
+    };
+    
+    Wait.waitForCriterion(criterion, 15 * 1000, 200, true);	  
+  }
+  
   public static int createServerCache() throws Exception {
     Cache cache = helper.createCache(false);
 


Mime
View raw message