1   /*
2    * $Id: CustomTransactionTestCase.java 11465 2008-03-21 17:49:44Z rossmason $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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  package org.mule.test.config;
11  
12  import org.mule.api.endpoint.EndpointBuilder;
13  import org.mule.api.endpoint.InboundEndpoint;
14  import org.mule.api.transaction.TransactionConfig;
15  import org.mule.tck.FunctionalTestCase;
16  import org.mule.tck.testmodels.mule.TestTransactionFactory;
17  
18  public class CustomTransactionTestCase extends FunctionalTestCase
19  {
20      protected String getConfigResources()
21      {
22          return "org/mule/test/config/custom-transaction-config.xml";
23      }
24  
25      public void testConfig() throws Exception
26      {
27          EndpointBuilder epb = muleContext.getRegistry().lookupEndpointBuilder("testEndpoint1");
28          assertNotNull(epb);
29          InboundEndpoint iep = epb.buildInboundEndpoint();
30  
31          assertNotNull(iep.getTransactionConfig());
32          assertTrue(iep.getTransactionConfig().getFactory() instanceof TestTransactionFactory);
33          assertEquals(TransactionConfig.ACTION_ALWAYS_BEGIN, iep.getTransactionConfig().getAction());
34          assertEquals(4004, iep.getTransactionConfig().getTimeout());
35      }
36  }