You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2014/02/16 15:13:23 UTC
[3/4] git commit: Added test
Added test
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ce7ecc7c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ce7ecc7c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ce7ecc7c
Branch: refs/heads/camel-2.12.x
Commit: ce7ecc7ca8d4b203dd313499ae14fe98af0d0c9d
Parents: d226586
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Feb 16 13:40:58 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Feb 16 14:55:57 2014 +0100
----------------------------------------------------------------------
...sComponentConfigurationAndDocumentation.java | 60 ++++++++++++++++++++
1 file changed, 60 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/ce7ecc7c/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);
+ }
+
+}