/** * 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); } }
/** * 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 */ @Test public void testCreateDurableConnectionConsumerOnQueueConnection() { try { queueConnection.createDurableConnectionConsumer(topic, "subscriptionName", "", (ServerSessionPool) null, 1); Assert.fail("Should throw a javax.jms.IllegalStateException"); } catch (javax.jms.IllegalStateException e) { } catch (JMSException e) { Assert.fail("Should throw a javax.jms.IllegalStateException, not a " + e); } }
/** * This test is similar to a JORAM Test... * (UnifiedTest::testCreateDurableConnectionConsumerOnQueueConnection) * * @throws Exception */ @Test public void testDurableSubscriberOnQueueConnection() throws Exception { QueueConnection queueConnection = ((QueueConnectionFactory) queueCf).createQueueConnection(); try { queueConnection.createDurableConnectionConsumer(ActiveMQServerTestCase.topic1, "subscriptionName", "", (ServerSessionPool) null, 1); ProxyAssertSupport.fail("Should throw a javax.jms.IllegalStateException"); } catch (javax.jms.IllegalStateException e) { } catch (java.lang.IllegalStateException e) { ProxyAssertSupport.fail("Should throw a javax.jms.IllegalStateException"); } catch (JMSException e) { ProxyAssertSupport.fail("Should throw a javax.jms.IllegalStateException, not a " + e); } finally { queueConnection.close(); } }