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 2018/01/05 01:37:12 UTC
qpid-broker-j git commit: QPID-6933: [System Tests] Refactor
temporary queue prefix tests as JMS 1.1 system test
Repository: qpid-broker-j
Updated Branches:
refs/heads/master a2e57db7c -> 762459018
QPID-6933: [System Tests] Refactor temporary queue prefix tests as JMS 1.1 system test
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/76245901
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/76245901
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/76245901
Branch: refs/heads/master
Commit: 7624590186189c6d4a801178c4f74636fa72aa39
Parents: a2e57db
Author: Alex Rudyy <or...@apache.org>
Authored: Fri Jan 5 01:36:05 2018 +0000
Committer: Alex Rudyy <or...@apache.org>
Committed: Fri Jan 5 01:36:05 2018 +0000
----------------------------------------------------------------------
.../queue/TemporaryQueuePrefixTest.java | 128 +++++++++++++++++++
.../qpid/client/TemporaryQueuePrefixTest.java | 88 -------------
test-profiles/CPPExcludes | 3 -
3 files changed, 128 insertions(+), 91 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/76245901/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/queue/TemporaryQueuePrefixTest.java
----------------------------------------------------------------------
diff --git a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/queue/TemporaryQueuePrefixTest.java b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/queue/TemporaryQueuePrefixTest.java
new file mode 100644
index 0000000..bdb8049
--- /dev/null
+++ b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/queue/TemporaryQueuePrefixTest.java
@@ -0,0 +1,128 @@
+/*
+ * 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.extensions.queue;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Collections;
+
+import javax.jms.Connection;
+import javax.jms.Session;
+import javax.jms.TemporaryQueue;
+
+import org.junit.Test;
+
+import org.apache.qpid.server.virtualhost.QueueManagingVirtualHost;
+import org.apache.qpid.systests.JmsTestBase;
+
+public class TemporaryQueuePrefixTest extends JmsTestBase
+{
+
+ @Test
+ public void testNoPrefixSet() throws Exception
+ {
+ Connection connection = getConnection();
+ try
+ {
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ TemporaryQueue queue = session.createTemporaryQueue();
+
+ assertTrue(queue.getQueueName() + " does not start with \"TempQueue\".",
+ queue.getQueueName().startsWith("TempQueue"));
+ }
+ finally
+ {
+ connection.close();
+ }
+ }
+
+ @Test
+ public void testEmptyPrefix() throws Exception
+ {
+ updateGlobalAddressDomains("[]");
+
+ Connection connection = getConnection();
+ try
+ {
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ TemporaryQueue queue = session.createTemporaryQueue();
+
+ assertTrue(queue.getQueueName() + " does not start with \"TempQueue\".",
+ queue.getQueueName().startsWith("TempQueue"));
+ }
+ finally
+ {
+ connection.close();
+ }
+ }
+
+ @Test
+ public void testTwoDomains() throws Exception
+ {
+ final String primaryPrefix = "/testPrefix";
+ updateGlobalAddressDomains("[\"" + primaryPrefix + "\", \"/foo\" ]");
+
+ Connection connection = getConnection();
+ try
+ {
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ TemporaryQueue queue = session.createTemporaryQueue();
+
+ assertFalse(queue.getQueueName() + " has superfluous slash in prefix.",
+ queue.getQueueName().startsWith(("[\"" + primaryPrefix + "\", \"/foo\" ]") + "/"));
+ assertTrue(queue.getQueueName() + " does not start with expected prefix \"" + primaryPrefix + "\".",
+ queue.getQueueName().startsWith(primaryPrefix));
+ }
+ finally
+ {
+ connection.close();
+ }
+ }
+
+ @Test
+ public void testPrefix() throws Exception
+ {
+ String prefix = "/testPrefix";
+ updateGlobalAddressDomains("[ \"" + prefix + "\" ]");
+
+ Connection connection = getConnection();
+ try
+ {
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ TemporaryQueue queue = session.createTemporaryQueue();
+
+ assertTrue(queue.getQueueName() + " does not start with expected prefix \"" + prefix + "/\".",
+ queue.getQueueName().startsWith(prefix + "/"));
+ }
+ finally
+ {
+ connection.close();
+ }
+ }
+
+ private void updateGlobalAddressDomains(String globalDomains) throws Exception
+ {
+ updateEntityUsingAmqpManagement(getVirtualHostName(),
+ "org.apache.qpid.VirtualHost",
+ Collections.singletonMap(QueueManagingVirtualHost.GLOBAL_ADDRESS_DOMAINS,
+ globalDomains));
+ }
+}
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/76245901/systests/src/test/java/org/apache/qpid/client/TemporaryQueuePrefixTest.java
----------------------------------------------------------------------
diff --git a/systests/src/test/java/org/apache/qpid/client/TemporaryQueuePrefixTest.java b/systests/src/test/java/org/apache/qpid/client/TemporaryQueuePrefixTest.java
deleted file mode 100644
index f71f45d..0000000
--- a/systests/src/test/java/org/apache/qpid/client/TemporaryQueuePrefixTest.java
+++ /dev/null
@@ -1,88 +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 org.apache.qpid.test.utils.QpidBrokerTestCase;
-
-import javax.jms.Connection;
-import javax.jms.Session;
-import javax.jms.TemporaryQueue;
-
-
-public class TemporaryQueuePrefixTest extends QpidBrokerTestCase
-{
- @Override
- public void startDefaultBroker() throws Exception
- {
- // deliberately don't start broker
- }
-
- public void testNoPrefixSet() throws Exception
- {
- super.startDefaultBroker();
- Connection connection = getConnection();
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- TemporaryQueue queue = session.createTemporaryQueue();
-
- assertTrue(queue.getQueueName() + " does not start with \"TempQueue\".", queue.getQueueName().startsWith("TempQueue"));
- connection.close();
- }
-
- public void testEmptyPrefix() throws Exception
- {
- String prefix = "[]";
- setTestSystemProperty("qpid.globalAddressDomains", prefix);
- super.startDefaultBroker();
- Connection connection = getConnection();
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- TemporaryQueue queue = session.createTemporaryQueue();
-
- assertTrue(queue.getQueueName() + " does not start with \"TempQueue\".", queue.getQueueName().startsWith("TempQueue"));
- connection.close();
- }
-
- public void testTwoDomains() throws Exception
- {
- final String primaryPrefix = "/testPrefix";
- String prefix = "[ \\\"" + primaryPrefix + "\\\", \\\"/foo\\\" ]";
- setTestSystemProperty("qpid.globalAddressDomains", prefix);
- super.startDefaultBroker();
- Connection connection = getConnection();
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- TemporaryQueue queue = session.createTemporaryQueue();
-
- assertFalse(queue.getQueueName() + " has superfluous slash in prefix.", queue.getQueueName().startsWith(prefix + "/"));
- assertTrue(queue.getQueueName() + " does not start with expected prefix \"" + primaryPrefix + "\".", queue.getQueueName().startsWith(primaryPrefix));
- connection.close();
- }
-
- public void testPrefix() throws Exception
- {
- String prefix = "/testPrefix";
- setTestSystemProperty("qpid.globalAddressDomains", prefix);
- super.startDefaultBroker();
- Connection connection = getConnection();
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- TemporaryQueue queue = session.createTemporaryQueue();
-
- assertTrue(queue.getQueueName() + " does not start with expected prefix \"" + prefix + "/\".", queue.getQueueName().startsWith(prefix + "/"));
- connection.close();
- }
-}
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/76245901/test-profiles/CPPExcludes
----------------------------------------------------------------------
diff --git a/test-profiles/CPPExcludes b/test-profiles/CPPExcludes
index 26c3573..1dcbf11 100755
--- a/test-profiles/CPPExcludes
+++ b/test-profiles/CPPExcludes
@@ -117,9 +117,6 @@ org.apache.qpid.server.failover.FailoverMethodTest#*
// passwd script is a Qpid Broker-J specific command line tool
org.apache.qpid.scripts.QpidPasswdTest#*
-// Qpid Broker-J has an extenstion to allow it to influence the prefix of temporary queue names
-org.apache.qpid.client.TemporaryQueuePrefixTest#*
-
// QPID-3936: Exclude Performance Test Framework tests
org.apache.qpid.systest.disttest.*
org.apache.qpid.disttest.*
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org