camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r790078 - in /camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms: JmsSimpleRequestLateReplyTest.java issues/JmsInOnlyIssueTest.java issues/JmsInOutIssueTest.java
Date Wed, 01 Jul 2009 09:03:46 GMT
Author: davsclaus
Date: Wed Jul  1 09:03:46 2009
New Revision: 790078

URL: http://svn.apache.org/viewvc?rev=790078&view=rev
Log:
Polished unit test

Modified:
    camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleRequestLateReplyTest.java
    camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsInOnlyIssueTest.java
    camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsInOutIssueTest.java

Modified: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleRequestLateReplyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleRequestLateReplyTest.java?rev=790078&r1=790077&r2=790078&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleRequestLateReplyTest.java
(original)
+++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSimpleRequestLateReplyTest.java
Wed Jul  1 09:03:46 2009
@@ -101,7 +101,7 @@
             }
 
             LOG.debug("Sending late reply");
-            // use some dummt queue as we override this with the property: JmsConstants.JMS_DESTINATION

+            // use some dummy queue as we override this with the property: JmsConstants.JMS_DESTINATION
             template.send("activemq:dummy", new Processor() {
                 public void process(Exchange exchange) throws Exception {
                     exchange.setPattern(ExchangePattern.InOnly);
@@ -190,4 +190,4 @@
         return "activemq:queue:hello.queue" + count;
     }
 
-}
\ No newline at end of file
+}

Modified: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsInOnlyIssueTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsInOnlyIssueTest.java?rev=790078&r1=790077&r2=790078&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsInOnlyIssueTest.java
(original)
+++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsInOnlyIssueTest.java
Wed Jul  1 09:03:46 2009
@@ -16,9 +16,6 @@
  */
 package org.apache.camel.component.jms.issues;
 
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-
 import static org.apache.activemq.camel.component.ActiveMQComponent.activeMQComponent;
 import org.apache.camel.CamelContext;
 import org.apache.camel.ContextTestSupport;
@@ -26,14 +23,15 @@
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.jms.JmsConstants;
 import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.Test;
 
 /**
  * @version $Revision$
  */
 public class JmsInOnlyIssueTest extends ContextTestSupport {
 
+    @Test
     public void testInOnlyWithSendBody() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedBodiesReceived("Bye World");
@@ -43,6 +41,7 @@
         assertMockEndpointsSatisfied();
     }
 
+    @Test
     public void testInOnlyWithAsyncSendBody() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedBodiesReceived("Bye World");
@@ -55,6 +54,7 @@
         assertMockEndpointsSatisfied();
     }
 
+    @Test
     public void testInOnlyWithSendExchange() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedBodiesReceived("Bye World");
@@ -69,6 +69,7 @@
         assertFalse("Should not have OUT", out.hasOut());
     }
 
+    @Test
     public void testInOnlyWithAsyncSendExchange() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedBodiesReceived("Bye World");
@@ -97,9 +98,6 @@
             public void configure() throws Exception {
                 from("activemq:queue:in").process(new Processor() {
                     public void process(Exchange exchange) throws Exception {
-                        assertEquals("Should be InOnly", ExchangePattern.InOnly, exchange.getPattern());
-                        assertNull("There should NOT be a reply destination", exchange.getIn().getHeader(JmsConstants.JMS_REPLY_DESTINATION));
-
                         exchange.getIn().setBody("Bye World");
                     }
                 }).to("mock:result");

Modified: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsInOutIssueTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsInOutIssueTest.java?rev=790078&r1=790077&r2=790078&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsInOutIssueTest.java
(original)
+++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsInOutIssueTest.java
Wed Jul  1 09:03:46 2009
@@ -25,23 +25,26 @@
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.jms.JmsConstants;
+import org.junit.Test;
 
 /**
  * @version $Revision$
  */
 public class JmsInOutIssueTest extends ContextTestSupport {
 
+    @Test
     public void testInOutWithRequestBody() throws Exception {
         String reply = template.requestBody("activemq:queue:in", "Hello World", String.class);
         assertEquals("Bye World", reply);
     }
 
+    @Test
     public void testInOutWithAsyncRequestBody() throws Exception {
         Future<String> reply = template.asyncRequestBody("activemq:queue:in", "Hello
World", String.class);
         assertEquals("Bye World", reply.get());
     }
 
+    @Test
     public void testInOutWithSendExchange() throws Exception {
         Exchange out = template.send("activemq:queue:in", ExchangePattern.InOut, new Processor()
{
             public void process(Exchange exchange) throws Exception {
@@ -52,6 +55,7 @@
         assertEquals("Bye World", out.getOut().getBody());
     }
 
+    @Test
     public void testInOutWithAsyncSendExchange() throws Exception {
         Future<Exchange> out = template.asyncSend("activemq:queue:in", new Processor()
{
             public void process(Exchange exchange) throws Exception {
@@ -74,9 +78,6 @@
             public void configure() throws Exception {
                 from("activemq:queue:in").process(new Processor() {
                     public void process(Exchange exchange) throws Exception {
-                        assertEquals("Should be InOut", ExchangePattern.InOut, exchange.getPattern());
-                        assertNotNull("There should be a reply destination", exchange.getIn().getHeader(JmsConstants.JMS_REPLY_DESTINATION));
-
                         exchange.getOut().setBody("Bye World");
                     }
                 });



Mime
View raw message