camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] git commit: Fix for CAMEL-7498. Most of this was already done, just adding a test here
Date Wed, 11 Jun 2014 13:10:26 GMT
Repository: camel
Updated Branches:
  refs/heads/master 85f65613d -> 7a98b543f


Fix for CAMEL-7498.  Most of this was already done, just adding a test here


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b66df8b7
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b66df8b7
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b66df8b7

Branch: refs/heads/master
Commit: b66df8b76357fd4f292a40f0d4c12b49dc88d50c
Parents: 6a02d8e
Author: Kevin Earls <kevin@kevinearls.com>
Authored: Wed Jun 11 14:22:41 2014 +0200
Committer: Kevin Earls <kevin@kevinearls.com>
Committed: Wed Jun 11 14:22:41 2014 +0200

----------------------------------------------------------------------
 ...ponentConfigurationAndDocumentationTest.java | 58 ++++++++++++++++++++
 1 file changed, 58 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b66df8b7/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlComponentConfigurationAndDocumentationTest.java
b/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlComponentConfigurationAndDocumentationTest.java
new file mode 100644
index 0000000..f6605c6
--- /dev/null
+++ b/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlComponentConfigurationAndDocumentationTest.java
@@ -0,0 +1,58 @@
+/**
+ * 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.sql;
+
+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;
+
+import javax.swing.*;
+
+public class SqlComponentConfigurationAndDocumentationTest extends CamelTestSupport {
+
+    @Override
+    public boolean isUseRouteBuilder() {
+        return false;
+    }
+
+    @Test
+    public void testComponentConfiguration() throws Exception {
+        SqlComponent comp = context.getComponent("sql", SqlComponent.class);
+        EndpointConfiguration conf = comp.createConfiguration("sql:select?dataSourceRef=jdbc/myDataSource&allowNamedParameters=true");
+
+        assertEquals("jdbc/myDataSource", conf.getParameter("dataSourceRef"));
+        assertEquals("true", conf.getParameter("allowNamedParameters"));
+
+        ComponentConfiguration compConf = comp.createComponentConfiguration();
+        String json = compConf.createParameterJsonSchema();
+        assertNotNull(json);
+
+        assertTrue(json.contains("\"onConsumeBatchComplete\": { \"type\": \"java.lang.String\"
}"));
+        assertTrue(json.contains("\"parametersCount\": { \"type\": \"int\" }"));
+    }
+
+    @Test
+    public void testComponentDocumentation() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        String html = context.getComponentDocumentation("sql");
+        assertNotNull("Should have found some auto-generated HTML if on Java 7", html);
+    }
+
+}


Mime
View raw message