Author: gertv
Date: Fri Apr 16 18:15:00 2010
New Revision: 935015

URL: http://svn.apache.org/viewvc?rev=935015&view=rev
Log:
SMXCOMP-737: MEP parameter gets appended to service/endpoint name

Modified:
    
servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiEndpoint.java
    
servicemix/components/engines/servicemix-camel/trunk/src/test/java/org/apache/servicemix/camel/JbiComponentTest.java

Modified: 
servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiEndpoint.java
URL: 
http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiEndpoint.java?rev=935015&r1=935014&r2=935015&view=diff
==============================================================================
--- 
servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiEndpoint.java
 (original)
+++ 
servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiEndpoint.java
 Fri Apr 16 18:15:00 2010
@@ -141,10 +141,12 @@ public class JbiEndpoint extends Default
                 mep = (String) params.get("mep");
                 if (mep != null && 
!mep.startsWith("http://www.w3.org/ns/wsdl/";)) {
                     mep = "http://www.w3.org/ns/wsdl/"; + mep;
+                    params.remove("mep");
                 }
                 String oper = (String) params.get("operation");
                 if (StringUtils.hasLength(oper)) {
                     operation = QName.valueOf(oper);
+                    params.remove("operation");
                 }
                 this.destinationUri = destinationUri.substring(0, idx);
 

Modified: 
servicemix/components/engines/servicemix-camel/trunk/src/test/java/org/apache/servicemix/camel/JbiComponentTest.java
URL: 
http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-camel/trunk/src/test/java/org/apache/servicemix/camel/JbiComponentTest.java?rev=935015&r1=935014&r2=935015&view=diff
==============================================================================
--- 
servicemix/components/engines/servicemix-camel/trunk/src/test/java/org/apache/servicemix/camel/JbiComponentTest.java
 (original)
+++ 
servicemix/components/engines/servicemix-camel/trunk/src/test/java/org/apache/servicemix/camel/JbiComponentTest.java
 Fri Apr 16 18:15:00 2010
@@ -16,6 +16,8 @@
  */
 package org.apache.servicemix.camel;
 
+import javax.xml.namespace.QName;
+
 import junit.framework.TestCase;
 
 /**
@@ -27,10 +29,20 @@ public class JbiComponentTest extends Te
     
     public void testGetUriWithMep() throws Exception {
         JbiComponent component = createJbiComponent();
-        JbiEndpoint endpoint = (JbiEndpoint) 
component.createEndpoint("jbi:endpoint:urn:test:service?mep=in-out");
-        assertEquals(IN_OUT, endpoint.getMep());        
+        JbiEndpoint endpoint =
+                (JbiEndpoint) 
component.createEndpoint("jbi:endpoint:urn:test:service:endpoint?mep=in-out");
+        assertEquals(IN_OUT, endpoint.getMep());
+        assertEquals("endpoint:urn:test:service:endpoint", 
endpoint.getEndpointUri());
     }
-    
+
+    public void testGetUriWithOperation() throws Exception {
+        JbiComponent component = createJbiComponent();
+        JbiEndpoint endpoint =
+                (JbiEndpoint) 
component.createEndpoint("jbi:endpoint:urn:test:service:endpoint?operation=doSomething");
+        assertEquals(new QName("doSomething"), endpoint.getOperation());
+        assertEquals("endpoint:urn:test:service:endpoint", 
endpoint.getEndpointUri());
+    }
+
     public void testNullWhenNoJbiUri() throws Exception {
         
assertNull(createJbiComponent().createEndpoint("somethingelse:service:urn:test"));
     }


Reply via email to