Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2D8B3200D5D for ; Wed, 20 Dec 2017 22:06:36 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2C197160C2D; Wed, 20 Dec 2017 21:06:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 71926160C18 for ; Wed, 20 Dec 2017 22:06:35 +0100 (CET) Received: (qmail 52251 invoked by uid 500); 20 Dec 2017 21:06:34 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 52145 invoked by uid 99); 20 Dec 2017 21:06:34 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Dec 2017 21:06:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 72EB6DFFD9; Wed, 20 Dec 2017 21:06:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: clebertsuconic@apache.org To: commits@activemq.apache.org Date: Wed, 20 Dec 2017 21:06:34 -0000 Message-Id: <2d0fc489b049435a979c4c893092926b@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/6] activemq-artemis git commit: ARTEMIS-1532 Fix OutgoingConnectionNoJTATest archived-at: Wed, 20 Dec 2017 21:06:36 -0000 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 Authored: Sun Dec 3 19:56:47 2017 +0100 Committer: Clebert Suconic 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);