Repository: camel Updated Branches: refs/heads/master d403cc908 -> 2bd185e92
Fixed test Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/aaa3a0c9 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/aaa3a0c9 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/aaa3a0c9 Branch: refs/heads/master Commit: aaa3a0c9e171bbeafad9688aaf468ae399bb6d16 Parents: d403cc9 Author: Claus Ibsen <davscl...@apache.org> Authored: Fri Apr 22 07:23:22 2016 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Fri Apr 22 07:23:22 2016 +0200 ---------------------------------------------------------------------- .../impl/EndpointRegistryKeepRouteEndpointsTest.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/aaa3a0c9/camel-core/src/test/java/org/apache/camel/impl/EndpointRegistryKeepRouteEndpointsTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/impl/EndpointRegistryKeepRouteEndpointsTest.java b/camel-core/src/test/java/org/apache/camel/impl/EndpointRegistryKeepRouteEndpointsTest.java index e75e7c1..db6e734 100644 --- a/camel-core/src/test/java/org/apache/camel/impl/EndpointRegistryKeepRouteEndpointsTest.java +++ b/camel-core/src/test/java/org/apache/camel/impl/EndpointRegistryKeepRouteEndpointsTest.java @@ -52,14 +52,21 @@ public class EndpointRegistryKeepRouteEndpointsTest extends ContextTestSupport { assertTrue(context.hasEndpoint("log://bar") != null); assertTrue(context.hasEndpoint("mock://result") != null); - // and the dynamic cache only keeps the last 20 - assertFalse(context.hasEndpoint("mock://unknown0") != null); - assertFalse(context.hasEndpoint("mock://unknown1") != null); + // and the dynamic cache only keeps 20 dynamic endpoints + int count = 0; + for (int i = 0; i < 50; i++) { + String uri = "mock://unknown" + i; + if (context.hasEndpoint(uri) != null) { + count++; + // and it should be dynamic + assertTrue(context.getEndpointRegistry().isDynamic(uri)); + }; + } + assertEquals("Should only be 20 dynamic endpoints in the cache", 20, count); // we should have 4 static, 20 dynamic and 24 in total assertEquals(4, context.getEndpointRegistry().staticSize()); assertTrue(context.getEndpointRegistry().isStatic("direct://start")); - assertTrue(context.getEndpointRegistry().isDynamic("mock://unknown49")); assertEquals(20, context.getEndpointRegistry().dynamicSize()); assertEquals(24, context.getEndpointRegistry().size());