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 org.junit.Test;
10  
11  /**
12   * There is a separate transaction for each service when single transaction(action:
13   * BEGIN_OR_JOIN) and jms transport are used
14   */
15  public class JmsSingleTransactionComponentTestCase extends AbstractJmsFunctionalTestCase
16  {
17      protected String getConfigResources()
18      {
19          return "integration/jms-single-tx-component.xml";
20      }
21  
22      @Test
23      public void testSingleTransactionComponent() throws Exception
24      {
25          send(scenarioCommit);
26          // Receive message but roll back transaction.
27          receive(scenarioRollback);
28          // Receive message again and commit transaction.
29          receive(scenarioCommit);
30          // Verify there is no more message to receive.
31          receive(scenarioNotReceive);
32      }
33  }