You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/03/10 17:10:11 UTC
[1/2] camel git commit: CAMEL-9696: test component should pass in uri
options to the endpoint. Also fix so you can use files for testing. Thanks to
Quinn for finding the issue.
Repository: camel
Updated Branches:
refs/heads/camel-2.16.x 7c2905f40 -> eb6e2ebd4
refs/heads/master 83ae1a526 -> a76ad7923
CAMEL-9696: test component should pass in uri options to the endpoint. Also fix so you can use files for testing. Thanks to Quinn for finding the issue.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/eb6e2ebd
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/eb6e2ebd
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/eb6e2ebd
Branch: refs/heads/camel-2.16.x
Commit: eb6e2ebd444937a6612804d43e2234c464d0f967
Parents: 7c2905f
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Mar 10 17:08:52 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Mar 10 17:09:21 2016 +0100
----------------------------------------------------------------------
.../java/org/apache/camel/PollingConsumer.java | 2 +-
.../camel/component/test/TestComponent.java | 24 +++------
.../camel/component/test/TestEndpoint.java | 12 ++++-
.../org/apache/camel/util/EndpointHelper.java | 7 ++-
.../camel/component/test/TestFileTest.java | 54 ++++++++++++++++++++
.../camel/component/test/TestSedaTest.java | 46 +++++++++++++++++
6 files changed, 122 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/eb6e2ebd/camel-core/src/main/java/org/apache/camel/PollingConsumer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/PollingConsumer.java b/camel-core/src/main/java/org/apache/camel/PollingConsumer.java
index 4236e8e..45a4f98 100644
--- a/camel-core/src/main/java/org/apache/camel/PollingConsumer.java
+++ b/camel-core/src/main/java/org/apache/camel/PollingConsumer.java
@@ -67,7 +67,7 @@ public interface PollingConsumer extends Consumer {
* @param timeout the amount of time in milliseconds to wait for a message
* before timing out and returning <tt>null</tt>
*
- * @return the message exchange if one iwas available within the timeout
+ * @return the message exchange if one was available within the timeout
* period, or <tt>null</tt> if the timeout expired
*/
Exchange receive(long timeout);
http://git-wip-us.apache.org/repos/asf/camel/blob/eb6e2ebd/camel-core/src/main/java/org/apache/camel/component/test/TestComponent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/test/TestComponent.java b/camel-core/src/main/java/org/apache/camel/component/test/TestComponent.java
index af16c2d..719b4b1 100644
--- a/camel-core/src/main/java/org/apache/camel/component/test/TestComponent.java
+++ b/camel-core/src/main/java/org/apache/camel/component/test/TestComponent.java
@@ -24,6 +24,7 @@ import org.apache.camel.Endpoint;
import org.apache.camel.impl.UriEndpointComponent;
import org.apache.camel.util.CamelContextHelper;
import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.URISupport;
import org.apache.camel.util.UnsafeUriCharactersEncoder;
/**
@@ -40,28 +41,19 @@ public class TestComponent extends UriEndpointComponent {
super(TestEndpoint.class);
}
- public Endpoint createEndpoint(String uri) throws Exception {
- // lets not use the normal parameter handling so that all parameters are sent to the nested endpoint
-
- ObjectHelper.notNull(getCamelContext(), "camelContext");
- URI u = new URI(UnsafeUriCharactersEncoder.encode(uri));
- String path = u.getSchemeSpecificPart();
- if (path.startsWith("//")) {
- path = path.substring(2);
- }
-
- return createEndpoint(uri, path, new HashMap<String, Object>());
- }
-
@Override
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
Long timeout = getAndRemoveParameter(parameters, "timeout", Long.class);
- Endpoint endpoint = CamelContextHelper.getMandatoryEndpoint(getCamelContext(), remaining);
-
- TestEndpoint answer = new TestEndpoint(uri, this, endpoint);
+ TestEndpoint answer = new TestEndpoint(uri, this);
if (timeout != null) {
answer.setTimeout(timeout);
}
+ setProperties(answer, parameters);
+
+ // from the rest create a new uri with those parameters
+ String endpointUri = URISupport.appendParametersToURI(remaining, parameters);
+ Endpoint endpoint = CamelContextHelper.getMandatoryEndpoint(getCamelContext(), endpointUri);
+ answer.setExpectedMessageEndpoint(endpoint);
return answer;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/eb6e2ebd/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java
index f1fd29c..76a9c62 100644
--- a/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java
@@ -23,6 +23,7 @@ import org.apache.camel.Component;
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
+import org.apache.camel.WrappedFile;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriEndpoint;
@@ -42,14 +43,17 @@ import org.slf4j.LoggerFactory;
@UriEndpoint(scheme = "test", title = "Test", syntax = "test:name", producerOnly = true, label = "core,testing", lenientProperties = true)
public class TestEndpoint extends MockEndpoint {
private static final Logger LOG = LoggerFactory.getLogger(TestEndpoint.class);
- private final Endpoint expectedMessageEndpoint;
+ private Endpoint expectedMessageEndpoint;
@UriPath(description = "Name of endpoint to lookup in the registry to use for polling messages used for testing") @Metadata(required = "true")
private String name;
@UriParam(label = "producer", defaultValue = "2000")
private long timeout = 2000L;
- public TestEndpoint(String endpointUri, Component component, Endpoint expectedMessageEndpoint) {
+ public TestEndpoint(String endpointUri, Component component) {
super(endpointUri, component);
+ }
+
+ public void setExpectedMessageEndpoint(Endpoint expectedMessageEndpoint) {
this.expectedMessageEndpoint = expectedMessageEndpoint;
}
@@ -60,7 +64,11 @@ public class TestEndpoint extends MockEndpoint {
final List<Object> expectedBodies = new ArrayList<Object>();
EndpointHelper.pollEndpoint(expectedMessageEndpoint, new Processor() {
public void process(Exchange exchange) throws Exception {
+ // if file based we need to load the file into memory as the file may be deleted/moved afterwards
Object body = getInBody(exchange);
+ if (body instanceof WrappedFile) {
+ body = exchange.getIn().getBody(byte[].class);
+ }
LOG.trace("Received message body {}", body);
expectedBodies.add(body);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/eb6e2ebd/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java b/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java
index eeb75ca..fb0c91e 100644
--- a/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java
@@ -53,7 +53,6 @@ public final class EndpointHelper {
private static final AtomicLong ENDPOINT_COUNTER = new AtomicLong(0);
private static final Pattern SYNTAX_PATTERN = Pattern.compile("(\\w+)");
-
private EndpointHelper() {
//Utility Class
}
@@ -66,7 +65,7 @@ public final class EndpointHelper {
public static void pollEndpoint(Endpoint endpoint, Processor processor, long timeout) throws Exception {
PollingConsumer consumer = endpoint.createPollingConsumer();
try {
- consumer.start();
+ ServiceHelper.startService(consumer);
while (true) {
Exchange exchange = consumer.receive(timeout);
@@ -78,9 +77,9 @@ public final class EndpointHelper {
}
} finally {
try {
- consumer.stop();
+ ServiceHelper.stopAndShutdownService(consumer);
} catch (Exception e) {
- LOG.warn("Failed to stop PollingConsumer: " + e, e);
+ LOG.warn("Failed to stop PollingConsumer: " + consumer + ". This example is ignored.", e);
}
}
}
http://git-wip-us.apache.org/repos/asf/camel/blob/eb6e2ebd/camel-core/src/test/java/org/apache/camel/component/test/TestFileTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/test/TestFileTest.java b/camel-core/src/test/java/org/apache/camel/component/test/TestFileTest.java
new file mode 100644
index 0000000..c1d0cca
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/component/test/TestFileTest.java
@@ -0,0 +1,54 @@
+/**
+ * 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.test;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Ignore;
+
+public class TestFileTest extends ContextTestSupport {
+
+ @Override
+ public boolean isUseRouteBuilder() {
+ return false;
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ deleteDirectory("target/testme");
+ super.setUp();
+ }
+
+ @Ignore
+ public void testFile() throws Exception {
+ template.sendBody("file:target/testme", "Hello World");
+
+ context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start")
+ .to("test:file:target/testme?noop=true&timeout=1500");
+ }
+ });
+ context.start();
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/eb6e2ebd/camel-core/src/test/java/org/apache/camel/component/test/TestSedaTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/test/TestSedaTest.java b/camel-core/src/test/java/org/apache/camel/component/test/TestSedaTest.java
new file mode 100644
index 0000000..b7eba80
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/component/test/TestSedaTest.java
@@ -0,0 +1,46 @@
+/**
+ * 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.test;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+
+public class TestSedaTest extends ContextTestSupport {
+
+ @Override
+ public boolean isUseRouteBuilder() {
+ return false;
+ }
+
+ public void testSeda() throws Exception {
+ template.sendBody("seda:testme", "Hello World");
+
+ context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start")
+ .to("test:seda:testme");
+ }
+ });
+ context.start();
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
[2/2] camel git commit: CAMEL-9696: test component should pass in uri
options to the endpoint. Also fix so you can use files for testing. Thanks to
Quinn for finding the issue.
Posted by da...@apache.org.
CAMEL-9696: test component should pass in uri options to the endpoint. Also fix so you can use files for testing. Thanks to Quinn for finding the issue.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a76ad792
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a76ad792
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a76ad792
Branch: refs/heads/master
Commit: a76ad7923630c251871e093975795d9a2efc2170
Parents: 83ae1a5
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Mar 10 17:08:52 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Mar 10 17:10:03 2016 +0100
----------------------------------------------------------------------
.../java/org/apache/camel/PollingConsumer.java | 2 +-
.../camel/component/test/TestComponent.java | 24 +++------
.../camel/component/test/TestEndpoint.java | 12 ++++-
.../org/apache/camel/util/EndpointHelper.java | 7 ++-
.../camel/component/test/TestFileTest.java | 54 ++++++++++++++++++++
.../camel/component/test/TestSedaTest.java | 46 +++++++++++++++++
6 files changed, 122 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/a76ad792/camel-core/src/main/java/org/apache/camel/PollingConsumer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/PollingConsumer.java b/camel-core/src/main/java/org/apache/camel/PollingConsumer.java
index 4236e8e..45a4f98 100644
--- a/camel-core/src/main/java/org/apache/camel/PollingConsumer.java
+++ b/camel-core/src/main/java/org/apache/camel/PollingConsumer.java
@@ -67,7 +67,7 @@ public interface PollingConsumer extends Consumer {
* @param timeout the amount of time in milliseconds to wait for a message
* before timing out and returning <tt>null</tt>
*
- * @return the message exchange if one iwas available within the timeout
+ * @return the message exchange if one was available within the timeout
* period, or <tt>null</tt> if the timeout expired
*/
Exchange receive(long timeout);
http://git-wip-us.apache.org/repos/asf/camel/blob/a76ad792/camel-core/src/main/java/org/apache/camel/component/test/TestComponent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/test/TestComponent.java b/camel-core/src/main/java/org/apache/camel/component/test/TestComponent.java
index af16c2d..719b4b1 100644
--- a/camel-core/src/main/java/org/apache/camel/component/test/TestComponent.java
+++ b/camel-core/src/main/java/org/apache/camel/component/test/TestComponent.java
@@ -24,6 +24,7 @@ import org.apache.camel.Endpoint;
import org.apache.camel.impl.UriEndpointComponent;
import org.apache.camel.util.CamelContextHelper;
import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.URISupport;
import org.apache.camel.util.UnsafeUriCharactersEncoder;
/**
@@ -40,28 +41,19 @@ public class TestComponent extends UriEndpointComponent {
super(TestEndpoint.class);
}
- public Endpoint createEndpoint(String uri) throws Exception {
- // lets not use the normal parameter handling so that all parameters are sent to the nested endpoint
-
- ObjectHelper.notNull(getCamelContext(), "camelContext");
- URI u = new URI(UnsafeUriCharactersEncoder.encode(uri));
- String path = u.getSchemeSpecificPart();
- if (path.startsWith("//")) {
- path = path.substring(2);
- }
-
- return createEndpoint(uri, path, new HashMap<String, Object>());
- }
-
@Override
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
Long timeout = getAndRemoveParameter(parameters, "timeout", Long.class);
- Endpoint endpoint = CamelContextHelper.getMandatoryEndpoint(getCamelContext(), remaining);
-
- TestEndpoint answer = new TestEndpoint(uri, this, endpoint);
+ TestEndpoint answer = new TestEndpoint(uri, this);
if (timeout != null) {
answer.setTimeout(timeout);
}
+ setProperties(answer, parameters);
+
+ // from the rest create a new uri with those parameters
+ String endpointUri = URISupport.appendParametersToURI(remaining, parameters);
+ Endpoint endpoint = CamelContextHelper.getMandatoryEndpoint(getCamelContext(), endpointUri);
+ answer.setExpectedMessageEndpoint(endpoint);
return answer;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/a76ad792/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java
index 77030e2..6882967 100644
--- a/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java
@@ -23,6 +23,7 @@ import org.apache.camel.Component;
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
+import org.apache.camel.WrappedFile;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriEndpoint;
@@ -44,14 +45,17 @@ import org.slf4j.LoggerFactory;
@UriEndpoint(scheme = "test", title = "Test", syntax = "test:name", producerOnly = true, label = "core,testing", lenientProperties = true)
public class TestEndpoint extends MockEndpoint {
private static final Logger LOG = LoggerFactory.getLogger(TestEndpoint.class);
- private final Endpoint expectedMessageEndpoint;
+ private Endpoint expectedMessageEndpoint;
@UriPath(description = "Name of endpoint to lookup in the registry to use for polling messages used for testing") @Metadata(required = "true")
private String name;
@UriParam(label = "producer", defaultValue = "2000")
private long timeout = 2000L;
- public TestEndpoint(String endpointUri, Component component, Endpoint expectedMessageEndpoint) {
+ public TestEndpoint(String endpointUri, Component component) {
super(endpointUri, component);
+ }
+
+ public void setExpectedMessageEndpoint(Endpoint expectedMessageEndpoint) {
this.expectedMessageEndpoint = expectedMessageEndpoint;
}
@@ -62,7 +66,11 @@ public class TestEndpoint extends MockEndpoint {
final List<Object> expectedBodies = new ArrayList<Object>();
EndpointHelper.pollEndpoint(expectedMessageEndpoint, new Processor() {
public void process(Exchange exchange) throws Exception {
+ // if file based we need to load the file into memory as the file may be deleted/moved afterwards
Object body = getInBody(exchange);
+ if (body instanceof WrappedFile) {
+ body = exchange.getIn().getBody(byte[].class);
+ }
LOG.trace("Received message body {}", body);
expectedBodies.add(body);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/a76ad792/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java b/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java
index eeb75ca..fb0c91e 100644
--- a/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java
@@ -53,7 +53,6 @@ public final class EndpointHelper {
private static final AtomicLong ENDPOINT_COUNTER = new AtomicLong(0);
private static final Pattern SYNTAX_PATTERN = Pattern.compile("(\\w+)");
-
private EndpointHelper() {
//Utility Class
}
@@ -66,7 +65,7 @@ public final class EndpointHelper {
public static void pollEndpoint(Endpoint endpoint, Processor processor, long timeout) throws Exception {
PollingConsumer consumer = endpoint.createPollingConsumer();
try {
- consumer.start();
+ ServiceHelper.startService(consumer);
while (true) {
Exchange exchange = consumer.receive(timeout);
@@ -78,9 +77,9 @@ public final class EndpointHelper {
}
} finally {
try {
- consumer.stop();
+ ServiceHelper.stopAndShutdownService(consumer);
} catch (Exception e) {
- LOG.warn("Failed to stop PollingConsumer: " + e, e);
+ LOG.warn("Failed to stop PollingConsumer: " + consumer + ". This example is ignored.", e);
}
}
}
http://git-wip-us.apache.org/repos/asf/camel/blob/a76ad792/camel-core/src/test/java/org/apache/camel/component/test/TestFileTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/test/TestFileTest.java b/camel-core/src/test/java/org/apache/camel/component/test/TestFileTest.java
new file mode 100644
index 0000000..c1d0cca
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/component/test/TestFileTest.java
@@ -0,0 +1,54 @@
+/**
+ * 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.test;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Ignore;
+
+public class TestFileTest extends ContextTestSupport {
+
+ @Override
+ public boolean isUseRouteBuilder() {
+ return false;
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ deleteDirectory("target/testme");
+ super.setUp();
+ }
+
+ @Ignore
+ public void testFile() throws Exception {
+ template.sendBody("file:target/testme", "Hello World");
+
+ context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start")
+ .to("test:file:target/testme?noop=true&timeout=1500");
+ }
+ });
+ context.start();
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/a76ad792/camel-core/src/test/java/org/apache/camel/component/test/TestSedaTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/test/TestSedaTest.java b/camel-core/src/test/java/org/apache/camel/component/test/TestSedaTest.java
new file mode 100644
index 0000000..b7eba80
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/component/test/TestSedaTest.java
@@ -0,0 +1,46 @@
+/**
+ * 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.test;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+
+public class TestSedaTest extends ContextTestSupport {
+
+ @Override
+ public boolean isUseRouteBuilder() {
+ return false;
+ }
+
+ public void testSeda() throws Exception {
+ template.sendBody("seda:testme", "Hello World");
+
+ context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start")
+ .to("test:seda:testme");
+ }
+ });
+ context.start();
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}