servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r663610 - in /servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src: main/java/org/apache/servicemix/cxfbc/ test/java/org/apache/servicemix/cxfbc/provider/
Date Thu, 05 Jun 2008 13:51:29 GMT
Author: ffang
Date: Thu Jun  5 06:51:28 2008
New Revision: 663610

URL: http://svn.apache.org/viewvc?rev=663610&view=rev
Log:
[SM-1379]CXF BC provider should support dynamic HTTP location URI

Modified:
    servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
    servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/CxfBCSEProviderSystemTest.java
    servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/MyServer.java

Modified: servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java?rev=663610&r1=663609&r2=663610&view=diff
==============================================================================
--- servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
(original)
+++ servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
Thu Jun  5 06:51:28 2008
@@ -138,6 +138,11 @@
         }
         NormalizedMessage nm = exchange.getMessage("in");
 
+        Object newDestinationURI = nm.getProperty(JbiConstants.HTTP_DESTINATION_URI);
+        if (newDestinationURI != null) {
+            ei.setAddress((String) newDestinationURI);
+        }
+        
         Conduit conduit = conduitInit.getConduit(ei);
         CxfBcProviderMessageObserver obs = new CxfBcProviderMessageObserver(
                 exchange, this);

Modified: servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/CxfBCSEProviderSystemTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/CxfBCSEProviderSystemTest.java?rev=663610&r1=663609&r2=663610&view=diff
==============================================================================
--- servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/CxfBCSEProviderSystemTest.java
(original)
+++ servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/CxfBCSEProviderSystemTest.java
Thu Jun  5 06:51:28 2008
@@ -28,6 +28,7 @@
 
 import org.apache.cxf.testutil.common.ServerLauncher;
 
+import org.apache.servicemix.JbiConstants;
 import org.apache.servicemix.client.DefaultServiceMixClient;
 import org.apache.servicemix.jbi.container.SpringJBIContainer;
 import org.apache.servicemix.jbi.jaxp.SourceTransformer;
@@ -113,10 +114,15 @@
 
     public void testGreetMeProviderWithOutJBIWrapper() throws Exception {
         setUpJBI("org/apache/servicemix/cxfbc/provider/xbean_provider_without_jbi_wrapper.xml");
-        greetMeProviderTestBase();
+        greetMeProviderTestBase(false);
+    }
+    
+    public void testGreetMeProviderWithDynamicUri() throws Exception {
+        setUpJBI("org/apache/servicemix/cxfbc/provider/xbean_provider_without_jbi_wrapper.xml");
+        greetMeProviderTestBase(true);
     }
         
-    private void greetMeProviderTestBase() throws Exception {
+    private void greetMeProviderTestBase(boolean useDynamicUri) throws Exception {
 
         client = new DefaultServiceMixClient(jbi);
         io = client.createInOutExchange();
@@ -128,6 +134,9 @@
               "<greetMe xmlns='http://apache.org/hello_world_soap_http_provider/types'><requestType>"
               + "Edell"
               + "</requestType></greetMe>"));
+        if (useDynamicUri) {
+            io.getInMessage().setProperty(JbiConstants.HTTP_DESTINATION_URI, "http://localhost:9002/dynamicuritest");
+        }
         client.sendSync(io);
         assertTrue(new SourceTransformer().contentToString(
                 io.getOutMessage()).indexOf("Hello Edell") >= 0);        

Modified: servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/MyServer.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/MyServer.java?rev=663610&r1=663609&r2=663610&view=diff
==============================================================================
--- servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/MyServer.java
(original)
+++ servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/MyServer.java
Thu Jun  5 06:51:28 2008
@@ -24,8 +24,10 @@
     protected void run() {
         System.out.println("Starting Server");
         Object implementor = new GreeterImpl();
-        String address = "http://localhost:9000/SoapContext/SoapPort";
-        Endpoint.publish(address, implementor);
+        String address1 = "http://localhost:9000/SoapContext/SoapPort";
+        String address2 = "http://localhost:9002/dynamicuritest";
+        Endpoint.publish(address1, implementor);
+        Endpoint.publish(address2, implementor);
     }
   
     public static void main(String args[]) throws Exception {



Mime
View raw message