Navigation Menu

Skip to content

Commit

Permalink
ARTEMIS-1532 Fix OutgoingConnectionNoJTATest
Browse files Browse the repository at this point in the history
  • Loading branch information
jiridanek authored and clebertsuconic committed Dec 20, 2017
1 parent aa730fd commit 62280c8
Showing 1 changed file with 14 additions and 5 deletions.
Expand Up @@ -38,6 +38,7 @@
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;
Expand Down Expand Up @@ -192,14 +193,22 @@ public void testSimpleMessageSendAndReceiveSessionTransacted2() throws Exception
}

@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();

Expand All @@ -216,7 +225,7 @@ public void testSimpleSendNoXAJMSContext() throws Exception {

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();
Expand Down Expand Up @@ -252,7 +261,7 @@ public void testSimpleSendNoXAJMS1() throws Exception {
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);
Expand Down

0 comments on commit 62280c8

Please sign in to comment.