camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/3] camel git commit: CAMEL-10523: Move test out of camel-core to itest
Date Tue, 31 Jan 2017 17:41:18 GMT
Repository: camel
Updated Branches:
  refs/heads/master c76224c1a -> 56d8b5514


http://git-wip-us.apache.org/repos/asf/camel/blob/57ccbe1d/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DirectVmComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DirectVmComponentConfigurationAndDocumentationTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DirectVmComponentConfigurationAndDocumentationTest.java
new file mode 100644
index 0000000..c43e20c
--- /dev/null
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DirectVmComponentConfigurationAndDocumentationTest.java
@@ -0,0 +1,56 @@
+/**
+ * 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.itest.doc;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ComponentConfiguration;
+import org.apache.camel.EndpointConfiguration;
+import org.apache.camel.component.directvm.DirectVmComponent;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class DirectVmComponentConfigurationAndDocumentationTest extends CamelTestSupport
{
+
+    @Override
+    public boolean isUseRouteBuilder() {
+        return false;
+    }
+
+    @Test
+    public void testComponentConfiguration() throws Exception {
+        DirectVmComponent comp = context.getComponent("direct-vm", DirectVmComponent.class);
+        EndpointConfiguration conf = comp.createConfiguration("direct-vm:foo?block=false");
+
+        assertEquals("false", conf.getParameter("block"));
+
+        ComponentConfiguration compConf = comp.createComponentConfiguration();
+        String json = compConf.createParameterJsonSchema();
+        assertNotNull(json);
+
+        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"group\": \"common\",
\"required\": \"true\", \"type\": \"string\""));
+        assertTrue(json.contains("\"timeout\": { \"kind\": \"parameter\", \"group\": \"producer\",
\"label\": \"producer\", \"type\": \"integer\""));
+    }
+
+    @Test
+    public void testComponentDocumentation() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String html = context.getComponentDocumentation("direct-vm");
+        assertNotNull("Should have found some auto-generated HTML", html);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/57ccbe1d/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/EipDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/EipDocumentationTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/EipDocumentationTest.java
new file mode 100644
index 0000000..6d96a9c
--- /dev/null
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/EipDocumentationTest.java
@@ -0,0 +1,86 @@
+/**
+ * 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.itest.doc;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class EipDocumentationTest extends CamelTestSupport {
+
+    @Override
+    public boolean isUseRouteBuilder() {
+        return false;
+    }
+
+    @Test
+    public void testDocumentation() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String json = context.getEipParameterJsonSchema("from");
+        log.info(json);
+        assertNotNull("Should have found json for from", json);
+
+        assertTrue(json.contains("\"name\": \"from\""));
+        assertTrue(json.contains("\"uri\": { \"kind\": \"attribute\""));
+        assertTrue(json.contains("\"ref\": { \"kind\": \"attribute\""));
+    }
+
+    @Test
+    public void testSplitDocumentation() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String json = context.getEipParameterJsonSchema("split");
+        log.info(json);
+        assertNotNull("Should have found json for split", json);
+
+        assertTrue(json.contains("\"name\": \"split\""));
+        // there should be javadoc included
+        assertTrue(json.contains("If enabled then processing each splitted messages occurs
concurrently."));
+        // and it support outputs
+        assertTrue(json.contains("\"outputs\": { \"kind\": \"element\", \"required\": \"true\",
\"type\": \"array\", \"javaType\""));
+    }
+
+    @Test
+    public void testSimpleDocumentation() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String json = context.getEipParameterJsonSchema("simple");
+        log.info(json);
+        assertNotNull("Should have found json for simple", json);
+
+        assertTrue(json.contains("\"label\": \"language,core,java\""));
+        assertTrue(json.contains("\"name\": \"simple\""));
+    }
+
+    @Test
+    public void testFailOverDocumentation() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String json = context.getEipParameterJsonSchema("failover");
+        log.info(json);
+        assertNotNull("Should have found json for failover", json);
+
+        assertTrue(json.contains("\"name\": \"failover\""));
+        assertTrue(json.contains("\"exception\": { \"kind\": \"element\", \"required\": \"false\",
\"type\": \"array\""
+            + ", \"javaType\": \"java.util.List<java.lang.String>\", \"deprecated\":
\"false\""));
+    }
+
+    @Test
+    public void testNotFound() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String json = context.getEipParameterJsonSchema("unknown");
+        assertNull("Should not have found json for unknown", json);
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/57ccbe1d/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/FileComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/FileComponentConfigurationAndDocumentationTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/FileComponentConfigurationAndDocumentationTest.java
new file mode 100644
index 0000000..0794e54
--- /dev/null
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/FileComponentConfigurationAndDocumentationTest.java
@@ -0,0 +1,57 @@
+/**
+ * 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.itest.doc;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ComponentConfiguration;
+import org.apache.camel.EndpointConfiguration;
+import org.apache.camel.component.file.FileComponent;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class FileComponentConfigurationAndDocumentationTest extends CamelTestSupport {
+
+    @Override
+    public boolean isUseRouteBuilder() {
+        return false;
+    }
+
+    @Test
+    public void testComponentConfiguration() throws Exception {
+        FileComponent comp = context.getComponent("file", FileComponent.class);
+        EndpointConfiguration conf = comp.createConfiguration("file:target/foo?delete=true");
+
+        assertEquals("true", conf.getParameter("delete"));
+
+        ComponentConfiguration compConf = comp.createComponentConfiguration();
+        String json = compConf.createParameterJsonSchema();
+        assertNotNull(json);
+
+        assertTrue(json.contains("\"directoryName\": { \"kind\": \"path\", \"group\": \"common\",
\"required\": \"true\""));
+        assertTrue(json.contains("\"autoCreate\": { \"kind\": \"parameter\", \"group\": \"advanced\",
\"label\": \"advanced\", \"type\": \"boolean\""));
+        assertTrue(json.contains("\"readLockMinAge\": { \"kind\": \"parameter\", \"group\":
\"lock\", \"label\": \"consumer,lock\""));
+    }
+
+    @Test
+    public void testComponentDocumentation() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String html = context.getComponentDocumentation("file");
+        assertNotNull("Should have found some auto-generated HTML", html);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/57ccbe1d/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LanguageComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LanguageComponentConfigurationAndDocumentationTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LanguageComponentConfigurationAndDocumentationTest.java
new file mode 100644
index 0000000..75acaef
--- /dev/null
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LanguageComponentConfigurationAndDocumentationTest.java
@@ -0,0 +1,56 @@
+/**
+ * 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.itest.doc;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ComponentConfiguration;
+import org.apache.camel.EndpointConfiguration;
+import org.apache.camel.component.language.LanguageComponent;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class LanguageComponentConfigurationAndDocumentationTest extends CamelTestSupport
{
+
+    @Override
+    public boolean isUseRouteBuilder() {
+        return false;
+    }
+
+    @Test
+    public void testComponentConfiguration() throws Exception {
+        LanguageComponent comp = context.getComponent("language", LanguageComponent.class);
+        EndpointConfiguration conf = comp.createConfiguration("language:simple:foo?transform=false");
+
+        assertEquals("false", conf.getParameter("transform"));
+
+        ComponentConfiguration compConf = comp.createComponentConfiguration();
+        String json = compConf.createParameterJsonSchema();
+        assertNotNull(json);
+
+        assertTrue(json.contains("\"languageName\": { \"kind\": \"path\", \"group\": \"producer\",
\"required\": \"true\""));
+        assertTrue(json.contains("\"script\": { \"kind\": \"parameter\", \"group\": \"producer\",
\"type\": \"string\""));
+    }
+
+    @Test
+    public void testComponentDocumentation() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String html = context.getComponentDocumentation("language");
+        assertNotNull("Should have found some auto-generated HTML", html);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/57ccbe1d/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LogComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LogComponentConfigurationAndDocumentationTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LogComponentConfigurationAndDocumentationTest.java
new file mode 100644
index 0000000..adbea39
--- /dev/null
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LogComponentConfigurationAndDocumentationTest.java
@@ -0,0 +1,57 @@
+/**
+ * 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.itest.doc;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ComponentConfiguration;
+import org.apache.camel.EndpointConfiguration;
+import org.apache.camel.component.log.LogComponent;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class LogComponentConfigurationAndDocumentationTest extends CamelTestSupport {
+
+    @Override
+    public boolean isUseRouteBuilder() {
+        return false;
+    }
+
+    @Test
+    public void testComponentConfiguration() throws Exception {
+        LogComponent comp = context.getComponent("log", LogComponent.class);
+        EndpointConfiguration conf = comp.createConfiguration("log:foo?level=DEBUG");
+
+        assertEquals("DEBUG", conf.getParameter("level"));
+
+        ComponentConfiguration compConf = comp.createComponentConfiguration();
+        String json = compConf.createParameterJsonSchema();
+        assertNotNull(json);
+
+        assertTrue(json.contains("\"loggerName\": { \"kind\": \"path\", \"group\": \"producer\",
\"required\": \"true\""));
+        assertTrue(json.contains("\"level\": { \"kind\": \"parameter\", \"group\": \"producer\",
\"type\": \"string\""));
+        assertTrue(json.contains("\"showBody\": { \"kind\": \"parameter\", \"group\": \"formatting\",
\"label\": \"formatting\""));
+    }
+
+    @Test
+    public void testComponentDocumentation() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String html = context.getComponentDocumentation("log");
+        assertNotNull("Should have found some auto-generated HTML", html);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/57ccbe1d/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/MockComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/MockComponentConfigurationAndDocumentationTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/MockComponentConfigurationAndDocumentationTest.java
new file mode 100644
index 0000000..f38fc1f
--- /dev/null
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/MockComponentConfigurationAndDocumentationTest.java
@@ -0,0 +1,66 @@
+/**
+ * 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.itest.doc;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ComponentConfiguration;
+import org.apache.camel.EndpointConfiguration;
+import org.apache.camel.component.mock.MockComponent;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class MockComponentConfigurationAndDocumentationTest extends CamelTestSupport {
+
+    @Override
+    public boolean isUseRouteBuilder() {
+        return false;
+    }
+
+    @Test
+    public void testComponentConfiguration() throws Exception {
+        MockComponent comp = context.getComponent("mock", MockComponent.class);
+        EndpointConfiguration conf = comp.createConfiguration("mock:foo?retainFirst=10");
+
+        assertEquals("10", conf.getParameter("retainFirst"));
+
+        ComponentConfiguration compConf = comp.createComponentConfiguration();
+        String json = compConf.createParameterJsonSchema();
+        assertNotNull(json);
+
+        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"group\": \"producer\",
\"required\": \"true\""));
+        assertTrue(json.contains("\"expectedCount\": { \"kind\": \"parameter\", \"group\":
\"producer\", \"label\": \"producer\""));
+        assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"group\":
\"producer\", \"label\": \"producer\""));
+    }
+
+    @Test
+    public void testEndpointExplain() throws Exception {
+        String json = context.explainEndpointJson("mock:foo?retainFirst=10", true);
+        assertNotNull(json);
+
+        assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"group\":
\"producer\", \"label\": \"producer\", \"type\": \"integer\","
+            + " \"javaType\": \"int\", \"deprecated\": \"false\", \"secret\": \"false\",
\"value\": \"10\""));
+    }
+
+    @Test
+    public void testComponentDocumentation() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String html = context.getComponentDocumentation("mock");
+        assertNotNull("Should have found some auto-generated HTML", html);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/57ccbe1d/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SedaComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SedaComponentConfigurationAndDocumentationTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SedaComponentConfigurationAndDocumentationTest.java
new file mode 100644
index 0000000..fa94ed7
--- /dev/null
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SedaComponentConfigurationAndDocumentationTest.java
@@ -0,0 +1,56 @@
+/**
+ * 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.itest.doc;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ComponentConfiguration;
+import org.apache.camel.EndpointConfiguration;
+import org.apache.camel.component.seda.SedaComponent;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class SedaComponentConfigurationAndDocumentationTest extends CamelTestSupport {
+
+    @Override
+    public boolean isUseRouteBuilder() {
+        return false;
+    }
+
+    @Test
+    public void testComponentConfiguration() throws Exception {
+        SedaComponent comp = context.getComponent("seda", SedaComponent.class);
+        EndpointConfiguration conf = comp.createConfiguration("seda:foo?blockWhenFull=true");
+
+        assertEquals("true", conf.getParameter("blockWhenFull"));
+
+        ComponentConfiguration compConf = comp.createComponentConfiguration();
+        String json = compConf.createParameterJsonSchema();
+        assertNotNull(json);
+
+        assertTrue(json.contains("\"concurrentConsumers\": { \"kind\": \"parameter\", \"group\":
\"consumer\", \"label\": \"consumer\""));
+        assertTrue(json.contains("\"timeout\": { \"kind\": \"parameter\", \"group\": \"producer\",
\"label\": \"producer\""));
+    }
+
+    @Test
+    public void testComponentDocumentation() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String html = context.getComponentDocumentation("seda");
+        assertNotNull("Should have found some auto-generated HTML", html);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/57ccbe1d/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SimpleLanguageConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SimpleLanguageConfigurationAndDocumentationTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SimpleLanguageConfigurationAndDocumentationTest.java
new file mode 100644
index 0000000..60c1545
--- /dev/null
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SimpleLanguageConfigurationAndDocumentationTest.java
@@ -0,0 +1,44 @@
+/**
+ * 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.itest.doc;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class SimpleLanguageConfigurationAndDocumentationTest extends CamelTestSupport {
+
+    @Override
+    public boolean isUseRouteBuilder() {
+        return false;
+    }
+
+    @Test
+    public void testLanguageJsonSchema() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String json = context.getLanguageParameterJsonSchema("simple");
+        assertNotNull("Should have found some auto-generated JSON", json);
+        log.info(json);
+
+        assertTrue(json.contains("\"name\": \"simple\""));
+        assertTrue(json.contains("\"modelName\": \"simple\""));
+        assertTrue(json.contains("\"resultType\": { \"kind\": \"attribute\", \"required\":
\"false\", \"type\": \"string\", \"javaType\": \"java.lang.String\", \"deprecated\": \"false\""));
+    }
+
+}
+

http://git-wip-us.apache.org/repos/asf/camel/blob/57ccbe1d/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/StringDataFormatConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/StringDataFormatConfigurationAndDocumentationTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/StringDataFormatConfigurationAndDocumentationTest.java
new file mode 100644
index 0000000..e110cc2
--- /dev/null
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/StringDataFormatConfigurationAndDocumentationTest.java
@@ -0,0 +1,43 @@
+/**
+ * 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.itest.doc;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class StringDataFormatConfigurationAndDocumentationTest extends CamelTestSupport {
+
+    @Override
+    public boolean isUseRouteBuilder() {
+        return false;
+    }
+
+    @Test
+    public void testDataFormatJsonSchema() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String json = context.getDataFormatParameterJsonSchema("string");
+        assertNotNull("Should have found some auto-generated JSON", json);
+        log.info(json);
+
+        assertTrue(json.contains("\"name\": \"string\""));
+        assertTrue(json.contains("\"modelName\": \"string\""));
+        assertTrue(json.contains("\"charset\": { \"kind\": \"attribute\", \"required\": \"false\",
\"type\": \"string\", \"javaType\": \"java.lang.String\", \"deprecated\": \"false\""));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/57ccbe1d/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TestComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TestComponentConfigurationAndDocumentationTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TestComponentConfigurationAndDocumentationTest.java
new file mode 100644
index 0000000..53394f7
--- /dev/null
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TestComponentConfigurationAndDocumentationTest.java
@@ -0,0 +1,56 @@
+/**
+ * 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.itest.doc;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ComponentConfiguration;
+import org.apache.camel.EndpointConfiguration;
+import org.apache.camel.component.test.TestComponent;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class TestComponentConfigurationAndDocumentationTest extends CamelTestSupport {
+
+    @Override
+    public boolean isUseRouteBuilder() {
+        return false;
+    }
+
+    @Test
+    public void testComponentConfiguration() throws Exception {
+        TestComponent comp = context.getComponent("test", TestComponent.class);
+        EndpointConfiguration conf = comp.createConfiguration("test:my:foo?timeout=1000");
+
+        assertEquals("1000", conf.getParameter("timeout"));
+
+        ComponentConfiguration compConf = comp.createComponentConfiguration();
+        String json = compConf.createParameterJsonSchema();
+        assertNotNull(json);
+
+        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"group\": \"producer\",
\"required\": \"true\""));
+        assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"group\":
\"producer\", \"label\": \"producer\""));
+    }
+
+    @Test
+    public void testComponentDocumentation() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String html = context.getComponentDocumentation("test");
+        assertNotNull("Should have found some auto-generated HTML", html);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/57ccbe1d/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TimerComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TimerComponentConfigurationAndDocumentationTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TimerComponentConfigurationAndDocumentationTest.java
new file mode 100644
index 0000000..e9f0647
--- /dev/null
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TimerComponentConfigurationAndDocumentationTest.java
@@ -0,0 +1,57 @@
+/**
+ * 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.itest.doc;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ComponentConfiguration;
+import org.apache.camel.EndpointConfiguration;
+import org.apache.camel.component.timer.TimerComponent;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class TimerComponentConfigurationAndDocumentationTest extends CamelTestSupport {
+
+    @Override
+    public boolean isUseRouteBuilder() {
+        return false;
+    }
+
+    @Test
+    public void testComponentConfiguration() throws Exception {
+        TimerComponent comp = context.getComponent("timer", TimerComponent.class);
+        EndpointConfiguration conf = comp.createConfiguration("timer:foo?period=2000");
+
+        assertEquals("2000", conf.getParameter("period"));
+
+        ComponentConfiguration compConf = comp.createComponentConfiguration();
+        String json = compConf.createParameterJsonSchema();
+        assertNotNull(json);
+
+        assertTrue(json.contains("\"timerName\": { \"kind\": \"path\", \"group\": \"consumer\",
\"required\": \"true\""));
+        assertTrue(json.contains("\"delay\": { \"kind\": \"parameter\", \"group\": \"consumer\",
\"type\": \"integer\""));
+        assertTrue(json.contains("\"timer\": { \"kind\": \"parameter\", \"group\": \"advanced\",
\"label\": \"advanced\""));
+    }
+
+    @Test
+    public void testComponentDocumentation() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String html = context.getComponentDocumentation("timer");
+        assertNotNull("Should have found some auto-generated HTML", html);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/57ccbe1d/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/XsltComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/XsltComponentConfigurationAndDocumentationTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/XsltComponentConfigurationAndDocumentationTest.java
new file mode 100644
index 0000000..babc415
--- /dev/null
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/XsltComponentConfigurationAndDocumentationTest.java
@@ -0,0 +1,57 @@
+/**
+ * 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.itest.doc;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ComponentConfiguration;
+import org.apache.camel.EndpointConfiguration;
+import org.apache.camel.component.xslt.XsltComponent;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class XsltComponentConfigurationAndDocumentationTest extends CamelTestSupport {
+
+    @Override
+    public boolean isUseRouteBuilder() {
+        return false;
+    }
+
+    @Test
+    public void testComponentConfiguration() throws Exception {
+        XsltComponent comp = context.getComponent("xslt", XsltComponent.class);
+        EndpointConfiguration conf = comp.createConfiguration("xslt:foo?deleteOutputFile=true");
+
+        assertEquals("true", conf.getParameter("deleteOutputFile"));
+
+        ComponentConfiguration compConf = comp.createComponentConfiguration();
+        String json = compConf.createParameterJsonSchema();
+        assertNotNull(json);
+
+        assertTrue(json.contains("\"resourceUri\": { \"kind\": \"path\", \"group\": \"producer\",
\"required\": \"true\""));
+        assertTrue(json.contains("\"allowStAX\": { \"kind\": \"parameter\", \"group\": \"producer\",
\"type\": \"boolean\""));
+        assertTrue(json.contains("\"transformerFactoryClass\": { \"kind\": \"parameter\",
\"group\": \"advanced\", \"label\": \"advanced\""));
+    }
+
+    @Test
+    public void testComponentDocumentation() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String html = context.getComponentDocumentation("xslt");
+        assertNotNull("Should have found some auto-generated HTML", html);
+    }
+
+}


Mime
View raw message