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 2015/03/18 12:37:35 UTC

[4/6] camel git commit: CAMEL-8505 Setup the message header according to MEP

CAMEL-8505 Setup the message header according to MEP


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/61e7fc84
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/61e7fc84
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/61e7fc84

Branch: refs/heads/camel-2.15.x
Commit: 61e7fc84e08f0fc53db4e9051dd5c97e7c2d7e94
Parents: e35d33a
Author: Willem Jiang <wi...@gmail.com>
Authored: Wed Mar 18 19:29:06 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Wed Mar 18 19:36:05 2015 +0800

----------------------------------------------------------------------
 .../apache/camel/component/schematron/SchematronProducer.java | 1 -
 .../camel/component/schematron/SchematronProducerTest.java    | 7 ++++---
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/61e7fc84/components/camel-schematron/src/main/java/org/apache/camel/component/schematron/SchematronProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-schematron/src/main/java/org/apache/camel/component/schematron/SchematronProducer.java b/components/camel-schematron/src/main/java/org/apache/camel/component/schematron/SchematronProducer.java
index e5d000b..9b3f354 100644
--- a/components/camel-schematron/src/main/java/org/apache/camel/component/schematron/SchematronProducer.java
+++ b/components/camel-schematron/src/main/java/org/apache/camel/component/schematron/SchematronProducer.java
@@ -72,7 +72,6 @@ public class SchematronProducer extends DefaultProducer {
         Map<String, Object> headers = new HashMap<String, Object>();
         headers.put(Constants.VALIDATION_STATUS, status);
         headers.put(Constants.VALIDATION_REPORT, report);
-        exchange.getOut().setHeader(Constants.VALIDATION_REPORT, report);
         if (exchange.getPattern().isOutCapable()) {
             exchange.getOut().setHeaders(exchange.getIn().getHeaders());
             exchange.getOut().getHeaders().putAll(headers);

http://git-wip-us.apache.org/repos/asf/camel/blob/61e7fc84/components/camel-schematron/src/test/java/org/apache/camel/component/schematron/SchematronProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-schematron/src/test/java/org/apache/camel/component/schematron/SchematronProducerTest.java b/components/camel-schematron/src/test/java/org/apache/camel/component/schematron/SchematronProducerTest.java
index 169f7f2..6694503 100644
--- a/components/camel-schematron/src/test/java/org/apache/camel/component/schematron/SchematronProducerTest.java
+++ b/components/camel-schematron/src/test/java/org/apache/camel/component/schematron/SchematronProducerTest.java
@@ -54,19 +54,20 @@ public class SchematronProducerTest extends CamelTestSupport {
 
         // assert
         assertTrue(exc.getOut().getHeader(Constants.VALIDATION_STATUS).equals(Constants.SUCCESS));
+        assertNotNull("We should get the report here.", exc.getOut().getHeader(Constants.VALIDATION_REPORT));
     }
 
     @Test
     public void testProcessInValidXML() throws Exception {
-        Exchange exc = new DefaultExchange(context, ExchangePattern.InOut);
+        Exchange exc = new DefaultExchange(context, ExchangePattern.InOnly);
         exc.getIn().setBody(ClassLoader.getSystemResourceAsStream("xml/article-2.xml"));
 
         // process xml payload
         producer.process(exc);
 
         // assert
-        assertTrue(exc.getOut().getHeader(Constants.VALIDATION_STATUS).equals(Constants.FAILED));
-
+        assertTrue("The validation status should be failed.", exc.getIn().getHeader(Constants.VALIDATION_STATUS).equals(Constants.FAILED));
+        assertNotNull("We should get the report here.", exc.getIn().getHeader(Constants.VALIDATION_REPORT));
     }
 
 }