[jboss-cvs] JBoss Messaging SVN: r2474 - trunk/tests/src/org/jboss/test/messaging/jms/clustering.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Feb 27 15:45:09 EST 2007


Author: clebert.suconic at jboss.com
Date: 2007-02-27 15:45:09 -0500 (Tue, 27 Feb 2007)
New Revision: 2474

Modified:
   trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java
Log:
Adding testGetAOPBroken back

Modified: trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java	2007-02-27 20:11:05 UTC (rev 2473)
+++ trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java	2007-02-27 20:45:09 UTC (rev 2474)
@@ -57,6 +57,38 @@
 
    // Public ---------------------------------------------------------------------------------------
 
+   public void testGetAOPBroken() throws Exception
+   {
+      Connection conn = null;
+
+      try
+      {
+
+         resetAOP();
+
+         ServerManagement.killAndWait(2);
+         ServerManagement.killAndWait(1);
+         ServerManagement.killAndWait(0);
+
+         try
+         {
+            conn = cf.createConnection();
+            fail ("This should try an exception as every server is down");
+         }
+         catch (RuntimeException e)
+         {
+            log.error(e.toString(), e);
+         }
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            conn.close();
+         }
+      }
+   }
+
    public void testCreateConnectionOnBrokenServer() throws Exception
    {
       Connection conn = null;
@@ -178,6 +210,17 @@
 
    // Private --------------------------------------------------------------------------------------
 
+   private void resetAOP()
+      throws NoSuchFieldException, IllegalAccessException
+   {
+
+      // Using reflection to cleanup AOP status and force to load AOP again
+      Field field = ClientAOPStackLoader.class.getDeclaredField("instance");
+      field.setAccessible(true);
+      log.info("Reseting AOP");
+      field.set(null,null);
+   }
+
    // Inner classes --------------------------------------------------------------------------------
 
 }




More information about the jboss-cvs-commits mailing list