1   /*
2    * $Id: ActiveMQJmsTransactionFunctionalTestCase.java 7963 2007-08-21 08:53:15Z dirk.olmes $
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  
11  package org.mule.test.integration.providers.jms.activemq;
12  
13  import org.mule.providers.jms.JmsConnector;
14  import org.mule.providers.jms.JmsConstants;
15  import org.mule.providers.jms.JmsTransactionFactory;
16  import org.mule.providers.jms.activemq.ActiveMqJmsConnector;
17  import org.mule.test.integration.providers.jms.AbstractJmsTransactionFunctionalTest;
18  import org.mule.umo.UMOTransactionFactory;
19  
20  import javax.jms.ConnectionFactory;
21  
22  import org.apache.activemq.ActiveMQConnectionFactory;
23  
24  public class ActiveMQJmsTransactionFunctionalTestCase extends AbstractJmsTransactionFunctionalTest
25  {
26      protected ActiveMQConnectionFactory factory = null;
27  
28      public ActiveMQJmsTransactionFunctionalTestCase()
29      {
30          exclude(TRANSACTED_REDELIVERY_TO_DL_DESTINATION); // MULE-2071
31      }
32  
33      public ConnectionFactory getConnectionFactory() throws Exception
34      {
35          if (factory == null)
36          {
37              factory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false&broker.useJmx=false");
38          }
39          return factory;
40      }
41  
42      protected void doTearDown() throws Exception
43      {
44          factory = null;
45          super.doTearDown();
46      }
47  
48      public UMOTransactionFactory getTransactionFactory()
49      {
50          return new JmsTransactionFactory();
51      }
52  
53      public JmsConnector createConnector() throws Exception
54      {
55          ActiveMqJmsConnector connector = new ActiveMqJmsConnector();
56          connector.setSpecification(JmsConstants.JMS_SPECIFICATION_11);
57          connector.setName(CONNECTOR_NAME);
58          connector.getDispatcherThreadingProfile().setDoThreading(false);
59          return connector;
60      }
61  
62  }