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/07/25 18:08:48 UTC

incubator-geode git commit: GEODE-420: Fixed DistributedMulticastRegionDUnitTest.java

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-420 230e5c896 -> e8676046c


GEODE-420: Fixed DistributedMulticastRegionDUnitTest.java


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

Branch: refs/heads/feature/GEODE-420
Commit: e8676046c758310d59d3f558d2a65fc786711559
Parents: 230e5c8
Author: Udo Kohlmeyer <uk...@pivotal.io>
Authored: Mon Jul 25 11:08:45 2016 -0700
Committer: Udo Kohlmeyer <uk...@pivotal.io>
Committed: Mon Jul 25 11:08:45 2016 -0700

----------------------------------------------------------------------
 .../DistributedMulticastRegionDUnitTest.java    | 63 +++++++-------------
 1 file changed, 21 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e8676046/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java
index 3ce3ec5..5efd5ce 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java
@@ -155,56 +155,35 @@ public class DistributedMulticastRegionDUnitTest extends JUnit4CacheTestCase {
       locatorPort = startLocator();
 
       vm0.invoke("setSysProps", () -> setSysProps());
-      //      vm1.invoke("setSysProps", () -> setSysProps());
-      setSysProps();
+      vm1.invoke("setSysProps", () -> setSysProps());
+
       //1. start locator with mcast port
       vm0.invoke("createRegion", () -> {
         createRegion(name, getRegionAttributes());
         return "";
       });
-      //      vm1.invoke("createRegion", () -> createRegion(name,getRegionAttributes()));
-      createRegion(name, getRegionAttributes());
-
-      //There is possibility that you may get this packet from other tests
-      /*
-      SerializableRunnable validateMulticastBeforeRegionOps =
-          new CacheSerializableRunnable("validateMulticast before region ops") {
-              public void run2() throws CacheException {
-                validateMulticastOpsBeforeRegionOps();
-              }
-          };
-        
-      vm0.invoke(validateMulticastBeforeRegionOps);
-      vm1.invoke(validateMulticastBeforeRegionOps);
-      */
-
-      SerializableRunnable doPuts = new CacheSerializableRunnable("do put") {
-        public void run2() throws CacheException {
-          final Region region = getRootRegion().getSubregion(name);
-          boolean gotReplyException = false;
-          for (int i = 0; i < 1; i++) {
-            try {
-              region.put(i, new TestObjectThrowsException());
-            } catch (PdxSerializationException e) {
-              gotReplyException = true;
-            } catch (Exception e) {
-              region.getCache().getLogger().info("Got exception of type " + e.getClass().toString());
-            }
-          }
-          assertTrue("We should have got ReplyEception ", gotReplyException);
-        }
-      };
-
-      vm0.invoke(doPuts);
+      vm1.invoke("createRegion", () -> {
+        createRegion(name, getRegionAttributes());
+        return "";
+      });
 
-      SerializableRunnable validateMulticastAfterRegionOps = new CacheSerializableRunnable("validateMulticast after region ops") {
-        public void run2() throws CacheException {
-          validateMulticastOpsAfterRegionOps();
+      vm0.invoke("do Put() with exception test", () -> {
+        final Region region = getRootRegion().getSubregion(name);
+        boolean gotReplyException = false;
+        for (int i = 0; i < 1; i++) {
+          try {
+            region.put(i, new TestObjectThrowsException());
+          } catch (PdxSerializationException e) {
+            gotReplyException = true;
+          } catch (Exception e) {
+            region.getCache().getLogger().info("Got exception of type " + e.getClass().toString());
+          }
         }
-      };
+        assertTrue("We should have got ReplyException ", gotReplyException);
+      });
 
-      vm0.invoke(validateMulticastAfterRegionOps);
-      vm1.invoke(validateMulticastAfterRegionOps);
+      vm0.invoke("validateMulticastOpsAfterRegionOps", () -> validateMulticastOpsAfterRegionOps());
+      vm1.invoke("validateMulticastOpsAfterRegionOps", () -> validateMulticastOpsAfterRegionOps());
 
       closeLocator();
     } finally {