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:37 UTC

[6/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/238ff59b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/238ff59b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/238ff59b

Branch: refs/heads/camel-2.14.x
Commit: 238ff59bbcbd7f6e42654b3fccd71a65f24672af
Parents: a0b05da
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:37:15 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/238ff59b/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/238ff59b/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));
     }
 
 }