qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject [3/4] qpid-broker-j git commit: QPID-6933: [System Tests] Move some tests for factory methods in queue session to JMS 1.1 systests
Date Fri, 01 Dec 2017 17:02:42 GMT
QPID-6933: [System Tests] Move some tests for factory methods in queue session to JMS 1.1 systests


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/f57c6a56
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/f57c6a56
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/f57c6a56

Branch: refs/heads/master
Commit: f57c6a56e04456acec515efbc959f652baf3b80f
Parents: a2d083e
Author: Alex Rudyy <orudyy@apache.org>
Authored: Fri Dec 1 16:29:03 2017 +0000
Committer: Alex Rudyy <orudyy@apache.org>
Committed: Fri Dec 1 17:02:26 2017 +0000

----------------------------------------------------------------------
 .../jms_1_1/queue/QueueSessionTest.java         | 137 +++++++++++++++++++
 .../unit/client/QueueSessionFactoryTest.java    | 108 ---------------
 test-profiles/Java10BrokenTestsExcludes         |   5 -
 3 files changed, 137 insertions(+), 113 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f57c6a56/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/queue/QueueSessionTest.java
----------------------------------------------------------------------
diff --git a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/queue/QueueSessionTest.java
b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/queue/QueueSessionTest.java
new file mode 100644
index 0000000..525793b
--- /dev/null
+++ b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/queue/QueueSessionTest.java
@@ -0,0 +1,137 @@
+/*
+ *
+ * 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.queue;
+
+import static org.junit.Assert.fail;
+
+import javax.jms.JMSException;
+import javax.jms.QueueConnection;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.Topic;
+import javax.naming.NamingException;
+
+import org.junit.Test;
+
+import org.apache.qpid.systests.JmsTestBase;
+
+public class QueueSessionTest extends JmsTestBase
+{
+
+    @Test
+    public void testQueueSessionCannotCreateTemporaryTopics() throws Exception
+    {
+        QueueConnection queueConnection = getQueueConnection();
+        try
+        {
+            QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+            try
+            {
+                queueSession.createTemporaryTopic();
+                fail("expected exception did not occur");
+            }
+            catch (javax.jms.IllegalStateException s)
+            {
+                // PASS
+            }
+        }
+        finally
+        {
+            queueConnection.close();
+        }
+    }
+
+    @Test
+    public void testQueueSessionCannotCreateTopics() throws Exception
+    {
+        QueueConnection queueConnection = getQueueConnection();
+        try
+        {
+            QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+            try
+            {
+                queueSession.createTopic("abc");
+                fail("expected exception did not occur");
+            }
+            catch (javax.jms.IllegalStateException s)
+            {
+                // PASS
+            }
+        }
+        finally
+        {
+            queueConnection.close();
+        }
+    }
+
+    @Test
+    public void testQueueSessionCannotCreateDurableSubscriber() throws Exception
+    {
+        Topic topic = createTopic(getTestName());
+        QueueConnection queueConnection = getQueueConnection();
+        try
+        {
+            QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+
+            try
+            {
+                queueSession.createDurableSubscriber(topic, "abc");
+                fail("expected exception did not occur");
+            }
+            catch (javax.jms.IllegalStateException s)
+            {
+                // PASS
+            }
+        }
+        finally
+        {
+            queueConnection.close();
+        }
+    }
+
+    @Test
+    public void testQueueSessionCannoutUnsubscribe() throws Exception
+    {
+        QueueConnection queueConnection = getQueueConnection();
+        try
+        {
+            QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+            try
+            {
+                queueSession.unsubscribe("abc");
+                fail("expected exception did not occur");
+            }
+            catch (javax.jms.IllegalStateException s)
+            {
+                // PASS
+            }
+        }
+        finally
+        {
+            queueConnection.close();
+        }
+    }
+
+    private QueueConnection getQueueConnection() throws JMSException, NamingException
+    {
+        return (QueueConnection)getConnection();
+    }
+}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f57c6a56/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
deleted file mode 100644
index b3bd236..0000000
--- a/systests/src/test/java/org/apache/qpid/test/unit/client/QueueSessionFactoryTest.java
+++ /dev/null
@@ -1,108 +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.QueueConnection;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.Topic;
-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.
- */
-public class QueueSessionFactoryTest extends QpidBrokerTestCase
-{
-    public void testQueueSessionIsNotATopicSession() throws Exception
-    {
-        QueueSession queueSession = getQueueSession();
-        assertFalse(queueSession instanceof TopicSession);
-    }
-
-    public void testQueueSessionCannotCreateTemporaryTopics() throws Exception
-    {
-        QueueSession queueSession = getQueueSession();
-        try
-        {
-            queueSession.createTemporaryTopic();
-            fail("expected exception did not occur");
-        }
-        catch (javax.jms.IllegalStateException s)
-        {
-            // PASS
-        }
-    }
-
-    public void testQueueSessionCannotCreateTopics() throws Exception
-    {
-        QueueSession queueSession = getQueueSession();
-        try
-        {
-            queueSession.createTopic("abc");
-            fail("expected exception did not occur");
-        }
-        catch (javax.jms.IllegalStateException s)
-        {
-            // PASS
-        }
-    }
-
-    public void testQueueSessionCannotCreateDurableSubscriber() throws Exception
-    {
-        QueueSession queueSession = getQueueSession();
-        Topic topic = getTestTopic();
-
-        try
-        {
-            queueSession.createDurableSubscriber(topic, "abc");
-            fail("expected exception did not occur");
-        }
-        catch (javax.jms.IllegalStateException s)
-        {
-            // PASS
-        }
-    }
-
-    public void testQueueSessionCannoutUnsubscribe() throws Exception
-    {
-        QueueSession queueSession = getQueueSession();
-        try
-        {
-            queueSession.unsubscribe("abc");
-            fail("expected exception did not occur");
-        }
-        catch (javax.jms.IllegalStateException s)
-        {
-            // PASS
-
-        }
-    }
-
-    private QueueSession getQueueSession() throws Exception
-    {
-        QueueConnection queueConnection = (QueueConnection)getConnection();
-        return queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-    }
-}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f57c6a56/test-profiles/Java10BrokenTestsExcludes
----------------------------------------------------------------------
diff --git a/test-profiles/Java10BrokenTestsExcludes b/test-profiles/Java10BrokenTestsExcludes
index 7cec0bf..0831810 100644
--- a/test-profiles/Java10BrokenTestsExcludes
+++ b/test-profiles/Java10BrokenTestsExcludes
@@ -39,11 +39,6 @@ org.apache.qpid.test.unit.basic.BytesMessageTest#testModificationAfterSend
 // the InternalMessage and back
 org.apache.qpid.systest.management.amqp.AmqpManagementTest#testGetTypesOnVhostManagement
 
-
-// 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
-
 // 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


Mime
View raw message