camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r958893 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/component/direct/ camel-core/src/test/java/org/apache/camel/component/bean/ camel-core/src/test/java/org/apache/camel/component/direct/ camel-core/src/test/java/org/apache...
Date Tue, 29 Jun 2010 09:18:36 GMT
Author: davsclaus
Date: Tue Jun 29 09:18:34 2010
New Revision: 958893

URL: http://svn.apache.org/viewvc?rev=958893&view=rev
Log:
CAMEL-2854: Fixed direct endpoint not having consumers if been evicated from LRUCache and
re-created, then it cant link to the old existing consumer.

Added:
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/SendingToAlotOfDifferentDirectEndpointTest.java
  (with props)
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformToInvalidEndpointTest.java
      - copied, changed from r958840, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformToTest.java
Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectComponent.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanInPipelineTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/issues/CoarseGrainedProcessorDefinitionIssueTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/PipelineMEPTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformToTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithHandlePipelineTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptSendToEndpointTest.java
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/ProducerTemplateMaximumCacheSizeTest.java
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/example/PojoDualCamelContextConsumerTest.java
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/example/pojoDualCamelContextConsumer.xml

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectComponent.java?rev=958893&r1=958892&r2=958893&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectComponent.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectComponent.java
Tue Jun 29 09:18:34 2010
@@ -16,10 +16,12 @@
  */
 package org.apache.camel.component.direct;
 
+import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.camel.Endpoint;
 import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.util.ServiceHelper;
 
 /**
  * Represents the component that manages {@link DirectEndpoint}. It holds the
@@ -29,9 +31,21 @@ import org.apache.camel.impl.DefaultComp
  */
 public class DirectComponent extends DefaultComponent {
 
+    // must keep a map of consumers on the component to ensure endpoints can lookup old consumers
+    // later in case the DirectEndpoint was re-created due the old was evicted from the endpoints
LRUCache
+    // on DefaultCamelContext
+    private final Map<String, DirectConsumer> consumers = new HashMap<String, DirectConsumer>();
+
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object>
parameters) throws Exception {
-        Endpoint endpoint = new DirectEndpoint(uri, this);
+        Endpoint endpoint = new DirectEndpoint(uri, this, consumers);
         setProperties(endpoint, parameters);
         return endpoint;
     }
