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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jul 6 14:57:29 EDT 2007


Author: clebert.suconic at jboss.com
Date: 2007-07-06 14:57:29 -0400 (Fri, 06 Jul 2007)
New Revision: 2851

Modified:
   trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteringTestBase.java
Log:
http://jira.jboss.com/jira/browse/JBMESSAGING-761

Modified: trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteringTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteringTestBase.java	2007-07-06 18:15:18 UTC (rev 2850)
+++ trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteringTestBase.java	2007-07-06 18:57:29 UTC (rev 2851)
@@ -94,10 +94,6 @@
          throw new Exception("Node count not defined! Initalize nodeCount in the test's setUp()");
       }
 
-      ic = new Context[nodeCount];
-      queue = new Queue[nodeCount];
-      topic = new Topic[nodeCount];
-
       for (int i = 0; i < nodeCount; i++)
       {
          // make sure all servers are created and started; make sure that database is zapped
@@ -107,7 +103,24 @@
 
          ServerManagement.deployQueue("testDistributedQueue", i);
          ServerManagement.deployTopic("testDistributedTopic", i);
+      }
 
+
+      lookups();
+
+      drainQueues();
+   }
+
+   // Perform Context creation and lookups on queues and factories
+   // Case a server is restarted, a test may want to recreate contexts in certain scenarios
+   protected void lookups() throws Exception
+   {
+      ic = new Context[nodeCount];
+      queue = new Queue[nodeCount];
+      topic = new Topic[nodeCount];
+
+      for (int i = 0; i < nodeCount; i++)
+      {
          ic[i] = new InitialContext(ServerManagement.getJNDIEnvironment(i));
          queue[i] = (Queue)ic[i].lookup("queue/testDistributedQueue");
          topic[i] = (Topic)ic[i].lookup("topic/testDistributedTopic");
@@ -117,7 +130,6 @@
       // actually create connections on different servers (round robin).
       cf = (ConnectionFactory)ic[0].lookup("/ClusteredConnectionFactory");
 
-      drainQueues();
    }
 
    protected void tearDown() throws Exception




More information about the jboss-cvs-commits mailing list