camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1407975 - in /camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/temp: TemporaryQueueRouteTest.java TemporaryTopicRouteTest.java
Date Sun, 11 Nov 2012 13:27:48 GMT
Author: davsclaus
Date: Sun Nov 11 13:27:47 2012
New Revision: 1407975

URL: http://svn.apache.org/viewvc?rev=1407975&view=rev
Log:
Fixed test

Removed:
    camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/temp/TemporaryTopicRouteTest.java
Modified:
    camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/temp/TemporaryQueueRouteTest.java

Modified: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/temp/TemporaryQueueRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/temp/TemporaryQueueRouteTest.java?rev=1407975&r1=1407974&r2=1407975&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/temp/TemporaryQueueRouteTest.java
(original)
+++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/temp/TemporaryQueueRouteTest.java
Sun Nov 11 13:27:47 2012
@@ -18,16 +18,12 @@ package org.apache.camel.component.jms.t
 
 import javax.jms.ConnectionFactory;
 
-import org.apache.activemq.command.ActiveMQTempQueue;
 import org.apache.camel.CamelContext;
-import org.apache.camel.Message;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.jms.CamelJmsTestHelper;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import static org.apache.camel.component.jms.JmsComponent.jmsComponentAutoAcknowledge;
 
@@ -35,40 +31,22 @@ import static org.apache.camel.component
  * @version 
  */
 public class TemporaryQueueRouteTest extends CamelTestSupport {
-    private static final transient Logger LOG = LoggerFactory.getLogger(TemporaryQueueRouteTest.class);
-
     protected String endpointUri = "activemq:temp:queue:cheese";
-    protected Object expectedBody = "<hello>world!</hello>";
-    protected MyBean myBean = new MyBean();
 
     @Test
     public void testSendMessage() throws Exception {
         MockEndpoint endpoint = getMockEndpoint("mock:result");
-        endpoint.expectedBodiesReceived("Result");
+        endpoint.expectedBodiesReceived("Hello World");
 
-        Thread.sleep(1000);
-        log.info("Sending: " + expectedBody + " to: " + endpointUri);
-        template.sendBody(endpointUri, expectedBody);
+        template.sendBody(endpointUri, "Hello World");
 
         endpoint.assertIsSatisfied();
-
-        Message message = myBean.getMessage();
-        assertNotNull("should have received a message", message);
-
-        LOG.info("Received: " + message);
-        Object header = message.getHeader("JMSDestination");
-        isValidDestination(header);
-    }
-
-    protected void isValidDestination(Object header) {
-        ActiveMQTempQueue destination = assertIsInstanceOf(ActiveMQTempQueue.class, header);
-        LOG.info("Received message has a temporary queue: " + destination);
     }
 
     protected CamelContext createCamelContext() throws Exception {
         CamelContext camelContext = super.createCamelContext();
 
-        ConnectionFactory connectionFactory = CamelJmsTestHelper.createPersistentConnectionFactory();
+        ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
         camelContext.addComponent("activemq", jmsComponentAutoAcknowledge(connectionFactory));
 
         return camelContext;
@@ -77,22 +55,9 @@ public class TemporaryQueueRouteTest ext
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from(endpointUri).bean(myBean).to("mock:result");
+                from(endpointUri).to("mock:result");
             }
         };
     }
 
-    public static class MyBean {
-        private Message message;
-
-        public String onMessage(Message message) {
-            this.message = message;
-            LOG.info("Invoked bean with: " + message);
-            return "Result";
-        }
-
-        public Message getMessage() {
-            return message;
-        }
-    }
 }



Mime
View raw message