1   /*
2    * $Id: ActiveMQJmsTransactionMule2071TestCase.java 7976 2007-08-21 14:26:13Z 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.providers.jms.issues;
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  /**
25   * The excluded parts of ActiveMQJmsTransactionFucntionalTestCase.
26   */
27  public class ActiveMQJmsTransactionMule2071TestCase extends AbstractJmsTransactionFunctionalTest
28  {
29      protected ActiveMQConnectionFactory factory = null;
30  
31      public ActiveMQJmsTransactionMule2071TestCase()
32      {
33          exclude(ALL ^ TRANSACTED_REDELIVERY_TO_DL_DESTINATION);
34      }
35  
36      public ConnectionFactory getConnectionFactory() throws Exception
37      {
38          if (factory == null)
39          {
40              factory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false&broker.useJmx=false");
41          }
42          return factory;
43      }
44  
45      protected void doTearDown() throws Exception
46      {
47          factory = null;
48          super.doTearDown();
49      }
50  
51      public UMOTransactionFactory getTransactionFactory()
52      {
53          return new JmsTransactionFactory();
54      }
55  
56      public JmsConnector createConnector() throws Exception
57      {
58          ActiveMqJmsConnector connector = new ActiveMqJmsConnector();
59          connector.setSpecification(JmsConstants.JMS_SPECIFICATION_11);
60          connector.setName(CONNECTOR_NAME);
61          connector.getDispatcherThreadingProfile().setDoThreading(false);
62          return connector;
63      }
64  
65  }