qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject [6/6] qpid-jms git commit: Clean up some of the Session testing.
Date Mon, 09 Feb 2015 21:50:59 GMT
Clean up some of the Session testing.  

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

Branch: refs/heads/master
Commit: 040b76198383274d41a47271802e2f24dc850d91
Parents: 6ff14af
Author: Timothy Bish <tabish121@gmail.com>
Authored: Mon Feb 9 16:49:41 2015 -0500
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Mon Feb 9 16:49:41 2015 -0500

----------------------------------------------------------------------
 .../qpid/jms/session/JmsQueueSessionTest.java   | 20 ++++++++++++++++----
 .../apache/qpid/jms/session/JmsSessionTest.java |  6 ++++++
 .../qpid/jms/session/JmsTopicSessionTest.java   | 10 ++++++----
 3 files changed, 28 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/040b7619/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 1a15c6a..de9998c 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
@@ -16,6 +16,8 @@
  */
 package org.apache.qpid.jms.session;
 
+import static org.junit.Assert.assertNotNull;
+
 import javax.jms.IllegalStateException;
 import javax.jms.JMSException;
 import javax.jms.QueueSession;
@@ -53,8 +55,18 @@ public class JmsQueueSessionTest extends JmsConnectionTestSupport {
     }
 
     @Test(timeout = 30000)
+    public void testCreateReceiver() throws JMSException {
+        assertNotNull(queueSession.createReceiver(queue));
+    }
+
+    @Test(timeout = 30000)
+    public void testCreateReceiverWithSelector() throws JMSException {
+        assertNotNull(queueSession.createReceiver(queue, "color = red"));
+    }
+
+    @Test(timeout = 30000)
     public void testCreateConsumerToQueue() throws JMSException {
-        queueSession.createConsumer(queue);
+        assertNotNull(queueSession.createConsumer(queue));
     }
 
     @Test(timeout = 30000, expected=IllegalStateException.class)
@@ -64,7 +76,7 @@ public class JmsQueueSessionTest extends JmsConnectionTestSupport {
 
     @Test(timeout = 30000)
     public void testCreateConsumerToQueueWithSelector() throws JMSException {
-        queueSession.createConsumer(queue, "color = red");
+        assertNotNull(queueSession.createConsumer(queue, "color = red"));
     }
 
     @Test(timeout = 30000, expected=IllegalStateException.class)
@@ -74,7 +86,7 @@ public class JmsQueueSessionTest extends JmsConnectionTestSupport {
 
     @Test(timeout = 30000)
     public void testCreateConsumerToQueueWithSelectorNoLocal() throws JMSException {
-        queueSession.createConsumer(queue, "color = red", false);
+        assertNotNull(queueSession.createConsumer(queue, "color = red", false));
     }
 
     @Test(timeout = 30000, expected=IllegalStateException.class)
@@ -94,7 +106,7 @@ public class JmsQueueSessionTest extends JmsConnectionTestSupport {
 
     @Test(timeout = 30000)
     public void testCreateProducerToQueue() throws JMSException {
-        queueSession.createProducer(queue);
+        assertNotNull(queueSession.createProducer(queue));
     }
 
     @Test(timeout = 30000, expected=IllegalStateException.class)

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/040b7619/qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsSessionTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsSessionTest.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsSessionTest.java
index 5a0c945..aedc76a 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsSessionTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsSessionTest.java
@@ -110,6 +110,12 @@ public class JmsSessionTest extends JmsConnectionTestSupport {
         session.recover();
     }
 
+    @Test(timeout = 10000)
+    public void testRecoverWithNoSessionActivity() throws JMSException {
+        JmsSession session = (JmsSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+        session.recover();
+    }
+
     @Test(timeout = 10000, expected=JMSException.class)
     public void testRollbackThrowsOnNonTxSession() throws JMSException {
         JmsSession session = (JmsSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/040b7619/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 4709f5f..11940e4 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
@@ -16,6 +16,8 @@
  */
 package org.apache.qpid.jms.session;
 
+import static org.junit.Assert.assertNotNull;
+
 import javax.jms.IllegalStateException;
 import javax.jms.JMSException;
 import javax.jms.Session;
@@ -73,7 +75,7 @@ public class JmsTopicSessionTest extends JmsConnectionTestSupport {
 
     @Test(timeout = 30000)
     public void testCreateConsumerToTopic() throws JMSException {
-        topicSession.createConsumer(topic);
+       assertNotNull(topicSession.createConsumer(topic));
     }
 
     @Test(timeout = 30000, expected=IllegalStateException.class)
@@ -83,7 +85,7 @@ public class JmsTopicSessionTest extends JmsConnectionTestSupport {
 
     @Test(timeout = 30000)
     public void testCreateConsumerWithSelectorToTopic() throws JMSException {
-        topicSession.createConsumer(topic, "color = red");
+        assertNotNull(topicSession.createConsumer(topic, "color = red"));
     }
 
     @Test(timeout = 30000, expected=IllegalStateException.class)
@@ -93,7 +95,7 @@ public class JmsTopicSessionTest extends JmsConnectionTestSupport {
 
     @Test(timeout = 30000)
     public void testCreateConsumerWithSelectorNoLocalToTopic() throws JMSException {
-        topicSession.createConsumer(topic, "color = red", false);
+        assertNotNull(topicSession.createConsumer(topic, "color = red", false));
     }
 
     @Test(timeout = 30000, expected=IllegalStateException.class)
@@ -103,7 +105,7 @@ public class JmsTopicSessionTest extends JmsConnectionTestSupport {
 
     @Test(timeout = 30000)
     public void testCreateProducerToTopic() throws JMSException {
-        topicSession.createProducer(topic);
+        assertNotNull(topicSession.createProducer(topic));
     }
 
     /**


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message