You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2017/12/01 00:57:57 UTC

qpid-broker-j git commit: QPID-6933: [System Tests] Add TopicSessionTest into JMS 1.1 system tests

Repository: qpid-broker-j
Updated Branches:
  refs/heads/master 569e7f6a4 -> 0a3b816ba


QPID-6933: [System Tests] Add TopicSessionTest 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/0a3b816b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/0a3b816b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/0a3b816b

Branch: refs/heads/master
Commit: 0a3b816baebf8ce1cb64ca63309565badbe725cf
Parents: 569e7f6
Author: Alex Rudyy <or...@apache.org>
Authored: Fri Dec 1 00:57:43 2017 +0000
Committer: Alex Rudyy <or...@apache.org>
Committed: Fri Dec 1 00:57:43 2017 +0000

----------------------------------------------------------------------
 .../jms_1_1/topic/TopicSessionTest.java         | 104 +++++++++++++++++++
 .../unit/client/QueueSessionFactoryTest.java    |   2 -
 .../unit/client/TopicSessionFactoryTest.java    |  95 -----------------
 test-profiles/Java10BrokenTestsExcludes         |   3 -
 4 files changed, 104 insertions(+), 100 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/0a3b816b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/topic/TopicSessionTest.java
----------------------------------------------------------------------
diff --git a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/topic/TopicSessionTest.java b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/topic/TopicSessionTest.java
new file mode 100644
index 0000000..15e2b4b
--- /dev/null
+++ b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/topic/TopicSessionTest.java
@@ -0,0 +1,104 @@
+/*
+ *
+ * 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.fail;
+
+import javax.jms.JMSException;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TopicConnection;
+import javax.jms.TopicSession;
+import javax.naming.NamingException;
+
+import org.junit.Test;
+
+import org.apache.qpid.systests.JmsTestBase;
+
+public class TopicSessionTest extends JmsTestBase
+{
+    @Test
+    public void testTopicSessionCannotCreateCreateBrowser() throws Exception
+    {
+        Queue queue = createQueue(getTestName());
+        TopicConnection topicConnection = getTopicConnection();
+        try
+        {
+            TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+            topicSession.createBrowser(queue);
+            fail("Expected exception was not thrown");
+        }
+        catch (javax.jms.IllegalStateException s)
+        {
+            // PASS
+        }
+        finally
+        {
+            topicConnection.close();
+        }
+    }
+
+    @Test
+    public void testTopicSessionCannotCreateQueues() throws Exception
+    {
+        TopicConnection topicConnection = getTopicConnection();
+        try
+        {
+            TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+            topicSession.createQueue("abc");
+            fail("Expected exception was not thrown");
+        }
+        catch (javax.jms.IllegalStateException s)
+        {
+            // PASS
+        }
+        finally
+        {
+            topicConnection.close();
+        }
+    }
+
+    @Test
+    public void testTopicSessionCannotCreateTemporaryQueues() throws Exception
+    {
+        TopicConnection topicConnection = getTopicConnection();
+        try
+        {
+            TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+            topicSession.createTemporaryQueue();
+            fail("Expected exception was not thrown");
+        }
+        catch (javax.jms.IllegalStateException s)
+        {
+            // PASS
+        }
+        finally
+        {
+            topicConnection.close();
+        }
+    }
+
+    private TopicConnection getTopicConnection() throws JMSException, NamingException
+    {
+        return (TopicConnection)getConnection();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/0a3b816b/systests/src/test/java/org/apache/qpid/test/unit/client/QueueSessionFactoryTest.java
----------------------------------------------------------------------
diff --git a/systests/src/test/java/org/apache/qpid/test/unit/client/QueueSessionFactoryTest.java b/systests/src/test/java/org/apache/qpid/test/unit/client/QueueSessionFactoryTest.java
index 7fccc6e..b3bd236 100644
--- a/systests/src/test/java/org/apache/qpid/test/unit/client/QueueSessionFactoryTest.java
+++ b/systests/src/test/java/org/apache/qpid/test/unit/client/QueueSessionFactoryTest.java
@@ -32,8 +32,6 @@ import javax.jms.TopicSession;
  * Ensures that queue specific session factory method {@link QueueConnection#createQueueSession()} create sessions
  * of type {@link QueueSession} and that those sessions correctly restrict the available JMS operations
  * operations to exclude those applicable to only topics.
- *
- * @see TopicSessionFactoryTest
  */
 public class QueueSessionFactoryTest extends QpidBrokerTestCase
 {

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/0a3b816b/systests/src/test/java/org/apache/qpid/test/unit/client/TopicSessionFactoryTest.java
----------------------------------------------------------------------
diff --git a/systests/src/test/java/org/apache/qpid/test/unit/client/TopicSessionFactoryTest.java b/systests/src/test/java/org/apache/qpid/test/unit/client/TopicSessionFactoryTest.java
deleted file mode 100644
index 1f93352..0000000
--- a/systests/src/test/java/org/apache/qpid/test/unit/client/TopicSessionFactoryTest.java
+++ /dev/null
@@ -1,95 +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.client;
-
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-
-import javax.jms.Queue;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.TopicConnection;
-import javax.jms.TopicSession;
-
-/**
- * Ensures that topic specific session factory method {@link TopicConnection#createTopicSession()} create sessions
- * of type {@link TopicSession} and that those sessions correctly restrict the available JMS operations
- * operations to exclude those applicable to only queues.
- *
- * @see QueueSessionFactoryTest
- */
-public class TopicSessionFactoryTest extends QpidBrokerTestCase
-{
-    public void testTopicSessionIsNotAQueueSession() throws Exception
-    {
-        TopicSession topicSession = getTopicSession();
-        assertFalse(topicSession instanceof QueueSession);
-    }
-
-    public void testTopicSessionCannotCreateCreateBrowser() throws Exception
-    {
-        TopicSession topicSession = getTopicSession();
-        Queue queue = getTestQueue();
-        try
-        {
-            topicSession.createBrowser(queue);
-            fail("expected exception did not occur");
-        }
-        catch (javax.jms.IllegalStateException s)
-        {
-            // PASS
-        }
-    }
-
-    public void testTopicSessionCannotCreateQueues() throws Exception
-    {
-        TopicSession topicSession =  getTopicSession();
-        try
-        {
-            topicSession.createQueue("abc");
-            fail("expected exception did not occur");
-        }
-        catch (javax.jms.IllegalStateException s)
-        {
-            // PASS
-        }
-    }
-
-    public void testTopicSessionCannotCreateTemporaryQueues() throws Exception
-    {
-        TopicSession topicSession = getTopicSession();
-        try
-        {
-            topicSession.createTemporaryQueue();
-            fail("expected exception did not occur");
-        }
-        catch (javax.jms.IllegalStateException s)
-        {
-            // PASS
-        }
-    }
-
-    private TopicSession getTopicSession() throws Exception
-    {
-        TopicConnection topicConnection = (TopicConnection)getConnection();
-        return topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/0a3b816b/test-profiles/Java10BrokenTestsExcludes
----------------------------------------------------------------------
diff --git a/test-profiles/Java10BrokenTestsExcludes b/test-profiles/Java10BrokenTestsExcludes
index 03ca98c..7cec0bf 100644
--- a/test-profiles/Java10BrokenTestsExcludes
+++ b/test-profiles/Java10BrokenTestsExcludes
@@ -43,9 +43,6 @@ org.apache.qpid.systest.management.amqp.AmqpManagementTest#testGetTypesOnVhostMa
 // client issue - the other tests demonstrate that it is not fulfilling the requirements of a TopicSession,
 // so it shouldn't implement it ...
 org.apache.qpid.test.unit.client.QueueSessionFactoryTest#testQueueSessionIsNotATopicSession
-// ... and vice versa
-org.apache.qpid.test.unit.client.TopicSessionFactoryTest#testTopicSessionIsNotAQueueSession
-org.apache.qpid.test.unit.client.QueueSessionFactoryTest#testTopicSessionCannotCreateCreateBrowser
 
 // Test uses AMQP 0-x ack modes and assumes the name of the queues backing subscriptions
 org.apache.qpid.test.unit.topic.DurableSubscriptionTest#*


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