[hornetq-commits] JBoss hornetq SVN: r9751 - branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/reattach.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Oct 5 12:30:24 EDT 2010


Author: ataylor
Date: 2010-10-05 12:30:24 -0400 (Tue, 05 Oct 2010)
New Revision: 9751

Modified:
   branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java
   branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadReattachSupport.java
   branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/reattach/NettyMultiThreadRandomReattachTest.java
Log:
fixed reattach test

Modified: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java	2010-10-05 16:24:15 UTC (rev 9750)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java	2010-10-05 16:30:24 UTC (rev 9751)
@@ -1241,14 +1241,12 @@
     * @return
     */
    @Override
-   protected ClientSessionFactoryInternal createSessionFactory() throws Exception
+   protected ServerLocator createLocator() throws Exception
    {
       ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory"));
       locator.setReconnectAttempts(-1);
       locator.setConfirmationWindowSize(1024 * 1024);
-      final ClientSessionFactory sf = locator.createSessionFactory();
-
-      return (ClientSessionFactoryInternal) sf;
+      return locator;
    }
 
    @Override

Modified: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadReattachSupport.java
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadReattachSupport.java	2010-10-05 16:24:15 UTC (rev 9750)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadReattachSupport.java	2010-10-05 16:30:24 UTC (rev 9751)
@@ -23,6 +23,7 @@
 import org.hornetq.api.core.HornetQException;
 import org.hornetq.api.core.client.ClientSession;
 import org.hornetq.api.core.client.ClientSessionFactory;
+import org.hornetq.api.core.client.ServerLocator;
 import org.hornetq.core.client.impl.ClientSessionFactoryInternal;
 import org.hornetq.core.client.impl.ClientSessionInternal;
 import org.hornetq.core.logging.Logger;
@@ -66,7 +67,7 @@
 
    protected abstract void stop() throws Exception;
 
-   protected abstract ClientSessionFactoryInternal createSessionFactory() throws Exception;
+   protected abstract ServerLocator createLocator() throws Exception;
 
    @Override
    protected void setUp() throws Exception
@@ -100,8 +101,10 @@
 
          start();
 
-         final ClientSessionFactoryInternal sf = createSessionFactory();
+         final ServerLocator locator = createLocator();
 
+         final ClientSessionFactoryInternal sf = (ClientSessionFactoryInternal) locator.createSessionFactory();
+
          final ClientSession session = sf.createSession(false, true, true);
 
          Failer failer = startFailer(failDelay, session, failOnCreateConnection);
@@ -174,6 +177,8 @@
 
          session.close();
 
+         locator.close();
+
          Assert.assertEquals(0, sf.numSessions());
 
          Assert.assertEquals(0, sf.numConnections());

Modified: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/reattach/NettyMultiThreadRandomReattachTest.java
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/reattach/NettyMultiThreadRandomReattachTest.java	2010-10-05 16:24:15 UTC (rev 9750)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/reattach/NettyMultiThreadRandomReattachTest.java	2010-10-05 16:30:24 UTC (rev 9751)
@@ -47,13 +47,13 @@
    }
 
    @Override
-   protected ClientSessionFactoryInternal createSessionFactory() throws Exception
+   protected ServerLocator createLocator() throws Exception
    {
       ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration("org.hornetq.core.remoting.impl.netty.NettyConnectorFactory")) ;
       locator.setReconnectAttempts(-1);
       locator.setConfirmationWindowSize(1024 * 1024);
       locator.setAckBatchSize(0);
-      return (ClientSessionFactoryInternal) locator.createSessionFactory();
+      return  locator;
    }
 
 }



More information about the hornetq-commits mailing list