[jboss-cvs] JBoss Messaging SVN: r6056 - trunk/tests/src/org/jboss/messaging/tests/integration/client.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Mar 10 09:44:09 EDT 2009


Author: ataylor
Date: 2009-03-10 09:44:09 -0400 (Tue, 10 Mar 2009)
New Revision: 6056

Removed:
   trunk/tests/src/org/jboss/messaging/tests/integration/client/ClientSessionFactoryImplTest.java
Modified:
   trunk/tests/src/org/jboss/messaging/tests/integration/client/ClientSessionFactoryTest.java
Log:
moved and re enabled tests

Deleted: trunk/tests/src/org/jboss/messaging/tests/integration/client/ClientSessionFactoryImplTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/client/ClientSessionFactoryImplTest.java	2009-03-10 13:39:58 UTC (rev 6055)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/client/ClientSessionFactoryImplTest.java	2009-03-10 13:44:09 UTC (rev 6056)
@@ -1,115 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.messaging.tests.integration.client;
-
-import org.jboss.messaging.core.client.ClientSessionFactory;
-import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
-import org.jboss.messaging.core.config.TransportConfiguration;
-import org.jboss.messaging.integration.transports.netty.NettyConnectorFactory;
-import org.jboss.messaging.tests.util.UnitTestCase;
-
-/**
- * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
- * 
- * Created 12 dec. 2008 16:52:12
- *
- *
- */
-public class ClientSessionFactoryImplTest extends UnitTestCase
-{
-
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   // Public --------------------------------------------------------
-
-   public void testCreateSessionFailureWithSimpleConstructorWhenNoServer() throws Exception
-   {
-
-      /****************************/
-      /* No JBM Server is started */
-      /****************************/
-
-      ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(NettyConnectorFactory.class.getName()));
-
-      try
-      {
-         sf.createSession(false, true, true);
-         fail("Can not create a session when there is no running JBM Server");
-      }
-      catch (Exception e)
-      {
-      }
-
-   }
-
-   /**
-    * The test is commented because it generates an infinite loop.
-    * The configuration to have it occured is:
-    * - no backup & default values for max retries before/after failover
-    * 
-    * - The infinite loop is in ConnectionManagerImpl.getConnectionForCreateSession()
-    *   - getConnection(1) always return null (no server to connect to)
-    *   - failover() always return true
-    *        - the value returned by failover() comes from the reconnect() method
-    *        - when there is no session already connected, the reconnect() method does *nothing* 
-    *          and returns true (while nothing has been reconnected)
-    */
-   public void _testCreateSessionFailureWithDefaultValuesWhenNoServer() throws Exception
-   {
-
-      /****************************/
-      /* No JBM Server is started */
-      /****************************/
-
-      ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(NettyConnectorFactory.class.getName()),
-                                                             null,
-                                                             ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL,
-                                                             ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL_MULTIPLIER,
-                                                             ClientSessionFactoryImpl.DEFAULT_MAX_RETRIES_BEFORE_FAILOVER,
-                                                             ClientSessionFactoryImpl.DEFAULT_MAX_RETRIES_AFTER_FAILOVER);
-
-      try
-      {
-         sf.createSession(false, true, true);
-         fail("Can not create a session when there is no running JBM Server");
-      }
-      catch (Exception e)
-      {
-      }
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-
-}

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/client/ClientSessionFactoryTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/client/ClientSessionFactoryTest.java	2009-03-10 13:39:58 UTC (rev 6055)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/client/ClientSessionFactoryTest.java	2009-03-10 13:44:09 UTC (rev 6056)
@@ -32,6 +32,7 @@
 import org.jboss.messaging.core.remoting.impl.invm.TransportConstants;
 import org.jboss.messaging.core.server.Messaging;
 import org.jboss.messaging.core.server.MessagingService;
+import org.jboss.messaging.integration.transports.netty.NettyConnectorFactory;
 import org.jboss.messaging.tests.util.ServiceTestBase;
 import org.jboss.messaging.utils.Pair;
 
@@ -527,6 +528,62 @@
       }
    }
 
+   public void testCreateSessionFailureWithSimpleConstructorWhenNoServer() throws Exception
+   {
+
+      /****************************/
+      /* No JBM Server is started */
+      /****************************/
+
+      ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(NettyConnectorFactory.class.getName()));
+
+      try
+      {
+         sf.createSession(false, true, true);
+         fail("Can not create a session when there is no running JBM Server");
+      }
+      catch (Exception e)
+      {
+      }
+
+   }
+
+   /**
+    * The test is commented because it generates an infinite loop.
+    * The configuration to have it occured is:
+    * - no backup & default values for max retries before/after failover
+    *
+    * - The infinite loop is in ConnectionManagerImpl.getConnectionForCreateSession()
+    *   - getConnection(1) always return null (no server to connect to)
+    *   - failover() always return true
+    *        - the value returned by failover() comes from the reconnect() method
+    *        - when there is no session already connected, the reconnect() method does *nothing*
+    *          and returns true (while nothing has been reconnected)
+    */
+   public void testCreateSessionFailureWithDefaultValuesWhenNoServer() throws Exception
+   {
+
+      /****************************/
+      /* No JBM Server is started */
+      /****************************/
+
+      ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(NettyConnectorFactory.class.getName()),
+                                                             null,
+                                                             ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL,
+                                                             ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL_MULTIPLIER,
+                                                             ClientSessionFactoryImpl.DEFAULT_MAX_RETRIES_BEFORE_FAILOVER,
+                                                             ClientSessionFactoryImpl.DEFAULT_MAX_RETRIES_AFTER_FAILOVER);
+
+      try
+      {
+         sf.createSession(false, true, true);
+         fail("Can not create a session when there is no running JBM Server");
+      }
+      catch (Exception e)
+      {
+      }
+   }
+
    private void assertFactoryParams(ClientSessionFactory cf,
                                     int ackBatchSize,
                                     long callTimeout,




More information about the jboss-cvs-commits mailing list