qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject qpid-broker-j git commit: QPID-6933: [System Tests] Add TopicSubscriberTest into JMS 1.1 system tests
Date Fri, 01 Dec 2017 00:38:12 GMT
Repository: qpid-broker-j
Updated Branches:
  refs/heads/master b005f4d70 -> 569e7f6a4


QPID-6933: [System Tests] Add TopicSubscriberTest into JMS 1.1 system tests


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/569e7f6a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/569e7f6a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/569e7f6a

Branch: refs/heads/master
Commit: 569e7f6a4beb4fed96a946dd03da4a839330c1e5
Parents: b005f4d
Author: Alex Rudyy <orudyy@apache.org>
Authored: Fri Dec 1 00:37:47 2017 +0000
Committer: Alex Rudyy <orudyy@apache.org>
Committed: Fri Dec 1 00:38:00 2017 +0000

----------------------------------------------------------------------
 .../jms_1_1/topic/DurableSubscribtionTest.java  |  45 +++
 .../jms_1_1/topic/TopicSubscriberTest.java      | 173 +++++++++++
 .../qpid/test/unit/topic/TopicSessionTest.java  | 305 -------------------
 .../test/unit/topic/TopicSubscriberTest.java    | 102 -------
 test-profiles/Java10BrokenTestsExcludes         |   5 -
 test-profiles/Java10Excludes                    |   3 -
 6 files changed, 218 insertions(+), 415 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/569e7f6a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/topic/DurableSubscribtionTest.java
----------------------------------------------------------------------
diff --git a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/topic/DurableSubscribtionTest.java
b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/topic/DurableSubscribtionTest.java
index f96662b..1ad4015 100644
--- a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/topic/DurableSubscribtionTest.java
+++ b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/topic/DurableSubscribtionTest.java
@@ -200,6 +200,51 @@ public class DurableSubscribtionTest extends JmsTestBase
         assertEquals("Unexpected number of queues", numberOfQueuesBeforeTest, numberOfQueuesAfterTest);
     }
 
