[Jboss-cvs] JBossAS SVN: r56864 - trunk/testsuite/src/main/org/jboss/test/cluster/partition/test

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 14 16:33:21 EDT 2006


Author: bstansberry at jboss.com
Date: 2006-09-14 16:33:19 -0400 (Thu, 14 Sep 2006)
New Revision: 56864

Modified:
   trunk/testsuite/src/main/org/jboss/test/cluster/partition/test/HAPartitionStateTransferTestCase.java
Log:
[JBAS-3656] Test for disconnect channel upon failure in startService()

Modified: trunk/testsuite/src/main/org/jboss/test/cluster/partition/test/HAPartitionStateTransferTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/partition/test/HAPartitionStateTransferTestCase.java	2006-09-14 19:52:27 UTC (rev 56863)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/partition/test/HAPartitionStateTransferTestCase.java	2006-09-14 20:33:19 UTC (rev 56864)
@@ -21,6 +21,8 @@
  */
 package org.jboss.test.cluster.partition.test;
 
+import java.util.Vector;
+
 import javax.management.ObjectName;
 
 import junit.framework.Test;
@@ -65,9 +67,9 @@
    {
       RMIAdaptor[] adaptors = getAdaptors();
       
-      ObjectName partition = new ObjectName("jboss:service=BadProviderPartitionRecorder");
+      ObjectName recorder = new ObjectName("jboss:service=BadProviderPartitionRecorder");
       
-      Exception e = (Exception) adaptors[1].getAttribute(partition, "StartupException");      
+      Exception e = (Exception) adaptors[1].getAttribute(recorder, "StartupException");      
 
       assertNotNull("Partition caught exception", e);
       
@@ -80,15 +82,20 @@
       }
       
       assertTrue("Correct type of Exception caught", parent instanceof IllegalStateException);
+      
+      // Confirm the bad partition is removed from the current view
+      ObjectName partition = new ObjectName("jboss:service=BadProviderPartition");
+      Vector view = (Vector) adaptors[0].getAttribute(partition, "CurrentView");
+      assertEquals("View size after failure is correct", 1, view.size());
    }
 
    public void testBadStateIntegration() throws Exception
    {
       RMIAdaptor[] adaptors = getAdaptors();
       
-      ObjectName partition = new ObjectName("jboss:service=BadStatePartitionRecorder");
+      ObjectName recorder = new ObjectName("jboss:service=BadStatePartitionRecorder");
       
-      Exception e = (Exception) adaptors[1].getAttribute(partition, "StartupException");
+      Exception e = (Exception) adaptors[1].getAttribute(recorder, "StartupException");
 
       assertNotNull("Partition caught exception", e);
       
@@ -101,6 +108,11 @@
       }
       
       assertTrue("Correct type of Exception caught", parent instanceof BadHAPartitionStateException);
+      
+      // Confirm the bad partition is removed from the current view
+      ObjectName partition = new ObjectName("jboss:service=BadStatePartition");
+      Vector view = (Vector) adaptors[0].getAttribute(partition, "CurrentView");
+      assertEquals("View size after failure is correct", 1, view.size());
    }
    
    public void testNoStateTransfer() throws Exception




More information about the jboss-cvs-commits mailing list