[jboss-cvs] JBossAS SVN: r103655 - in trunk/testsuite/src/main/org/jboss/test/cluster: multicfg/test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 7 16:00:06 EDT 2010


Author: pferraro
Date: 2010-04-07 16:00:05 -0400 (Wed, 07 Apr 2010)
New Revision: 103655

Modified:
   trunk/testsuite/src/main/org/jboss/test/cluster/hapartition/ds/DistributedStateUser.java
   trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/test/DRMTestCase.java
   trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/test/DistributedStateTestCase.java
Log:
Fixed test failures due to ClassCastException

Modified: trunk/testsuite/src/main/org/jboss/test/cluster/hapartition/ds/DistributedStateUser.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/hapartition/ds/DistributedStateUser.java	2010-04-07 19:45:13 UTC (rev 103654)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/hapartition/ds/DistributedStateUser.java	2010-04-07 20:00:05 UTC (rev 103655)
@@ -25,20 +25,20 @@
 import java.util.Collection;
 import java.util.Iterator;
 import javax.management.Notification;
+import javax.management.NotificationBroadcasterSupport;
 
 import org.jboss.ha.framework.interfaces.DistributedState;
 import org.jboss.ha.framework.interfaces.DistributedState.DSListenerEx;
 import org.jboss.ha.framework.interfaces.HAPartition;
 import org.jboss.ha.framework.server.HAPartitionLocator;
 import org.jboss.logging.Logger;
-import org.jboss.mx.util.JBossNotificationBroadcasterSupport;
 
 /** Tests of the DistributedState service  
 
     @author <a href="mailto:Scott.Stark at jboss.org">Scott Stark</a>.
     @version $Revision$
 */
