Repository: qpid-jms Updated Branches: refs/heads/master 7ca5622ce -> 42d2cdd77
Fully cover the QueueSession implementation Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/75d50cf9 Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/75d50cf9 Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/75d50cf9 Branch: refs/heads/master Commit: 75d50cf9bf6a3db9ffdd070e59d04e3810cd9e1e Parents: 7ca5622 Author: Timothy Bish <[email protected]> Authored: Mon Feb 2 14:00:05 2015 -0500 Committer: Timothy Bish <[email protected]> Committed: Mon Feb 2 14:00:05 2015 -0500 ---------------------------------------------------------------------- .../qpid/jms/session/JmsQueueSessionTest.java | 51 ++++++++++++++++++-- 1 file changed, 47 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/75d50cf9/qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsQueueSessionTest.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsQueueSessionTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsQueueSessionTest.java index f71b475..1a15c6a 100644 --- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsQueueSessionTest.java +++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsQueueSessionTest.java @@ -22,6 +22,8 @@ import javax.jms.QueueSession; import javax.jms.Session; import org.apache.qpid.jms.JmsConnectionTestSupport; +import org.apache.qpid.jms.JmsQueue; +import org.apache.qpid.jms.JmsQueueSession; import org.apache.qpid.jms.JmsTopic; import org.junit.Before; import org.junit.Test; @@ -33,6 +35,7 @@ public class JmsQueueSessionTest extends JmsConnectionTestSupport { private QueueSession queueSession; private final JmsTopic topic = new JmsTopic(); + private final JmsQueue queue = new JmsQueue(); @Override @Before @@ -45,25 +48,60 @@ public class JmsQueueSessionTest extends JmsConnectionTestSupport { } @Test(timeout = 30000, expected=IllegalStateException.class) - public void testCreateConsumerTopicSession() throws JMSException { + public void testCreateConsumerToTopic() throws JMSException { queueSession.createConsumer(topic); } + @Test(timeout = 30000) + public void testCreateConsumerToQueue() throws JMSException { + queueSession.createConsumer(queue); + } + @Test(timeout = 30000, expected=IllegalStateException.class) - public void testCreateConsumerWithSelectorTopicSession() throws JMSException { + public void testCreateConsumerWithSelector() throws JMSException { queueSession.createConsumer(topic, "color = red"); } + @Test(timeout = 30000) + public void testCreateConsumerToQueueWithSelector() throws JMSException { + queueSession.createConsumer(queue, "color = red"); + } + @Test(timeout = 30000, expected=IllegalStateException.class) - public void testCreateConsumerWithSelectorNoLocalTopicSession() throws JMSException { + public void testCreateConsumerWithSelectorNoLocal() throws JMSException { queueSession.createConsumer(topic, "color = red", false); } + @Test(timeout = 30000) + public void testCreateConsumerToQueueWithSelectorNoLocal() throws JMSException { + queueSession.createConsumer(queue, "color = red", false); + } + + @Test(timeout = 30000, expected=IllegalStateException.class) + public void testCreateSubscriber() throws JMSException { + ((JmsQueueSession) queueSession).createSubscriber(topic); + } + + @Test(timeout = 30000, expected=IllegalStateException.class) + public void testCreateSubscriberSelector() throws JMSException { + ((JmsQueueSession) queueSession).createSubscriber(topic, "color = red", false); + } + @Test(timeout = 30000, expected=IllegalStateException.class) - public void testCreateProducerTopicSession() throws JMSException { + public void testCreateProducerToTopic() throws JMSException { queueSession.createProducer(topic); } + @Test(timeout = 30000) + public void testCreateProducerToQueue() throws JMSException { + queueSession.createProducer(queue); + } + + @Test(timeout = 30000, expected=IllegalStateException.class) + public void testCreateTopicPublisher() throws JMSException { + ((JmsQueueSession) queueSession).createPublisher(topic); + } + /** * Test that a call to <code>createDurableSubscriber()</code> method * on a <code>QueueSession</code> throws a @@ -77,6 +115,11 @@ public class JmsQueueSessionTest extends JmsConnectionTestSupport { queueSession.createDurableSubscriber(topic, "subscriptionName"); } + @Test(timeout = 30000, expected=IllegalStateException.class) + public void testCreateDurableSubscriberWithSelectorOnQueueSession() throws JMSException { + queueSession.createDurableSubscriber(topic, "subscriptionName", "color = red", false); + } + /** * Test that a call to <code>createTemporaryTopic()</code> method * on a <code>QueueSession</code> throws a --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
