Repository: camel Updated Branches: refs/heads/camel-2.12.x d22658623 -> 7c7c86fd4 refs/heads/master 61490fdf0 -> 62ed5d974
Added test Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4a5cc163 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4a5cc163 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4a5cc163 Branch: refs/heads/master Commit: 4a5cc163c8f215792913ce5f48b5be9b39697588 Parents: 61490fd Author: Claus Ibsen <[email protected]> Authored: Sun Feb 16 13:40:58 2014 +0100 Committer: Claus Ibsen <[email protected]> Committed: Sun Feb 16 13:40:58 2014 +0100 ---------------------------------------------------------------------- ...sComponentConfigurationAndDocumentation.java | 60 ++++++++++++++++++++ 1 file changed, 60 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/4a5cc163/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsComponentConfigurationAndDocumentation.java ---------------------------------------------------------------------- diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsComponentConfigurationAndDocumentation.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsComponentConfigurationAndDocumentation.java new file mode 100644 index 0000000..839034a --- /dev/null +++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsComponentConfigurationAndDocumentation.java @@ -0,0 +1,60 @@ +/** + * 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.jms; + +import org.apache.camel.CamelContext; +import org.apache.camel.ComponentConfiguration; +import org.apache.camel.EndpointConfiguration; +import org.apache.camel.impl.DefaultCamelContext; +import org.apache.camel.test.junit4.CamelTestSupport; +import org.junit.Test; + +public class JmsComponentConfigurationAndDocumentation extends CamelTestSupport { + + @Override + public boolean isUseRouteBuilder() { + return false; + } + + @Test + public void testComponentConfiguration() throws Exception { + JmsComponent comp = context.getComponent("jms", JmsComponent.class); + EndpointConfiguration conf = comp.createConfiguration("jms:queue:foo?replyTo=bar"); + + assertEquals("bar", conf.getParameter("replyTo")); + + ComponentConfiguration compConf = comp.createComponentConfiguration(); + String json = compConf.createParameterJsonSchema(); + assertNotNull(json); + + assertTrue(json.contains("\"replyToDestination\": { \"type\": \"java.lang.String\" }")); + assertTrue(json.contains("\"transacted\": { \"type\": \"boolean\" }")); + } + + @Test + public void testComponentDocumentation() throws Exception { + // cannot be tested on java 1.6 + if (CamelTestSupport.isJava16()) { + return; + } + + CamelContext context = new DefaultCamelContext(); + String html = context.getComponentDocumentation("jms"); + assertNotNull("Should have found some auto-generated HTML if on Java 7", html); + } + +}
