summaryrefslogtreecommitdiff
path: root/java/client/test/src
diff options
context:
space:
mode:
authorMarnie McCormack <marnie@apache.org>2006-11-07 08:57:46 +0000
committerMarnie McCormack <marnie@apache.org>2006-11-07 08:57:46 +0000
commite6c57ca0d0687486ee9a7e2f4c6086fadf226b61 (patch)
tree0c003d38e0d6f4489d30653dee23934e974e9fa2 /java/client/test/src
parent22a77d694dfaa75e3eda74c219b83f99cd974b95 (diff)
downloadqpid-python-e6c57ca0d0687486ee9a7e2f4c6086fadf226b61.tar.gz
Added tests for QueueReceiver create methods to check for ClassCastException etc.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@472039 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client/test/src')
-rw-r--r--java/client/test/src/org/apache/qpid/client/TestAMQSession.java23
1 files changed, 21 insertions, 2 deletions
diff --git a/java/client/test/src/org/apache/qpid/client/TestAMQSession.java b/java/client/test/src/org/apache/qpid/client/TestAMQSession.java
index c734a67122..78086706ec 100644
--- a/java/client/test/src/org/apache/qpid/client/TestAMQSession.java
+++ b/java/client/test/src/org/apache/qpid/client/TestAMQSession.java
@@ -27,6 +27,7 @@ import org.apache.qpid.url.URLSyntaxException;
import javax.jms.JMSException;
import javax.jms.TopicSubscriber;
+import javax.jms.QueueReceiver;
import junit.framework.JUnit4TestAdapter;
@@ -60,13 +61,31 @@ public class TestAMQSession {
@Test
public void testCreateDurableSubscriber() throws JMSException {
- TopicSubscriber subscriber = _session.createDurableSubscriber(_topic, "mysubname");
- Assert.assertEquals("Topic names should match from durable TopicSubscriber",_topic.getTopicName(),subscriber.getTopic().getTopicName());
+ TopicSubscriber subscriber = _session.createDurableSubscriber(_topic, "mysubname");
+ Assert.assertEquals("Topic names should match from durable TopicSubscriber",_topic.getTopicName(),subscriber.getTopic().getTopicName());
subscriber = _session.createDurableSubscriber(_topic,"mysubname","abc",false);
Assert.assertEquals("Topic names should match from durable TopicSubscriber with selector",_topic.getTopicName(),subscriber.getTopic().getTopicName());
}
+ @Test
+ public void testCreateQueueReceiver() throws JMSException {
+ QueueReceiver receiver = _session.createQueueReceiver(_queue);
+ Assert.assertEquals("Queue names should match from QueueReceiver",_queue.getQueueName(),receiver.getQueue().getQueueName());
+
+ receiver = _session.createQueueReceiver(_queue, "abc");
+ Assert.assertEquals("Queue names should match from QueueReceiver with selector",_queue.getQueueName(),receiver.getQueue().getQueueName());
+ }
+
+ @Test
+ public void testCreateReceiver() throws JMSException {
+ QueueReceiver receiver = _session.createReceiver(_queue);
+ Assert.assertEquals("Queue names should match from QueueReceiver",_queue.getQueueName(),receiver.getQueue().getQueueName());
+
+ receiver = _session.createReceiver(_queue, "abc");
+ Assert.assertEquals("Queue names should match from QueueReceiver with selector",_queue.getQueueName(),receiver.getQueue().getQueueName());
+ }
+
public static junit.framework.Test suite()
{
return new JUnit4TestAdapter(TestAMQSession.class);