Updated Branches: refs/heads/master dbe794c37 -> 1ef5f5f9e
Added test based on user forum issue Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1ef5f5f9 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1ef5f5f9 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1ef5f5f9 Branch: refs/heads/master Commit: 1ef5f5f9e7115a51237b02a7740121b4daaee8e9 Parents: dbe794c Author: Claus Ibsen <davscl...@apache.org> Authored: Wed Oct 30 18:15:33 2013 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Wed Oct 30 18:15:41 2013 +0100 ---------------------------------------------------------------------- .../apache/camel/test/CamelTestSupportTest.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/1ef5f5f9/components/camel-test/src/test/java/org/apache/camel/test/CamelTestSupportTest.java ---------------------------------------------------------------------- diff --git a/components/camel-test/src/test/java/org/apache/camel/test/CamelTestSupportTest.java b/components/camel-test/src/test/java/org/apache/camel/test/CamelTestSupportTest.java index cfa0cc5..d5e3ee3 100644 --- a/components/camel-test/src/test/java/org/apache/camel/test/CamelTestSupportTest.java +++ b/components/camel-test/src/test/java/org/apache/camel/test/CamelTestSupportTest.java @@ -14,21 +14,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.test; import org.apache.camel.NoSuchEndpointException; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.impl.JndiRegistry; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Before; import org.junit.Test; public class CamelTestSupportTest extends CamelTestSupport { + private volatile boolean called; + @Override @Before public void setUp() throws Exception { + called = false; replaceRouteFromWith("routeId", "direct:start"); super.setUp(); } @@ -59,6 +62,21 @@ public class CamelTestSupportTest extends CamelTestSupport { } @Override + protected JndiRegistry createRegistry() throws Exception { + called = true; + + JndiRegistry jndi = super.createRegistry(); + jndi.bind("beer", "yes"); + return jndi; + } + + @Test + public void testCreateRegistry() { + assertTrue("Should call createRegistry", called); + assertEquals("yes", context.getRegistry().lookupByName("beer")); + } + + @Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override