activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [2/3] activemq-artemis git commit: ARTEMIS-740 Test on redeployment divert
Date Wed, 21 Sep 2016 21:09:49 GMT
ARTEMIS-740 Test on redeployment divert


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/911ec30b
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/911ec30b
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/911ec30b

Branch: refs/heads/master
Commit: 911ec30be1a4ef5512e24f986df3117beb75405c
Parents: 589adbc
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Wed Sep 21 17:07:02 2016 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Sep 21 17:07:02 2016 -0400

----------------------------------------------------------------------
 .../artemis/tests/integration/jms/RedeployTest.java    | 13 +++++++++++++
 .../src/test/resources/reload-test-updated-jms.xml     |  8 ++++++++
 2 files changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/911ec30b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/RedeployTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/RedeployTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/RedeployTest.java
index c106897..7c49053 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/RedeployTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/RedeployTest.java
@@ -20,6 +20,7 @@ package org.apache.activemq.artemis.tests.integration.jms;
 import javax.jms.Connection;
 import javax.jms.JMSException;
 import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
 import java.net.URL;
@@ -75,6 +76,18 @@ public class RedeployTest extends ActiveMQTestBase {
          Assert.assertEquals("jms.queue.NewQueue", embeddedJMS.getActiveMQServer().getAddressSettingsRepository().getMatch("jms").getDeadLetterAddress().toString());
          Assert.assertEquals("jms.queue.NewQueue", embeddedJMS.getActiveMQServer().getAddressSettingsRepository().getMatch("jms").getExpiryAddress().toString());
 
+
+         ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
+         try (Connection connection = factory.createConnection()) {
+            Session session = connection.createSession();
+            Queue queue = session.createQueue("DivertQueue");
+            MessageProducer producer = session.createProducer(queue);
+            producer.send(session.createTextMessage("text"));
+            connection.start();
+            MessageConsumer consumer = session.createConsumer(session.createQueue("NewQueue"));
+            Assert.assertNotNull("Divert wasn't redeployed accordingly", consumer.receive(5000));
+         }
+
       }
       finally {
          embeddedJMS.stop();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/911ec30b/tests/integration-tests/src/test/resources/reload-test-updated-jms.xml
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/resources/reload-test-updated-jms.xml b/tests/integration-tests/src/test/resources/reload-test-updated-jms.xml
index 3e6e329..a9d1016 100644
--- a/tests/integration-tests/src/test/resources/reload-test-updated-jms.xml
+++ b/tests/integration-tests/src/test/resources/reload-test-updated-jms.xml
@@ -26,6 +26,7 @@ under the License.
       <queue name="DLQ"/>
       <queue name="ExpiryQueue"/>
       <queue name="NewQueue"/>
+      <queue name="DivertQueue"/>
 
    </jms>
 
@@ -83,6 +84,13 @@ under the License.
 
       </acceptors>
 
+      <diverts>
+         <divert name="myDivert">
+            <address>jms.queue.DivertQueue</address>
+            <forwarding-address>jms.queue.NewQueue</forwarding-address>
+         </divert>
+      </diverts>
+
 
       <security-settings>
          <security-setting match="#">


Mime
View raw message