[jboss-cvs] JBossAS SVN: r60302 - branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Feb 5 12:45:29 EST 2007


Author: bstansberry at jboss.com
Date: 2007-02-05 12:45:28 -0500 (Mon, 05 Feb 2007)
New Revision: 60302

Modified:
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/test/HASingletonElectionPolicyTestCase.java
Log:
HASingletonElectionPolicy test should use its own partition

Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/test/HASingletonElectionPolicyTestCase.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/test/HASingletonElectionPolicyTestCase.java	2007-02-05 17:44:35 UTC (rev 60301)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/test/HASingletonElectionPolicyTestCase.java	2007-02-05 17:45:28 UTC (rev 60302)
@@ -33,6 +33,7 @@
  * The testing deployment is under resources/ha/electionpolicy. 
  *
  * @author <a href="mailto:Alex.Fu at novell.com">Alex Fu</a>
+ * @author Brian Stansberry
  * @version $Revision: 46010 $
  *
  */
@@ -55,13 +56,8 @@
       // Get MBeanServerConnections
       RMIAdaptor[] adaptors = this.getAdaptors();
       int size = adaptors.length;
-      assertTrue(size > 1);   // cluster size must be at least 2
+      assertTrue(size == 2);   // cluster size must be 2 for 3rd policy test
       
-      // Restart partition to ensure the ordering of the cluster, which is important for testing the simple policy
-      // This is to avoid the mis-ordering caused by partition restart unit test
-      for (int i = 0; i < size; i++) 
-        restartPartition(adaptors[i]);
-      
       // First policy is to elect the oldest node (position = 0)
       {
          ObjectName mbean = new ObjectName("jboss.examples:service=HASingletonMBeanExample_1");
@@ -72,6 +68,7 @@
          assertEquals(n1, Boolean.TRUE);
          assertEquals(n2, Boolean.FALSE);
       }
+      
       // Second policy is the youngest (position = -1)
       {
          ObjectName mbean = new ObjectName("jboss.examples:service=HASingletonMBeanExample_2");
@@ -82,6 +79,7 @@
          assertEquals(n1, Boolean.FALSE);
          assertEquals(n2, Boolean.TRUE);
       }
+      
       // 3rd policy is the 2nd oldest (position = 1)
       {
          ObjectName mbean = new ObjectName("jboss.examples:service=HASingletonMBeanExample_3");
@@ -92,6 +90,7 @@
          assertEquals(n1, Boolean.FALSE);
          assertEquals(n2, Boolean.TRUE);
       }
+      
       // 4th policy is not set, default is oldest
       {
          ObjectName mbean = new ObjectName("jboss.examples:service=HASingletonMBeanExample_4");
@@ -105,14 +104,4 @@
       
       return;
    }
-
-   private void restartPartition(RMIAdaptor adaptor) throws Exception
-   {
-      ObjectName partition = new ObjectName("jboss:service=DefaultPartition");
-      
-      Object[] params = new Object[0];
-      String[] types = new String[0];
-      adaptor.invoke(partition, "stop", params, types);
-      adaptor.invoke(partition, "start", params, types);
-   }
 }




More information about the jboss-cvs-commits mailing list