camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmoulli...@apache.org
Subject svn commit: r1141866 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/model/ test/java/org/apache/camel/impl/ test/java/org/apache/camel/model/ test/java/org/apache/camel/processor/ test/java/org/apache/camel/processor/onexception/ test/jav...
Date Fri, 01 Jul 2011 08:30:01 GMT
Author: cmoulliard
Date: Fri Jul  1 08:30:01 2011
New Revision: 1141866

URL: http://svn.apache.org/viewvc?rev=1141866&view=rev
Log:
camel-4167: marshall/unmarshall processors were not added in the TRACE

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/UnmarshalDefinition.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/impl/StringDataFormatTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/model/LoadRouteFromXmlTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MyLoggingSentEventNotifer.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionContinueSubRouteTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionHandleAndTransformWithDefaultErrorHandlerTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipDataModificationTest.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalDefinition.java?rev=1141866&r1=1141865&r2=1141866&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalDefinition.java Fri
Jul  1 08:30:01 2011
@@ -16,13 +16,6 @@
  */
 package org.apache.camel.model;
 
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElements;
-import javax.xml.bind.annotation.XmlRootElement;
-
 import org.apache.camel.Processor;
 import org.apache.camel.model.dataformat.BindyDataFormat;
 import org.apache.camel.model.dataformat.CastorDataFormat;
@@ -50,6 +43,8 @@ import org.apache.camel.processor.Marsha
 import org.apache.camel.spi.DataFormat;
 import org.apache.camel.spi.RouteContext;
 
+import javax.xml.bind.annotation.*;
+
 /**
  * Marshals to a binary payload using the given {@link DataFormatDefinition}
  *
@@ -137,4 +132,13 @@ public class MarshalDefinition extends N
         DataFormat dataFormat = DataFormatDefinition.getDataFormat(routeContext, getDataFormatType(),
ref);
         return new MarshalProcessor(dataFormat);
     }
+
+    @Override
+    public String getLabel() {
+        if (dataFormatType != null) {
+            return "marshal[" + dataFormatType + "]";
+        } else {
+            return "marshal[ref:" + ref + "]";
+        }
+    }
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/UnmarshalDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/UnmarshalDefinition.java?rev=1141866&r1=1141865&r2=1141866&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/UnmarshalDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/UnmarshalDefinition.java Fri
Jul  1 08:30:01 2011
@@ -16,13 +16,6 @@
  */
 package org.apache.camel.model;
 
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElements;
-import javax.xml.bind.annotation.XmlRootElement;
-
 import org.apache.camel.Processor;
 import org.apache.camel.model.dataformat.BindyDataFormat;
 import org.apache.camel.model.dataformat.CastorDataFormat;
@@ -50,6 +43,8 @@ import org.apache.camel.processor.Unmars
 import org.apache.camel.spi.DataFormat;
 import org.apache.camel.spi.RouteContext;
 
+import javax.xml.bind.annotation.*;
+
 /**
  * Unmarshals the binary payload using the given {@link DataFormatDefinition}
  *
@@ -137,4 +132,13 @@ public class UnmarshalDefinition extends
         DataFormat dataFormat = DataFormatDefinition.getDataFormat(routeContext, getDataFormatType(),
ref);
         return new UnmarshalProcessor(dataFormat);
     }
+
+    @Override
+    public String getLabel() {
+        if (dataFormatType != null) {
+            return "unmarshal[" + dataFormatType + "]";
+        } else {
+            return "unmarshal[ref:" + ref + "]";
+        }
+    }
 }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/impl/StringDataFormatTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/StringDataFormatTest.java?rev=1141866&r1=1141865&r2=1141866&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/impl/StringDataFormatTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/impl/StringDataFormatTest.java Fri
Jul  1 08:30:01 2011
@@ -16,17 +16,13 @@
  */
 package org.apache.camel.impl;
 
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.ProducerTemplate;
-import org.apache.camel.TestSupport;
+import org.apache.camel.*;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
 /**
  * Unit test of the string data format.
  */
