[jboss-cvs] JBossAS SVN: r71125 - trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Mar 21 00:47:32 EDT 2008
Author: bstansberry at jboss.com
Date: 2008-03-21 00:47:31 -0400 (Fri, 21 Mar 2008)
New Revision: 71125
Modified:
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/DRMTestCase.java
Log:
Remove duplicate test method long since moved to multicfg.test.DRMTestCase
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/DRMTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/DRMTestCase.java 2008-03-21 04:45:32 UTC (rev 71124)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/DRMTestCase.java 2008-03-21 04:47:31 UTC (rev 71125)
@@ -21,21 +21,14 @@
*/
package org.jboss.test.cluster.defaultcfg.test;
-import java.rmi.RemoteException;
-import java.rmi.server.UnicastRemoteObject;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Iterator;
-import java.util.Vector;
import java.util.List;
-import java.util.HashSet;
+import java.util.Vector;
import javax.management.MBeanServer;
-import javax.management.MBeanServerConnection;
import javax.management.MBeanServerFactory;
-import javax.management.MBeanServerInvocationHandler;
-import javax.management.ObjectName;
-import javax.management.Notification;
import junit.framework.Test;
@@ -51,16 +44,12 @@
import org.jboss.ha.framework.server.DistributedReplicantManagerImpl;
import org.jboss.ha.framework.server.DistributedStateImpl;
import org.jboss.ha.framework.server.JChannelFactory;
-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;
import org.jboss.test.cluster.hapartition.drm.MockHAPartition;
import org.jgroups.stack.GossipRouter;
import org.jgroups.stack.IpAddress;
-
import EDU.oswego.cs.dl.util.concurrent.Semaphore;
/** Tests of the DistributedReplicantManagerImpl
@@ -75,23 +64,6 @@
private static final String SERVICEA = "serviceA";
private static final String SERVICEB = "serviceB";
- static class TestListener extends UnicastRemoteObject
- implements RMINotificationListener
- {
- private static final long serialVersionUID = 1;
- private Logger log;
-
- public TestListener(Logger log) throws RemoteException
- {
- this.log = log;
- }
- public void handleNotification(Notification notification, Object handback)
- throws RemoteException
- {
- log.info("handleNotification, "+notification);
- }
- }
-
/**
* Thread that will first register a DRM ReplicantLister that synchronizes
* on the test class' lock object, and then calls DRM add or remove,
@@ -515,95 +487,6 @@
{
super(name);
}
-
- public void testStateReplication()
- throws Exception
- {
- log.debug("+++ testStateReplication");
- log.info("java.rmi.server.hostname="+System.getProperty("java.rmi.server.hostname"));
- MBeanServerConnection[] adaptors = getAdaptors();
- String[] servers = super.getServers();
- RMIAdaptorExt server0 = (RMIAdaptorExt) adaptors[0];
- log.info("server0: "+server0);
- ObjectName clusterService = new ObjectName("jboss:service=HAPartition,partition=DefaultPartition");
- Vector view0 = (Vector) server0.getAttribute(clusterService, "CurrentView");
- log.info("server0: CurrentView, "+view0);
- log.debug("+++ testStateReplication 1");
- ObjectName drmService = new ObjectName("jboss.test:service=DRMTestCase");
- IReplicants drm0 = (IReplicants)
- MBeanServerInvocationHandler.newProxyInstance(server0, drmService,
- IReplicants.class, true);
- log.debug("+++ testStateReplication 2");
- log.info(MBeanServerInvocationHandler.class.getProtectionDomain());
- TestListener listener = new TestListener(log);
- server0.addNotificationListener(drmService, listener, null, null);
- log.info("server0 addNotificationListener");
- log.debug("+++ testStateReplication 3");
- String address = (String) drm0.lookupLocalReplicant();
- log.debug("+++ testStateReplication 4");
- log.info("server0: lookupLocalReplicant: "+address);
- assertTrue("server0: address("+address+") == server0("+servers[0]+")",
- address.equals(servers[0]));
-
- RMIAdaptorExt server1 = (RMIAdaptorExt) adaptors[1];
- log.info("server1: "+server1);
- Vector view1 = (Vector) server1.getAttribute(clusterService, "CurrentView");
- log.info("server1: CurrentView, "+view1);
- IReplicants drm1 = (IReplicants)
- MBeanServerInvocationHandler.newProxyInstance(server1, drmService,
- IReplicants.class, true);
- server1.addNotificationListener(drmService, listener, null, null);
- log.info("server1 addNotificationListener");
- address = (String) drm1.lookupLocalReplicant();
- log.info("server1: lookupLocalReplicant: "+address);
- assertTrue("server1: address("+address+") == server1("+servers[1]+")",
- address.equals(servers[1]));
-
- List replicants0 = drm0.lookupReplicants();
- List replicants1 = drm1.lookupReplicants();
- assertTrue("size of replicants0 == replicants1)",
- replicants0.size() == replicants1.size());
- HashSet testSet = new HashSet(replicants0);
- for(int n = 0; n < replicants0.size(); n ++)
- {
- Object entry = replicants1.get(n);
- assertTrue("replicants0 contains:"+entry, testSet.contains(entry));
- }
-
- //
- for(int n = 0; n < 10; n ++)
- {
- drm0.add("key"+n, "data"+n+".0");
- drm1.add("key"+n, "data"+n+".1");
- }
- for(int n = 0; n < 10; n ++)
- {
- String key = "key"+n;
- log.info("key: "+key);
- replicants0 = drm0.lookupReplicants(key);
- replicants1 = drm1.lookupReplicants(key);
- log.info("replicants0: "+replicants0);
- log.info("replicants1: "+replicants1);
- HashSet testSet0 = new HashSet(replicants0);
- HashSet testSet1 = new HashSet(replicants1);
- assertTrue("size of replicants0 == replicants1)",
- replicants0.size() == replicants1.size());
- Object entry = drm0.lookupLocalReplicant(key);
- log.info("drm0.lookupLocalReplicant, key="+key+", entry="+entry);
- assertTrue("replicants0 contains:"+entry, testSet0.contains(entry));
- assertTrue("replicants1 contains:"+entry, testSet1.contains(entry));
- entry = drm1.lookupLocalReplicant(key);
- log.info("drm1.lookupLocalReplicant, key="+key+", entry="+entry);
- assertTrue("replicants0 contains:"+entry, testSet0.contains(entry));
- assertTrue("replicants1 contains:"+entry, testSet1.contains(entry));
- }
-
- for(int n = 0; n < 10; n ++)
- drm0.remove("key"+n);
-
- server0.removeNotificationListener(drmService, listener);
- server1.removeNotificationListener(drmService, listener);
- }
/**
* Tests the functionality of isMasterReplica(), also testing merge
More information about the jboss-cvs-commits
mailing list