[jboss-cvs] JBossAS SVN: r104028 - trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 15 18:43:47 EDT 2010


Author: bstansberry at jboss.com
Date: 2010-04-15 18:43:47 -0400 (Thu, 15 Apr 2010)
New Revision: 104028

Modified:
   trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/test/DistributedStateTestCase.java
Log:
Use more informative assertion types

Modified: trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/test/DistributedStateTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/test/DistributedStateTestCase.java	2010-04-15 22:43:05 UTC (rev 104027)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/test/DistributedStateTestCase.java	2010-04-15 22:43:47 UTC (rev 104028)
@@ -115,7 +115,7 @@
       ds0.put("key0", "value0");
       String value = (String) ds0.get("key0");
       log.info("server0: get(key0): "+value);
-      assertTrue("server0: value == value0", value.equals("value0"));
+      assertEquals("server0: value == value0", "value0", value);
 
       MBeanServerConnection server1 = adaptors[1];
       log.info("server1: "+server1);
@@ -128,12 +128,14 @@
       server1.addNotificationListener(dsService, listener1, null, null);
       value = (String) ds1.get("key0");
       log.info("server1: get(key0): "+value);
-      assertTrue("server1: value == value0", value.equals("value0"));
+      assertEquals("server1: value == value0", "value0", value);
       ds1.put("key0", "value1");
       value = (String) ds1.get("key0");
-      assertTrue("server1: value == value1("+value+")", value.equals("value1"));
+      assertEquals("server1: value == value1("+value+")", "value1", value);
+      log.info("server1: get(key0): "+value);
       value = (String) ds0.get("key0");
-      assertTrue("server0: value == value1("+value+")", value.equals("value1"));
+      assertEquals("server0: value == value1("+value+")", "value1", value);
+      log.info("server0: get(key0): "+value);
       
       ds1.put("key1", "value11");
       Collection<?> categories = ds0.listAllCategories();
@@ -158,9 +160,9 @@
 
       ds0.remove("key0");
       value = (String) ds1.get("key0");
-      assertTrue("server1: value == null("+value+")", value == null);
+      assertNull("server1: value == null("+value+")", value);
       value = (String) ds0.get("key0");
-      assertTrue("server0: value == null("+value+")", value == null);
+      assertNull("server0: value == null("+value+")", value);
 
       // set a key/value on server0 and test its notifications on both servers
       ds0.put(NOTIFY_KEY, NOTIFY_VALUE);
@@ -175,10 +177,10 @@
       String key = (String)data.key;
       String val = (String)data.value;
       boolean isLocal = data.locallyModified;
-      assertTrue("server0: change notification category = " + cat, cat.equals(NOTIFY_CATEGORY));
-      assertTrue("server0: change notification key = " + key, key.equals(NOTIFY_KEY));
-      assertTrue("server0: change notification value = " + val, val.equals(NOTIFY_VALUE));
-      assertTrue("server0: change notification isLocal = " + isLocal, isLocal == true);
+      assertEquals("server0: change notification category = " + cat, NOTIFY_CATEGORY, cat);
+      assertEquals("server0: change notification key = " + key, NOTIFY_KEY, key);
+      assertEquals("server0: change notification value = " + val, NOTIFY_VALUE, val);
+      assertTrue("server0: change notification isLocal = " + isLocal, isLocal);
       
       // check the change notification on server1
       type = listener1.getNotificationType();
@@ -189,10 +191,10 @@
       key = (String)data.key;
       val = (String)data.value;
       isLocal = data.locallyModified;
-      assertTrue("server1: change notification category = " + cat, cat.equals(NOTIFY_CATEGORY));
-      assertTrue("server1: change notification key = " + key, key.equals(NOTIFY_KEY));
-      assertTrue("server1: change notification value = " + val, val.equals(NOTIFY_VALUE));
-      assertTrue("server1: change notification isLocal = " + isLocal, isLocal == false);
+      assertEquals("server1: change notification category = " + cat, NOTIFY_CATEGORY, cat);
+      assertEquals("server1: change notification key = " + key, NOTIFY_KEY, key);
+      assertEquals("server1: change notification value = " + val, NOTIFY_VALUE, val);
+      assertFalse("server1: change notification isLocal = " + isLocal, isLocal);
       
       // remove the key from server1 and check its notifications
       ds1.remove(NOTIFY_KEY);
@@ -207,10 +209,10 @@
       key = (String)data.key;
       val = (String)data.value;
       isLocal = data.locallyModified;
-      assertTrue("server0: removal notification category = " + cat, cat.equals(NOTIFY_CATEGORY));
-      assertTrue("server0: removal notification key = " + key, key.equals(NOTIFY_KEY));
-      assertTrue("server01: removal notification value = " + val, val.equals(NOTIFY_VALUE));
-      assertTrue("server0: removal notification isLocal = " + isLocal, isLocal == false);
+      assertEquals("server0: removal notification category = " + cat, NOTIFY_CATEGORY, cat);
+      assertEquals("server0: removal notification key = " + key, NOTIFY_KEY, key);
+      assertEquals("server01: removal notification value = " + val, NOTIFY_VALUE, val);
+      assertFalse("server0: removal notification isLocal = " + isLocal, isLocal);
       
       // check the remove notification on server1
       type = listener1.getNotificationType();
@@ -221,10 +223,10 @@
       key = (String)data.key;
       val = (String)data.value;
       isLocal = data.locallyModified;
-      assertTrue("server1: removal notification category = " + cat, cat.equals(NOTIFY_CATEGORY));
-      assertTrue("server1: removal notification key = " + key, key.equals(NOTIFY_KEY));
-      assertTrue("server1: removal notification value = " + val, val.equals(NOTIFY_VALUE));
-      assertTrue("server1: removal notification isLocal = " + isLocal, isLocal == true);
+      assertEquals("server1: removal notification category = " + cat, NOTIFY_CATEGORY, cat);
+      assertEquals("server1: removal notification key = " + key, NOTIFY_KEY, key);
+      assertEquals("server1: removal notification value = " + val, NOTIFY_VALUE, val);
+      assertTrue("server1: removal notification isLocal = " + isLocal, isLocal);
       
    }
 




More information about the jboss-cvs-commits mailing list