activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r522542 - in /activemq/camel/trunk/camel-jbi/src: main/java/org/apache/camel/component/jbi/ test/java/org/apache/camel/component/jbi/
Date Mon, 26 Mar 2007 15:18:35 GMT
Author: gnodet
Date: Mon Mar 26 08:18:34 2007
New Revision: 522542

URL: http://svn.apache.org/viewvc?view=rev&rev=522542
Log:
Fix jbi test cases.

Modified:
    activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiComponent.java
    activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/JbiEndpoint.java
    activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiTestSupport.java
    activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiThenRouteToAnotherJbiComponentTest.java

Modified: activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiComponent.java?view=diff&rev=522542&r1=522541&r2=522542
==============================================================================
--- activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiComponent.java
(original)
+++ activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiComponent.java
Mon Mar 26 08:18:34 2007
@@ -139,15 +139,15 @@
     public CamelJbiEndpoint activateJbiEndpoint(JbiEndpoint camelEndpoint) throws Exception
{
         CamelJbiEndpoint jbiEndpoint = null;
         String endpointUri = camelEndpoint.getEndpointUri();
-        if (endpointUri.startsWith("service:")) {
+        if (endpointUri.startsWith("endpoint:")) {
             // lets decode "service:serviceNamespace:serviceName:endpointName
-            String uri = endpointUri.substring("service:".length());
+            String uri = endpointUri.substring("endpoint:".length());
             String[] parts = new String[0];
             try {
                 parts = URIResolver.split3(uri);
             }
             catch (IllegalArgumentException e) {
-                throw new IllegalArgumentException("Expected syntax service:serviceNamespace:serviceName:endpointName
but was given: " + endpointUri + ". Cause: " + e, e);
+                throw new IllegalArgumentException("Expected syntax endpoint:[serviceNamespace]:[serviceName]:[endpointName]
but was given: " + endpointUri + ". Cause: " + e, e);
             }
             QName service = new QName(parts[0], parts[1]);
             String endpoint = parts[2];

Modified: activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/JbiEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/JbiEndpoint.java?view=diff&rev=522542&r1=522541&r2=522542
==============================================================================
--- activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/JbiEndpoint.java
(original)
+++ activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/JbiEndpoint.java
Mon Mar 26 08:18:34 2007
@@ -19,6 +19,7 @@
 
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
 import org.apache.camel.impl.DefaultEndpoint;
 
 /**
@@ -27,7 +28,7 @@
  * @version $Revision$
  */
 public class JbiEndpoint extends DefaultEndpoint<Exchange> {
-    private ToJbiProcessor toJbiProcessor;
+    private Processor<Exchange> toJbiProcessor;
     private final CamelJbiComponent jbiComponent;
 
     public JbiEndpoint(CamelJbiComponent jbiComponent, String uri) {
@@ -40,7 +41,10 @@
      * Sends a message into JBI
      */
     public void onExchange(Exchange exchange) {
-        toJbiProcessor.onExchange(exchange);
+        if (getInboundProcessor() != null) {
+            getInboundProcessor().onExchange(exchange);
+        } else {
+            toJbiProcessor.onExchange(exchange);        }
     }
 
     @Override

Modified: activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiTestSupport.java?view=diff&rev=522542&r1=522541&r2=522542
==============================================================================
--- activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiTestSupport.java
(original)
+++ activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiTestSupport.java
Mon Mar 26 08:18:34 2007
@@ -42,7 +42,7 @@
     protected SpringJBIContainer jbiContainer = new SpringJBIContainer();
     protected CountDownLatch latch = new CountDownLatch(1);
     protected Endpoint<Exchange> endpoint;
-    protected String startEndpointUri = "jbi:service:serviceNamespace:serviceA";
+    protected String startEndpointUri = "jbi:endpoint:serviceNamespace:serviceA:endpointA";
 
     /**
      * Sends an exchange to the endpoint

Modified: activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiThenRouteToAnotherJbiComponentTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiThenRouteToAnotherJbiComponentTest.java?view=diff&rev=522542&r1=522541&r2=522542
==============================================================================
--- activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiThenRouteToAnotherJbiComponentTest.java
(original)
+++ activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiThenRouteToAnotherJbiComponentTest.java
Mon Mar 26 08:18:34 2007
@@ -48,7 +48,7 @@
     protected RouteBuilder createRoutes() {
         return new RouteBuilder() {
             public void configure() {
-                from("jbi:service:serviceNamespace:serviceA:endpointA").to("jbi:service:serviceNamespace:serviceB");
+                from("jbi:endpoint:serviceNamespace:serviceA:endpointA").to("jbi:endpoint:serviceNamespace:serviceB:endpointB");
             }
         };
     }



Mime
View raw message