servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r596196 - in /servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test: java/org/apache/servicemix/cxfbc/CxfBcProviderConsumerTest.java resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml
Date Mon, 19 Nov 2007 04:37:46 GMT
Author: ffang
Date: Sun Nov 18 20:37:46 2007
New Revision: 596196

URL: http://svn.apache.org/viewvc?rev=596196&view=rev
Log:
add test to illustrate how cxf-bc provider and consumer play the role as a bridge

Added:
    servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderConsumerTest.java
  (with props)
    servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml
  (with props)

Added: servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderConsumerTest.java
URL: http://svn.apache.org/viewvc/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderConsumerTest.java?rev=596196&view=auto
==============================================================================
--- servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderConsumerTest.java
(added)
+++ servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderConsumerTest.java
Sun Nov 18 20:37:46 2007
@@ -0,0 +1,69 @@
+/*
+ * 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.cxfbc;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.calculator.CalculatorImpl;
+import org.apache.cxf.calculator.CalculatorPortType;
+import org.apache.cxf.calculator.CalculatorService;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.servicemix.tck.SpringTestSupport;
+import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+
+public class CxfBcProviderConsumerTest extends SpringTestSupport {
+
+    public void testBridge() throws Exception {
+        // start external service
+        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
+        factory.setServiceClass(CalculatorPortType.class);
+        factory.setServiceBean(new CalculatorImpl());
+        String address = "http://localhost:9001/bridgetest";
+        factory.setAddress(address);
+        Server server = factory.create();
+        Endpoint endpoint = server.getEndpoint();
+        endpoint.getInInterceptors().add(new LoggingInInterceptor());
+        endpoint.getOutInterceptors().add(new LoggingOutInterceptor());
+        ServiceInfo service = endpoint.getEndpointInfo().getService();
+        assertNotNull(service);
+
+        // start external client
+        URL wsdl = getClass().getResource("/wsdl/calculator.wsdl");
+        assertNotNull(wsdl);
+        CalculatorService service1 = new CalculatorService(wsdl, new QName(
+                "http://apache.org/cxf/calculator", "CalculatorService"));
+        CalculatorPortType port = service1.getCalculatorPort();
+        int ret = port.add(1, 2);
+        assertEquals(ret, 3);
+
+    }
+
+    @Override
+    protected AbstractXmlApplicationContext createBeanFactory() {
+        return new ClassPathXmlApplicationContext(
+                "org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml");
+    }
+
+}

Propchange: servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderConsumerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderConsumerTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml
URL: http://svn.apache.org/viewvc/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml?rev=596196&view=auto
==============================================================================
--- servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml
(added)
+++ servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml
Sun Nov 18 20:37:46 2007
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  
+  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.
+  
+-->
+<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
+       xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
+       xmlns:calculator="http://apache.org/cxf/calculator">
+  
+  <sm:container id="jbi" embedded="true">
+    
+    <sm:endpoints>
+      <cxfbc:consumer wsdl="/wsdl/calculator.wsdl"
+                      service="calculator:CalculatorService"
+                      endpoint="CalculatorPort"
+                      targetEndpoint="CalculatorPortProxy"
+                      targetService="calculator:CalculatorService"
+                      targetInterface="calculator:CalculatorPortType">
+          <cxfbc:inInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+          </cxfbc:inInterceptors>
+          <cxfbc:outInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+          </cxfbc:outInterceptors>
+          <cxfbc:inFaultInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+          </cxfbc:inFaultInterceptors>
+          <cxfbc:outFaultInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+          </cxfbc:outFaultInterceptors>
+      </cxfbc:consumer>
+
+      <cxfbc:provider wsdl="/wsdl/calculator.wsdl"
+                      locationURI="http://localhost:9001/bridgetest"
+                      service="calculator:CalculatorService"
+                      endpoint="CalculatorPortProxy"
+                      interfaceName="calculator:CalculatorPortType"
+                     >
+          <cxfbc:inInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+          </cxfbc:inInterceptors>
+          <cxfbc:outInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+          </cxfbc:outInterceptors>
+          <cxfbc:inFaultInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+          </cxfbc:inFaultInterceptors>
+          <cxfbc:outFaultInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+          </cxfbc:outFaultInterceptors>
+      </cxfbc:provider> 
+    </sm:endpoints>
+    
+  </sm:container>
+  
+</beans>

Propchange: servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message