Repository: camel Updated Branches: refs/heads/master 8087fe90f -> 011e49452
CAMEL-11446: Use awaitility in camel-core for testing where we otherwise use thred sleep which can be speeded up. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/011e4945 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/011e4945 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/011e4945 Branch: refs/heads/master Commit: 011e49452f701c4721cd516c275a260de29789b6 Parents: 8087fe9 Author: Claus Ibsen <davscl...@apache.org> Authored: Sun Jul 9 09:40:38 2017 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Sun Jul 9 09:40:38 2017 +0200 ---------------------------------------------------------------------- .../camel/component/rest/DummyRestConsumerFactory.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/011e4945/camel-core/src/test/java/org/apache/camel/component/rest/DummyRestConsumerFactory.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/component/rest/DummyRestConsumerFactory.java b/camel-core/src/test/java/org/apache/camel/component/rest/DummyRestConsumerFactory.java index cdd64d8..b00df45 100644 --- a/camel-core/src/test/java/org/apache/camel/component/rest/DummyRestConsumerFactory.java +++ b/camel-core/src/test/java/org/apache/camel/component/rest/DummyRestConsumerFactory.java @@ -22,7 +22,7 @@ import org.apache.camel.CamelContext; import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.component.seda.SedaEndpoint; -import org.apache.camel.impl.ActiveMQUuidGenerator; +import org.apache.camel.impl.DefaultUuidGenerator; import org.apache.camel.spi.RestApiConsumerFactory; import org.apache.camel.spi.RestConfiguration; import org.apache.camel.spi.RestConsumerFactory; @@ -46,9 +46,9 @@ public class DummyRestConsumerFactory implements RestConsumerFactory, RestApiCon // just use a seda endpoint for testing purpose String id; if (uriTemplate != null) { - id = ActiveMQUuidGenerator.generateSanitizedId(basePath + uriTemplate); + id = DefaultUuidGenerator.generateSanitizedId(basePath + uriTemplate); } else { - id = ActiveMQUuidGenerator.generateSanitizedId(basePath); + id = DefaultUuidGenerator.generateSanitizedId(basePath); } // remove leading dash as we add that ourselves if (id.startsWith("-")) { @@ -63,6 +63,8 @@ public class DummyRestConsumerFactory implements RestConsumerFactory, RestApiCon } SedaEndpoint seda = camelContext.getEndpoint("seda:" + verb + "-" + id, SedaEndpoint.class); + // speedup pooling to also be able to shutdown faster + seda.setPollTimeout(10); return seda.createConsumer(processor); } @@ -70,12 +72,14 @@ public class DummyRestConsumerFactory implements RestConsumerFactory, RestApiCon public Consumer createApiConsumer(CamelContext camelContext, Processor processor, String contextPath, RestConfiguration configuration, Map<String, Object> parameters) throws Exception { // just use a seda endpoint for testing purpose - String id = ActiveMQUuidGenerator.generateSanitizedId(contextPath); + String id = DefaultUuidGenerator.generateSanitizedId(contextPath); // remove leading dash as we add that ourselves if (id.startsWith("-")) { id = id.substring(1); } SedaEndpoint seda = camelContext.getEndpoint("seda:api:" + "-" + id, SedaEndpoint.class); + // speedup pooling to also be able to shutdown faster + seda.setPollTimeout(10); return seda.createConsumer(processor); }