+
+    @Override
+    protected void doStop() throws Exception {
+        ServiceHelper.stopService(consumers.values());
+        consumers.clear();
+        super.doStop();
+    }
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectConsumer.java?rev=958893&r1=958892&r2=958893&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectConsumer.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectConsumer.java
Tue Jun 29 09:18:34 2010
@@ -38,16 +38,16 @@ public class DirectConsumer extends Defa
 
     public void start() throws Exception {
         // add consumer to endpoint
-        if (endpoint.getConsumer() != null && endpoint.getConsumer() != this) {
-            throw new IllegalArgumentException("Endpoint " + endpoint + " only allows one
consumer. Existing: " + endpoint.getConsumer() + " and this: " + this);
+        if (endpoint.hasConsumer(this)) {
+            throw new IllegalArgumentException("Cannot add a 2nd consumer to the same endpoint.
Endpoint " + endpoint + " only allows one consumer.");
         }
-        endpoint.setConsumer(this);
+        endpoint.addConsumer(this);
         super.start();
     }
 
     @Override
     public void stop() throws Exception {
-        endpoint.setConsumer(null);
+        endpoint.removeConsumer(this);
         super.stop();
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java?rev=958893&r1=958892&r2=958893&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
Tue Jun 29 09:18:34 2010
@@ -16,6 +16,10 @@
  */
 package org.apache.camel.component.direct;
 
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.Component;
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
@@ -28,17 +32,25 @@ import org.apache.camel.impl.DefaultEndp
  * @version $Revision$
  */
 public class DirectEndpoint extends DefaultEndpoint {
-    private DirectConsumer consumer;
 
-    public DirectEndpoint() {
-    }
+    private volatile Map<String, DirectConsumer> consumers;
 
-    public DirectEndpoint(String uri, DirectComponent component) {
-        super(uri, component);
+    public DirectEndpoint() {
+        this.consumers = new HashMap<String, DirectConsumer>();
     }
 
     public DirectEndpoint(String endpointUri) {
         super(endpointUri);
+        this.consumers = new HashMap<String, DirectConsumer>();
+    }
+
+    public DirectEndpoint(String endpointUri, Component component) {
+        this(endpointUri, component, new HashMap<String, DirectConsumer>());
+    }
+
+    public DirectEndpoint(String uri, Component component, Map<String, DirectConsumer>
consumers) {
+        super(uri, component);
+        this.consumers = consumers;
     }
 
     public Producer createProducer() throws Exception {
@@ -53,11 +65,24 @@ public class DirectEndpoint extends Defa
         return true;
     }
 
-    public DirectConsumer getConsumer() {
-        return consumer;
+    public void addConsumer(DirectConsumer consumer) {
+        String key = consumer.getEndpoint().getEndpointKey();
+        consumers.put(key, consumer);
+    }
+
+    public void removeConsumer(DirectConsumer consumer) {
+        String key = consumer.getEndpoint().getEndpointKey();
+        consumers.remove(key);
     }
 
-    public void setConsumer(DirectConsumer consumer) {
-        this.consumer = consumer;
+    public boolean hasConsumer(DirectConsumer consumer) {
+        String key = consumer.getEndpoint().getEndpointKey();
+        return consumers.containsKey(key);
     }
+
+    public DirectConsumer getConsumer() {
+        String key = getEndpointKey();
+        return consumers.get(key);
+    }
+
 }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanInPipelineTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanInPipelineTest.java?rev=958893&r1=958892&r2=958893&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanInPipelineTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanInPipelineTest.java
Tue Jun 29 09:18:34 2010
@@ -44,7 +44,7 @@ public class BeanInPipelineTest extends 
         return new RouteBuilder() {
             public void configure() throws Exception {
                 from("direct:start")
-                    .pipeline("bean:one", "bean:two", "direct:x", "direct:y", "bean:three");
+                    .pipeline("bean:one", "bean:two", "log:x", "log:y", "bean:three");
             }
         };
     }

Added: camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/SendingToAlotOfDifferentDirectEndpointTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/SendingToAlotOfDifferentDirectEndpointTest.java?rev=958893&view=auto
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/SendingToAlotOfDifferentDirectEndpointTest.java
(added)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/SendingToAlotOfDifferentDirectEndpointTest.java
Tue Jun 29 09:18:34 2010
@@ -0,0 +1,55 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.direct;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Endpoint;
+import org.apache.camel.builder.RouteBuilder;
+
+/**
+ * @version $Revision$
+ */
+public class SendingToAlotOfDifferentDirectEndpointTest extends ContextTestSupport {
+
+    public void testDirect() throws Exception {
+        getMockEndpoint("mock:foo").expectedMessageCount(3);
+
+        template.sendBody("seda:start", "Hello World");
+
+        // now create 1000 other endpoints to cause the first direct endpoint to vanish from
the LRUCache
+        for (int i = 0; i < 1200; i++) {
+            context.getEndpoint("direct:bar-" + i);
+        }
+
+        template.sendBody("direct:foo", "Bye Moon");
+        template.sendBody("seda:start", "Bye World");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("seda:start").to("direct:foo");
+
+                from("direct:foo").to("log:foo").to("mock:foo");
+            }
+        };
+    }
+}

Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/SendingToAlotOfDifferentDirectEndpointTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/SendingToAlotOfDifferentDirectEndpointTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateTest.java?rev=958893&r1=958892&r2=958893&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateTest.java
Tue Jun 29 09:18:34 2010
@@ -185,7 +185,7 @@ public class DefaultProducerTemplateTest
 
         // test that we cache at most 500 producers to avoid it eating to much memory
         for (int i = 0; i < 503; i++) {
-            Endpoint e = context.getEndpoint("direct:queue:" + i);
+            Endpoint e = context.getEndpoint("seda:queue:" + i);
             template.sendBody(e, "Hello");
         }
 
@@ -203,7 +203,7 @@ public class DefaultProducerTemplateTest
 
         // test that we cache at most 500 producers to avoid it eating to much memory
         for (int i = 0; i < 503; i++) {
-            Endpoint e = context.getEndpoint("direct:queue:" + i);
+            Endpoint e = context.getEndpoint("seda:queue:" + i);
             template.sendBody(e, "Hello");
         }
 

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/issues/CoarseGrainedProcessorDefinitionIssueTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/CoarseGrainedProcessorDefinitionIssueTest.java?rev=958893&r1=958892&r2=958893&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/issues/CoarseGrainedProcessorDefinitionIssueTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/issues/CoarseGrainedProcessorDefinitionIssueTest.java
Tue Jun 29 09:18:34 2010
@@ -47,7 +47,7 @@ public class CoarseGrainedProcessorDefin
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").delay(500).to("direct:foo").to("mock:result");
+                from("direct:start").delay(500).to("log:foo").to("mock:result");
             }
         };
     }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/PipelineMEPTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/PipelineMEPTest.java?rev=958893&r1=958892&r2=958893&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/PipelineMEPTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/PipelineMEPTest.java Tue
Jun 29 09:18:34 2010
@@ -87,7 +87,7 @@ public class PipelineMEPTest extends Con
                 // however the result after the routing is correct using APIs to get the
result
                 // however the exchange will carry body IN and OUT when the route completes,
as
                 // we operate on the original exchange in this processor
-                // (= we are the first node in the route after the from conumer)
+                // (= we are the first node in the route after the from consumer)
                 exchange.getOut().setBody(number);
             }
         };
