[jboss-cvs] JBossAS SVN: r67832 - branches/JBoss_4_0_0_CP/testsuite/src/main/org/jboss/test/cluster/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Dec 3 20:23:26 EST 2007
Author: jiwils
Date: 2007-12-03 20:23:26 -0500 (Mon, 03 Dec 2007)
New Revision: 67832
Modified:
branches/JBoss_4_0_0_CP/testsuite/src/main/org/jboss/test/cluster/test/DRMTestCase.java
Log:
Fix for [ASPATCH-322]; cleaned up test case removing unnecessary imports, deployment dependancies, etc.
Modified: branches/JBoss_4_0_0_CP/testsuite/src/main/org/jboss/test/cluster/test/DRMTestCase.java
===================================================================
--- branches/JBoss_4_0_0_CP/testsuite/src/main/org/jboss/test/cluster/test/DRMTestCase.java 2007-12-04 01:04:26 UTC (rev 67831)
+++ branches/JBoss_4_0_0_CP/testsuite/src/main/org/jboss/test/cluster/test/DRMTestCase.java 2007-12-04 01:23:26 UTC (rev 67832)
@@ -6,61 +6,37 @@
*/
package org.jboss.test.cluster.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 javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
-import javax.management.MBeanServerInvocationHandler;
-import javax.management.ObjectName;
-import javax.management.Notification;
import junit.framework.Test;
+import junit.framework.TestSuite;
import org.jboss.test.JBossClusteredTestCase;
-/* Added per movement to 401sp1, not part of ASPATCH-322
-import org.jboss.test.cluster.drm.IReplicants;
-*/
-
import org.jboss.test.cluster.drm.MockHAPartition;
+
import org.jboss.ha.framework.interfaces.ClusterNode;
import org.jboss.ha.framework.interfaces.DistributedReplicantManager.ReplicantListener;
import org.jboss.ha.framework.server.DistributedReplicantManagerImpl;
-import org.jboss.jmx.adaptor.rmi.RMIAdaptor;
-import org.jboss.jmx.adaptor.rmi.RMIAdaptorExt;
-import org.jboss.jmx.adaptor.rmi.RMINotificationListener;
+
import org.jgroups.stack.IpAddress;
+
import org.apache.log4j.Logger;
-/** Tests of http session replication
+/** Tests the DRM.
*
* @author Scott.Stark at jboss.org
* @version $Revision$
*/
public class DRMTestCase extends JBossClusteredTestCase
{
- static class TestListener extends UnicastRemoteObject
- implements RMINotificationListener
- {
- private Logger log;
- TestListener(Logger log) throws RemoteException
- {
- this.log = log;
- }
- public void handleNotification(Notification notification, Object handback)
- throws RemoteException
- {
- log.info(notification);
- }
- }
-
/** ReplicantListener that caches the list of replicants */
static class CachingListener implements ReplicantListener
{
@@ -92,8 +68,10 @@
public static Test suite() throws Exception
{
- Test t1 = getDeploySetup(DRMTestCase.class, "drm-tests.sar");
- return t1;
+ TestSuite suite = new TestSuite();
+ suite.addTest(new DRMTestCase("testReplicantOrder"));
+
+ return suite;
}
public DRMTestCase(String name)
@@ -101,55 +79,6 @@
super(name);
}
-/* Test added per movment to 401sp1, not related to ASPATCH-322
- public void testStateReplication()
- throws Exception
- {
- log.debug("+++ testStateReplication");
-
- RMIAdaptor[] adaptors = getAdaptors();
- String[] servers = super.getServers();
- RMIAdaptorExt server0 = (RMIAdaptorExt) adaptors[0];
- log.info("server0: "+server0);
- ObjectName clusterService = new ObjectName("jboss:service=DefaultPartition");
- Vector view0 = (Vector) server0.getAttribute(clusterService, "CurrentView");
- log.info("server0: CurrentView, "+view0);
- ObjectName drmService = new ObjectName("jboss.test:service=DRMTestCase");
- IReplicants drm0 = (IReplicants)
- MBeanServerInvocationHandler.newProxyInstance(server0, drmService,
- IReplicants.class, true);
- TestListener listener = new TestListener(log);
- server0.addNotificationListener(drmService, listener, null, null);
- String address = (String) drm0.lookupLocalReplicant();
- 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);
- address = (String) drm1.lookupLocalReplicant();
- log.info("server1: lookupLocalReplicant: "+address);
- assertTrue("server1: address("+address+") == server1("+servers[1]+")",
- address.equals(servers[1]));
-
- List replicants0 = drm0.lookupLocalReplicants();
- List replicants1 = drm1.lookupLocalReplicants();
- 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));
- }
- } */
-
public void testReplicantOrder() throws Exception
{
MBeanServer mbeanServer =
More information about the jboss-cvs-commits
mailing list