View Javadoc

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