camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bvah...@apache.org
Subject svn commit: r1478047 - in /camel/branches/camel-2.10.x: ./ components/camel-fop/src/main/java/org/apache/camel/component/fop/FopProducer.java components/camel-fop/src/test/java/org/apache/camel/component/fop/FopComponentTest.java
Date Wed, 01 May 2013 15:20:29 GMT
Author: bvahdat
Date: Wed May  1 15:20:29 2013
New Revision: 1478047

URL: http://svn.apache.org/r1478047
Log:
Merged revisions 1478045 via svnmerge from 
https://svn.apache.org/repos/asf/camel/branches/camel-2.11.x

................
  r1478045 | bvahdat | 2013-05-01 17:15:58 +0200 (Mi, 01 Mai 2013) | 9 lines
  
  Merged revisions 1478044 via svnmerge from 
  https://svn.apache.org/repos/asf/camel/trunk
  
  ........
    r1478044 | bvahdat | 2013-05-01 17:13:35 +0200 (Mi, 01 Mai 2013) | 1 line
    
    CAMEL-6284: FOPProducer should populate the existing headers properly.
  ........
................

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopProducer.java
    camel/branches/camel-2.10.x/components/camel-fop/src/test/java/org/apache/camel/component/fop/FopComponentTest.java

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1478044
  Merged /camel/branches/camel-2.11.x:r1478045

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.10.x/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopProducer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopProducer.java?rev=1478047&r1=1478046&r2=1478047&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopProducer.java
(original)
+++ camel/branches/camel-2.10.x/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopProducer.java
Wed May  1 15:20:29 2013
@@ -61,6 +61,9 @@ public class FopProducer extends Default
 
         OutputStream out = transform(userAgent, outputFormat, src);
         exchange.getOut().setBody(out);
+
+        // propagate headers
+        exchange.getOut().setHeaders(headers);
     }
 
     private String getOutputFormat(Exchange exchange) {

Modified: camel/branches/camel-2.10.x/components/camel-fop/src/test/java/org/apache/camel/component/fop/FopComponentTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-fop/src/test/java/org/apache/camel/component/fop/FopComponentTest.java?rev=1478047&r1=1478046&r2=1478047&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-fop/src/test/java/org/apache/camel/component/fop/FopComponentTest.java
(original)
+++ camel/branches/camel-2.10.x/components/camel-fop/src/test/java/org/apache/camel/component/fop/FopComponentTest.java
Wed May  1 15:20:29 2013
@@ -26,6 +26,7 @@ import org.apache.camel.builder.RouteBui
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.apache.pdfbox.pdmodel.PDDocument;
+import org.junit.Before;
 import org.junit.Test;
 
 public class FopComponentTest extends CamelTestSupport {
@@ -36,6 +37,14 @@ public class FopComponentTest extends Ca
     @Produce(uri = "direct:start")
     protected ProducerTemplate template;
 
+    @Override
+    @Before
+    public void setUp() throws Exception {
+        deleteDirectory("target/data");
+
+        super.setUp();
+    }
+
     @Test
     public void createPdfUsingXmlDataAndXsltTransformation() throws Exception {
         resultEndpoint.expectedMessageCount(1);
@@ -48,6 +57,10 @@ public class FopComponentTest extends Ca
         String pdfText = FopHelper.extractTextFrom(document);
         assertTrue(pdfText.contains("Project"));    //from xsl template
         assertTrue(pdfText.contains("John Doe"));   //from data xml
+
+        // assert on the header "foo" being populated
+        Exchange exchange = resultEndpoint.getReceivedExchanges().get(0);
+        assertEquals("Header value is lost!", "bar", exchange.getIn().getHeader("foo"));
     }
 
     @Override
@@ -56,6 +69,7 @@ public class FopComponentTest extends Ca
             public void configure() {
                 from("direct:start")
                         .to("xslt:xslt/template.xsl")
+                        .setHeader("foo", constant("bar"))
                         .to("fop:application/pdf")
                         .setHeader(Exchange.FILE_NAME, constant("result.pdf"))
                         .to("file:target/data")



Mime
View raw message