qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject [2/2] qpid-broker-j git commit: QPID-6933: [System Tests] Refactor queue message durability tests as JMS 1.1 system test
Date Fri, 05 Jan 2018 01:00:14 GMT
QPID-6933: [System Tests] Refactor queue message durability 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/a2e57db7
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/a2e57db7
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/a2e57db7

Branch: refs/heads/master
Commit: a2e57db7cc45ca4f0b8bb12c83f60ba2a6c6c25d
Parents: 61389ed
Author: Alex Rudyy <orudyy@apache.org>
Authored: Fri Jan 5 00:59:14 2018 +0000
Committer: Alex Rudyy <orudyy@apache.org>
Committed: Fri Jan 5 00:59:14 2018 +0000

----------------------------------------------------------------------
 .../queue/QueueMessageDurabilityTest.java       | 310 +++++++++++++++++++
 .../queue/QueueMessageDurabilityTest.java       | 221 -------------
 test-profiles/CPPExcludes                       |   3 -
 test-profiles/JavaTransientExcludes             |   2 -
 4 files changed, 310 insertions(+), 226 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a2e57db7/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/queue/QueueMessageDurabilityTest.java
----------------------------------------------------------------------
diff --git a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/queue/QueueMessageDurabilityTest.java
b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/queue/QueueMessageDurabilityTest.java
new file mode 100644
index 0000000..8d5d2d3
--- /dev/null
+++ b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/queue/QueueMessageDurabilityTest.java
@@ -0,0 +1,310 @@
+/*
+ *
+ * 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.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeThat;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jms.Connection;
+import javax.jms.DeliveryMode;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+import org.junit.Test;
+
+import org.apache.qpid.server.model.Protocol;
+import org.apache.qpid.server.store.MessageDurability;
+import org.apache.qpid.systests.AmqpManagementFacade;
+import org.apache.qpid.systests.JmsTestBase;
+
+public class QueueMessageDurabilityTest extends JmsTestBase
+{
+    private static final String DURABLE_ALWAYS_PERSIST_NAME = "DURABLE_QUEUE_ALWAYS_PERSIST";
+    private static final String DURABLE_NEVER_PERSIST_NAME = "DURABLE_QUEUE_NEVER_PERSIST";
+    private static final String DURABLE_DEFAULT_PERSIST_NAME = "DURABLE_QUEUE_DEFAULT_PERSIST";
+    private static final String NONDURABLE_ALWAYS_PERSIST_NAME = "NONDURABLE_QUEUE_ALWAYS_PERSIST";
+
+    @Test
+    public void testSendPersistentMessageToAll() throws Exception
+    {
+        assumeThat(getBrokerAdmin().supportsRestart(), is(true));
+
+        prepare();
+
+        Connection connection = getConnection();
+        try
+        {
+            Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
+            MessageProducer producer = session.createProducer(null);
+            producer.send(session.createTopic(getTestTopic("Y.Y.Y.Y")), session.createTextMessage("test"));
+            session.commit();
+        }
+        finally
+        {
+            connection.close();
+        }
+
+        assertEquals(1, getQueueDepth(DURABLE_NEVER_PERSIST_NAME));
+        assertEquals(1, getQueueDepth(NONDURABLE_ALWAYS_PERSIST_NAME));
+        assertEquals(1, getQueueDepth(DURABLE_ALWAYS_PERSIST_NAME));
+        assertEquals(1, getQueueDepth(DURABLE_DEFAULT_PERSIST_NAME));
+
+        getBrokerAdmin().restart();
+
+        assertEquals(0, getQueueDepth(DURABLE_NEVER_PERSIST_NAME));
+        assertEquals(1, getQueueDepth(DURABLE_ALWAYS_PERSIST_NAME));
+        assertEquals(1, getQueueDepth(DURABLE_DEFAULT_PERSIST_NAME));
+        assertFalse(isQueueExist(NONDURABLE_ALWAYS_PERSIST_NAME));
+    }
+
+    @Test
+    public void testSendNonPersistentMessageToAll() throws Exception
+    {
+        assumeThat(getBrokerAdmin().supportsRestart(), is(true));
+
+        prepare();
+
+        Connection connection = getConnection();
+        try
+        {
+            Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
+            MessageProducer producer = session.createProducer(null);
+            producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+            connection.start();
+            producer.send(session.createTopic(getTestTopic("Y.Y.Y.Y")), session.createTextMessage("test"));
+            session.commit();
+        }
+        finally
+        {
+            connection.close();
+        }
+
+        assertEquals(1, getQueueDepth(DURABLE_NEVER_PERSIST_NAME));
+        assertEquals(1, getQueueDepth(NONDURABLE_ALWAYS_PERSIST_NAME));
+        assertEquals(1, getQueueDepth(DURABLE_ALWAYS_PERSIST_NAME));
+        assertEquals(1, getQueueDepth(DURABLE_DEFAULT_PERSIST_NAME));
+
+        getBrokerAdmin().restart();
+
+        assertEquals(0, getQueueDepth(DURABLE_NEVER_PERSIST_NAME));
+        assertEquals(1, getQueueDepth(DURABLE_ALWAYS_PERSIST_NAME));
+        assertEquals(0, getQueueDepth(DURABLE_DEFAULT_PERSIST_NAME));
+        assertFalse(isQueueExist(NONDURABLE_ALWAYS_PERSIST_NAME));
+    }
+
+    @Test
+    public void testNonPersistentContentRetained() throws Exception
+    {
+        assumeThat(getBrokerAdmin().supportsRestart(), is(true));
+
+        prepare();
+
+        Connection connection = getConnection();
+        try
+        {
+            connection.start();
+
+            Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
+            MessageProducer producer = session.createProducer(null);
+            producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+            producer.send(session.createTopic(getTestTopic("N.N.Y.Y")), session.createTextMessage("test1"));
+            producer.send(session.createTopic(getTestTopic("Y.N.Y.Y")), session.createTextMessage("test2"));
+            session.commit();
+
+            MessageConsumer consumer = session.createConsumer(session.createQueue(DURABLE_ALWAYS_PERSIST_NAME));
+            Message msg = consumer.receive(getReceiveTimeout());
+            assertNotNull(msg);
+            assertTrue(msg instanceof TextMessage);
+            assertEquals("test2", ((TextMessage) msg).getText());
+            session.rollback();
+        }
+        finally
+        {
+            connection.close();
+        }
+
+        getBrokerAdmin().restart();
+
+        assertEquals(0, getQueueDepth(DURABLE_NEVER_PERSIST_NAME));
+        assertEquals(1, getQueueDepth(DURABLE_ALWAYS_PERSIST_NAME));
+        assertEquals(0, getQueueDepth(DURABLE_DEFAULT_PERSIST_NAME));
+
+        Connection connection2 = getConnection();
+        try
+        {
+            connection2.start();
+            Session session = connection2.createSession(true, Session.SESSION_TRANSACTED);
+
+            MessageConsumer consumer = session.createConsumer(session.createQueue(DURABLE_ALWAYS_PERSIST_NAME));
+            Message msg = consumer.receive(getReceiveTimeout());
+            assertNotNull(msg);
+            assertTrue(msg instanceof TextMessage);
+            assertEquals("test2", ((TextMessage) msg).getText());
+            session.commit();
+        }
+        finally
+        {
+            connection2.close();
+        }
+    }
+
+    @Test
+    public void testPersistentContentRetainedOnTransientQueue() throws Exception
+    {
+        prepare();
+
+        Connection connection = getConnection();
+        try
+        {
+            connection.start();
+            Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
+            MessageProducer producer = session.createProducer(null);
+            producer.setDeliveryMode(DeliveryMode.PERSISTENT);
+
+            producer.send(session.createTopic(getTestTopic("N.N.Y.Y")), session.createTextMessage("test1"));
+            session.commit();
+            MessageConsumer consumer =
+                    session.createConsumer(session.createQueue(getTestQueue(DURABLE_DEFAULT_PERSIST_NAME)));
+            Message msg = consumer.receive(getReceiveTimeout());
+            assertNotNull(msg);
+            assertTrue(msg instanceof TextMessage);
+            assertEquals("test1", ((TextMessage) msg).getText());
+            session.commit();
+
+            consumer = session.createConsumer(session.createQueue(getTestQueue(NONDURABLE_ALWAYS_PERSIST_NAME)));
+            msg = consumer.receive(getReceiveTimeout());
+            assertNotNull(msg);
+            assertTrue(msg instanceof TextMessage);
+            assertEquals("test1", ((TextMessage) msg).getText());
+            session.commit();
+        }
+        finally
+        {
+            connection.close();
+        }
+    }
+
+    private boolean isQueueExist(final String queueName) throws Exception
+    {
+        try
+        {
+            performOperationUsingAmqpManagement(queueName,
+                                                "READ",
+                                                "org.apache.qpid.Queue",
+                                                Collections.emptyMap());
+            return true;
+        }
+        catch (AmqpManagementFacade.OperationUnsuccessfulException e)
+        {
+            if (e.getStatusCode() == 404)
+            {
+                return false;
+            }
+            else
+            {
+                throw e;
+            }
+        }
+    }
+
+    private int getQueueDepth(final String queueName) throws Exception
+    {
+        Map<String, Object> arguments =
+                Collections.singletonMap("statistics", Collections.singletonList("queueDepthMessages"));
+        Object statistics = performOperationUsingAmqpManagement(queueName,
+                                                                "getStatistics",
+                                                                "org.apache.qpid.Queue",
+                                                                arguments);
+        assertNotNull("Statistics is null", statistics);
+        assertTrue("Statistics is not map", statistics instanceof Map);
+        @SuppressWarnings("unchecked")
+        Map<String, Object> statisticsMap = (Map<String, Object>) statistics;
+        assertTrue("queueDepthMessages is not present", statisticsMap.get("queueDepthMessages")
instanceof Number);
+        return ((Number) statisticsMap.get("queueDepthMessages")).intValue();
+    }
+
+    private void prepare() throws Exception
+    {
+        Map<String, Object> arguments = new HashMap<>();
+        arguments.put(org.apache.qpid.server.model.Queue.MESSAGE_DURABILITY, MessageDurability.ALWAYS.name());
+        arguments.put(org.apache.qpid.server.model.Queue.DURABLE, true);
+        createEntityUsingAmqpManagement(DURABLE_ALWAYS_PERSIST_NAME, "org.apache.qpid.Queue",
arguments);
+
+        arguments = new HashMap<>();
+        arguments.put(org.apache.qpid.server.model.Queue.MESSAGE_DURABILITY, MessageDurability.NEVER.name());
+        arguments.put(org.apache.qpid.server.model.Queue.DURABLE, true);
+        createEntityUsingAmqpManagement(DURABLE_NEVER_PERSIST_NAME, "org.apache.qpid.Queue",
arguments);
+
+        arguments = new HashMap<>();
+        arguments.put(org.apache.qpid.server.model.Queue.MESSAGE_DURABILITY, MessageDurability.DEFAULT.name());
+        arguments.put(org.apache.qpid.server.model.Queue.DURABLE, true);
+        createEntityUsingAmqpManagement(DURABLE_DEFAULT_PERSIST_NAME, "org.apache.qpid.Queue",
arguments);
+
+        arguments = new HashMap<>();
+        arguments.put(org.apache.qpid.server.model.Queue.MESSAGE_DURABILITY, MessageDurability.ALWAYS.name());
+        arguments.put(org.apache.qpid.server.model.Queue.DURABLE, false);
+        createEntityUsingAmqpManagement(NONDURABLE_ALWAYS_PERSIST_NAME, "org.apache.qpid.Queue",
arguments);
+
+        arguments = new HashMap<>();
+        arguments.put("destination", DURABLE_ALWAYS_PERSIST_NAME);
+        arguments.put("bindingKey", "Y.*.*.*");
+        performOperationUsingAmqpManagement("amq.topic", "bind", "org.apache.qpid.TopicExchange",
arguments);
+
+        arguments = new HashMap<>();
+        arguments.put("destination", DURABLE_NEVER_PERSIST_NAME);
+        arguments.put("bindingKey", "*.Y.*.*");
+        performOperationUsingAmqpManagement("amq.topic", "bind", "org.apache.qpid.TopicExchange",
arguments);
+
+        arguments = new HashMap<>();
+        arguments.put("destination", DURABLE_DEFAULT_PERSIST_NAME);
+        arguments.put("bindingKey", "*.*.Y.*");
+        performOperationUsingAmqpManagement("amq.topic", "bind", "org.apache.qpid.TopicExchange",
arguments);
+
+        arguments = new HashMap<>();
+        arguments.put("destination", NONDURABLE_ALWAYS_PERSIST_NAME);
+        arguments.put("bindingKey", "*.*.*.Y");
+        performOperationUsingAmqpManagement("amq.topic", "bind", "org.apache.qpid.TopicExchange",
arguments);
+    }
+
+    private String getTestTopic(final String routingKey)
+    {
+        String topicNameFormat = getProtocol() == Protocol.AMQP_1_0 ? "amq.topic/%s" : "%s";
+        return String.format(topicNameFormat, routingKey);
+    }
+
+    private String getTestQueue(final String name)
+    {
+        String queueFormat =
+                getProtocol() == Protocol.AMQP_1_0 ? "%s" : "ADDR:%s; {create:never, node:
{ type: queue }}";
+        return String.format(queueFormat, name);
+    }
+}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a2e57db7/systests/src/test/java/org/apache/qpid/server/queue/QueueMessageDurabilityTest.java
----------------------------------------------------------------------
diff --git a/systests/src/test/java/org/apache/qpid/server/queue/QueueMessageDurabilityTest.java
b/systests/src/test/java/org/apache/qpid/server/queue/QueueMessageDurabilityTest.java
deleted file mode 100644
index 7237561..0000000
--- a/systests/src/test/java/org/apache/qpid/server/queue/QueueMessageDurabilityTest.java
+++ /dev/null
@@ -1,221 +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.server.queue;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.jms.Connection;
-import javax.jms.DeliveryMode;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.NamingException;
-
-import org.apache.qpid.configuration.ClientProperties;
-import org.apache.qpid.server.store.MessageDurability;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-
-public class QueueMessageDurabilityTest extends QpidBrokerTestCase
-{
-    private static final String DURABLE_ALWAYS_PERSIST_NAME = "DURABLE_QUEUE_ALWAYS_PERSIST";
-    private static final String DURABLE_NEVER_PERSIST_NAME = "DURABLE_QUEUE_NEVER_PERSIST";
-    private static final String DURABLE_DEFAULT_PERSIST_NAME = "DURABLE_QUEUE_DEFAULT_PERSIST";
-    private static final String NONDURABLE_ALWAYS_PERSIST_NAME = "NONDURABLE_QUEUE_ALWAYS_PERSIST";
-    private Queue _durableAlwaysPersist;
-    private Queue _durableNeverPersist;
-    private Queue _durableDefaultPersist;
-    private Queue _nonDurableAlwaysPersist;
-    private String _topicNameFormat;
-
-    @Override
-    public void setUp() throws Exception
-    {
-        super.setUp();
-        Connection conn = createStartedConnection();
-        Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-        Map<String,Object> arguments = new HashMap<>();
-        arguments.put(org.apache.qpid.server.model.Queue.MESSAGE_DURABILITY, MessageDurability.ALWAYS.name());
-        arguments.put(org.apache.qpid.server.model.Queue.DURABLE, true);
-        _durableAlwaysPersist = createQueueWithArguments(session, DURABLE_ALWAYS_PERSIST_NAME,
arguments);
-
-        arguments = new HashMap<>();
-        arguments.put(org.apache.qpid.server.model.Queue.MESSAGE_DURABILITY, MessageDurability.NEVER.name());
-        arguments.put(org.apache.qpid.server.model.Queue.DURABLE, true);
-        _durableNeverPersist = createQueueWithArguments(session, DURABLE_NEVER_PERSIST_NAME,
arguments);
-
-        arguments = new HashMap<>();
-        arguments.put(org.apache.qpid.server.model.Queue.MESSAGE_DURABILITY, MessageDurability.DEFAULT.name());
-        arguments.put(org.apache.qpid.server.model.Queue.DURABLE, true);
-        _durableDefaultPersist = createQueueWithArguments(session, DURABLE_DEFAULT_PERSIST_NAME,
arguments);
-
-        arguments = new HashMap<>();
-        arguments.put(org.apache.qpid.server.model.Queue.MESSAGE_DURABILITY,MessageDurability.ALWAYS.name());
-        arguments.put(org.apache.qpid.server.model.Queue.DURABLE, false);
-        _nonDurableAlwaysPersist = createQueueWithArguments(session, NONDURABLE_ALWAYS_PERSIST_NAME,
arguments);
-
-        bindQueue(conn.createSession(false, Session.AUTO_ACKNOWLEDGE), "amq.topic", DURABLE_ALWAYS_PERSIST_NAME,
"Y.*.*.*");
-        bindQueue(conn.createSession(false, Session.AUTO_ACKNOWLEDGE), "amq.topic", DURABLE_NEVER_PERSIST_NAME,
"*.Y.*.*");
-        bindQueue(conn.createSession(false, Session.AUTO_ACKNOWLEDGE), "amq.topic", DURABLE_DEFAULT_PERSIST_NAME,
"*.*.Y.*");
-        bindQueue(conn.createSession(false, Session.AUTO_ACKNOWLEDGE), "amq.topic", NONDURABLE_ALWAYS_PERSIST_NAME,
"*.*.*.Y");
-
-        _topicNameFormat = isBroker10() ? "amq.topic/%s" : "%s";
-
-        conn.close();
-    }
-
-    public void testSendPersistentMessageToAll() throws Exception
-    {
-        Connection conn = createStartedConnection();
-        Session session = conn.createSession(true, Session.SESSION_TRANSACTED);
-        MessageProducer producer = session.createProducer(null);
-        conn.start();
-        producer.send(session.createTopic(String.format(_topicNameFormat, "Y.Y.Y.Y")), session.createTextMessage("test"));
-        session.commit();
-
-        assertEquals(1, getQueueDepth(conn, _durableAlwaysPersist));
-        assertEquals(1, getQueueDepth(conn, _durableNeverPersist));
-        assertEquals(1, getQueueDepth(conn, _durableDefaultPersist));
-        assertEquals(1, getQueueDepth(conn,_nonDurableAlwaysPersist));
-
-        restartDefaultBroker();
-
-        conn = createStartedConnection();
-        assertEquals(1, getQueueDepth(conn, _durableAlwaysPersist));
-        assertEquals(0, getQueueDepth(conn, _durableNeverPersist));
-        assertEquals(1, getQueueDepth(conn, _durableDefaultPersist));
-
-        assertFalse(isQueueExist(conn, _nonDurableAlwaysPersist));
-    }
-
-    public void testSendNonPersistentMessageToAll() throws Exception
-    {
-        Connection conn = createStartedConnection();
-        Session session = conn.createSession(true, Session.SESSION_TRANSACTED);
-        MessageProducer producer = session.createProducer(null);
-        producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-        conn.start();
-        producer.send(session.createTopic(String.format(_topicNameFormat, "Y.Y.Y.Y")), session.createTextMessage("test"));
-        session.commit();
-
-        assertEquals(1, getQueueDepth(conn, _durableAlwaysPersist));
-        assertEquals(1, getQueueDepth(conn, _durableNeverPersist));
-        assertEquals(1, getQueueDepth(conn, _durableDefaultPersist));
-        assertEquals(1, getQueueDepth(conn,_nonDurableAlwaysPersist));
-
-        restartDefaultBroker();
-
-        conn = createStartedConnection();
-        assertEquals(1, getQueueDepth(conn, _durableAlwaysPersist));
-        assertEquals(0, getQueueDepth(conn, _durableNeverPersist));
-        assertEquals(0, getQueueDepth(conn, _durableDefaultPersist));
-
-        assertFalse(isQueueExist(conn, _nonDurableAlwaysPersist));
-
-    }
-
-    public void testNonPersistentContentRetained() throws Exception
-    {
-        Connection conn = createStartedConnection();
-        Session session = conn.createSession(true, Session.SESSION_TRANSACTED);
-        MessageProducer producer = session.createProducer(null);
-        producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-        conn.start();
-        producer.send(session.createTopic(String.format(_topicNameFormat, "N.N.Y.Y")), session.createTextMessage("test1"));
-        producer.send(session.createTopic(String.format(_topicNameFormat, "Y.N.Y.Y")), session.createTextMessage("test2"));
-        session.commit();
-        MessageConsumer consumer = session.createConsumer(_durableAlwaysPersist);
-        Message msg = consumer.receive(getReceiveTimeout());
-        assertNotNull(msg);
-        assertTrue(msg instanceof TextMessage);
-        assertEquals("test2", ((TextMessage) msg).getText());
-        session.rollback();
-        restartDefaultBroker();
-        conn = createStartedConnection();
-        session = conn.createSession(true, Session.SESSION_TRANSACTED);
-        assertEquals(1, getQueueDepth(conn, _durableAlwaysPersist));
-        assertEquals(0, getQueueDepth(conn, _durableNeverPersist));
-        assertEquals(0, getQueueDepth(conn, _durableDefaultPersist));
-
-        consumer = session.createConsumer(_durableAlwaysPersist);
-        msg = consumer.receive(getReceiveTimeout());
-        assertNotNull(msg);
-        assertTrue(msg instanceof TextMessage);
-        assertEquals("test2", ((TextMessage)msg).getText());
-        session.commit();
-    }
-
-    public void testPersistentContentRetainedOnTransientQueue() throws Exception
-    {
-        setTestClientSystemProperty(ClientProperties.QPID_DECLARE_QUEUES_PROP_NAME, "false");
-        Connection conn = createStartedConnection();
-        Session session = conn.createSession(true, Session.SESSION_TRANSACTED);
-        MessageProducer producer = session.createProducer(null);
-        producer.setDeliveryMode(DeliveryMode.PERSISTENT);
-        conn.start();
-        producer.send(session.createTopic(String.format(_topicNameFormat, "N.N.Y.Y")), session.createTextMessage("test1"));
-        session.commit();
-        MessageConsumer consumer = session.createConsumer(_durableDefaultPersist);
-        Message msg = consumer.receive(getReceiveTimeout());
-        assertNotNull(msg);
-        assertTrue(msg instanceof TextMessage);
-        assertEquals("test1", ((TextMessage)msg).getText());
-        session.commit();
-        System.gc();
-        consumer = session.createConsumer(_nonDurableAlwaysPersist);
-        msg = consumer.receive(getReceiveTimeout());
-        assertNotNull(msg);
-        assertTrue(msg instanceof TextMessage);
-        assertEquals("test1", ((TextMessage)msg).getText());
-        session.commit();
-    }
-
-    private Connection createStartedConnection() throws JMSException, NamingException
-    {
-        Connection conn = getConnection();
-        conn.start();
-        return conn;
-    }
-
-    private Queue createQueueWithArguments(final Session session,
-                                           final String testQueueName,
-                                           final Map<String, Object> arguments) throws
Exception
-    {
-        createEntityUsingAmqpManagement(testQueueName, session, "org.apache.qpid.Queue",
arguments);
-        return getQueueFromName(session, testQueueName);
-    }
-
-    private void bindQueue(final Session session, final String exchange, final String queueName,
-                           final String bindingKey) throws Exception
-    {
-
-        final Map<String, Object> arguments = new HashMap<>();
-        arguments.put("destination", queueName);
-        arguments.put("bindingKey", bindingKey);
-        performOperationUsingAmqpManagement(exchange, "bind", session, "org.apache.qpid.TopicExchange",
arguments);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a2e57db7/test-profiles/CPPExcludes
----------------------------------------------------------------------
diff --git a/test-profiles/CPPExcludes b/test-profiles/CPPExcludes
index 09e7152..26c3573 100755
--- a/test-profiles/CPPExcludes
+++ b/test-profiles/CPPExcludes
@@ -136,9 +136,6 @@ org.apache.qpid.client.failover.MultipleBrokersFailoverTest#*
 org.apache.qpid.client.HeartbeatTest#testUnidirectionalHeartbeating
 org.apache.qpid.client.HeartbeatTest#testHeartbeatsEnabledBrokerSide
 
-// Tests queue message durability settings which are a Qpid Broker-J specific feature
-org.apache.qpid.server.queue.QueueMessageDurabilityTest#*
-
 // CPP Broker does not timeout connections with no activity like the Qpid Broker-J
 org.apache.qpid.transport.ProtocolNegotiationTest#testNoProtocolHeaderSent_BrokerClosesConnection
 org.apache.qpid.transport.ProtocolNegotiationTest#testNoConnectionOpenSent_BrokerClosesConnection

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a2e57db7/test-profiles/JavaTransientExcludes
----------------------------------------------------------------------
diff --git a/test-profiles/JavaTransientExcludes b/test-profiles/JavaTransientExcludes
index ec48a4a..66cd5e8 100644
--- a/test-profiles/JavaTransientExcludes
+++ b/test-profiles/JavaTransientExcludes
@@ -23,8 +23,6 @@ org.apache.qpid.server.store.SplitStoreTest#*
 org.apache.qpid.server.logging.AlertingTest#testAlertingReallyWorksWithRestart
 org.apache.qpid.server.logging.AlertingTest#testAlertingReallyWorksWithChanges
 
-org.apache.qpid.server.queue.QueueMessageDurabilityTest#*
-
 org.apache.qpid.server.store.berkeleydb.*
 org.apache.qpid.server.store.berkeleydb.replication.*
 org.apache.qpid.server.store.berkeleydb.upgrade.*


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


Mime
View raw message