camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r950505 - in /camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf: CxfCustomizedExceptionTest.java CxfMessageStreamExceptionTest.java
Date Wed, 02 Jun 2010 11:43:02 GMT
Author: ningjiang
Date: Wed Jun  2 11:43:02 2010
New Revision: 950505

URL: http://svn.apache.org/viewvc?rev=950505&view=rev
Log:
Fixed the unit test errors of camel-cxf exception test

Modified:
    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfCustomizedExceptionTest.java
    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMessageStreamExceptionTest.java

Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfCustomizedExceptionTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfCustomizedExceptionTest.java?rev=950505&r1=950504&r2=950505&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfCustomizedExceptionTest.java
(original)
+++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfCustomizedExceptionTest.java
Wed Jun  2 11:43:02 2010
@@ -48,6 +48,7 @@ public class CxfCustomizedExceptionTest 
     protected static final String ROUTER_ADDRESS = "http://localhost:9002/router";
     protected static final String SERVICE_CLASS = "serviceClass=org.apache.camel.component.cxf.HelloService";
     protected static String routerEndpointURI = "cxf://" + ROUTER_ADDRESS + "?" + SERVICE_CLASS;
+    protected static final String SERVICE_URI = "cxf://" + ROUTER_ADDRESS + "?" + SERVICE_CLASS;
     private static final String EXCEPTION_MESSAGE = "This is an exception test message";
     private static final String DETAIL_TEXT = "This is a detail text node";
     private static final SoapFault SOAP_FAULT;
@@ -97,7 +98,7 @@ public class CxfCustomizedExceptionTest 
                         })
                         .to("mock:error")                        
                         .end() 
-                    .to(routerEndpointURI);
+                    .to(SERVICE_URI);
                 // END SNIPPET: onException
                 // START SNIPPET: ThrowFault
                 from(routerEndpointURI).setFaultBody(constant(SOAP_FAULT));

Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMessageStreamExceptionTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMessageStreamExceptionTest.java?rev=950505&r1=950504&r2=950505&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMessageStreamExceptionTest.java
(original)
+++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMessageStreamExceptionTest.java
Wed Jun  2 11:43:02 2010
@@ -20,13 +20,31 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.cxf.binding.soap.SoapFault;
 
 public class CxfMessageStreamExceptionTest extends CxfMessageCustomizedExceptionTest {
 
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
-             // START SNIPPET: MessageStreamFault
+                // START SNIPPET: onException
+                from("direct:start")
+                    .onException(SoapFault.class)
+                        .maximumRedeliveries(0)
+                        .handled(true)
+                        .process(new Processor() {
+                            public void process(Exchange exchange) throws Exception {
+                                SoapFault fault =
+                                    exchange.getProperty(Exchange.EXCEPTION_CAUGHT, SoapFault.class);
+                                exchange.getOut().setBody(fault.getDetail().getTextContent());
+                            }
+                            
+                        })
+                        .to("mock:error")                        
+                        .end() 
+                    .to(SERVICE_URI);
+                // END SNIPPET: onException
+                // START SNIPPET: MessageStreamFault
                 from(routerEndpointURI).process(new Processor() {
 
                     public void process(Exchange exchange) throws Exception {



Mime
View raw message