[jboss-cvs] JBoss Messaging SVN: r2791 - in trunk: tests/src/org/jboss/test/messaging/jms and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jun 19 14:30:08 EDT 2007


Author: clebert.suconic at jboss.com
Date: 2007-06-19 14:30:07 -0400 (Tue, 19 Jun 2007)
New Revision: 2791

Modified:
   trunk/src/main/org/jboss/jms/client/container/ConnectionAspect.java
   trunk/tests/src/org/jboss/test/messaging/jms/ConnectionTest.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-996 - fix and testcase
http://jira.jboss.org/jira/browse/JBMESSAGING-995 - Removing rejected testcase

Modified: trunk/src/main/org/jboss/jms/client/container/ConnectionAspect.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/ConnectionAspect.java	2007-06-19 16:33:52 UTC (rev 2790)
+++ trunk/src/main/org/jboss/jms/client/container/ConnectionAspect.java	2007-06-19 18:30:07 UTC (rev 2791)
@@ -144,6 +144,7 @@
    {
       ConnectionState currentState = getConnectionState(invocation);
       currentState.setStarted(true);
+      currentState.setJustCreated(false);
       return invocation.invokeNext();
    }
    
@@ -151,6 +152,7 @@
    {
       ConnectionState currentState = getConnectionState(invocation);
       currentState.setStarted(false);
+      currentState.setJustCreated(false);
       return invocation.invokeNext();
    }
    

Modified: trunk/tests/src/org/jboss/test/messaging/jms/ConnectionTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/ConnectionTest.java	2007-06-19 16:33:52 UTC (rev 2790)
+++ trunk/tests/src/org/jboss/test/messaging/jms/ConnectionTest.java	2007-06-19 18:30:07 UTC (rev 2791)
@@ -265,15 +265,31 @@
       connection.close();
    }
 
-   public void testSetClientID2() throws Exception
+   public void testSetClientAfterStart()
    {
-      Connection connection = cf.createConnection();
-      if (connection.getClientID() == null)
+      try
       {
-         connection.setClientID("publisherConnection");
+         Connection connection = cf.createConnection();
+
+         //we start the connection
+         connection.start();
+
+         // an attempt to set the client ID now should throw a IllegalStateException
+         connection.setClientID("testSetClientID_2");
+         fail("Should throw a javax.jms.IllegalStateException");
       }
-
-      connection.close();
+      catch (javax.jms.IllegalStateException e)
+      {
+      }
+      catch (JMSException e)
+      {
+         fail("Should raise a javax.jms.IllegalStateException, not a " + e);
+      }
+      catch (java.lang.IllegalStateException e)
+      {
+         fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException");
+      }
+      
    }
 
    public void testSetClientIDFail() throws Exception




More information about the jboss-cvs-commits mailing list