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.test.integration.transaction;
8   
9   import org.mule.api.MuleMessage;
10  import org.mule.module.client.MuleClient;
11  import org.mule.tck.junit4.FunctionalTestCase;
12  
13  import org.junit.Test;
14  
15  import static org.junit.Assert.assertEquals;
16  import static org.junit.Assert.assertNotNull;
17  import static org.junit.Assert.assertNull;
18  
19  public class VmXaTransactionsPersistentQueueTestCase extends FunctionalTestCase
20  {
21  
22      private static final String TEST_MESSAGE = "TEST_MESSAGE";
23  
24      private final long timeout = getTestTimeoutSecs() * 1000 / 30;
25  
26      @Override
27      protected String getConfigResources()
28      {
29          return "org/mule/test/integration/transaction/vm-xa-transaction-persistent-queue.xml";
30      }
31  
32      @Test
33      public void testOutboundRouterTransactions() throws Exception
34      {
35          MuleClient client = new MuleClient(muleContext);
36          MuleMessage msg = client.send("vm://in", TEST_MESSAGE, null, (int) timeout);
37  
38          assertNotNull(msg);
39          assertNull(msg.getExceptionPayload());
40          assertEquals("Wrong message returned", TEST_MESSAGE + " Received", msg.getPayload());
41      }
42  
43  }