View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.jms.integration;
8   
9   import javax.jms.Message;
10  import javax.jms.TextMessage;
11  
12  import org.junit.Test;
13  
14  import static org.junit.Assert.assertEquals;
15  import static org.junit.Assert.assertNotNull;
16  import static org.junit.Assert.assertTrue;
17  
18  public class JmsSingleTransactionRecieveAndSendTestCase extends AbstractJmsFunctionalTestCase
19  {
20  
21      @Override
22      protected String getConfigResources()
23      {
24          return "integration/jms-single-tx-receive-send-in-one-tx.xml";
25      }
26  
27      @Test
28      public void testSingleTransactionBeginOrJoinAndAlwaysBegin() throws Exception
29      {
30          send(scenarioCommit);
31          Message message = receive(scenarioReceive);
32          assertNotNull(message);
33          assertTrue(TextMessage.class.isAssignableFrom(message.getClass()));
34          assertEquals(((TextMessage) message).getText(), AbstractJmsFunctionalTestCase.DEFAULT_OUTPUT_MESSAGE);
35      }
36  
37  }