[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Invalid JORAM Test

clebert.suconic@jboss.com do-not-reply at jboss.com
Tue Jun 19 13:38:34 EDT 2007


"timfox" wrote : I would say the JORAM test is invalid.
  | 
  | setClientID() is supposed to throw an exception unless it is the first operation called on the connection.
  | 
  | In your case, you are calling getClientID() first, so it is correct to throw an exception:
  | 
  | See http://java.sun.com/j2ee/1.4/docs/api/index.html

Well... I wouldn't consider checking for getClientID an operation... JORAMTests aways tests if ClientID is already set... if not set by the provider it would set the ClientID.

I would agree about that on real operations.. but not on getClientID.

Ah... BTW... connection.start() is not setting the just created.. 

The following tests would fail:


   public void testSetClientAfterStart()
  |    {
  |       try
  |       {
  |          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");
  |       }
  |       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");
  |       }
  |       
  |    }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055752#4055752

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055752



More information about the jboss-dev-forums mailing list