+    @Test
+    public void unsubscribeTwice() throws Exception
+    {
+        Topic topic = createTopic(getTestName());
+        Connection connection = getConnection();
+        String subscriptionName = getTestName() + "_sub";
+        try
+        {
+
+            Session subscriberSession = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
+            TopicSubscriber subscriber = subscriberSession.createDurableSubscriber(topic,
subscriptionName);
+            MessageProducer publisher = subscriberSession.createProducer(topic);
+
+            connection.start();
+
+            publisher.send(subscriberSession.createTextMessage("Test"));
+            subscriberSession.commit();
+
+            Message message =  subscriber.receive(getReceiveTimeout());
+            assertTrue("TextMessage should be received", message instanceof TextMessage);
+            assertEquals("Unexpected message", "Test", ((TextMessage)message).getText());
+            subscriberSession.commit();
+            subscriber.close();
+            subscriberSession.unsubscribe(subscriptionName);
+
+            try
+            {
+                subscriberSession.unsubscribe(subscriptionName);
+                fail("expected InvalidDestinationException when unsubscribing from unknown
subscription");
+            }
+            catch (InvalidDestinationException e)
+            {
+                // PASS
+            }
+            catch (Exception e)
+            {
+                fail("expected InvalidDestinationException when unsubscribing from unknown
subscription, got: " + e);
+            }
+        }
+        finally
+        {
+            connection.close();
+        }
+    }
+
     /**
      * <ul>
      * <li>create and register a durable subscriber with no message selector

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/569e7f6a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/topic/TopicSubscriberTest.java
----------------------------------------------------------------------
diff --git a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/topic/TopicSubscriberTest.java
b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/topic/TopicSubscriberTest.java
new file mode 100644
index 0000000..18d40e8
--- /dev/null
+++ b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/topic/TopicSubscriberTest.java
@@ -0,0 +1,173 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.systests.jms_1_1.topic;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import javax.jms.Connection;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.jms.TopicConnection;
+import javax.jms.TopicPublisher;
+import javax.jms.TopicSession;
+import javax.jms.TopicSubscriber;
+
+import org.junit.Test;
+
+import org.apache.qpid.systests.JmsTestBase;
+
+public class TopicSubscriberTest extends JmsTestBase
+{
+
+    @Test
+    public void messageDeliveredToAllSubscribers() throws Exception
+    {
+        Topic topic = createTopic(getTestName());
+        final TopicConnection connection = (TopicConnection) getConnection();
+        try
+        {
+            final TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+            final TopicPublisher producer = session.createPublisher(topic);
+            final TopicSubscriber subscriber1 = session.createSubscriber(topic);
+            assertEquals("Unexpected subscriber1 topic", topic.getTopicName(), subscriber1.getTopic().getTopicName());
+            final TopicSubscriber subscriber2 = session.createSubscriber(topic);
+            assertEquals("Unexpected subscriber2 topic", topic.getTopicName(), subscriber2.getTopic().getTopicName());
+
+            connection.start();
+            String messageText = "Test Message";
+            producer.send(session.createTextMessage(messageText));
+
+            final Message subscriber1Message = subscriber1.receive(getReceiveTimeout());
+            final Message subscriber2Message = subscriber2.receive(getReceiveTimeout());
+
+            assertTrue("TextMessage should be received  by subscriber1", subscriber1Message
instanceof TextMessage);
+            assertEquals(messageText, ((TextMessage) subscriber1Message).getText());
+            assertTrue("TextMessage should be received  by subscriber2", subscriber2Message
instanceof TextMessage);
+            assertEquals(messageText, ((TextMessage) subscriber2Message).getText());
+        }
+        finally
+        {
+            connection.close();
+        }
+    }
+
+    @Test
+    public void publishedMessageIsLostWhenSubscriberDisconnected() throws Exception
+    {
+        Topic topic = createTopic(getTestName());
+        final Connection connection = getConnection();
+        try
+        {
+            final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+            final MessageProducer producer = session.createProducer(topic);
+            final MessageConsumer subscriber = session.createConsumer(topic);
+            connection.start();
+            producer.send(session.createTextMessage("A"));
+
+            final Message message1 = subscriber.receive(getReceiveTimeout());
+            assertTrue("TextMessage should be received", message1 instanceof TextMessage);
+            assertEquals("Unexpected message received", "A", ((TextMessage) message1).getText());
+
+            subscriber.close();
+
+            producer.send(session.createTextMessage("B"));
+            final MessageConsumer subscriber2 = session.createConsumer(topic);
+            producer.send(session.createTextMessage("C"));
+
+            final Message message2 = subscriber2.receive(getReceiveTimeout());
+            assertTrue("TextMessage should be received", message2 instanceof TextMessage);
+            assertEquals("Unexpected message received", "C", ((TextMessage) message2).getText());
+        }
+        finally
+        {
+            connection.close();
+        }
+    }
+
+    @Test
+    public void selector() throws Exception
+    {
+        Topic topic = createTopic(getTestName());
+        final Connection connection = getConnection();
+        try
+        {
+            final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+            final MessageConsumer subscriber = session.createConsumer(topic, "id='B'");
+            final MessageProducer producer = session.createProducer(topic);
+            Message message1 = session.createMessage();
+            message1.setStringProperty("id", "A");
+            producer.send(message1);
+            Message message2 = session.createMessage();
+            message2.setStringProperty("id", "B");
+            producer.send(message2);
+
+            connection.start();
+            final Message receivedMessage = subscriber.receive(getReceiveTimeout());
+            assertNotNull("Message not received", receivedMessage);
+            assertEquals("Unexpected message received", "B", receivedMessage.getStringProperty("id"));
+        }
+        finally
+        {
+            connection.close();
+        }
+    }
+
+    @Test
+    public void noLocal() throws Exception
+    {
+        Topic topic = createTopic(getTestName());
+        final Connection connection = getConnection();
+        try
+        {
+            final Connection connection2 = getConnection();
+            try
+            {
+                final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+                final MessageConsumer subscriber = session.createConsumer(topic, null, true);
+
+                final Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
+                final MessageProducer producer1 = session.createProducer(topic);
+                final MessageProducer producer2 = session2.createProducer(topic);
+                producer1.send(session.createTextMessage("A"));
+                producer2.send(session2.createTextMessage("B"));
+
+                connection.start();
+                final Message receivedMessage = subscriber.receive(getReceiveTimeout());
+                assertTrue("TextMessage should be received", receivedMessage instanceof TextMessage);
+                assertEquals("Unexpected message received", "B", ((TextMessage) receivedMessage).getText());
+            }
+            finally
+            {
+                connection2.close();
+            }
+        }
+        finally
+        {
+            connection.close();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/569e7f6a/systests/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
----------------------------------------------------------------------
diff --git a/systests/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
b/systests/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
index 187a5be..740d952 100644
--- a/systests/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
+++ b/systests/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
@@ -20,162 +20,19 @@
  */
 package org.apache.qpid.test.unit.topic;
 
-import javax.jms.Connection;
-import javax.jms.InvalidDestinationException;
-import javax.jms.Message;
 import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.jms.TopicConnection;
 import javax.jms.TopicPublisher;
 import javax.jms.TopicSession;
-import javax.jms.TopicSubscriber;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.server.logging.ConsumerLoggingTest;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
 
 
 public class TopicSessionTest extends QpidBrokerTestCase
 {
-    private static final Logger LOGGER = LoggerFactory.getLogger(TopicSessionTest.class);
-
-    public void testTopicSubscriptionUnsubscription() throws Exception
-    {
-
-        TopicConnection con = (TopicConnection) getConnection();
-        String topicName = "MyTopic";
-        Topic topic = createTopic(con, topicName);
-        TopicSession session1 = con.createTopicSession(true, AMQSession.NO_ACKNOWLEDGE);
-        TopicSubscriber sub = session1.createDurableSubscriber(topic, "subscription0");
-        TopicPublisher publisher = session1.createPublisher(topic);
-
-        con.start();
-
-        TextMessage tm = session1.createTextMessage("Hello");
-        publisher.publish(tm);
-        session1.commit();
-
-        tm = (TextMessage) sub.receive(2000);
-        assertNotNull(tm);
-        session1.commit();
-        sub.close();
-        session1.unsubscribe("subscription0");
-
-        try
-        {
-            session1.unsubscribe("not a subscription");
-            fail("expected InvalidDestinationException when unsubscribing from unknown subscription");
-        }
-        catch (InvalidDestinationException e)
-        {
-            ; // PASS
-        }
-        catch (Exception e)
-        {
-            fail("expected InvalidDestinationException when unsubscribing from unknown subscription,
got: " + e);
-        }
-
-        con.close();
-    }
-
-    public void testSubscriptionNameReuseForDifferentTopicSingleConnection() throws Exception
-    {
-        subscriptionNameReuseForDifferentTopic(false);
-    }
-
-    public void testSubscriptionNameReuseForDifferentTopicTwoConnections() throws Exception
-    {
-        subscriptionNameReuseForDifferentTopic(true);
-    }
-
-    private void subscriptionNameReuseForDifferentTopic(boolean shutdown) throws Exception
-    {
-        TopicConnection con = (TopicConnection) getConnection();
-        Topic topic = createTopic(con, "MyTopic1" + String.valueOf(shutdown));
-        Topic topic2 = createTopic(con, "MyOtherTopic1" + String.valueOf(shutdown));
-
-        TopicSession session1 = con.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
-        TopicSubscriber sub = session1.createDurableSubscriber(topic, "subscription0");
-        TopicPublisher publisher = session1.createPublisher(null);
-
-        con.start();
-
-        publisher.publish(topic, session1.createTextMessage("hello"));
-        session1.commit();
-        TextMessage m = (TextMessage) sub.receive(2000);
-        assertNotNull(m);
-        session1.commit();
-
-        if (shutdown)
-        {
-            session1.close();
-            con.close();
-            con = (TopicConnection) getConnection();
-            con.start();
-            session1 = con.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
-            publisher = session1.createPublisher(null);
-        }
-        sub.close();
-        TopicSubscriber sub2 = session1.createDurableSubscriber(topic2, "subscription0");
-        publisher.publish(topic, session1.createTextMessage("hello"));
-        session1.commit();
-        if (!shutdown)
-        {
-            m = (TextMessage) sub2.receive(2000);
-            assertNull(m);
-            session1.commit();
-        }
-        publisher.publish(topic2, session1.createTextMessage("goodbye"));
-        session1.commit();
-        m = (TextMessage) sub2.receive(2000);
-        assertNotNull(m);
-        assertEquals("goodbye", m.getText());
-        session1.unsubscribe("subscription0");
-        con.close();
-    }
-
-    public void testUnsubscriptionAfterConnectionClose() throws Exception
-    {
-        TopicConnection con1 = (TopicConnection) getConnectionBuilder().build();
-        Topic topic = createTopic(con1, "MyTopic3");
-
-        TopicSession session1 = con1.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
-        TopicPublisher publisher = session1.createPublisher(topic);
-
-        TopicConnection con2 = (TopicConnection) getConnectionBuilder().setClientId("clientid").build();
-        TopicSession session2 = con2.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
-        TopicSubscriber sub = session2.createDurableSubscriber(topic, "subscription0");
-
-        con2.start();
-
-        publisher.publish(session1.createTextMessage("Hello"));
-        session1.commit();
-        TextMessage tm = (TextMessage) sub.receive(2000);
-        session2.commit();
-        assertNotNull(tm);
-        con2.close();
-        publisher.publish(session1.createTextMessage("Hello2"));
-        session1.commit();
-        con2 = (TopicConnection) getConnectionBuilder().setClientId("clientid").build();
-        session2 = con2.createTopicSession(true,Session.AUTO_ACKNOWLEDGE);
-        sub = session2.createDurableSubscriber(topic, "subscription0");
-        con2.start();
-        tm = (TextMessage) sub.receive(2000);
-        session2.commit();
-        assertNotNull(tm);
-        assertEquals("Hello2", tm.getText());
-        sub.close();
-        session2.unsubscribe("subscription0");
-        con1.close();
-        con2.close();
-    }
 
     public void testTextMessageCreation() throws Exception
     {
@@ -225,166 +82,4 @@ public class TopicSessionTest extends QpidBrokerTestCase
         con.close();
     }
 
-    public void testNoLocal() throws Exception
-    {
-
-        TopicConnection con = (TopicConnection) getConnection();
-
-        Topic topic = createTopic(con, "testNoLocal");
-
-        noLocalTest(con, topic);
-
-
-        con.close();
-    }
-
-
-    public void testNoLocalDirectExchange() throws Exception
-    {
-
-        TopicConnection con = (TopicConnection) getConnection();
-
-        Topic topic = createTopicOnDirect(con, "testNoLocal");
-
-        noLocalTest(con, topic);
-
-
-        con.close();
-    }
-
-
-
-    public void testNoLocalFanoutExchange() throws Exception
-    {
-
-        TopicConnection con = (TopicConnection) getConnection();
-
-        Topic topic = createTopicOnFanout(con, "testNoLocal");
-
-        noLocalTest(con, topic);
-
-        con.close();
-    }
-
-
-    private void noLocalTest(TopicConnection con, Topic topic) throws Exception
-    {
-        TopicSession session1 = con.createTopicSession(true, AMQSession.AUTO_ACKNOWLEDGE);
-        TopicSubscriber noLocal = session1.createSubscriber(topic,  "", true);
-
-        TopicSubscriber select = session1.createSubscriber(topic,  "Selector = 'select'",
false);
-        TopicSubscriber normal = session1.createSubscriber(topic);
-
-
-        TopicPublisher publisher = session1.createPublisher(topic);
-
-        con.start();
-        TextMessage m;
-        TextMessage message;
-
-        //send message to all consumers
-        publisher.publish(session1.createTextMessage("hello-new2"));
-        session1.commit();
-        //test normal subscriber gets message
-        m = (TextMessage) normal.receive(1000);
-        assertNotNull(m);
-        session1.commit();
-
-        //test selector subscriber doesn't message
-        m = (TextMessage) select.receive(1000);
-        assertNull(m);
-        session1.commit();
-
-        //test nolocal subscriber doesn't message
-        m = (TextMessage) noLocal.receive(1000);
-        if (m != null)
-        {
-            LOGGER.info("Message:" + m.getText());
-        }
-        assertNull(m);
-
-        //send message to all consumers
-        message = session1.createTextMessage("hello2");
-        message.setStringProperty("Selector", "select");
-
-        publisher.publish(message);
-        session1.commit();
-
-        //test normal subscriber gets message
-        m = (TextMessage) normal.receive(1000);
-        assertNotNull(m);
-        session1.commit();
-
-        //test selector subscriber does get message
-        m = (TextMessage) select.receive(1000);
-        assertNotNull(m);
-        session1.commit();
-
-        //test nolocal subscriber doesn't message
-        m = (TextMessage) noLocal.receive(100);
-        assertNull(m);
-
-        TopicConnection con2 = (TopicConnection) getClientConnection("guest", "guest", "foo");
-        TopicSession session2 = con2.createTopicSession(true, AMQSession.AUTO_ACKNOWLEDGE);
-        TopicPublisher publisher2 = session2.createPublisher(topic);
-
-
-        message = session2.createTextMessage("hello2");
-        message.setStringProperty("Selector", "select");
-
-        publisher2.publish(message);
-        session2.commit();
-
-        //test normal subscriber gets message
-        m = (TextMessage) normal.receive(1000);
-        assertNotNull(m);
-        session1.commit();
-
-        //test selector subscriber does get message
-        m = (TextMessage) select.receive(1000);
-        assertNotNull(m);
-        session1.commit();
-
-        //test nolocal subscriber does message
-        m = (TextMessage) noLocal.receive(1000);
-        assertNotNull(m);
-        con2.close();
-    }
-
-    /**
-     * This tests was added to demonstrate QPID-3542.  The Java Client when used with the
CPP Broker was failing to
-     * ack messages received that did not match the selector.  This meant the messages remained
indefinitely on the Broker.
-     */
-    public void testNonMatchingMessagesHandledCorrectly() throws Exception
-    {
-        final String topicName = getName();
-        final String clientId = "clientId" + topicName;
-        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);
-        final MessageProducer publisher = session1.createProducer(topic1);
-
-        con1.start();
-
-        // Send non-matching message
-        final Message sentMessage = session1.createTextMessage("hello");
-        sentMessage.setStringProperty("Selector", "nonMatch");
-        publisher.send(sentMessage);
-
-        // Try to consume non-message, expect this to fail.
-        final Message message1 = subscriberWithSelector.receive(1000);
-        assertNull("should not have received message", message1);
-        subscriberWithSelector.close();
-
-        session1.close();
-
-        // Now verify queue depth on broker.
-        final Session session2 = con1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-        final long depth = ((AMQSession) session2).getQueueDepth(internalNameOnBroker);
-        assertEquals("Expected queue depth of zero", 0, depth);
-    }
 }

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/569e7f6a/systests/src/test/java/org/apache/qpid/test/unit/topic/TopicSubscriberTest.java
----------------------------------------------------------------------
diff --git a/systests/src/test/java/org/apache/qpid/test/unit/topic/TopicSubscriberTest.java
b/systests/src/test/java/org/apache/qpid/test/unit/topic/TopicSubscriberTest.java
deleted file mode 100644
index 26ad7c8..0000000
--- a/systests/src/test/java/org/apache/qpid/test/unit/topic/TopicSubscriberTest.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.test.unit.topic;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.Topic;
-import javax.jms.TopicSession;
-import javax.jms.TopicSubscriber;
-
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-
-public class TopicSubscriberTest extends QpidBrokerTestCase
-{
-    private Connection _connection;
-    private Topic _topic;
-    private Session _session;
-
-    @Override
-    public void setUp() throws Exception
-    {
-        super.setUp();
-        _connection = getConnection();
-        _topic = createTopic(_connection, "mytopic");
-        _session = _connection.createSession(true, Session.SESSION_TRANSACTED);
-    }
-
-    public void testCreateSubscriber() throws JMSException
-    {
-        TopicSession topicSession = (TopicSession)_session;
-        TopicSubscriber subscriber = topicSession.createSubscriber(_topic);
-        assertEquals("Topic names should match from TopicSubscriber", _topic.getTopicName(),
subscriber.getTopic().getTopicName());
-
-        subscriber = topicSession.createSubscriber(_topic, "abc", false);
-        assertEquals("Topic names should match from TopicSubscriber with selector",
-                     _topic.getTopicName(),
-                     subscriber.getTopic().getTopicName());
-    }
-
-    public void testCreateDurableSubscriber() throws JMSException
-    {
-        TopicSubscriber subscriber = _session.createDurableSubscriber(_topic, "mysubname");
-        assertEquals("Topic names should match from durable TopicSubscriber", _topic.getTopicName(),
subscriber.getTopic().getTopicName());
-        subscriber.close();
-
-        subscriber = _session.createDurableSubscriber(_topic, "mysubname2", "abc", false);
-        assertEquals("Topic names should match from durable TopicSubscriber with selector",
_topic.getTopicName(), subscriber.getTopic().getTopicName());
-        subscriber.close();
-        _session.unsubscribe("mysubname");
-        _session.unsubscribe("mysubname2");
-    }
-
-    public void testTopicWithNoSubscriber() throws JMSException
-    {
-        _connection.start();
-
-        Message message1 = createMessage(_session, DEFAULT_MESSAGE_SIZE);
-        Message message2 = createMessage(_session, DEFAULT_MESSAGE_SIZE);
-
-        MessageProducer producer = _session.createProducer(_topic);
-
-        // Send first message when topic has no subscriber
-        producer.send(message1);
-        _session.commit();
-
-        String subscriptionName = "mysub";
-        TopicSubscriber durableSubscriber = _session.createDurableSubscriber(_topic, subscriptionName,
null, false);
-
-        // Send second message when topic has subscriber
-        producer.send(message2);
-        _session.commit();
-
-        Message receivedMessage = durableSubscriber.receive(getReceiveTimeout());
-        assertNotNull("Message is unexpected", receivedMessage);
-        assertEquals("Unexpected message", message2.getJMSMessageID(), message2.getJMSMessageID());
-        _session.commit();
-        durableSubscriber.close();
-
-        _session.unsubscribe(subscriptionName);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/569e7f6a/test-profiles/Java10BrokenTestsExcludes
----------------------------------------------------------------------
diff --git a/test-profiles/Java10BrokenTestsExcludes b/test-profiles/Java10BrokenTestsExcludes
index a47db57..03ca98c 100644
--- a/test-profiles/Java10BrokenTestsExcludes
+++ b/test-profiles/Java10BrokenTestsExcludes
@@ -27,11 +27,6 @@
 org.apache.qpid.test.unit.transacted.TransactionTimeoutTest#*
 org.apache.qpid.test.unit.transacted.TransactionTimeoutDisabledTest#*
 
-
-// Testing behaviour of changing the topic associated with a durable subscriber
-org.apache.qpid.test.unit.topic.TopicSessionTest#testSubscriptionNameReuseForDifferentTopicSingleConnection
-org.apache.qpid.test.unit.topic.TopicSessionTest#testSubscriptionNameReuseForDifferentTopicTwoConnections
-
 // the received message is being treated as an object message (because it lacks the necessary
JMS annotation?)
 org.apache.qpid.systest.rest.PublishMessageRestTest#testPublishMapMessage
 org.apache.qpid.systest.rest.PublishMessageRestTest#testPublishListMessage

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/569e7f6a/test-profiles/Java10Excludes
----------------------------------------------------------------------
diff --git a/test-profiles/Java10Excludes b/test-profiles/Java10Excludes
index 52e1ba4..f1f3529 100644
--- a/test-profiles/Java10Excludes
+++ b/test-profiles/Java10Excludes
@@ -33,9 +33,6 @@ org.apache.qpid.server.queue.ModelTest#*
 // Exclude tests of connection URL failover method property
 org.apache.qpid.server.failover.FailoverMethodTest#*
 
-// Testing that the 0-x implementation of a durable topic does not cause queue growth when
messages are excluded by selectors
-org.apache.qpid.test.unit.topic.TopicSessionTest#testNonMatchingMessagesHandledCorrectly
-
 // This test covers the client version specific mechanisms for restricting the types of Object
which can be sent via an ObjectMessage
 org.apache.qpid.client.message.ObjectMessageClassWhitelistingTest#*
 


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


Mime
View raw message