@@ -37,6 +33,7 @@ public class StringDataFormatTest extend
 
     protected void setUp() throws Exception {
         context = new DefaultCamelContext();
+        context.setTracing(true);
         template = context.createProducerTemplate();
         template.start();
     }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/model/LoadRouteFromXmlTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/model/LoadRouteFromXmlTest.java?rev=1141866&r1=1141865&r2=1141866&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/model/LoadRouteFromXmlTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/model/LoadRouteFromXmlTest.java
Fri Jul  1 08:30:01 2011
@@ -19,6 +19,8 @@ package org.apache.camel.model;
 import java.io.InputStream;
 
 import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MyLoggingSentEventNotifer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MyLoggingSentEventNotifer.java?rev=1141866&r1=1141865&r2=1141866&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MyLoggingSentEventNotifer.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MyLoggingSentEventNotifer.java
Fri Jul  1 08:30:01 2011
@@ -28,10 +28,12 @@ import org.apache.camel.management.event
 public class MyLoggingSentEventNotifer extends EventNotifierSupport {
 
     public void notify(EventObject event) throws Exception {
+
         if (event instanceof ExchangeSentEvent) {
             ExchangeSentEvent sent = (ExchangeSentEvent) event;
             log.info("Took " + sent.getTimeTaken() + " millis to send to: " + sent.getEndpoint());
         }
+
     }
 
     public boolean isEnabled(EventObject event) {

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionContinueSubRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionContinueSubRouteTest.java?rev=1141866&r1=1141865&r2=1141866&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionContinueSubRouteTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionContinueSubRouteTest.java
Fri Jul  1 08:30:01 2011
@@ -46,15 +46,17 @@ public class OnExceptionContinueSubRoute
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                onException(IllegalArgumentException.class).continued(true).logContinued(true);
+                //onException(IllegalArgumentException.class).continued(true).logContinued(true);
 
                 from("direct:start")
+                    .onException(IllegalArgumentException.class).continued(true).logContinued(true).end()
                     .to("mock:start")
                     .to("direct:b")
                     .to("direct:c")
                     .to("mock:result");
 
                 from("direct:b")
+                    .errorHandler(noErrorHandler())
                     .to("mock:b")
                     .throwException(new IllegalArgumentException("Forced"));
 

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionHandleAndTransformWithDefaultErrorHandlerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionHandleAndTransformWithDefaultErrorHandlerTest.java?rev=1141866&r1=1141865&r2=1141866&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionHandleAndTransformWithDefaultErrorHandlerTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionHandleAndTransformWithDefaultErrorHandlerTest.java
Fri Jul  1 08:30:01 2011
@@ -17,9 +17,11 @@
 package org.apache.camel.processor.onexception;
 
 import org.apache.camel.ContextTestSupport;
+import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
 
 /**
  * Unit test inspired by end user
@@ -83,19 +85,28 @@ public class OnExceptionHandleAndTransfo
                 // but we want to return a fixed text response, so we transform OUT body
and return a nice message
                 // using the simple language where we want insert the exception message
                 onException(MyFunctionalException.class)
-                        .handled(true)
+                        .handled(false)
                         .transform().simple("Error reported: ${exception.message} - cannot
process this message.");
                 // END SNIPPET: e3
 
                 from("direct:start").process(new Processor() {
                     public void process(Exchange exchange) throws Exception {
                         throw new MyFunctionalException("Out of order");
+
                     }
                 });
             }
         });
 
-        Object out = template.requestBody("direct:start", "Hello World");
+
+        Exchange exch = template.request("direct:start",new Processor() {
+            public void process(Exchange exchange) {
+                exchange.getIn().setBody("Hello World");
+            }
+        });
+
+        // Object out = template.requestBody("direct:start", "Hello World");
+        Object out = exch.getOut().getBody();
         assertEquals("Error reported: Out of order - cannot process this message.", out);
     }
 

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipDataModificationTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipDataModificationTest.java?rev=1141866&r1=1141865&r2=1141866&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipDataModificationTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipDataModificationTest.java
Fri Jul  1 08:30:01 2011
@@ -64,6 +64,7 @@ public class RoutingSlipDataModification
 
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
+
             public void configure() {
                 // START SNIPPET: example
                 from("direct:a").routingSlip(ROUTING_SLIP_HEADER).to("mock:y");



Mime
View raw message