@@ -97,7 +97,7 @@ public class PipelineMEPTest extends Con
                 from("direct:a")
                         .process(outProcessor)
                         // this pipeline is not really needed by to have some more routing
in there to test with
-                        .pipeline("direct:x", "direct:y")
+                        .pipeline("log:x", "log:y")
                         .process(inProcessor)
                         .to("mock:result");
             }

Copied: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformToInvalidEndpointTest.java
(from r958840, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformToTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformToInvalidEndpointTest.java?p2=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformToInvalidEndpointTest.java&p1=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformToTest.java&r1=958840&r2=958893&rev=958893&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformToTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformToInvalidEndpointTest.java
Tue Jun 29 09:18:34 2010
@@ -18,45 +18,15 @@ package org.apache.camel.processor;
 
 import org.apache.camel.CamelExecutionException;
 import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
 import org.apache.camel.NoSuchEndpointException;
-import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
 
 /**
  * @version $Revision$
  */
-public class TransformToTest extends ContextTestSupport {
-
-    public void testTransformTo() throws Exception {
-        MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedBodiesReceived("Bye World");
-
-        String out = template.requestBody("direct:start", "Hello World", String.class);
-        assertEquals("Bye World", out);
-
-        assertMockEndpointsSatisfied();
-    }
-
-    public void testTransformToInOnly() throws Exception {
-        MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedBodiesReceived("InOnly");
-
-        template.sendBody("direct:start", "Hello In");
-
-        assertMockEndpointsSatisfied();
-    }
+public class TransformToInvalidEndpointTest extends ContextTestSupport {
 
     public void testTransformToInvalidEndpoint() throws Exception {
-        context.addRoutes(new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                from("direct:bar").transform(sendTo("bar"));
-            }
-        });
-        context.start();
-
         try {
             template.requestBody("direct:bar", "Hello World");
             fail("Should thrown an exception");
@@ -70,20 +40,8 @@ public class TransformToTest extends Con
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start")
-                    .transform(sendTo("direct:foo")).to("mock:result");
-
-                from("direct:foo").process(new Processor() {
-                    public void process(Exchange exchange) throws Exception {
-                        String body = exchange.getIn().getBody(String.class);
-                        if ("Hello World".equals(body)) {
-                            exchange.getOut().setBody("Bye World");
-                        } else {
-                            exchange.getIn().setBody("InOnly");
-                        }
-                    }
-                });
+                from("direct:bar").transform(sendTo("bar"));
             }
         };
     }
-}
+}
\ No newline at end of file

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformToTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformToTest.java?rev=958893&r1=958892&r2=958893&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformToTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformToTest.java Tue
Jun 29 09:18:34 2010
@@ -16,10 +16,8 @@
  */
 package org.apache.camel.processor;
 
-import org.apache.camel.CamelExecutionException;
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
-import org.apache.camel.NoSuchEndpointException;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
@@ -48,23 +46,6 @@ public class TransformToTest extends Con
         assertMockEndpointsSatisfied();
     }
 
