camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r663822 - in /activemq/camel/trunk/components: camel-stringtemplate/src/main/java/org/apache/camel/component/stringtemplate/ camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/ camel-stringtemplate/src/test/resourc...
Date Fri, 06 Jun 2008 04:56:47 GMT
Author: davsclaus
Date: Thu Jun  5 21:56:47 2008
New Revision: 663822

URL: http://svn.apache.org/viewvc?rev=663822&view=rev
Log:
CAMEL-580: Added content cache for resource based endpoints such as camel-velocity and camel-stringtemplate.

Modified:
    activemq/camel/trunk/components/camel-stringtemplate/src/main/java/org/apache/camel/component/stringtemplate/StringTemplateEndpoint.java
    activemq/camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateLetterTest.java
    activemq/camel/trunk/components/camel-stringtemplate/src/test/resources/log4j.properties
    activemq/camel/trunk/components/camel-stringtemplate/src/test/resources/org/apache/camel/component/stringtemplate/letter.tm
    activemq/camel/trunk/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java
    activemq/camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityLetterTest.java
    activemq/camel/trunk/components/camel-velocity/src/test/resources/log4j.properties
    activemq/camel/trunk/components/camel-velocity/src/test/resources/org/apache/camel/component/velocity/letter.vm

Modified: activemq/camel/trunk/components/camel-stringtemplate/src/main/java/org/apache/camel/component/stringtemplate/StringTemplateEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-stringtemplate/src/main/java/org/apache/camel/component/stringtemplate/StringTemplateEndpoint.java?rev=663822&r1=663821&r2=663822&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-stringtemplate/src/main/java/org/apache/camel/component/stringtemplate/StringTemplateEndpoint.java
(original)
+++ activemq/camel/trunk/components/camel-stringtemplate/src/main/java/org/apache/camel/component/stringtemplate/StringTemplateEndpoint.java
Thu Jun  5 21:56:47 2008
@@ -61,6 +61,9 @@
         String text = IOConverter.toString(getResourceAsInputStream());
         StringTemplate template = new StringTemplate(text);
         template.setAttributes(variableMap);
+        if (log.isDebugEnabled()) {
+            log.debug("StringTemplate is writing using attributes: " + variableMap);
+        }
         template.write(new AutoIndentWriter(buffer));
 
         // now lets output the results to the exchange

Modified: activemq/camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateLetterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateLetterTest.java?rev=663822&r1=663821&r2=663822&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateLetterTest.java
(original)
+++ activemq/camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateLetterTest.java
Thu Jun  5 21:56:47 2008
@@ -18,13 +18,14 @@
         msg.setHeader("firstName", "Claus");
         msg.setHeader("lastName", "Ibsen");
         msg.setHeader("item", "Camel in Action");
+        msg.setBody("PS: Next beer is on me, James");
         return exchange;
     }
 
     public void testVelocityLetter() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);
-        mock.expectedBodiesReceived("Dear Ibsen, Claus\n\nThanks for the order of Camel in
Action.\n\nRegards Camel Riders Bookstore");
+        mock.expectedBodiesReceived("Dear Ibsen, Claus\n\nThanks for the order of Camel in
Action.\n\nRegards Camel Riders Bookstore\nPS: Next beer is on me, James");
 
         template.send("direct:a", createLetter());
 

Modified: activemq/camel/trunk/components/camel-stringtemplate/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-stringtemplate/src/test/resources/log4j.properties?rev=663822&r1=663821&r2=663822&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-stringtemplate/src/test/resources/log4j.properties
(original)
+++ activemq/camel/trunk/components/camel-stringtemplate/src/test/resources/log4j.properties
Thu Jun  5 21:56:47 2008
@@ -21,6 +21,7 @@
 log4j.rootLogger=INFO, out
 
 log4j.logger.org.apache.activemq.spring=WARN
+log4j.logger.org.apache.camel.component.stringtemplate=DEBUG
 
 # CONSOLE appender not used by default
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender

Modified: activemq/camel/trunk/components/camel-stringtemplate/src/test/resources/org/apache/camel/component/stringtemplate/letter.tm
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-stringtemplate/src/test/resources/org/apache/camel/component/stringtemplate/letter.tm?rev=663822&r1=663821&r2=663822&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-stringtemplate/src/test/resources/org/apache/camel/component/stringtemplate/letter.tm
(original)
+++ activemq/camel/trunk/components/camel-stringtemplate/src/test/resources/org/apache/camel/component/stringtemplate/letter.tm
Thu Jun  5 21:56:47 2008
@@ -18,4 +18,5 @@
 
 Thanks for the order of $headers.item$.
 
-Regards Camel Riders Bookstore
\ No newline at end of file
+Regards Camel Riders Bookstore
+$body$
\ No newline at end of file

Modified: activemq/camel/trunk/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java?rev=663822&r1=663821&r2=663822&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java
(original)
+++ activemq/camel/trunk/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java
Thu Jun  5 21:56:47 2008
@@ -97,6 +97,9 @@
 
         // let velocity parse and generate the result in buffer
         VelocityEngine engine = getVelocityEngine();
+        if (log.isDebugEnabled()) {
+            log.debug("Velocity is evaluating using velocity context: " + variableMap);
+        }
         engine.evaluate(velocityContext, buffer, logTag, reader);
 
         // now lets output the results to the exchange

Modified: activemq/camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityLetterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityLetterTest.java?rev=663822&r1=663821&r2=663822&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityLetterTest.java
(original)
+++ activemq/camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityLetterTest.java
Thu Jun  5 21:56:47 2008
@@ -18,13 +18,14 @@
         msg.setHeader("firstName", "Claus");
         msg.setHeader("lastName", "Ibsen");
         msg.setHeader("item", "Camel in Action");
+        msg.setBody("PS: Next beer is on me, James");
         return exchange;
     }
 
     public void testVelocityLetter() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);
-        mock.expectedBodiesReceived("Dear Ibsen, Claus\n\nThanks for the order of Camel in
Action.\n\nRegards Camel Riders Bookstore");
+        mock.expectedBodiesReceived("Dear Ibsen, Claus\n\nThanks for the order of Camel in
Action.\n\nRegards Camel Riders Bookstore\nPS: Next beer is on me, James");
 
         template.send("direct:a", createLetter());
 

Modified: activemq/camel/trunk/components/camel-velocity/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-velocity/src/test/resources/log4j.properties?rev=663822&r1=663821&r2=663822&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-velocity/src/test/resources/log4j.properties (original)
+++ activemq/camel/trunk/components/camel-velocity/src/test/resources/log4j.properties Thu
Jun  5 21:56:47 2008
@@ -21,6 +21,7 @@
 log4j.rootLogger=INFO, out
 
 log4j.logger.org.apache.activemq.spring=WARN
+log4j.logger.org.apache.camel.component.velocity=DEBUG
 
 # CONSOLE appender not used by default
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender

Modified: activemq/camel/trunk/components/camel-velocity/src/test/resources/org/apache/camel/component/velocity/letter.vm
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-velocity/src/test/resources/org/apache/camel/component/velocity/letter.vm?rev=663822&r1=663821&r2=663822&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-velocity/src/test/resources/org/apache/camel/component/velocity/letter.vm
(original)
+++ activemq/camel/trunk/components/camel-velocity/src/test/resources/org/apache/camel/component/velocity/letter.vm
Thu Jun  5 21:56:47 2008
@@ -18,4 +18,5 @@
 
 Thanks for the order of ${headers.item}.
 
-Regards Camel Riders Bookstore
\ No newline at end of file
+Regards Camel Riders Bookstore
+${body}
\ No newline at end of file



Mime
View raw message