[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - javax.jms.IllegalStateException vs java.lang.IllegalStateExc

clebert.suconic@jboss.com do-not-reply at jboss.com
Tue Jun 19 17:01:55 EDT 2007


I'm trying to keep JORAM tests discussions under "Invalid JORAM Test" thread, but I wanted to open this one here to start a new discussion.


According to this test, we should be throwing javax.jms.IllegalStateException, but JBossConnection is actually throwing java.lang.IllegalStateException, causing the test to fail.



  |    /**
  |     * Test that a call to <code>createDurableConnectionConsumer()</code> method 
  |     * on a <code>QueueConnection</code> throws a 
  |     * <code>javax.jms.IllegalStateException</code>.
  |     * (see JMS 1.1 specs, table 4-1).
  |     * 
  |     * @since JMS 1.1
  |     */
  |    public void testCreateDurableConnectionConsumerOnQueueConnection()
  |    {
  |       try
  |       {
  |          queueConnection.createDurableConnectionConsumer(topic, "subscriptionName", "", (ServerSessionPool) null, 1);
  |          fail("Should throw a javax.jms.IllegalStateException");
  |       }
  |       catch (javax.jms.IllegalStateException e)
  |       {
  |       }
  |       catch (JMSException e)
  |       {
  |          fail("Should throw a javax.jms.IllegalStateException, not a " + e);
  |       }
  |    }
  | 

On the JMS spec, at section 7.3, JMS defines IllegalStateException. From that I read we should be aways throwing javax.jms.IllegalStateException... but from what I inspected on code, we aways use java.lang.IllegalStateException.

Should we change this?



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

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



More information about the jboss-dev-forums mailing list