geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject incubator-geode git commit: GEODE-535 CI failure: ProductUseLogDUnitTest.testMembershipMonitoring
Date Wed, 23 Mar 2016 17:55:12 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 3b7e3ff35 -> 1e985b810


GEODE-535 CI failure: ProductUseLogDUnitTest.testMembershipMonitoring

Modified the test to disconnect any existing DistributedSystems in preSetUp.

Modified RoleDUnitTest to return its custom distributed system properties
in getDistributedSystemProperties() so that tearDown can detect the custom
settings and disconnect the DistributedSystems created by the test.


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

Branch: refs/heads/develop
Commit: 1e985b810b71cfbdda6d398a182635419ca36f99
Parents: 3b7e3ff
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Wed Mar 23 10:50:02 2016 -0700
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Wed Mar 23 10:52:46 2016 -0700

----------------------------------------------------------------------
 .../gemfire/distributed/RoleDUnitTest.java      | 41 ++++++++++++--------
 .../internal/ProductUseLogDUnitTest.java        |  5 +++
 2 files changed, 30 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1e985b81/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java
index eb36cdc..25428b2 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java
@@ -30,17 +30,24 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 
 /**
- * Tests the functionality of the {@link DistributedMember} class.
+ * Tests the setting of Roles in a DistributedSystem
  *
- * @author Kirk Lund
- * @since 5.0
  */
 public class RoleDUnitTest extends DistributedTestCase {
+  
+  static Properties distributionProperties = new Properties();
 
   public RoleDUnitTest(String name) {
     super(name);
   }
   
+  
+  
+  @Override
+  public Properties getDistributedSystemProperties() {
+    return distributionProperties;
+  }
+  
   /**
    * Tests usage of Roles in a Loner vm.
    */
@@ -49,12 +56,12 @@ public class RoleDUnitTest extends DistributedTestCase {
     final String[] rolesArray = new String[] {"A","B","C","D","E","F","G"};
 //    final List rolesList = Arrays.asList(rolesArray);
     
-    Properties config = new Properties();
-    config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
-    config.setProperty(DistributionConfig.LOCATORS_NAME, "");
-    config.setProperty(DistributionConfig.ROLES_NAME, rolesProp);
+    distributionProperties = new Properties();
+    distributionProperties.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
+    distributionProperties.setProperty(DistributionConfig.LOCATORS_NAME, "");
+    distributionProperties.setProperty(DistributionConfig.ROLES_NAME, rolesProp);
 
-    InternalDistributedSystem system = getSystem(config);
+    InternalDistributedSystem system = getSystem(distributionProperties);
     try {
       DM dm = system.getDistributionManager();
       Set allRoles = dm.getAllRoles();
@@ -84,10 +91,8 @@ public class RoleDUnitTest extends DistributedTestCase {
    */
   public void testRolesInDistributedVMs() {  
     // connect all four vms...
-    final String[] vmRoleNames = new String[] 
+    final String[] vmRoles = new String[] 
         {"VM_A", "BAR", "Foo,BAR", "Bip,BAM"};
-    final String[][] vmRoles = new String[][] 
-        {{"VM_A"}, {"BAR"}, {"Foo","BAR"}, {"Bip","BAM"}};
     final Object[][] roleCounts = new Object[][]
         {{"VM_A", new Integer(1)}, {"BAR", new Integer(2)},
          {"Foo", new Integer(1)}, {"Bip", new Integer(1)},
@@ -95,12 +100,14 @@ public class RoleDUnitTest extends DistributedTestCase {
 
     for (int i = 0; i < vmRoles.length; i++) {
       final int vm = i;
-      Host.getHost(0).getVM(vm).invoke(new SerializableRunnable() {
+      Host.getHost(0).getVM(vm).invoke(new SerializableRunnable("create system") {
         public void run() {
           disconnectFromDS();
           Properties config = new Properties();
-          config.setProperty(DistributionConfig.ROLES_NAME, vmRoleNames[vm]);
-          getSystem(config);
+          config.setProperty(DistributionConfig.ROLES_NAME, vmRoles[vm]);
+          config.setProperty(DistributionConfig.LOG_LEVEL_NAME, "fine");
+          distributionProperties = config;
+          getSystem();
         }
       });
     }
@@ -108,7 +115,7 @@ public class RoleDUnitTest extends DistributedTestCase {
     // validate roles from each vm...
     for (int i = 0; i < vmRoles.length; i++) {
       final int vm = i;
-      Host.getHost(0).getVM(vm).invoke(new SerializableRunnable() {
+      Host.getHost(0).getVM(vm).invoke(new SerializableRunnable("verify roles") {
         public void run() {
           InternalDistributedSystem sys = getSystem();
           DM dm = sys.getDistributionManager();
@@ -136,6 +143,7 @@ public class RoleDUnitTest extends DistributedTestCase {
         }
       });
     }
+    System.out.println("testRolesInDistributedVMs completed");
   }
   
   /** 
@@ -148,8 +156,9 @@ public class RoleDUnitTest extends DistributedTestCase {
     config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     config.setProperty(DistributionConfig.LOCATORS_NAME, "");
     config.setProperty(DistributionConfig.ROLES_NAME, rolesProp);
+    distributionProperties = config;
 
-    InternalDistributedSystem system = getSystem(config);
+    InternalDistributedSystem system = getSystem();
     try {
       DM dm = system.getDistributionManager();
       InternalDistributedMember member = dm.getDistributionManagerId();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1e985b81/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
index b8fbb30..2cc8ce2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
@@ -48,6 +48,11 @@ public class ProductUseLogDUnitTest extends CacheTestCase {
   }
   
   @Override
+  public void preSetUp() {
+    disconnectAllFromDS();
+  }
+  
+  @Override
   public Properties getDistributedSystemProperties() {
     Properties p = super.getDistributedSystemProperties();
     p.put(DistributionConfig.USE_CLUSTER_CONFIGURATION_NAME, "false");


Mime
View raw message