You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2008/11/18 08:17:40 UTC

svn commit: r718515 - in /activemq/camel/trunk/components/camel-cxf/src: main/java/org/apache/camel/component/cxf/ main/resources/META-INF/ test/java/org/apache/camel/component/cxf/ test/java/org/apache/camel/wsdl_first/ test/resources/org/apache/camel...

Author: ningjiang
Date: Mon Nov 17 23:17:39 2008
New Revision: 718515

URL: http://svn.apache.org/viewvc?rev=718515&view=rev
Log:
Updated the spring.schemas file in camel-cxf, also added a JAXWS Handler test for the WebServiceProvider

Modified:
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
    activemq/camel/trunk/components/camel-cxf/src/main/resources/META-INF/spring.schemas
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/wsdl_first/JaxwsTestHandler.java
    activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/SoapMessageProviderContext.xml

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java?rev=718515&r1=718514&r2=718515&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java Mon Nov 17 23:17:39 2008
@@ -93,8 +93,8 @@
         boolean jsr181Enabled = CxfEndpointUtils.hasWebServiceAnnotation(serviceClass);
         cfb.setJSR181Enabled(jsr181Enabled);
        
-        return createClientFromClientFactoryBean(jsr181Enabled ? new JaxWsProxyFactoryBean(cfb) :
-            new ClientProxyFactoryBean(cfb));
+        return createClientFromClientFactoryBean(jsr181Enabled ? new JaxWsProxyFactoryBean(cfb)
+            : new ClientProxyFactoryBean(cfb));
     }
 
     // If cfb is null, we will try to find the right cfb to use.

Modified: activemq/camel/trunk/components/camel-cxf/src/main/resources/META-INF/spring.schemas
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/resources/META-INF/spring.schemas?rev=718515&r1=718514&r2=718515&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/resources/META-INF/spring.schemas (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/resources/META-INF/spring.schemas Mon Nov 17 23:17:39 2008
@@ -24,6 +24,9 @@
 http\://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd=schema/cxfEndpoint.xsd
 # and for the other previous releases
 http\://activemq.apache.org/camel/schema/cxfEndpoint/camel-cxf-1.3.0.xsd=schema/cxfEndpoint.xsd
+http\://activemq.apache.org/camel/schema/cxfEndpoint/camel-cxf-1.4.0.xsd=schema/cxfEndpoint.xsd
+http\://activemq.apache.org/camel/schema/cxfEndpoint/camel-cxf-1.5.0.xsd=schema/cxfEndpoint.xsd
 http\://activemq.apache.org/camel/schema/cxfEndpoint/camel-cxf-${pom.version}.xsd=schema/cxfEndpoint.xsd
 
+# since we don't publish the camel schema in the cxf site, we will always use the schema file in the class path 
 http\://cxf.apache.org/transports/camel.xsd=schema/configuration/camel.xsd
\ No newline at end of file

Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java?rev=718515&r1=718514&r2=718515&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java Mon Nov 17 23:17:39 2008
@@ -21,22 +21,24 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.camel.CamelContext;
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.spring.processor.SpringTestHelper;
+import org.apache.camel.spring.SpringTestSupport;
+import org.apache.camel.wsdl_first.JaxwsTestHandler;
 import org.apache.hello_world_soap_http.Greeter;
 import org.apache.hello_world_soap_http.SOAPService;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 
-public class CxfSoapMessageProviderTest extends ContextTestSupport {
+public class CxfSoapMessageProviderTest extends SpringTestSupport {
 
     @Override
-    protected CamelContext createCamelContext() throws Exception {
-        return SpringTestHelper.createSpringCamelContext(this, "org/apache/camel/component/cxf/SoapMessageProviderContext.xml");
+    protected ClassPathXmlApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/component/cxf/SoapMessageProviderContext.xml");
     }
 
     public void testSOAPMessageModeDocLit() throws Exception {
-
+        JaxwsTestHandler fromHandler = getMandatoryBean(JaxwsTestHandler.class, "fromEndpointJaxwsHandler");
+        fromHandler.reset();
+        
         QName serviceName =
             new QName("http://apache.org/hello_world_soap_http", "SOAPProviderService");
         QName portName =
@@ -64,6 +66,11 @@
         } catch (UndeclaredThrowableException ex) {
             throw (Exception)ex.getCause();
         }
+        
+        assertEquals("Can't get the right message count", fromHandler.getMessageCount(), 8);
+        assertEquals("Can't get the right fault count", fromHandler.getFaultCount(), 0);
+        assertEquals("Can't get the right headers count", fromHandler.getGetHeadersCount(), 0);
+        
     }
 
 

Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/wsdl_first/JaxwsTestHandler.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/wsdl_first/JaxwsTestHandler.java?rev=718515&r1=718514&r2=718515&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/wsdl_first/JaxwsTestHandler.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/wsdl_first/JaxwsTestHandler.java Mon Nov 17 23:17:39 2008
@@ -64,6 +64,11 @@
     public int getMessageCount() {
         return messageCount;
     }
+    
+    public String toString() {
+        return "faultCount=" + faultCount + ", messageCount=" 
+            + messageCount + ", getHeadersCount=" + getHeadersCount;
+    }
   
 
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/SoapMessageProviderContext.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/SoapMessageProviderContext.xml?rev=718515&r1=718514&r2=718515&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/SoapMessageProviderContext.xml (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/SoapMessageProviderContext.xml Mon Nov 17 23:17:39 2008
@@ -39,10 +39,13 @@
     <bean id = "targetBean" class="org.apache.camel.component.cxf.SoapTargetBean" />
     <bean id = "parameterProcessor" class="org.apache.camel.component.cxf.ParameterProcessor"/>
 
-   	<cxf:cxfEndpoint id="soapMessageEndpoint"
-	        serviceClass="org.apache.camel.component.cxf.SoapMessageProvider"
-			address="http://localhost:9003/SoapContext/SoapProviderPort"
-   	/>
+	<cxf:cxfEndpoint id="soapMessageEndpoint"
+		serviceClass="org.apache.camel.component.cxf.SoapMessageProvider"
+		address="http://localhost:9003/SoapContext/SoapProviderPort">
+		<cxf:handlers>
+			<ref bean="fromEndpointJaxwsHandler" />
+		</cxf:handlers>
+	</cxf:cxfEndpoint>
 
 
    <camelContext id="test_context" xmlns="http://activemq.apache.org/camel/schema/spring">
@@ -52,5 +55,7 @@
             <to uri="bean:targetBean?method=invokeSoapMessage"/>
         </route>
    </camelContext>
+   
+   <bean id="fromEndpointJaxwsHandler" class="org.apache.camel.wsdl_first.JaxwsTestHandler"/>
 
 </beans>