activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [2/6] activemq-artemis git commit: ARTEMIS-1532 Fix OutgoingConnectionNoJTATest
Date Wed, 20 Dec 2017 21:06:34 GMT
ARTEMIS-1532 Fix OutgoingConnectionNoJTATest


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

Branch: refs/heads/master
Commit: 62280c88dc2fce0fdaded6ba8cb98c77c9ae873b
Parents: aa730fd
Author: Jiri Danek <jdanek@redhat.com>
Authored: Sun Dec 3 19:56:47 2017 +0100
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Dec 20 16:06:22 2017 -0500

----------------------------------------------------------------------
 .../ra/OutgoingConnectionNoJTATest.java          | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/62280c88/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/OutgoingConnectionNoJTATest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/OutgoingConnectionNoJTATest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/OutgoingConnectionNoJTATest.java
index d18bf76..2cc129f 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/OutgoingConnectionNoJTATest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/OutgoingConnectionNoJTATest.java
@@ -38,6 +38,7 @@ import org.junit.Test;
 import javax.jms.Connection;
 import javax.jms.JMSContext;
 import javax.jms.JMSProducer;
+import javax.jms.JMSRuntimeException;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
@@ -192,14 +193,22 @@ public class OutgoingConnectionNoJTATest extends ActiveMQRATestBase
{
    }
 
    @Test
-   public void sessionTransactedTestNoActiveJTATx() throws Exception {
-      JMSContext context = qraConnectionFactory.createContext(JMSContext.SESSION_TRANSACTED);
+   public void sessionNotTransactedTestNoActiveJTATx() throws Exception {
+      JMSContext context = qraConnectionFactory.createContext(JMSContext.AUTO_ACKNOWLEDGE);
       assertEquals(context.getSessionMode(), JMSContext.AUTO_ACKNOWLEDGE);
    }
 
+   @Test
+   public void sessionTransactedTestNoActiveJTATx() throws Exception {
+      try {
+         qraConnectionFactory.createContext(JMSContext.SESSION_TRANSACTED);
+         fail("Exception expected");
+      } catch (JMSRuntimeException ignored) {
+      }
+   }
 
    @Test
-   public void testQueuSessionAckMode() throws Exception {
+   public void testQueueSessionAckMode() throws Exception {
 
       QueueConnection queueConnection = qraConnectionFactory.createQueueConnection();
 
@@ -216,7 +225,7 @@ public class OutgoingConnectionNoJTATest extends ActiveMQRATestBase {
 
       try (ClientSessionFactory sf = locator.createSessionFactory();
            ClientSession session = sf.createSession();
-           ClientConsumer consVerify = session.createConsumer("jms.queue." + MDBQUEUE);
+           ClientConsumer consVerify = session.createConsumer(MDBQUEUE);
            JMSContext jmsctx = qraConnectionFactory.createContext();
       ) {
          session.start();
@@ -252,7 +261,7 @@ public class OutgoingConnectionNoJTATest extends ActiveMQRATestBase {
       Queue q = ActiveMQJMSClient.createQueue(MDBQUEUE);
       try (ClientSessionFactory sf = locator.createSessionFactory();
            ClientSession session = sf.createSession();
-           ClientConsumer consVerify = session.createConsumer("jms.queue." + MDBQUEUE);
+           ClientConsumer consVerify = session.createConsumer(MDBQUEUE);
            Connection conn = qraConnectionFactory.createConnection();
       ) {
          Session jmsSess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);


Mime
View raw message