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/09 18:17:00 UTC

[2/2] qpid-broker-j git commit: QPID-6933: [System Tests] Move test for deletion of temporary queue from SyncPublishTest into JMS 1.1 system test TemporaryQueueTest

QPID-6933: [System Tests] Move test for deletion of temporary queue from SyncPublishTest into JMS 1.1 system test TemporaryQueueTest


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

Branch: refs/heads/master
Commit: b1127b7b933171aa8bbee4c05ba15e4c32b1dcdf
Parents: 4573e36
Author: Alex Rudyy <or...@apache.org>
Authored: Sat Dec 9 18:15:46 2017 +0000
Committer: Alex Rudyy <or...@apache.org>
Committed: Sat Dec 9 18:15:46 2017 +0000

----------------------------------------------------------------------
 .../jms_1_1/queue/TemporaryQueueTest.java       | 43 ++++++++++
 .../org/apache/qpid/client/SyncPublishTest.java | 86 --------------------
 test-profiles/CPPExcludes                       |  2 -
 3 files changed, 43 insertions(+), 88 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/b1127b7b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/queue/TemporaryQueueTest.java
----------------------------------------------------------------------
diff --git a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/queue/TemporaryQueueTest.java b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/queue/TemporaryQueueTest.java
index 73d5b55..f7b8c18 100644
--- a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/queue/TemporaryQueueTest.java
+++ b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/queue/TemporaryQueueTest.java
@@ -235,4 +235,47 @@ public class TemporaryQueueTest extends JmsTestBase
             connection.close();
         }
     }
+
+    @Test
+    public void delete() throws Exception
+    {
+        Connection connection = getConnectionBuilder().setSyncPublish(true).build();
+        try
+        {
+            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+            TemporaryQueue queue = session.createTemporaryQueue();
+            MessageProducer producer = session.createProducer(queue);
+            try
+            {
+                producer.send(session.createTextMessage("hello"));
+            }
+            catch (JMSException e)
+            {
+                fail("Send to temporary queue should succeed");
+            }
+
+            try
+            {
+                queue.delete();
+            }
+            catch (JMSException e)
+            {
+                fail("temporary queue should be deletable");
+            }
+
+            try
+            {
+                producer.send(session.createTextMessage("hello"));
+                fail("Send to deleted temporary queue should not succeed");
+            }
+            catch (JMSException e)
+            {
+                // pass
+            }
+        }
+        finally
+        {
+            connection.close();
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/b1127b7b/systests/src/test/java/org/apache/qpid/client/SyncPublishTest.java
----------------------------------------------------------------------
diff --git a/systests/src/test/java/org/apache/qpid/client/SyncPublishTest.java b/systests/src/test/java/org/apache/qpid/client/SyncPublishTest.java
deleted file mode 100644
index 14716ac..0000000
--- a/systests/src/test/java/org/apache/qpid/client/SyncPublishTest.java
+++ /dev/null
@@ -1,86 +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.client;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TemporaryQueue;
-
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-
-public class SyncPublishTest extends QpidBrokerTestCase
-{
-    private Connection _connection;
-
-    @Override
-    public void setUp() throws Exception
-    {
-
-        super.setUp();
-        _connection = getConnectionWithSyncPublishing();
-    }
-
-    @Override
-    public void tearDown() throws Exception
-    {
-        _connection.close();
-        super.tearDown();
-    }
-
-    public void testQueueRemovedAfterConsumerCreated() throws JMSException
-    {
-        Session session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-        TemporaryQueue queue = session.createTemporaryQueue();
-        MessageProducer producer = session.createProducer(queue);
-        try
-        {
-            producer.send(session.createTextMessage("hello"));
-        }
-        catch (JMSException e)
-        {
-            fail("Send to temporary queue should succeed");
-        }
-
-        try
-        {
-            queue.delete();
-        }
-        catch (JMSException e)
-        {
-            fail("temporary queue should be deletable");
-        }
-
-        try
-        {
-            producer.send(session.createTextMessage("hello"));
-            fail("Send to deleted temporary queue should not succeed");
-        }
-        catch (JMSException e)
-        {
-            // pass
-        }
-
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/b1127b7b/test-profiles/CPPExcludes
----------------------------------------------------------------------
diff --git a/test-profiles/CPPExcludes b/test-profiles/CPPExcludes
index ca9943a..6cf6646 100755
--- a/test-profiles/CPPExcludes
+++ b/test-profiles/CPPExcludes
@@ -190,8 +190,6 @@ org.apache.qpid.test.unit.client.AMQSessionTest#testQueueDepthForQueueThatDoesNo
 
 org.apache.qpid.client.prefetch.PrefetchBehaviourTest#testPrefetchWindowExpandsOnReceiveTransaction
 
-org.apache.qpid.client.SyncPublishTest#*
-
 org.apache.qpid.server.queue.ArrivalTimeFilterTest#*
 org.apache.qpid.server.queue.DefaultFiltersTest#*
 org.apache.qpid.server.queue.EnsureNondestructiveConsumersTest#*


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