-public class DistributedStateUser extends JBossNotificationBroadcasterSupport
+public class DistributedStateUser extends NotificationBroadcasterSupport
    implements DistributedStateUserMBean, DSListenerEx
 {
    public static final String NOTIFY_CHANGE = "valueHasChanged";

Modified: trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/test/DRMTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/test/DRMTestCase.java	2010-04-07 19:45:13 UTC (rev 103654)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/test/DRMTestCase.java	2010-04-07 20:00:05 UTC (rev 103655)
@@ -25,17 +25,17 @@
 import java.rmi.server.UnicastRemoteObject;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 import java.util.Vector;
 
 import javax.management.MBeanServerConnection;
 import javax.management.MBeanServerInvocationHandler;
 import javax.management.Notification;
+import javax.management.NotificationListener;
 import javax.management.ObjectName;
 
 import junit.framework.Test;
 
-import org.jboss.jmx.adaptor.rmi.RMIAdaptorExt;
-import org.jboss.jmx.adaptor.rmi.RMINotificationListener;
 import org.jboss.logging.Logger;
 import org.jboss.test.JBossClusteredTestCase;
 import org.jboss.test.cluster.hapartition.drm.IReplicants;
@@ -52,7 +52,7 @@
    private static final String PARTITION_NAME = System.getProperty("jbosstest.partitionName", "DefaultPartition");
    
    static class TestListener extends UnicastRemoteObject
-      implements RMINotificationListener
+      implements NotificationListener
    {
       private static final long serialVersionUID = 1;
       private Logger log;
@@ -62,7 +62,6 @@
          this.log = log;
       }
       public void handleNotification(Notification notification, Object handback)
-         throws RemoteException
       {
          log.info("handleNotification, "+notification);
       }
@@ -86,10 +85,10 @@
       log.info("java.rmi.server.hostname="+System.getProperty("java.rmi.server.hostname"));
       MBeanServerConnection[] adaptors = getAdaptors();
       String[] servers = super.getServers();
-      RMIAdaptorExt server0 = (RMIAdaptorExt) adaptors[0];
+      MBeanServerConnection server0 = adaptors[0];
       log.info("server0: "+server0);
       ObjectName clusterService = new ObjectName("jboss:service=HAPartition,partition=" + PARTITION_NAME);
-      Vector view0 = (Vector) server0.getAttribute(clusterService, "CurrentView");
+      Vector<?> view0 = (Vector<?>) server0.getAttribute(clusterService, "CurrentView");
       log.info("server0: CurrentView, "+view0);
       log.debug("+++ testStateReplication 1");
       ObjectName drmService = new ObjectName("jboss.test:service=DRMTestCase");
@@ -108,9 +107,9 @@
       assertTrue("server0: address("+address+") == server0("+servers[0]+")",
          address.equals(servers[0]));
 
-      RMIAdaptorExt server1 = (RMIAdaptorExt) adaptors[1];
+      MBeanServerConnection server1 = adaptors[1];
       log.info("server1: "+server1);
-      Vector view1 = (Vector) server1.getAttribute(clusterService, "CurrentView");
+      Vector<?> view1 = (Vector<?>) server1.getAttribute(clusterService, "CurrentView");
       log.info("server1: CurrentView, "+view1);
       IReplicants drm1 = (IReplicants)
          MBeanServerInvocationHandler.newProxyInstance(server1, drmService,
@@ -122,11 +121,11 @@
       assertTrue("server1: address("+address+") == server1("+servers[1]+")",
          address.equals(servers[1]));
 
-      List replicants0 = drm0.lookupReplicants();
-      List replicants1 = drm1.lookupReplicants();
+      List<?> replicants0 = drm0.lookupReplicants();
+      List<?> replicants1 = drm1.lookupReplicants();
       assertTrue("size of replicants0 == replicants1)",
          replicants0.size() == replicants1.size());
-      HashSet testSet = new HashSet(replicants0);
+      Set<?> testSet = new HashSet<Object>(replicants0);
       for(int n = 0; n < replicants0.size(); n ++)
       {
          Object entry = replicants1.get(n);
@@ -147,8 +146,8 @@
          replicants1 = drm1.lookupReplicants(key);
          log.info("replicants0: "+replicants0);
          log.info("replicants1: "+replicants1);
-         HashSet testSet0 = new HashSet(replicants0);
-         HashSet testSet1 = new HashSet(replicants1);
+         Set<?> testSet0 = new HashSet<Object>(replicants0);
+         Set<?> testSet1 = new HashSet<Object>(replicants1);
          assertTrue("size of replicants0 == replicants1)",
             replicants0.size() == replicants1.size());
          Object entry = drm0.lookupLocalReplicant(key);

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-07 19:45:13 UTC (rev 103654)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/test/DistributedStateTestCase.java	2010-04-07 20:00:05 UTC (rev 103655)
@@ -28,6 +28,7 @@
 
 import javax.management.MBeanServerConnection;
 import javax.management.MBeanServerInvocationHandler;
+import javax.management.NotificationListener;
 import javax.management.ObjectName;
 import javax.management.Notification;
 
@@ -37,8 +38,6 @@
 import org.jboss.test.cluster.hapartition.ds.DistributedStateUser;
 import org.jboss.test.cluster.hapartition.ds.IDistributedState;
 import org.jboss.test.cluster.hapartition.ds.IDistributedState.NotifyData;
-import org.jboss.jmx.adaptor.rmi.RMIAdaptorExt;
-import org.jboss.jmx.adaptor.rmi.RMINotificationListener;
 
 /** Tests of http session replication
  *
@@ -55,7 +54,7 @@
    private static final String NOTIFY_CATEGORY = "DistributedStateTestCase";
    
    class TestListener extends UnicastRemoteObject
-      implements RMINotificationListener
+      implements NotificationListener
    {
       /** The serialVersionUID */
       private static final long serialVersionUID = 3694780966459612453L;
@@ -68,7 +67,6 @@
       }
       
       public void handleNotification(Notification notification, Object handback)
-         throws RemoteException
       {
          System.out.println(notification);
          type = notification.getType();
@@ -103,10 +101,10 @@
       log.debug("+++ testStateReplication");
       
       MBeanServerConnection[] adaptors = getAdaptors();
-      RMIAdaptorExt server0 = (RMIAdaptorExt) adaptors[0];
+      MBeanServerConnection server0 = adaptors[0];
       log.info("server0: "+server0);
       ObjectName clusterService = new ObjectName("jboss:service=HAPartition,partition=" + PARTITION_NAME);
-      Vector view0 = (Vector) server0.getAttribute(clusterService, "CurrentView");
+      Vector<?> view0 = (Vector<?>) server0.getAttribute(clusterService, "CurrentView");
       log.info("server0: CurrentView, "+view0);
       ObjectName dsService = new ObjectName("jboss.test:service=DistributedStateTestCase");
       IDistributedState ds0 = (IDistributedState)
@@ -119,9 +117,9 @@
       log.info("server0: get(key0): "+value);
       assertTrue("server0: value == value0", value.equals("value0"));
 
-      RMIAdaptorExt server1 = (RMIAdaptorExt) adaptors[1];
+      MBeanServerConnection server1 = adaptors[1];
       log.info("server1: "+server1);
-      Vector view1 = (Vector) server1.getAttribute(clusterService, "CurrentView");
+      Vector<?> view1 = (Vector<?>) server1.getAttribute(clusterService, "CurrentView");
       log.info("server1: CurrentView, "+view1);
       IDistributedState ds1 = (IDistributedState)
          MBeanServerInvocationHandler.newProxyInstance(server1, dsService,
@@ -138,20 +136,20 @@
       assertTrue("server0: value == value1("+value+")", value.equals("value1"));
       
       ds1.put("key1", "value11");
-      Collection categories = ds0.listAllCategories();
+      Collection<?> categories = ds0.listAllCategories();
       log.info("server0: categories: " + categories);
       assertTrue("server0 has category " + NOTIFY_CATEGORY, categories.contains(NOTIFY_CATEGORY));
       categories = ds1.listAllCategories();
       log.info("server1: categories: " + categories);
       assertTrue("server1 has category " + NOTIFY_CATEGORY, categories.contains(NOTIFY_CATEGORY));
       
-      Collection keys = ds0.listAllKeys(NOTIFY_CATEGORY);
+      Collection<?> keys = ds0.listAllKeys(NOTIFY_CATEGORY);
       log.info("server0: keys: " + keys);
       assertEquals("server0 keys size", 2, keys.size());
       keys = ds1.listAllKeys(NOTIFY_CATEGORY);
       log.info("server1: keys: " + keys);
       assertEquals("server1 keys size", 2, keys.size());
-      Collection vals = ds0.listAllValues(NOTIFY_CATEGORY);
+      Collection<?> vals = ds0.listAllValues(NOTIFY_CATEGORY);
       log.info("server0: values: " + vals);
       assertEquals("server0 values size", 2, vals.size());
       vals = ds1.listAllValues(NOTIFY_CATEGORY);




More information about the jboss-cvs-commits mailing list