camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [1/3] camel git commit: CAMEL-8505 Setup the message header according to MEP
Date Wed, 18 Mar 2015 11:33:20 GMT
Repository: camel
Updated Branches:
  refs/heads/master b3afcac20 -> 1e17b6b59


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

Branch: refs/heads/master
Commit: 1e17b6b5948bd668f226e0f98211636b175782b0
Parents: 6365a5d
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Wed Mar 18 19:29:06 2015 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Wed Mar 18 19:30:36 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/1e17b6b5/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/1e17b6b5/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));
     }
 
 }


Mime
View raw message