[hornetq-commits] JBoss hornetq SVN: r7923 - in trunk/tests/src/org/hornetq/tests: util and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Aug 27 10:22:21 EDT 2009


Author: clebert.suconic at jboss.com
Date: 2009-08-27 10:22:20 -0400 (Thu, 27 Aug 2009)
New Revision: 7923

Modified:
   trunk/tests/src/org/hornetq/tests/integration/jms/largemessage/JMSLargeMessageTest.java
   trunk/tests/src/org/hornetq/tests/util/JMSTestBase.java
Log:
small tweak

Modified: trunk/tests/src/org/hornetq/tests/integration/jms/largemessage/JMSLargeMessageTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/largemessage/JMSLargeMessageTest.java	2009-08-27 13:54:23 UTC (rev 7922)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/largemessage/JMSLargeMessageTest.java	2009-08-27 14:22:20 UTC (rev 7923)
@@ -59,11 +59,9 @@
    protected void setUp() throws Exception
    {
       super.setUp();
-      jmsServer.createQueue("queue1", "/jms/queue1", null, true);
-      
-      queue1 = (Queue)context.lookup("/jms/queue1");
+      queue1 = createQueue("queue1");
    }
-   
+
    protected void tearDown() throws Exception
    {
       queue1 = null;

Modified: trunk/tests/src/org/hornetq/tests/util/JMSTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/util/JMSTestBase.java	2009-08-27 13:54:23 UTC (rev 7922)
+++ trunk/tests/src/org/hornetq/tests/util/JMSTestBase.java	2009-08-27 14:22:20 UTC (rev 7923)
@@ -37,6 +37,8 @@
 import java.util.List;
 
 import javax.jms.ConnectionFactory;
+import javax.jms.Queue;
+import javax.naming.NamingException;
 
 import org.hornetq.core.config.Configuration;
 import org.hornetq.core.config.TransportConfiguration;
@@ -94,6 +96,18 @@
    {
       return false;
    }
+   
+   /**
+    * @throws Exception
+    * @throws NamingException
+    */
+   protected Queue createQueue(String name) throws Exception, NamingException
+   {
+      jmsServer.createQueue(name, "/jms/" + name, null, true);
+      
+      return (Queue)context.lookup("/jms/" + name);
+   }
+   
 
    @Override
    protected void setUp() throws Exception
@@ -156,12 +170,6 @@
 
    private void registerConnectionFactory() throws Exception
    {
-      int retryInterval = 1000;
-      double retryIntervalMultiplier = 1.0;
-      int reconnectAttempts = -1;
-      boolean failoverOnServerShutdown = true;
-      int callTimeout = 30000;
-
       List<Pair<TransportConfiguration, TransportConfiguration>> connectorConfigs = new ArrayList<Pair<TransportConfiguration, TransportConfiguration>>();
       connectorConfigs.add(new Pair<TransportConfiguration, TransportConfiguration>(new TransportConfiguration(NettyConnectorFactory.class.getName()),
                                                                                     null));
@@ -169,6 +177,26 @@
       List<String> jndiBindings = new ArrayList<String>();
       jndiBindings.add("/cf");
 
+      createCF(connectorConfigs, jndiBindings);
+      
+      cf = (ConnectionFactory)context.lookup("/cf");
+      
+   }
+
+   /**
+    * @param connectorConfigs
+    * @param jndiBindings
+    * @throws Exception
+    */
+   protected void createCF(List<Pair<TransportConfiguration, TransportConfiguration>> connectorConfigs,
+                         List<String> jndiBindings) throws Exception
+   {
+      int retryInterval = 1000;
+      double retryIntervalMultiplier = 1.0;
+      int reconnectAttempts = -1;
+      boolean failoverOnServerShutdown = true;
+      int callTimeout = 30000;
+
       jmsServer.createConnectionFactory("ManualReconnectionToSingleServerTest",
                                             connectorConfigs,
                                             null,
@@ -198,9 +226,6 @@
                                             reconnectAttempts,
                                             failoverOnServerShutdown,
                                             jndiBindings);
-      
-      cf = (ConnectionFactory)context.lookup("/cf");
-      
    }
 
 }



More information about the hornetq-commits mailing list