servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r387868 - in /incubator/servicemix/trunk/servicemix-jms: ./ src/main/java/org/apache/servicemix/jms/ src/test/java/org/apache/servicemix/jms/ src/test/resources/xbean/
Date Wed, 22 Mar 2006 14:37:02 GMT
Author: gnodet
Date: Wed Mar 22 06:37:00 2006
New Revision: 387868

URL: http://svn.apache.org/viewcvs?rev=387868&view=rev
Log:
Fix servicemix-jms tests with maven

Modified:
    incubator/servicemix/trunk/servicemix-jms/project.xml
    incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/MultiplexingConsumerProcessor.java
    incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/MultiplexingProviderProcessor.java
    incubator/servicemix/trunk/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsXBeanDeployerTest.java
    incubator/servicemix/trunk/servicemix-jms/src/test/resources/xbean/xbean.xml

Modified: incubator/servicemix/trunk/servicemix-jms/project.xml
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-jms/project.xml?rev=387868&r1=387867&r2=387868&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-jms/project.xml (original)
+++ incubator/servicemix/trunk/servicemix-jms/project.xml Wed Mar 22 06:37:00 2006
@@ -105,6 +105,16 @@
         <artifactId>geronimo-jms_1.1_spec</artifactId>
         <version>${geronimo_spec_jms_version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-activation_1.0.2_spec</artifactId>
+        <version>${geronimo_spec_activation_version}</version>
+      </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-javamail_1.3.1_spec</artifactId>
+      <version>${geronimo_spec_javamail_version}</version>
+    </dependency>
       <!-- dependency>
         <groupId>servicemix</groupId>
         <artifactId>jaxp</artifactId>
@@ -213,6 +223,43 @@
         <groupId>xml-apis</groupId>
         <artifactId>xml-apis</artifactId>
         <version>${xml_apis_version}</version>
+      </dependency>
+      <dependency>
+        <id>stax+api</id>
+        <version>${stax_api_version}</version>
+        <properties>
+          <scope>test</scope>
+        </properties>
+      </dependency>
+      <dependency>
+        <groupId>woodstox</groupId>
+        <artifactId>wstx-asl</artifactId>
+        <version>${woodstox_version}</version>
+        <properties>
+          <scope>test</scope>
+        </properties>
+      </dependency>
+      <dependency>
+        <groupId>servicemix</groupId>
+        <artifactId>stax-utils</artifactId>
+        <version>${stax_utils_version}</version>
+        <properties>
+          <scope>test</scope>
+        </properties>
+      </dependency>
+      <dependency>
+        <id>log4j</id>
+        <version>${log4j_version}</version>
+        <properties>
+          <scope>test</scope>
+        </properties>
+      </dependency>
+      <dependency>
+        <id>xalan</id>
+        <version>${xalan_version}</version>
+        <properties>
+          <scope>test</scope>
+        </properties>
       </dependency>
       
       <dependency>

Modified: incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/MultiplexingConsumerProcessor.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/MultiplexingConsumerProcessor.java?rev=387868&r1=387867&r2=387868&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/MultiplexingConsumerProcessor.java
(original)
+++ incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/MultiplexingConsumerProcessor.java
Wed Mar 22 06:37:00 2006
@@ -36,6 +36,8 @@
 import javax.resource.spi.work.Work;
 import javax.resource.spi.work.WorkException;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.common.BaseLifeCycle;
 import org.apache.servicemix.soap.SoapFault;
 import org.apache.servicemix.soap.SoapHelper;
@@ -49,6 +51,8 @@
 
 public class MultiplexingConsumerProcessor extends AbstractJmsProcessor implements MessageListener
{
 
+    private static final Log log = LogFactory.getLog(MultiplexingConsumerProcessor.class);
+    
     protected Session session;
     protected Destination destination;
     protected MessageConsumer consumer;
@@ -97,11 +101,17 @@
 
     public void onMessage(final Message message) {
         try {
+            if (log.isDebugEnabled()) {
+                log.debug("Received jms message " + message);
+            }
             endpoint.getServiceUnit().getComponent().getWorkManager().scheduleWork(new Work()
{
                 public void release() {
                 }
                 public void run() {
                     try {
+                        if (log.isDebugEnabled()) {
+                            log.debug("Handling jms message " + message);
+                        }
                         InputStream is = null;
                         if (message instanceof TextMessage) {
                             is = new ByteArrayInputStream(((TextMessage) message).getText().getBytes());
@@ -121,16 +131,13 @@
                         pendingMessages.put(exchange.getExchangeId(), message);
                         BaseLifeCycle lf = (BaseLifeCycle) endpoint.getServiceUnit().getComponent().getLifeCycle();
                         lf.sendConsumerExchange(exchange, MultiplexingConsumerProcessor.this);
-                        
-                    } catch (Exception e) {
-                        // TODO: log exception
-                        e.printStackTrace();
+                    } catch (Throwable e) {
+                        log.error("Error while handling jms message", e);
                     }
                 }
             });
         } catch (WorkException e) {
-            // TODO: log exception
-            e.printStackTrace();
+            log.error("Error while handling jms message", e);
         }
     }
 

Modified: incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/MultiplexingProviderProcessor.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/MultiplexingProviderProcessor.java?rev=387868&r1=387867&r2=387868&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/MultiplexingProviderProcessor.java
(original)
+++ incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/MultiplexingProviderProcessor.java
Wed Mar 22 06:37:00 2006
@@ -42,6 +42,8 @@
 import javax.resource.spi.work.Work;
 import javax.resource.spi.work.WorkException;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.JbiConstants;
 import org.apache.servicemix.soap.marshalers.JBIMarshaler;
 import org.apache.servicemix.soap.marshalers.SoapMarshaler;
@@ -52,6 +54,8 @@
 
 public class MultiplexingProviderProcessor extends AbstractJmsProcessor implements MessageListener
{
 
+    private static final Log log = LogFactory.getLog(MultiplexingProviderProcessor.class);
+    
     protected Session session;
     protected Destination destination;
     protected Destination replyToDestination;
@@ -103,11 +107,17 @@
 
     public void onMessage(final Message message) {
         try {
+            if (log.isDebugEnabled()) {
+                log.debug("Received jms message " + message);
+            }
             endpoint.getServiceUnit().getComponent().getWorkManager().scheduleWork(new Work()
{
                 public void release() {
                 }
                 public void run() {
                     try {
+                        if (log.isDebugEnabled()) {
+                            log.debug("Handling jms message " + message);
+                        }
                         InOut exchange = (InOut) pendingExchanges.remove(message.getJMSCorrelationID());
                         if (exchange == null) {
                             throw new IllegalStateException("Could not find exchange " +
message.getJMSCorrelationID());
@@ -138,15 +148,13 @@
                             ((InOut) exchange).setOutMessage(out);
                         }
                         channel.send(exchange);
-                    } catch (Exception e) {
-                        // TODO: log exception
-                        e.printStackTrace();
+                    } catch (Throwable e) {
+                        log.error("Error while handling jms message", e);
                     }
                 }
             });
         } catch (WorkException e) {
-            // TODO: log exception
-            e.printStackTrace();
+            log.error("Error while handling jms message", e);
         }
     }
 

Modified: incubator/servicemix/trunk/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsXBeanDeployerTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsXBeanDeployerTest.java?rev=387868&r1=387867&r2=387868&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsXBeanDeployerTest.java
(original)
+++ incubator/servicemix/trunk/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsXBeanDeployerTest.java
Wed Mar 22 06:37:00 2006
@@ -60,7 +60,6 @@
     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();
@@ -68,8 +67,8 @@
         broker.start();
         
         container = new JBIContainer();
-        container.setUseMBeanServer(false);
-        container.setCreateMBeanServer(false);
+        //container.setUseMBeanServer(false);
+        //container.setCreateMBeanServer(false);
         container.setEmbedded(true);
         container.init();
         
@@ -88,7 +87,7 @@
     public void test() throws Exception {
         // JMS Component
         JmsComponent component = new JmsComponent();
-        container.activateComponent(component, "JMSComponent");
+        container.activateComponent(component, "JMSComponent1");
         
         // Add a receiver component
         ActivationSpec asEcho = new ActivationSpec("echo", new EchoComponent() {
@@ -163,7 +162,7 @@
     public void testSoap() throws Exception {
         // JMS Component
         JmsComponent component = new JmsComponent();
-        container.activateComponent(component, "JMSComponent");
+        container.activateComponent(component, "JMSComponent2");
         
         // Add a receiver component
         ActivationSpec asEcho = new ActivationSpec("echo", new EchoComponent() {

Modified: incubator/servicemix/trunk/servicemix-jms/src/test/resources/xbean/xbean.xml
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-jms/src/test/resources/xbean/xbean.xml?rev=387868&r1=387867&r2=387868&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-jms/src/test/resources/xbean/xbean.xml (original)
+++ incubator/servicemix/trunk/servicemix-jms/src/test/resources/xbean/xbean.xml Wed Mar 22
06:37:00 2006
@@ -13,8 +13,8 @@
                   endpoint="myConsumer"
                   role="consumer" 
                   destinationStyle="queue"
-		          jmsProviderDestinationName="queue/A"
-		          jndiConnectionFactoryName="ConnectionFactory"
+                  jmsProviderDestinationName="queue/A"
+                  jndiConnectionFactoryName="ConnectionFactory"
                   defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
                   defaultOperation="test:Echo" />
     <!-- END SNIPPET: consumer -->
@@ -23,8 +23,8 @@
                   endpoint="myConsumer"
                   role="consumer"
                   destinationStyle="queue"
-		          jmsProviderDestinationName="queue/A/Soap"
-		          jndiConnectionFactoryName="ConnectionFactory"
+                  jmsProviderDestinationName="queue/A/Soap"
+                  jndiConnectionFactoryName="ConnectionFactory"
                   soap="true"
                   defaultMep="http://www.w3.org/2004/08/wsdl/in-out" />
 
@@ -33,8 +33,8 @@
                   endpoint="myProvider"
                   role="provider" 
                   destinationStyle="queue"
-		          jmsProviderDestinationName="queue/A"
-		          jndiConnectionFactoryName="ConnectionFactory"
+                  jmsProviderDestinationName="queue/A"
+                  jndiConnectionFactoryName="ConnectionFactory"
                   wsdlResource="classpath:provider.wsdl" />
     <!-- END SNIPPET: provider -->
 
@@ -42,8 +42,8 @@
                   endpoint="myProvider"
                   role="provider" 
                   destinationStyle="queue"
-		          jmsProviderDestinationName="queue/A/Soap"
-		          jndiConnectionFactoryName="ConnectionFactory"
-		          soap="true"/>
+                  jmsProviderDestinationName="queue/A/Soap"
+                  jndiConnectionFactoryName="ConnectionFactory"
+                  soap="true"/>
   				   
 </beans>



Mime
View raw message