camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r800288 - in /camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms: JmsSimpleInOnlyNoMutateTest.java JmsSimpleRequestReplyTest.java JmsXMLRouteTest.java
Date Mon, 03 Aug 2009 10:45:11 GMT
Author: davsclaus
Date: Mon Aug  3 10:45:11 2009
New Revision: 800288

URL: http://svn.apache.org/viewvc?rev=800288&view=rev
Log:
CAMEL-1867: polished unit test

Added:
    camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleInOnlyNoMutateTest.java
  (contents, props changed)
      - copied, changed from r800199, camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleRequestReplyTest.java
Modified:
    camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleRequestReplyTest.java
    camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsXMLRouteTest.java

Copied: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleInOnlyNoMutateTest.java
(from r800199, camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleRequestReplyTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleInOnlyNoMutateTest.java?p2=camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleInOnlyNoMutateTest.java&p1=camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleRequestReplyTest.java&r1=800199&r2=800288&rev=800288&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleRequestReplyTest.java
(original)
+++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleInOnlyNoMutateTest.java
Mon Aug  3 10:45:11 2009
@@ -21,7 +21,6 @@
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
-import org.apache.camel.ExchangePattern;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
@@ -30,18 +29,20 @@
 import static org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
 
 /**
- * A simple requesr / reply test
+ * A simple in only test that does not mutate the message
  */
-public class JmsSimpleRequestReplyTest extends CamelTestSupport {
+public class JmsSimpleInOnlyNoMutateTest extends CamelTestSupport {
 
     protected String componentName = "activemq";
 
     @Test
-    public void testRequetReply() throws Exception {
+    public void testRequetReplyNoMutate() throws Exception {
         MockEndpoint result = getMockEndpoint("mock:result");
         result.expectedMessageCount(1);
+        result.expectedBodiesReceived("Hello World");
+        result.expectedHeaderReceived("foo", 123);
 
-        Exchange out = template.send("activemq:queue:hello", ExchangePattern.InOut, new Processor()
{
+        template.send("activemq:queue:hello", new Processor() {
             public void process(Exchange exchange) throws Exception {
                 exchange.getIn().setBody("Hello World");
                 exchange.getIn().setHeader("foo", 123);
@@ -49,11 +50,6 @@
         });
 
         result.assertIsSatisfied();
-
-        assertNotNull(out);
-
-        assertEquals("Bye World", out.getOut().getBody(String.class));
-        assertEquals(123, out.getOut().getHeader("foo"));
     }
 
     protected CamelContext createCamelContext() throws Exception {
@@ -68,12 +64,7 @@
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("activemq:queue:hello").process(new Processor() {
-                    public void process(Exchange exchange) throws Exception {
-                        exchange.getIn().setBody("Bye World");
-                        assertNotNull(exchange.getIn().getHeader("JMSReplyTo"));
-                    }
-                }).to("mock:result");
+                from("activemq:queue:hello").to("log:foo").to("mock:result");
             }
         };
     }

Propchange: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleInOnlyNoMutateTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleInOnlyNoMutateTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleRequestReplyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleRequestReplyTest.java?rev=800288&r1=800287&r2=800288&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleRequestReplyTest.java
(original)
+++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleRequestReplyTest.java
Mon Aug  3 10:45:11 2009
@@ -30,7 +30,7 @@
 import static org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
 
 /**
- * A simple requesr / reply test
+ * A simple request / reply test
  */
 public class JmsSimpleRequestReplyTest extends CamelTestSupport {
 

Modified: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsXMLRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsXMLRouteTest.java?rev=800288&r1=800287&r2=800288&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsXMLRouteTest.java
(original)
+++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsXMLRouteTest.java
Mon Aug  3 10:45:11 2009
@@ -132,7 +132,8 @@
         mock.expectedMessageCount(1);
         mock.message(0).body(String.class).contains("James");
 
-        Source source = new StringSource("<person user=\"james\">\n"
+        Source source = new StringSource("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+                + "<person user=\"james\">\n"
                 + "  <firstName>James</firstName>\n"
                 + "  <lastName>Strachan</lastName>\n"
                 + "  <city>London</city>\n"
@@ -150,7 +151,8 @@
         mock.expectedMessageCount(1);
         mock.message(0).body(String.class).contains("James");
 
-        Source source = new StringSource("<person user=\"james\">\n"
+        Source source = new StringSource("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+                + "<person user=\"james\">\n"
                 + "  <firstName>James</firstName>\n"
                 + "  <lastName>Strachan</lastName>\n"
                 + "  <city>London</city>\n"
@@ -168,7 +170,8 @@
         mock.expectedMessageCount(1);
         mock.message(0).body(String.class).contains("James");
 
-        Source source = new StringSource("<person user=\"james\">\n"
+        Source source = new StringSource("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+                + "<person user=\"james\">\n"
                 + "  <firstName>James</firstName>\n"
                 + "  <lastName>Strachan</lastName>\n"
                 + "  <city>London</city>\n"



Mime
View raw message