Repository: qpid-jms
Updated Branches:
  refs/heads/master 42d2cdd77 -> f00a7ffd3


Full path coverage for the JmsTopicSession class.

Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/d2da853e
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/d2da853e
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/d2da853e

Branch: refs/heads/master
Commit: d2da853e19f4715d7ffb202c1867856d6ad11ff4
Parents: 42d2cdd
Author: Timothy Bish <[email protected]>
Authored: Mon Feb 2 15:16:02 2015 -0500
Committer: Timothy Bish <[email protected]>
Committed: Mon Feb 2 15:16:02 2015 -0500

----------------------------------------------------------------------
 .../qpid/jms/session/JmsTopicSessionTest.java   | 46 ++++++++++++++++++--
 1 file changed, 42 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/d2da853e/qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsTopicSessionTest.java
----------------------------------------------------------------------
diff --git 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsTopicSessionTest.java
 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsTopicSessionTest.java
index 2937718..4709f5f 100644
--- 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsTopicSessionTest.java
+++ 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsTopicSessionTest.java
@@ -23,6 +23,8 @@ import javax.jms.TopicSession;
 
 import org.apache.qpid.jms.JmsConnectionTestSupport;
 import org.apache.qpid.jms.JmsQueue;
+import org.apache.qpid.jms.JmsTopic;
+import org.apache.qpid.jms.JmsTopicSession;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -33,6 +35,7 @@ public class JmsTopicSessionTest extends 
JmsConnectionTestSupport {
 
     private TopicSession topicSession;
     private final JmsQueue queue = new JmsQueue();
+    private final JmsTopic topic = new JmsTopic();
 
     @Override
     @Before
@@ -64,25 +67,45 @@ public class JmsTopicSessionTest extends 
JmsConnectionTestSupport {
     }
 
     @Test(timeout = 30000, expected=IllegalStateException.class)
-    public void testCreateConsumerTopicSession() throws JMSException {
+    public void testCreateConsumerToQueue() throws JMSException {
         topicSession.createConsumer(queue);
     }
 
+    @Test(timeout = 30000)
+    public void testCreateConsumerToTopic() throws JMSException {
+        topicSession.createConsumer(topic);
+    }
+
     @Test(timeout = 30000, expected=IllegalStateException.class)
-    public void testCreateConsumerWithSelectorTopicSession() throws 
JMSException {
+    public void testCreateConsumerWithSelectorToQueue() throws JMSException {
         topicSession.createConsumer(queue, "color = red");
     }
 
+    @Test(timeout = 30000)
+    public void testCreateConsumerWithSelectorToTopic() throws JMSException {
+        topicSession.createConsumer(topic, "color = red");
+    }
+
     @Test(timeout = 30000, expected=IllegalStateException.class)
-    public void testCreateConsumerWithSelectorNoLocalTopicSession() throws 
JMSException {
+    public void testCreateConsumerWithSelectorNoLocalToQueue() throws 
JMSException {
         topicSession.createConsumer(queue, "color = red", false);
     }
 
+    @Test(timeout = 30000)
+    public void testCreateConsumerWithSelectorNoLocalToTopic() throws 
JMSException {
+        topicSession.createConsumer(topic, "color = red", false);
+    }
+
     @Test(timeout = 30000, expected=IllegalStateException.class)
-    public void testCreateProducerTopicSession() throws JMSException {
+    public void testCreateProducerToQueue() throws JMSException {
         topicSession.createProducer(queue);
     }
 
+    @Test(timeout = 30000)
+    public void testCreateProducerToTopic() throws JMSException {
+        topicSession.createProducer(topic);
+    }
+
     /**
      * Test that a call to <code>createQueue()</code> method
      * on a <code>TopicSession</code> throws a
@@ -108,4 +131,19 @@ public class JmsTopicSessionTest extends 
JmsConnectionTestSupport {
     public void testCreateTemporaryQueueOnTopicSession() throws JMSException {
         topicSession.createTemporaryQueue();
     }
+
+    @Test(timeout = 30000, expected=IllegalStateException.class)
+    public void testCreateQueueReceiver() throws JMSException {
+        ((JmsTopicSession) topicSession).createReceiver(queue);
+    }
+
+    @Test(timeout = 30000, expected=IllegalStateException.class)
+    public void testCreateQueueReceiverWithSelector() throws JMSException {
+        ((JmsTopicSession) topicSession).createReceiver(queue, "color = read");
+    }
+
+    @Test(timeout = 30000, expected=IllegalStateException.class)
+    public void testCreateQueueSender() throws JMSException {
+        ((JmsTopicSession) topicSession).createSender(queue);
+    }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to