Repository: camel Updated Branches: refs/heads/master ccfa6c527 -> 680ee9e0c
CAMEL-9956 : Add support for FluentProducerTemplate to CamelTestSupport Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/680ee9e0 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/680ee9e0 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/680ee9e0 Branch: refs/heads/master Commit: 680ee9e0c052d53e0686c0a38f986a1fee65dc04 Parents: ccfa6c5 Author: lburgazzoli <lburgazz...@gmail.com> Authored: Wed May 11 23:14:59 2016 +0200 Committer: lburgazzoli <lburgazz...@gmail.com> Committed: Wed May 11 23:14:59 2016 +0200 ---------------------------------------------------------------------- .../apache/camel/component/ehcache/EhcacheTestSupport.java | 5 ----- .../java/org/apache/camel/test/junit4/CamelTestSupport.java | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/680ee9e0/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheTestSupport.java ---------------------------------------------------------------------- diff --git a/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheTestSupport.java b/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheTestSupport.java index 3aec949..616401d 100644 --- a/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheTestSupport.java +++ b/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheTestSupport.java @@ -26,7 +26,6 @@ import java.util.UUID; import java.util.stream.Collectors; import java.util.stream.IntStream; -import org.apache.camel.builder.FluentProducerTemplate; import org.apache.camel.component.ehcache.processor.aggregate.EhcacheAggregationRepository; import org.apache.camel.impl.DefaultExchangeHolder; import org.apache.camel.impl.JndiRegistry; @@ -132,8 +131,4 @@ public class EhcacheTestSupport extends CamelTestSupport { i -> i + "-" + generateRandomString() )); } - - FluentProducerTemplate fluentTemplate() { - return FluentProducerTemplate.on(context()); - } } http://git-wip-us.apache.org/repos/asf/camel/blob/680ee9e0/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java ---------------------------------------------------------------------- diff --git a/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java b/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java index 2c74e80..03fd1fe 100644 --- a/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java +++ b/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java @@ -44,6 +44,7 @@ import org.apache.camel.Service; import org.apache.camel.ServiceStatus; import org.apache.camel.api.management.mbean.ManagedCamelContextMBean; import org.apache.camel.builder.AdviceWithRouteBuilder; +import org.apache.camel.builder.FluentProducerTemplate; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.component.properties.PropertiesComponent; @@ -82,6 +83,7 @@ public abstract class CamelTestSupport extends TestSupport { private static ThreadLocal<Service> threadService = new ThreadLocal<Service>(); protected volatile ModelCamelContext context; protected volatile ProducerTemplate template; + protected volatile FluentProducerTemplate fluentTemplate; protected volatile ConsumerTemplate consumer; protected volatile Service camelContextService; protected boolean dumpRouteStats; @@ -201,6 +203,10 @@ public abstract class CamelTestSupport extends TestSupport { return template; } + public FluentProducerTemplate fluentTemplate() { + return fluentTemplate; + } + public ConsumerTemplate consumer() { return consumer; } @@ -292,6 +298,7 @@ public abstract class CamelTestSupport extends TestSupport { template.start(); consumer = context.createConsumerTemplate(); consumer.start(); + fluentTemplate = FluentProducerTemplate.on(context()); threadTemplate.set(template); threadConsumer.set(consumer);