1   /*
2    * $Id: ActiveMQJmsQueueFunctionalTestCase.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.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.activemq.ActiveMqJmsConnector;
16  import org.mule.test.integration.providers.jms.AbstractJmsQueueFunctionalTestCase;
17  
18  import java.util.HashMap;
19  
20  import javax.jms.ConnectionFactory;
21  
22  import org.apache.activemq.ActiveMQConnectionFactory;
23  
24  public class ActiveMQJmsQueueFunctionalTestCase extends AbstractJmsQueueFunctionalTestCase
25  {
26      protected ActiveMQConnectionFactory factory = null;
27  
28      public ConnectionFactory getConnectionFactory() throws Exception
29      {
30          if (factory == null)
31          {
32              factory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false&broker.useJmx=false");
33          }
34          return factory;
35      }
36  
37      protected void doTearDown() throws Exception
38      {
39          factory = null;
40          super.doTearDown();
41      }
42  
43      public JmsConnector createConnector() throws Exception
44      {
45          ActiveMqJmsConnector connector = new ActiveMqJmsConnector();
46          connector.setSpecification(JmsConstants.JMS_SPECIFICATION_11);
47          connector.setName(CONNECTOR_NAME);
48          connector.getDispatcherThreadingProfile().setDoThreading(false);
49  
50          HashMap overrides = new HashMap();
51          overrides.put("message.receiver", JmsMessageReceiverSynchronous.class.getName());
52          connector.setServiceOverrides(overrides);
53          return connector;
54      }
55  }