summaryrefslogtreecommitdiff
path: root/qpid/java/systests/src
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2011-10-18 11:20:53 +0000
committerKeith Wall <kwall@apache.org>2011-10-18 11:20:53 +0000
commita687cefcf9e6b7063749ed2827e28b6cd4d2528e (patch)
treea3e621f26afcf51c8980951d782198a2a5d6dd58 /qpid/java/systests/src
parentdc6109ae293a01f12083c6e7a62231b3775382ec (diff)
downloadqpid-python-a687cefcf9e6b7063749ed2827e28b6cd4d2528e.tar.gz
QPID-3542: ensure session complete sent for filtered out messages
Applied patch from Andrew MacBean <andymacbean@gmail.com> and myself. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1185580 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests/src')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
index a7a06a357a..826545a23d 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
@@ -33,6 +33,7 @@ import javax.jms.TopicSession;
import javax.jms.TopicSubscriber;
import org.apache.qpid.client.AMQConnection;
+import org.apache.qpid.client.AMQQueue;
import org.apache.qpid.client.AMQSession;
import org.apache.qpid.client.AMQTopic;
import org.apache.qpid.test.utils.QpidBrokerTestCase;
@@ -320,6 +321,7 @@ public class TopicSessionTest extends QpidBrokerTestCase
final Connection con1 = getConnection();
final Session session1 = con1.createSession(false, Session.AUTO_ACKNOWLEDGE);
final Topic topic1 = session1.createTopic(topicName);
+ final AMQQueue internalNameOnBroker = new AMQQueue("amq.topic", "clientid" + ":" + clientId);
// Setup subscriber with selector
final TopicSubscriber subscriberWithSelector = session1.createDurableSubscriber(topic1, clientId, "Selector = 'select'", false);
@@ -339,13 +341,9 @@ public class TopicSessionTest extends QpidBrokerTestCase
session1.close();
- // Now recreate the session and subscriber (same clientid) but without selector and check that the message still
- // is not received. This defect meant that such a message would be received.
+ // Now verify queue depth on broker.
final Session session2 = con1.createSession(false, Session.AUTO_ACKNOWLEDGE);
- final Topic topic2 = session2.createTopic(topicName);
-
- final TopicSubscriber sameSubscriberWithoutSelector = session2.createDurableSubscriber(topic2, clientId, null, false);
- final Message message2 = sameSubscriberWithoutSelector.receive(1000);
- assertNull("still should not have received message", message2);
+ final long depth = ((AMQSession) session2).getQueueDepth(internalNameOnBroker);
+ assertEquals("Expected queue depth of zero", 0, depth);
}
}