-    public void testTransformToInvalidEndpoint() throws Exception {
-        context.addRoutes(new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                from("direct:bar").transform(sendTo("bar"));
-            }
-        });
-        context.start();
-
-        try {
-            template.requestBody("direct:bar", "Hello World");
-            fail("Should thrown an exception");
-        } catch (CamelExecutionException e) {
-            assertIsInstanceOf(NoSuchEndpointException.class, e.getCause());
-        }
-    }
-
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithHandlePipelineTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithHandlePipelineTest.java?rev=958893&r1=958892&r2=958893&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithHandlePipelineTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithHandlePipelineTest.java
Tue Jun 29 09:18:34 2010
@@ -33,7 +33,7 @@ public class ValidationWithHandlePipelin
                         .doTry()
                             .process(validator).to("mock:valid")
                         .doCatch(ValidationException.class)
-                            .pipeline("direct:a", "mock:invalid");
+                            .pipeline("log:a", "mock:invalid");
             }
         };
     }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptSendToEndpointTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptSendToEndpointTest.java?rev=958893&r1=958892&r2=958893&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptSendToEndpointTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptSendToEndpointTest.java
Tue Jun 29 09:18:34 2010
@@ -189,6 +189,9 @@ public class InterceptSendToEndpointTest
                 
                 from("direct:input1").to("direct:intercept1");
                 from("direct:input2").to("direct:intercept2");
+
+                from("direct:intercept1").to("log:1");
+                from("direct:intercept2").to("log:2");
             }
         });
         context.start();

Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/ProducerTemplateMaximumCacheSizeTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/ProducerTemplateMaximumCacheSizeTest.java?rev=958893&r1=958892&r2=958893&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/ProducerTemplateMaximumCacheSizeTest.java
(original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/ProducerTemplateMaximumCacheSizeTest.java
Tue Jun 29 09:18:34 2010
@@ -46,7 +46,7 @@ public class ProducerTemplateMaximumCach
 
         // test that we cache at most 50 producers to avoid it eating to much memory
         for (int i = 0; i < 53; i++) {
-            Endpoint e = context.getEndpoint("direct:queue:" + i);
+            Endpoint e = context.getEndpoint("seda:queue:" + i);
             template.sendBody(e, "Hello");
         }
 

Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/example/PojoDualCamelContextConsumerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/example/PojoDualCamelContextConsumerTest.java?rev=958893&r1=958892&r2=958893&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/example/PojoDualCamelContextConsumerTest.java
(original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/example/PojoDualCamelContextConsumerTest.java
Tue Jun 29 09:18:34 2010
@@ -62,13 +62,13 @@ public class PojoDualCamelContextConsume
     public void testCamel1RecipientList() throws Exception {
         String body = "<hello>world!</hello>";
 
-        // direct:foo has no consumer in camel-1 so we should not expect any messages to
be routed to result/foo
+        // seda:foo has no consumer in camel-1 so we should not expect any messages to be
routed to result/foo
         MockEndpoint result = camel1.getEndpoint("mock:result", MockEndpoint.class);
         result.expectedMessageCount(0);
 
         ProducerTemplate template = camel1.createProducerTemplate();
         template.start();
-        template.sendBody("direct:foo", body);
+        template.sendBody("seda:foo", body);
         template.stop();
 
         Thread.sleep(200);

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/example/pojoDualCamelContextConsumer.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/example/pojoDualCamelContextConsumer.xml?rev=958893&r1=958892&r2=958893&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/example/pojoDualCamelContextConsumer.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/example/pojoDualCamelContextConsumer.xml
Tue Jun 29 09:18:34 2010
@@ -31,6 +31,6 @@
 
     <bean id="myCamel1Consumer" class="org.apache.camel.spring.example.MyCamel1Consumer"/>
     <bean id="myCamel2Consumer" class="org.apache.camel.spring.example.MyCamel2Consumer"/>
-    <bean id="myCamel2RecipeintList" class="org.apache.camel.spring.example.MyCamel2RecipientList"/>
+    <bean id="myCamel2RecipientList" class="org.apache.camel.spring.example.MyCamel2RecipientList"/>
 
 </beans>



Mime
View raw message