servicemix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Co <...@exist.com>
Subject Re: svn commit: r552774 - in /incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms: ./ src/test/java/org/apache/servicemix/jms/ src/test/resources/org/apache/servicemix/jms/
Date Thu, 05 Jul 2007 06:46:43 GMT
Sorry, about this. I think I've figured out whats wrong.

The maven-surefire plugin by default includes test cases in the 
following format: |**/Test*.java **/*Test.java **/*TestCase.java
if no includes is specified. This matches the abstract class I've 
created which I think causes the exception below.
I just renamed the class to *TestSupport, to avoid any problems if no 
include is specified. Just my luck to pick the wrong class name. (duh!) :)
|
Guillaume Nodet wrote:
> Hey, I've just svn up and I have the following problem when bulding:
>
> [INFO] Surefire report directory:
> c:\java\servicemix\clean\deployables\bindingcomponents\servicemix-jms\target\surefire-reports 
>
> org.apache.maven.surefire.booter.SurefireExecutionException: Unable to
> create test class 'org.apache.servicemix.jms.'; nested exception is
> java.lang.ClassNotFou
> ndException: org.apache.servicemix.jms.; nested exception is
> org.apache.maven.surefire.testset.TestSetFailedException: Unable to
> create test class 'org.apache.s
> ervicemix.jms.'; nested exception is java.lang.ClassNotFoundException:
> org.apache.servicemix.jms.
> org.apache.maven.surefire.testset.TestSetFailedException: Unable to
> create test class 'org.apache.servicemix.jms.'; nested exception is
> java.lang.ClassNotFoundE
> xception: org.apache.servicemix.jms.
> java.lang.ClassNotFoundException: org.apache.servicemix.jms.
>        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>        at 
> org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(IsolatedClassLoader.java:103) 
>
>        at 
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets(AbstractDirectoryTestSuite.java:87) 
>
>        at 
> org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.java:150) 
>
>        at org.apache.maven.surefire.Surefire.run(Surefire.java:111)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at 
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290) 
>
>        at 
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818) 
>
>
> Does this work for you ?
>
>
> On 7/3/07, aco@apache.org <aco@apache.org> wrote:
>> Author: aco
>> Date: Tue Jul  3 03:34:31 2007
>> New Revision: 552774
>>
>> URL: http://svn.apache.org/viewvc?view=rev&rev=552774
>> Log:
>> - Fix up log4j configuration in the surefire-report plugin
>> - Refactored test cases to use an abstract base class
>>
>> Added:
>>     
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/AbstractJmsTestCase.java 
>>
>> Modified:
>>     
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/pom.xml 
>>
>>     
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JMSComponentTest.java 
>>
>>     
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsConsumerEndpointTest.java 
>>
>>     
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java 
>>
>>     
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsStandardTest.java 
>>
>>     
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsURITest.java 
>>
>>     
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsXBeanDeployerTest.java 
>>
>>     
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/resources/org/apache/servicemix/jms/activemq.xml 
>>
>>
>> Modified: 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/pom.xml 
>>
>> URL: 
>> http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/pom.xml?view=diff&rev=552774&r1=552773&r2=552774 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/pom.xml 
>> (original)
>> +++ 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/pom.xml 
>> Tue Jul  3 03:34:31 2007
>> @@ -146,7 +146,7 @@
>>        <version>${spring-version}</version>
>>        <scope>provided</scope>
>>      </dependency>
>> -</dependencies>
>> +  </dependencies>
>>
>>    <build>
>>      <plugins>
>> @@ -186,6 +186,19 @@
>>          <groupId>org.apache.maven.plugins</groupId>
>>          <artifactId>maven-surefire-plugin</artifactId>
>>          <configuration>
>> +          <useFile>true</useFile>
>> +          <forkMode>once</forkMode>
>> +          <childDelegation>false</childDelegation>
>> +          <workingDirectory>${basedir}</workingDirectory>
>> +          <systemProperties>
>> +            <property>
>> +              <name>log4j.configuration</name>
>> +              <value>log4j-tests.properties</value>
>> +            </property>
>> +          </systemProperties>
>> +          <includes>
>> +            <include>**/*Test.*</include>
>> +          </includes>
>>            <excludes>
>>              <exclude>**/JmsSpringJcaTest.*</exclude>
>>            </excludes>
>>
>> Added: 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/AbstractJmsTestCase.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/AbstractJmsTestCase.java?view=auto&rev=552774 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/AbstractJmsTestCase.java 
>> (added)
>> +++ 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/AbstractJmsTestCase.java 
>> Tue Jul  3 03:34:31 2007
>> @@ -0,0 +1,107 @@
>> +/**
>> + *
>> + * Licensed to the Apache Software Foundation (ASF) under one or more
>> + * contributor license agreements.  See the NOTICE file distributed 
>> with
>> + * this work for additional information regarding copyright ownership.
>> + * The ASF licenses this file to You under the Apache License, 
>> Version 2.0
>> + * (the "License"); you may not use this file except in compliance with
>> + * the License.  You may obtain a copy of the License at
>> + *
>> + * http://www.apache.org/licenses/LICENSE-2.0
>> + *
>> + * Unless required by applicable law or agreed to in writing, software
>> + * distributed under the License is distributed on an "AS IS" BASIS,
>> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
>> implied.
>> + * See the License for the specific language governing permissions and
>> + * limitations under the License.
>> + */
>> +package org.apache.servicemix.jms;
>> +
>> +import junit.framework.TestCase;
>> +import org.apache.servicemix.jbi.container.JBIContainer;
>> +import org.apache.servicemix.client.ServiceMixClient;
>> +import org.apache.servicemix.client.DefaultServiceMixClient;
>> +import org.apache.activemq.broker.BrokerService;
>> +import org.apache.activemq.ActiveMQConnectionFactory;
>> +import org.apache.activemq.pool.PooledConnectionFactory;
>> +import org.apache.activemq.xbean.BrokerFactoryBean;
>> +import org.apache.activemq.jndi.ActiveMQInitialContextFactory;
>> +import org.springframework.jms.core.JmsTemplate;
>> +import org.springframework.core.io.ClassPathResource;
>> +import org.jencks.GeronimoPlatformTransactionManager;
>> +
>> +import javax.naming.Context;
>> +import javax.naming.InitialContext;
>> +
>> +public abstract class AbstractJmsTestCase extends TestCase {
>> +    protected JBIContainer container;
>> +    protected BrokerService broker;
>> +    protected ActiveMQConnectionFactory connectionFactory;
>> +    protected JmsTemplate jmsTemplate;
>> +    protected ServiceMixClient client;
>> +
>> +    protected void setUp() throws Exception {
>> +        createInitContext();
>> +        createJmsBroker();
>> +        createJbiContainer();
>> +        createSmxClient();
>> +        createJmsConnectionFactory();
>> +        createJmsTemplate();
>> +    }
>> +
>> +    protected void tearDown() throws Exception {
>> +        if (container != null) {
>> +            container.shutDown();
>> +        }
>> +        if (broker != null) {
>> +            broker.stop();
>> +        }
>> +    }
>> +
>> +    protected void createInitContext() throws Exception {
>> +        System.setProperty(Context.INITIAL_CONTEXT_FACTORY, 
>> ActiveMQInitialContextFactory.class.getName());
>> +        System.setProperty(Context.PROVIDER_URL, 
>> "tcp://localhost:61216");
>> +    }
>> +
>> +    protected void createJbiContainer() throws Exception {
>> +        container = new JBIContainer();
>> +        configureJbiContainer();
>> +        container.init();
>> +        container.start();
>> +    }
>> +
>> +    protected void createJmsBroker() throws Exception {
>> +        BrokerFactoryBean bfb = new BrokerFactoryBean(new 
>> ClassPathResource("org/apache/servicemix/jms/activemq.xml"));
>> +        bfb.afterPropertiesSet();
>> +        broker = bfb.getBroker();
>> +        configureJmsBroker();
>> +        broker.start();
>> +    }
>> +
>> +    protected void createSmxClient() throws Exception {
>> +        client = new DefaultServiceMixClient(container);
>> +    }
>> +
>> +    protected void createJmsConnectionFactory() throws Exception {
>> +        connectionFactory = new 
>> ActiveMQConnectionFactory("tcp://localhost:61216");
>> +    }
>> +
>> +    protected void createJmsTemplate() throws Exception {
>> +        jmsTemplate = new JmsTemplate(new 
>> PooledConnectionFactory(connectionFactory));
>> +    }
>> +
>> +    protected void configureJbiContainer() throws Exception {
>> +        container.setEmbedded(true);
>> +        container.setUseMBeanServer(false);
>> +        container.setCreateMBeanServer(false);
>> +        container.setCreateJmxConnector(false);
>> +        container.setRootDir("target/smx-data");
>> +        container.setMonitorInstallationDirectory(false);
>> +        container.setNamingContext(new InitialContext());
>> +        container.setTransactionManager(new 
>> GeronimoPlatformTransactionManager());
>> +    }
>> +
>> +    protected void configureJmsBroker() throws Exception {
>> +
>> +    }
>> +}
>>
>> Modified: 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JMSComponentTest.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JMSComponentTest.java?view=diff&rev=552774&r1=552773&r2=552774 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JMSComponentTest.java 
>> (original)
>> +++ 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JMSComponentTest.java 
>> Tue Jul  3 03:34:31 2007
>> @@ -23,65 +23,28 @@
>>  import javax.jbi.messaging.InOnly;
>>  import javax.jbi.messaging.InOut;
>>  import javax.jbi.messaging.NormalizedMessage;
>> -import javax.naming.Context;
>> -import javax.naming.InitialContext;
>>  import javax.xml.namespace.QName;
>>  import javax.xml.transform.Source;
>> +import javax.jms.Message;
>> +import javax.jms.JMSException;
>> +import javax.jms.Session;
>> +import javax.jms.TextMessage;
>>
>> -import junit.framework.TestCase;
>> -
>> -import org.apache.activemq.ActiveMQConnectionFactory;
>> -import org.apache.activemq.broker.BrokerService;
>> -import org.apache.activemq.jndi.ActiveMQInitialContextFactory;
>> -import org.apache.activemq.pool.PooledConnectionFactory;
>> -import org.apache.activemq.xbean.BrokerFactoryBean;
>> -import org.apache.servicemix.client.DefaultServiceMixClient;
>>  import org.apache.servicemix.components.jms.JmsReceiverComponent;
>>  import org.apache.servicemix.components.jms.JmsServiceComponent;
>>  import org.apache.servicemix.components.util.EchoComponent;
>>  import org.apache.servicemix.jbi.container.ActivationSpec;
>> -import org.apache.servicemix.jbi.container.JBIContainer;
>>  import org.apache.servicemix.jbi.jaxp.SourceTransformer;
>>  import org.apache.servicemix.jbi.jaxp.StringSource;
>>  import org.apache.servicemix.tck.Receiver;
>>  import org.apache.servicemix.tck.ReceiverComponent;
>> -import org.springframework.core.io.ClassPathResource;
>> -import org.springframework.jms.core.JmsTemplate;
>> +import org.apache.commons.logging.Log;
>> +import org.apache.commons.logging.LogFactory;
>> +import org.springframework.jms.core.MessageCreator;
>>
>> -public class JMSComponentTest extends TestCase {
>> +public class JMSComponentTest extends AbstractJmsTestCase {
>>
>> -    protected JBIContainer container;
>> -    protected BrokerService broker;
>> -    protected ActiveMQConnectionFactory connectionFactory;
>> -
>> -    protected void setUp() throws Exception {
>> -        System.setProperty(Context.INITIAL_CONTEXT_FACTORY, 
>> ActiveMQInitialContextFactory.class.getName());
>> -        System.setProperty(Context.PROVIDER_URL, 
>> "tcp://localhost:61216");
>> -
>> -
>> -        BrokerFactoryBean bfb = new BrokerFactoryBean(new 
>> ClassPathResource("org/apache/servicemix/jms/activemq.xml"));
>> -        bfb.afterPropertiesSet();
>> -        broker = bfb.getBroker();
>> -        broker.start();
>> -
>> -        container = new JBIContainer();
>> -        container.setUseMBeanServer(true);
>> -        container.setCreateMBeanServer(true);
>> -        container.setMonitorInstallationDirectory(false);
>> -        container.setNamingContext(new InitialContext());
>> -        container.init();
>> -
>> -        connectionFactory = new 
>> ActiveMQConnectionFactory("tcp://localhost:61216");
>> -    }
>> -
>> -    protected void tearDown() throws Exception {
>> -        if (container != null) {
>> -            container.shutDown();
>> -        }
>> -        if (broker != null) {
>> -            broker.stop();
>> -        }
>> -    }
>> +    private static Log logger =  
>> LogFactory.getLog(JMSComponentTest.class);
>>
>>      public void testProviderInOnly() throws Exception {
>>          // JMS Component
>> @@ -90,9 +53,8 @@
>>
>>          // Add a jms receiver
>>          JmsReceiverComponent jmsReceiver = new JmsReceiverComponent();
>> -        JmsTemplate template = new JmsTemplate(connectionFactory);
>> -        template.setDefaultDestinationName("queue/A");
>> -        jmsReceiver.setTemplate(template);
>> +        jmsTemplate.setDefaultDestinationName("queue/A");
>> +        jmsReceiver.setTemplate(jmsTemplate);
>>          jmsReceiver.afterPropertiesSet();
>>          ActivationSpec asJmsReceiver = new 
>> ActivationSpec("jmsReceiver", jmsReceiver);
>>          asJmsReceiver.setDestinationService(new QName("test", 
>> "receiver"));
>> @@ -103,10 +65,7 @@
>>          ActivationSpec asReceiver = new ActivationSpec("receiver", 
>> receiver);
>>          asReceiver.setService(new QName("test", "receiver"));
>>          container.activateComponent(asReceiver);
>> -
>> -        // Start container
>> -        container.start();
>> -
>> +
>>          // Deploy SU
>>          URL url = 
>> getClass().getClassLoader().getResource("provider/jms.wsdl");
>>          File path = new File(new URI(url.toString()));
>> @@ -115,7 +74,6 @@
>>          component.getServiceUnitManager().start("provider");
>>
>>          // Call it
>> -        DefaultServiceMixClient client = new 
>> DefaultServiceMixClient(container);
>>          InOnly in = client.createInOnlyExchange();
>>          in.setInterfaceName(new 
>> QName("http://jms.servicemix.org/Test", "ProviderInterface"));
>>          in.getInMessage().setContent(new 
>> StringSource("<hello>world</hello>"));
>> @@ -132,9 +90,8 @@
>>
>>          // Add a jms receiver
>>          JmsServiceComponent jmsReceiver = new JmsServiceComponent();
>> -        JmsTemplate template = new JmsTemplate(new 
>> PooledConnectionFactory(connectionFactory));
>> -        template.setDefaultDestinationName("queue/A");
>> -        jmsReceiver.setTemplate(template);
>> +        jmsTemplate.setDefaultDestinationName("queue/A");
>> +        jmsReceiver.setTemplate(jmsTemplate);
>>          jmsReceiver.afterPropertiesSet();
>>          ActivationSpec asJmsReceiver = new 
>> ActivationSpec("jmsReceiver", jmsReceiver);
>>          asJmsReceiver.setDestinationService(new QName("test", 
>> "receiver"));
>> @@ -145,10 +102,7 @@
>>          ActivationSpec asEcho = new ActivationSpec("receiver", echo);
>>          asEcho.setService(new QName("test", "receiver"));
>>          container.activateComponent(asEcho);
>> -
>> -        // Start container
>> -        container.start();
>> -
>> +
>>          // Deploy SU
>>          URL url = 
>> getClass().getClassLoader().getResource("provider/jms.wsdl");
>>          File path = new File(new URI(url.toString()));
>> @@ -157,7 +111,6 @@
>>          component.getServiceUnitManager().start("provider");
>>
>>          // Call it
>> -        DefaultServiceMixClient client = new 
>> DefaultServiceMixClient(container);
>>          InOut inout = client.createInOutExchange();
>>          inout.setInterfaceName(new 
>> QName("http://jms.servicemix.org/Test", "ProviderInterface"));
>>          inout.getInMessage().setContent(new 
>> StringSource("<hello>world</hello>"));
>> @@ -167,41 +120,44 @@
>>          assertNotNull(out);
>>          Source src = out.getContent();
>>          assertNotNull(src);
>> -        System.err.println(new SourceTransformer().toString(src));
>> +        logger.info(new SourceTransformer().toString(src));
>>      }
>>
>> -    /*
>> -     * This test is not finished.
>> -     * But the feature is actually in the testProviderConsumerInOut 
>> test
>> -     *
>>      public void testConsumerInOut() throws Exception {
>>          // JMS Component
>>          JmsComponent component = new JmsComponent();
>>          container.activateComponent(component, "JMSComponent");
>> +
>> +        // Add an echo component
>> +        EchoComponent echo = new EchoComponent();
>> +        ActivationSpec asEcho = new ActivationSpec("receiver", echo);
>> +        asEcho.setService(new 
>> QName("http://jms.servicemix.org/Test", "Echo"));
>> +        container.activateComponent(asEcho);
>>
>> -        // Start container
>> -        container.start();
>> -
>> -        // Deploy SU
>> +        // Deploy Consumer SU
>>          URL url = 
>> getClass().getClassLoader().getResource("consumer/jms.wsdl");
>>          File path = new File(new URI(url.toString()));
>>          path = path.getParentFile();
>>          component.getServiceUnitManager().deploy("consumer", 
>> path.getAbsolutePath());
>>          component.getServiceUnitManager().start("consumer");
>>
>> -        // Call it
>> -        JmsTemplate template = new JmsTemplate(new 
>> PooledConnectionFactory(connectionFactory));
>> -        template.setDefaultDestinationName("queue/A");
>> -        template.afterPropertiesSet();
>> -        template.send(new MessageCreator() {
>> +        // Send test message
>> +        jmsTemplate.setDefaultDestinationName("queue/A");
>> +        jmsTemplate.afterPropertiesSet();
>> +        jmsTemplate.send(new MessageCreator() {
>>              public Message createMessage(Session session) throws 
>> JMSException {
>> -                return 
>> session.createTextMessage("<hello>world</hello>");
>> +                Message m = 
>> session.createTextMessage("<hello>world</hello>");
>> +                m.setJMSReplyTo(session.createQueue("queue/B"));
>> +                return m;
>>              }
>>          });
>>
>> -        System.err.println("Sent");
>> +        // Receive echo message
>> +        TextMessage reply = 
>> (TextMessage)jmsTemplate.receive("queue/B");
>> +        assertNotNull(reply);
>> +        logger.info(reply.getText());
>>      }
>> -    */
>> +
>>
>>      public void testProviderConsumerInOut() throws Exception {
>>          // JMS Component
>> @@ -213,10 +169,7 @@
>>          ActivationSpec asEcho = new ActivationSpec("receiver", echo);
>>          asEcho.setService(new 
>> QName("http://jms.servicemix.org/Test", "Echo"));
>>          container.activateComponent(asEcho);
>> -
>> -        // Start container
>> -        container.start();
>> -
>> +
>>          // Deploy Provider SU
>>          {
>>              URL url = 
>> getClass().getClassLoader().getResource("provider/jms.wsdl");
>> @@ -236,7 +189,6 @@
>>          }
>>
>>          // Call it
>> -        DefaultServiceMixClient client = new 
>> DefaultServiceMixClient(container);
>>          InOut inout = client.createInOutExchange();
>>          inout.setInterfaceName(new 
>> QName("http://jms.servicemix.org/Test", "ProviderInterface"));
>>          inout.getInMessage().setContent(new 
>> StringSource("<hello>world</hello>"));
>> @@ -246,8 +198,7 @@
>>          assertNotNull(out);
>>          Source src = out.getContent();
>>          assertNotNull(src);
>> -        System.err.println(new SourceTransformer().toString(src));
>> -
>> +        logger.info(new SourceTransformer().toString(src));
>>      }
>>
>>  }
>>
>> Modified: 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsConsumerEndpointTest.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsConsumerEndpointTest.java?view=diff&rev=552774&r1=552773&r2=552774 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsConsumerEndpointTest.java 
>> (original)
>> +++ 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsConsumerEndpointTest.java 
>> Tue Jul  3 03:34:31 2007
>> @@ -20,19 +20,11 @@
>>
>>  import javax.jms.Message;
>>  import javax.jms.TextMessage;
>> -import javax.naming.Context;
>> -import javax.naming.InitialContext;
>>  import javax.xml.namespace.QName;
>>
>> -import junit.framework.TestCase;
>>
>> -import org.apache.activemq.ActiveMQConnectionFactory;
>> -import org.apache.activemq.broker.BrokerService;
>> -import org.apache.activemq.jndi.ActiveMQInitialContextFactory;
>> -import org.apache.activemq.xbean.BrokerFactoryBean;
>>  import org.apache.servicemix.components.util.EchoComponent;
>>  import org.apache.servicemix.components.util.MockServiceComponent;
>> -import org.apache.servicemix.jbi.container.JBIContainer;
>>  import org.apache.servicemix.jbi.jaxp.SourceTransformer;
>>  import org.apache.servicemix.jbi.jaxp.StringSource;
>>  import org.apache.servicemix.jbi.messaging.MessageExchangeSupport;
>> @@ -42,36 +34,20 @@
>>  import org.apache.servicemix.jms.endpoints.JmsSoapConsumerEndpoint;
>>  import org.apache.servicemix.tck.Receiver;
>>  import org.apache.servicemix.tck.ReceiverComponent;
>> -import org.jencks.GeronimoPlatformTransactionManager;
>> +import org.apache.commons.logging.Log;
>> +import org.apache.commons.logging.LogFactory;
>>  import org.springframework.core.io.ClassPathResource;
>> -import org.springframework.jms.core.JmsTemplate;
>>  import org.w3c.dom.Element;
>>
>> -public class JmsConsumerEndpointTest extends TestCase {
>> +public class JmsConsumerEndpointTest extends AbstractJmsTestCase {
>>
>> -    protected JBIContainer container;
>> -    protected BrokerService broker;
>> -    protected ActiveMQConnectionFactory connectionFactory;
>> -    private Receiver receiver;
>> -    private JmsTemplate jmsTemplate;
>> -    private SourceTransformer sourceTransformer = new 
>> SourceTransformer();
>> -
>> -    protected void setUp() throws Exception {
>> -        System.setProperty(Context.INITIAL_CONTEXT_FACTORY, 
>> ActiveMQInitialContextFactory.class.getName());
>> -        System.setProperty(Context.PROVIDER_URL, 
>> "tcp://localhost:61216");
>> +    private static Log logger =  
>> LogFactory.getLog(JmsConsumerEndpointTest.class);
>> +
>> +    protected Receiver receiver;
>> +    protected SourceTransformer sourceTransformer = new 
>> SourceTransformer();
>>
>> -        BrokerFactoryBean bfb = new BrokerFactoryBean(new 
>> ClassPathResource("org/apache/servicemix/jms/activemq.xml"));
>> -        bfb.afterPropertiesSet();
>> -        broker = bfb.getBroker();
>> -        broker.start();
>> -
>> -        container = new JBIContainer();
>> -        container.setUseMBeanServer(true);
>> -        container.setCreateMBeanServer(true);
>> -        container.setMonitorInstallationDirectory(false);
>> -        container.setNamingContext(new InitialContext());
>> -        container.setTransactionManager(new 
>> GeronimoPlatformTransactionManager());
>> -        container.init();
>> +    protected void setUp() throws Exception {
>> +        super.setUp();
>>
>>          ReceiverComponent rec = new ReceiverComponent();
>>          rec.setService(new QName("receiver"));
>> @@ -83,18 +59,6 @@
>>          echo.setService(new QName("echo"));
>>          echo.setEndpoint("endpoint");
>>          container.activateComponent(echo, "echo");
>> -
>> -        connectionFactory = new 
>> ActiveMQConnectionFactory("tcp://localhost:61216");
>> -        jmsTemplate = new JmsTemplate(connectionFactory);
>> -    }
>> -
>> -    protected void tearDown() throws Exception {
>> -        if (container != null) {
>> -            container.shutDown();
>> -        }
>> -        if (broker != null) {
>> -            broker.stop();
>> -        }
>>      }
>>
>>      public void testConsumerSimple() throws Exception {
>> @@ -108,11 +72,8 @@
>>          endpoint.setDestinationName("destination");
>>          component.setEndpoints(new JmsConsumerEndpoint[] { endpoint });
>>          container.activateComponent(component, "servicemix-jms");
>> -
>> -        container.start();
>> -
>> -        new 
>> JmsTemplate(connectionFactory).convertAndSend("destination", 
>> "<hello>world</hello>");
>> -
>> +
>> +        jmsTemplate.convertAndSend("destination", 
>> "<hello>world</hello>");
>>          receiver.getMessageList().assertMessagesReceived(1);
>>      }
>>
>> @@ -131,8 +92,7 @@
>>
>>          container.start();
>>
>> -        new 
>> JmsTemplate(connectionFactory).convertAndSend("destination", 
>> "<hello>world</hello>");
>> -
>> +        jmsTemplate.convertAndSend("destination", 
>> "<hello>world</hello>");
>>          receiver.getMessageList().assertMessagesReceived(1);
>>      }
>>
>> @@ -151,7 +111,6 @@
>>          container.start();
>>
>>          jmsTemplate.convertAndSend("destination", 
>> "<hello>world</hello>");
>> -
>>          receiver.getMessageList().assertMessagesReceived(1);
>>      }
>>
>> @@ -168,9 +127,7 @@
>>          endpoint.setMarshaler(new 
>> DefaultConsumerMarshaler(MessageExchangeSupport.IN_OUT));
>>          component.setEndpoints(new JmsConsumerEndpoint[] { endpoint });
>>          container.activateComponent(component, "servicemix-jms");
>> -
>> -        container.start();
>> -
>> +
>>          jmsTemplate.convertAndSend("destination", 
>> "<hello>world</hello>");
>>          TextMessage msg = (TextMessage) 
>> jmsTemplate.receive("replyDestination");
>>          Element e = sourceTransformer.toDOMElement(new 
>> StringSource(msg.getText()));
>> @@ -190,11 +147,8 @@
>>          endpoint.setTransacted("jms");
>>          component.setEndpoints(new JmsConsumerEndpoint[] { endpoint });
>>          container.activateComponent(component, "servicemix-jms");
>> -
>> -        container.start();
>> -
>> -        new 
>> JmsTemplate(connectionFactory).convertAndSend("destination", 
>> "<hello>world</hello>");
>> -
>> +
>> +        jmsTemplate.convertAndSend("destination", 
>> "<hello>world</hello>");
>>          receiver.getMessageList().assertMessagesReceived(1);
>>      }
>>
>> @@ -212,9 +166,7 @@
>>          endpoint.setMarshaler(new 
>> DefaultConsumerMarshaler(MessageExchangeSupport.IN_OUT));
>>          component.setEndpoints(new JmsConsumerEndpoint[] { endpoint });
>>          container.activateComponent(component, "servicemix-jms");
>> -
>> -        container.start();
>> -
>> +
>>          jmsTemplate.convertAndSend("destination", 
>> "<hello>world</hello>");
>>          TextMessage msg = (TextMessage) 
>> jmsTemplate.receive("replyDestination");
>>          Element e = sourceTransformer.toDOMElement(new 
>> StringSource(msg.getText()));
>> @@ -234,11 +186,8 @@
>>          endpoint.setTransacted("xa");
>>          component.setEndpoints(new JmsConsumerEndpoint[] { endpoint });
>>          container.activateComponent(component, "servicemix-jms");
>> -
>> -        container.start();
>> -
>> -        new 
>> JmsTemplate(connectionFactory).convertAndSend("destination", 
>> "<hello>world</hello>");
>> -
>> +
>> +        jmsTemplate.convertAndSend("destination", 
>> "<hello>world</hello>");
>>          receiver.getMessageList().assertMessagesReceived(1);
>>      }
>>
>> @@ -254,10 +203,7 @@
>>          component.setEndpoints(new JmsConsumerEndpoint[] { endpoint });
>>          container.activateComponent(component, "servicemix-jms");
>>
>> -        container.start();
>> -
>> -        new 
>> JmsTemplate(connectionFactory).convertAndSend("destination", 
>> "<hello>world</hello>");
>> -
>> +        jmsTemplate.convertAndSend("destination", 
>> "<hello>world</hello>");
>>          receiver.getMessageList().assertMessagesReceived(1);
>>      }
>>
>> @@ -274,10 +220,7 @@
>>          component.setEndpoints(new JmsConsumerEndpoint[] { endpoint });
>>          container.activateComponent(component, "servicemix-jms");
>>
>> -        container.start();
>> -
>> -        new 
>> JmsTemplate(connectionFactory).convertAndSend("destination", 
>> "<hello>world</hello>");
>> -
>> +        jmsTemplate.convertAndSend("destination", 
>> "<hello>world</hello>");
>>          receiver.getMessageList().assertMessagesReceived(1);
>>      }
>>
>> @@ -300,17 +243,14 @@
>>          mock.setEndpoint("endpoint");
>>          mock.setResponseXml("<jbi:message 
>> xmlns:jbi=\"http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper\"><jbi:part>hello</jbi:part></jbi:message>"); 
>>
>>          container.activateComponent(mock, "mock");
>> -
>> -        container.start();
>> -
>> +
>>          ByteArrayOutputStream baos = new ByteArrayOutputStream();
>>          FileUtil.copyInputStream(new 
>> ClassPathResource("org/apache/servicemix/jms/HelloWorld-RPC-Input.xml").getInputStream(), 
>> baos);
>> -        new 
>> JmsTemplate(connectionFactory).convertAndSend("destination", 
>> baos.toString());
>> +        jmsTemplate.convertAndSend("destination", baos.toString());
>>
>> -        Message msg = new 
>> JmsTemplate(connectionFactory).receive("reply");
>> +        Message msg = jmsTemplate.receive("reply");
>>          assertNotNull(msg);
>> -        //System.err.println(msg);
>> -        //System.err.println(((TextMessage) msg).getText());
>> +        logger.info(((TextMessage) msg).getText());
>>      }
>>
>>  }
>>
>> Modified: 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java?view=diff&rev=552774&r1=552773&r2=552774 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java 
>> (original)
>> +++ 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java 
>> Tue Jul  3 03:34:31 2007
>> @@ -19,64 +19,13 @@
>>  import javax.jbi.messaging.ExchangeStatus;
>>  import javax.jbi.messaging.InOnly;
>>  import javax.jms.Message;
>> -import javax.naming.Context;
>> -import javax.naming.InitialContext;
>>  import javax.xml.namespace.QName;
>>
>> -import org.apache.activemq.ActiveMQConnectionFactory;
>> -import org.apache.activemq.broker.BrokerService;
>> -import org.apache.activemq.jndi.ActiveMQInitialContextFactory;
>> -import org.apache.activemq.xbean.BrokerFactoryBean;
>> -import org.apache.servicemix.client.DefaultServiceMixClient;
>> -import org.apache.servicemix.client.ServiceMixClient;
>> -import org.apache.servicemix.jbi.container.JBIContainer;
>>  import org.apache.servicemix.jbi.jaxp.StringSource;
>>  import org.apache.servicemix.jms.endpoints.JmsProviderEndpoint;
>> -import org.jencks.GeronimoPlatformTransactionManager;
>> -import org.springframework.core.io.ClassPathResource;
>> -import org.springframework.jms.core.JmsTemplate;
>>
>> -import junit.framework.TestCase;
>> +public class JmsProviderEndpointTest extends AbstractJmsTestCase {
>>
>> -public class JmsProviderEndpointTest extends TestCase {
>> -
>> -    protected JBIContainer container;
>> -    protected BrokerService broker;
>> -    protected ActiveMQConnectionFactory connectionFactory;
>> -    private JmsTemplate jmsTemplate;
>> -    private ServiceMixClient client;
>> -
>> -    protected void setUp() throws Exception {
>> -        System.setProperty(Context.INITIAL_CONTEXT_FACTORY, 
>> ActiveMQInitialContextFactory.class.getName());
>> -        System.setProperty(Context.PROVIDER_URL, 
>> "tcp://localhost:61216");
>> -
>> -        BrokerFactoryBean bfb = new BrokerFactoryBean(new 
>> ClassPathResource("org/apache/servicemix/jms/activemq.xml"));
>> -        bfb.afterPropertiesSet();
>> -        broker = bfb.getBroker();
>> -        broker.start();
>> -
>> -        container = new JBIContainer();
>> -        container.setUseMBeanServer(true);
>> -        container.setCreateMBeanServer(true);
>> -        container.setMonitorInstallationDirectory(false);
>> -        container.setNamingContext(new InitialContext());
>> -        container.setTransactionManager(new 
>> GeronimoPlatformTransactionManager());
>> -        container.init();
>> -
>> -        client = new DefaultServiceMixClient(container);
>> -        connectionFactory = new 
>> ActiveMQConnectionFactory("tcp://localhost:61216");
>> -        jmsTemplate = new JmsTemplate(connectionFactory);
>> -    }
>> -
>> -    protected void tearDown() throws Exception {
>> -        if (container != null) {
>> -            container.shutDown();
>> -        }
>> -        if (broker != null) {
>> -            broker.stop();
>> -        }
>> -    }
>> -
>>      public void testSendSimple() throws Exception {
>>          JmsComponent component = new JmsComponent();
>>          JmsProviderEndpoint endpoint = new JmsProviderEndpoint();
>> @@ -86,8 +35,6 @@
>>          endpoint.setDestinationName("destination");
>>          component.setEndpoints(new JmsProviderEndpoint[] { endpoint });
>>          container.activateComponent(component, "servicemix-jms");
>> -
>> -        container.start();
>>
>>          InOnly me = client.createInOnlyExchange();
>>          me.getInMessage().setContent(new 
>> StringSource("<hello>world</hello>"));
>>
>> Modified: 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsStandardTest.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsStandardTest.java?view=diff&rev=552774&r1=552773&r2=552774 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsStandardTest.java 
>> (original)
>> +++ 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsStandardTest.java 
>> Tue Jul  3 03:34:31 2007
>> @@ -16,53 +16,11 @@
>>   */
>>  package org.apache.servicemix.jms;
>>
>> -import javax.naming.Context;
>> -import javax.naming.InitialContext;
>>  import javax.xml.namespace.QName;
>>
>> -import org.apache.activemq.ActiveMQConnectionFactory;
>> -import org.apache.activemq.broker.BrokerService;
>>  import org.apache.activemq.jndi.ActiveMQInitialContextFactory;
>> -import org.apache.activemq.xbean.BrokerFactoryBean;
>> -import org.apache.servicemix.jbi.container.JBIContainer;
>> -import org.springframework.core.io.ClassPathResource;
>>
>> -import junit.framework.TestCase;
>> -
>> -public class JmsStandardTest extends TestCase {
>> -
>> -    protected JBIContainer container;
>> -    protected BrokerService broker;
>> -    protected ActiveMQConnectionFactory connectionFactory;
>> -
>> -    protected void setUp() throws Exception {
>> -        System.setProperty(Context.INITIAL_CONTEXT_FACTORY, 
>> ActiveMQInitialContextFactory.class.getName());
>> -        System.setProperty(Context.PROVIDER_URL, 
>> "tcp://localhost:61216");
>> -
>> -
>> -        BrokerFactoryBean bfb = new BrokerFactoryBean(new 
>> ClassPathResource("org/apache/servicemix/jms/activemq.xml"));
>> -        bfb.afterPropertiesSet();
>> -        broker = bfb.getBroker();
>> -        broker.start();
>> -
>> -        container = new JBIContainer();
>> -        container.setUseMBeanServer(true);
>> -        container.setCreateMBeanServer(true);
>> -        container.setMonitorInstallationDirectory(false);
>> -        container.setNamingContext(new InitialContext());
>> -        container.init();
>> -
>> -        connectionFactory = new 
>> ActiveMQConnectionFactory("tcp://localhost:61216");
>> -    }
>> -
>> -    protected void tearDown() throws Exception {
>> -        if (container != null) {
>> -            container.shutDown();
>> -        }
>> -        if (broker != null) {
>> -            broker.stop();
>> -        }
>> -    }
>> +public class JmsStandardTest extends AbstractJmsTestCase {
>>
>>      public void test() throws Exception {
>>          JmsComponent jms = new JmsComponent();
>> @@ -77,6 +35,5 @@
>>          ep.setEndpoint("endpoint");
>>          jms.setEndpoints(new JmsEndpoint[] { ep });
>>          container.activateComponent(jms, "jms");
>> -        container.start();
>>      }
>>  }
>>
>> Modified: 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsURITest.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsURITest.java?view=diff&rev=552774&r1=552773&r2=552774 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsURITest.java 
>> (original)
>> +++ 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsURITest.java 
>> Tue Jul  3 03:34:31 2007
>> @@ -24,52 +24,20 @@
>>  import javax.jbi.messaging.NormalizedMessage;
>>  import javax.jbi.servicedesc.ServiceEndpoint;
>>
>> -import junit.framework.TestCase;
>> -
>> -import org.apache.activemq.ActiveMQConnectionFactory;
>> -import org.apache.activemq.broker.BrokerService;
>> -import org.apache.activemq.xbean.BrokerFactoryBean;
>>  import org.apache.servicemix.client.DefaultServiceMixClient;
>> -import org.apache.servicemix.jbi.container.JBIContainer;
>>  import org.apache.servicemix.jbi.jaxp.SourceTransformer;
>>  import org.apache.servicemix.jbi.jaxp.StringSource;
>>  import org.apache.servicemix.jbi.messaging.MessageExchangeSupport;
>>  import org.apache.servicemix.jbi.resolver.URIResolver;
>>  import org.apache.servicemix.tck.ReceiverComponent;
>> -import org.springframework.core.io.ClassPathResource;
>> +import org.apache.commons.logging.Log;
>> +import org.apache.commons.logging.LogFactory;
>>  import org.w3c.dom.DocumentFragment;
>>  import org.w3c.dom.Element;
>>
>> -public class JmsURITest extends TestCase {
>> +public class JmsURITest extends AbstractJmsTestCase {
>>
>> -    protected JBIContainer container;
>> -    protected BrokerService broker;
>> -    protected ActiveMQConnectionFactory connectionFactory;
>> -
>> -    protected void setUp() throws Exception {
>> -        BrokerFactoryBean bfb = new BrokerFactoryBean(new 
>> ClassPathResource("org/apache/servicemix/jms/activemq.xml"));
>> -        bfb.afterPropertiesSet();
>> -        broker = bfb.getBroker();
>> -        broker.start();
>> -
>> -        container = new JBIContainer();
>> -        container.setUseMBeanServer(true);
>> -        container.setCreateMBeanServer(true);
>> -        container.setMonitorInstallationDirectory(false);
>> -        container.init();
>> -        container.start();
>> -
>> -        connectionFactory = new 
>> ActiveMQConnectionFactory("tcp://localhost:61216");
>> -    }
>> -
>> -    protected void tearDown() throws Exception {
>> -        if (container != null) {
>> -            container.shutDown();
>> -        }
>> -        if (broker != null) {
>> -            broker.stop();
>> -        }
>> -    }
>> +    private static Log logger =  LogFactory.getLog(JmsURITest.class);
>>
>>      public void testResolveEndpoint() throws Exception {
>>          JmsComponent jms = new JmsComponent();
>> @@ -104,7 +72,7 @@
>>          Element elem = new SourceTransformer().toDOMElement(msg);
>>          assertEquals("http://www.w3.org/2003/05/soap-envelope", 
>> elem.getNamespaceURI());
>>          assertEquals("env:Envelope", elem.getNodeName());
>> -        System.out.println(new 
>> SourceTransformer().contentToString(msg));
>> +        logger.info(new SourceTransformer().contentToString(msg));
>>
>>          // Wait for DONE status
>>          Thread.sleep(50);
>>
>> Modified: 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsXBeanDeployerTest.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsXBeanDeployerTest.java?view=diff&rev=552774&r1=552773&r2=552774 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsXBeanDeployerTest.java 
>> (original)
>> +++ 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsXBeanDeployerTest.java 
>> Tue Jul  3 03:34:31 2007
>> @@ -23,7 +23,6 @@
>>  import javax.jbi.messaging.ExchangeStatus;
>>  import javax.jbi.messaging.InOut;
>>  import javax.jbi.servicedesc.ServiceEndpoint;
>> -import javax.naming.Context;
>>  import javax.wsdl.Binding;
>>  import javax.wsdl.Definition;
>>  import javax.wsdl.Port;
>> @@ -32,58 +31,18 @@
>>  import javax.wsdl.factory.WSDLFactory;
>>  import javax.xml.namespace.QName;
>>
>> -import junit.framework.TestCase;
>> -
>> -import org.apache.activemq.ActiveMQConnectionFactory;
>> -import org.apache.activemq.broker.BrokerService;
>> -import org.apache.activemq.jndi.ActiveMQInitialContextFactory;
>> -import org.apache.activemq.xbean.BrokerFactoryBean;
>>  import org.apache.commons.logging.Log;
>>  import org.apache.commons.logging.LogFactory;
>> -import org.apache.servicemix.client.DefaultServiceMixClient;
>>  import org.apache.servicemix.components.util.EchoComponent;
>>  import org.apache.servicemix.jbi.container.ActivationSpec;
>> -import org.apache.servicemix.jbi.container.JBIContainer;
>>  import org.apache.servicemix.jbi.jaxp.SourceTransformer;
>>  import org.apache.servicemix.jbi.jaxp.StringSource;
>> -import org.springframework.core.io.ClassPathResource;
>>  import org.w3c.dom.Document;
>>
>> -public class JmsXBeanDeployerTest extends TestCase {
>> +public class JmsXBeanDeployerTest extends AbstractJmsTestCase {
>>
>>      private static Log logger =  
>> LogFactory.getLog(JmsXBeanDeployerTest.class);
>>
>> -    protected JBIContainer container;
>> -    protected BrokerService broker;
>> -    protected ActiveMQConnectionFactory connectionFactory;
>> -
>> -    protected void setUp() throws Exception {
>> -        System.setProperty(Context.INITIAL_CONTEXT_FACTORY, 
>> ActiveMQInitialContextFactory.class.getName());
>> -        System.setProperty(Context.PROVIDER_URL, 
>> "tcp://localhost:61216");
>> -
>> -        BrokerFactoryBean bfb = new BrokerFactoryBean(new 
>> ClassPathResource("org/apache/servicemix/jms/activemq.xml"));
>> -        bfb.afterPropertiesSet();
>> -        broker = bfb.getBroker();
>> -        broker.start();
>> -
>> -        container = new JBIContainer();
>> -        //container.setUseMBeanServer(false);
>> -        //container.setCreateMBeanServer(false);
>> -        container.setEmbedded(true);
>> -        container.init();
>> -
>> -        connectionFactory = new 
>> ActiveMQConnectionFactory("tcp://localhost:61216");
>> -    }
>> -
>> -    protected void tearDown() throws Exception {
>> -        if (container != null) {
>> -            container.shutDown();
>> -        }
>> -        if (broker != null) {
>> -            broker.stop();
>> -        }
>> -    }
>> -
>>      public void test() throws Exception {
>>          // JMS Component
>>          JmsComponent component = new JmsComponent();
>> @@ -112,8 +71,7 @@
>>                      def.addPortType(type);
>>                      def.addBinding(binding);
>>                      def.addService(svc);
>> -                    Document doc = 
>> WSDLFactory.newInstance().newWSDLWriter().getDocument(def);
>> -                    return doc;
>> +                    return 
>> WSDLFactory.newInstance().newWSDLWriter().getDocument(def);
>>                  } catch (Exception e) {
>>                      throw new RuntimeException(e);
>>                  }
>> @@ -123,9 +81,6 @@
>>          asEcho.setService(new QName("http://test", 
>> "MyConsumerService"));
>>          container.activateComponent(asEcho);
>>
>> -        // Start container
>> -        container.start();
>> -
>>          // Deploy SU
>>          URL url = 
>> getClass().getClassLoader().getResource("xbean/xbean.xml");
>>          File path = new File(new URI(url.toString()));
>> @@ -142,7 +97,6 @@
>>                          new QName("http://test", 
>> "MyConsumerService"))[0]));
>>
>>          // Test
>> -        DefaultServiceMixClient client = new 
>> DefaultServiceMixClient(container);
>>          InOut me = client.createInOutExchange();
>>          me.setService(new QName("http://test", "MyProviderService"));
>>          me.getInMessage().setContent(new StringSource("<echo 
>> xmlns='http://test'><echoin0>world</echoin0></echo>"));
>> @@ -187,8 +141,7 @@
>>                      def.addPortType(type);
>>                      def.addBinding(binding);
>>                      def.addService(svc);
>> -                    Document doc = 
>> WSDLFactory.newInstance().newWSDLWriter().getDocument(def);
>> -                    return doc;
>> +                    return 
>> WSDLFactory.newInstance().newWSDLWriter().getDocument(def);
>>                  } catch (Exception e) {
>>                      throw new RuntimeException(e);
>>                  }
>> @@ -197,9 +150,6 @@
>>          asEcho.setEndpoint("myConsumer");
>>          asEcho.setService(new QName("http://test", 
>> "MyConsumerService"));
>>          container.activateComponent(asEcho);
>> -
>> -        // Start container
>> -        container.start();
>>
>>          // Deploy SU
>>          URL url = 
>> getClass().getClassLoader().getResource("xbean/xbean.xml");
>> @@ -214,7 +164,6 @@
>>                          new QName("http://test", 
>> "MyConsumerService"))[0]));
>>
>>          // Test
>> -        DefaultServiceMixClient client = new 
>> DefaultServiceMixClient(container);
>>          InOut me = client.createInOutExchange();
>>          me.setService(new QName("http://test", "MyProviderService"));
>>          me.getInMessage().setContent(new StringSource("<echo 
>> xmlns='http://test'><echoin0>world</echoin0></echo>"));
>>
>> Modified: 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/resources/org/apache/servicemix/jms/activemq.xml 
>>
>> URL: 
>> http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/resources/org/apache/servicemix/jms/activemq.xml?view=diff&rev=552774&r1=552773&r2=552774 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/resources/org/apache/servicemix/jms/activemq.xml 
>> (original)
>> +++ 
>> incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-jms/src/test/resources/org/apache/servicemix/jms/activemq.xml 
>> Tue Jul  3 03:34:31 2007
>> @@ -21,7 +21,7 @@
>>  <!-- START SNIPPET: xbean -->
>>  <beans>
>>
>> -  <broker persistent="false" xmlns="http://activemq.org/config/1.0">
>> +  <broker persistent="false" useJmx="false" 
>> xmlns="http://activemq.org/config/1.0">
>>
>>      <transportConnectors>
>>        <transportConnector uri="tcp://localhost:61216" />
>>
>>
>>
>
>


Mime
View raw message