diff --git a/feature-pack/src/main/resources/modules/system/layers/fuse/org/apache/camel/main/module.xml b/feature-pack/src/main/resources/modules/system/layers/fuse/org/apache/camel/main/module.xml index 76ebe662ff..f0e3d52fee 100644 --- a/feature-pack/src/main/resources/modules/system/layers/fuse/org/apache/camel/main/module.xml +++ b/feature-pack/src/main/resources/modules/system/layers/fuse/org/apache/camel/main/module.xml @@ -26,7 +26,14 @@ - + + + + + + + + diff --git a/feature-pack/src/main/resources/modules/system/layers/fuse/org/apache/camel/spring/main/module.xml b/feature-pack/src/main/resources/modules/system/layers/fuse/org/apache/camel/spring/main/module.xml index db483ee213..f5fbaca5bc 100644 --- a/feature-pack/src/main/resources/modules/system/layers/fuse/org/apache/camel/spring/main/module.xml +++ b/feature-pack/src/main/resources/modules/system/layers/fuse/org/apache/camel/spring/main/module.xml @@ -17,6 +17,16 @@ + + + + + + + + + + diff --git a/feature-pack/src/main/resources/modules/system/layers/fuse/org/springframework/jdbc/main/module.xml b/feature-pack/src/main/resources/modules/system/layers/fuse/org/springframework/jdbc/main/module.xml index 23b82b567e..304e1879be 100644 --- a/feature-pack/src/main/resources/modules/system/layers/fuse/org/springframework/jdbc/main/module.xml +++ b/feature-pack/src/main/resources/modules/system/layers/fuse/org/springframework/jdbc/main/module.xml @@ -4,8 +4,10 @@ + + diff --git a/itests/standalone/basic/src/main/java/org/wildfly/camel/test/spring/SpringJdbcNamespaceTest.java b/itests/standalone/basic/src/main/java/org/wildfly/camel/test/spring/SpringJdbcNamespaceTest.java new file mode 100644 index 0000000000..8e9ccd3c40 --- /dev/null +++ b/itests/standalone/basic/src/main/java/org/wildfly/camel/test/spring/SpringJdbcNamespaceTest.java @@ -0,0 +1,67 @@ +/* + * #%L + * Wildfly Camel :: Testsuite + * %% + * Copyright (C) 2013 - 2015 RedHat + * %% + * Licensed 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. + * #L% + */ + +package org.wildfly.camel.test.spring; + +import java.util.concurrent.TimeUnit; + +import org.apache.camel.CamelContext; +import org.apache.camel.component.mock.MockEndpoint; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.wildfly.extension.camel.CamelContextRegistry; + +@RunWith(Arquillian.class) +public class SpringJdbcNamespaceTest { + + @ArquillianResource + CamelContextRegistry contextRegistry; + + @Deployment + public static JavaArchive createDeployment() { + final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "camel-jdbc-tests"); + archive.addAsResource("spring/jdbc-namespace-camel-context.xml"); + archive.addAsResource("spring/sql/db-schema.sql", "db-schema.sql"); + archive.addAsResource("spring/sql/db-data.sql", "db-data.sql"); + return archive; + } + + @Test + public void testSpringJdbcNamespace() throws Exception { + CamelContext camelctx = contextRegistry.getCamelContext("spring-jdbc"); + Assert.assertNotNull(camelctx); + + MockEndpoint resultEndpoint = camelctx.getEndpoint("mock:result", MockEndpoint.class); + resultEndpoint.expectedMessageCount(1); + + MockEndpoint.assertWait(1, TimeUnit.SECONDS, resultEndpoint); + resultEndpoint.assertIsSatisfied(); + + String result = resultEndpoint.getExchanges().get(0).getIn().getBody(String.class); + + Assert.assertEquals("Hello kermit", result); + } +} diff --git a/itests/standalone/basic/src/main/resources/spring/jdbc-namespace-camel-context.xml b/itests/standalone/basic/src/main/resources/spring/jdbc-namespace-camel-context.xml new file mode 100644 index 0000000000..6e56527cd6 --- /dev/null +++ b/itests/standalone/basic/src/main/resources/spring/jdbc-namespace-camel-context.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + Hello ${body['NAME']} + + + + + + diff --git a/itests/standalone/basic/src/main/resources/spring/sql/db-data.sql b/itests/standalone/basic/src/main/resources/spring/sql/db-data.sql new file mode 100644 index 0000000000..a62c2c51ad --- /dev/null +++ b/itests/standalone/basic/src/main/resources/spring/sql/db-data.sql @@ -0,0 +1 @@ +INSERT INTO jdbc_test VALUES (1, 'kermit'); diff --git a/itests/standalone/basic/src/main/resources/spring/sql/db-schema.sql b/itests/standalone/basic/src/main/resources/spring/sql/db-schema.sql new file mode 100644 index 0000000000..43e3d59ef7 --- /dev/null +++ b/itests/standalone/basic/src/main/resources/spring/sql/db-schema.sql @@ -0,0 +1,5 @@ +DROP SCHEMA IF EXISTS jdbc_test; +CREATE TABLE jdbc_test ( + id INT, + name VARCHAR(6) +); diff --git a/modules/etc/baseline/exported-paths.txt b/modules/etc/baseline/exported-paths.txt index 2175baf9c9..3519beb6e5 100644 --- a/modules/etc/baseline/exported-paths.txt +++ b/modules/etc/baseline/exported-paths.txt @@ -131,6 +131,7 @@ org/springframework/instrument/classloading/jboss org/springframework/instrument/classloading/tomcat org/springframework/instrument/classloading/weblogic org/springframework/instrument/classloading/websphere +org/springframework/jdbc/config org/springframework/jmx org/springframework/jmx/access org/springframework/jmx/export diff --git a/modules/etc/generated/wildfly/modules/system/layers/fuse/org/apache/camel/spring/main/module.xml b/modules/etc/generated/wildfly/modules/system/layers/fuse/org/apache/camel/spring/main/module.xml index 78682fa8d9..21ac5df6fb 100644 --- a/modules/etc/generated/wildfly/modules/system/layers/fuse/org/apache/camel/spring/main/module.xml +++ b/modules/etc/generated/wildfly/modules/system/layers/fuse/org/apache/camel/spring/main/module.xml @@ -17,6 +17,16 @@ + + + + + + + + + + diff --git a/modules/etc/generated/wildfly/modules/system/layers/fuse/org/springframework/jdbc/main/module.xml b/modules/etc/generated/wildfly/modules/system/layers/fuse/org/springframework/jdbc/main/module.xml index 9ffdecd3e6..38d2a0dc89 100644 --- a/modules/etc/generated/wildfly/modules/system/layers/fuse/org/springframework/jdbc/main/module.xml +++ b/modules/etc/generated/wildfly/modules/system/layers/fuse/org/springframework/jdbc/main/module.xml @@ -4,8 +4,10 @@ + + diff --git a/modules/etc/managed/wildfly/modules/system/layers/fuse/org/apache/camel/main/module.xml b/modules/etc/managed/wildfly/modules/system/layers/fuse/org/apache/camel/main/module.xml index 76ebe662ff..f0e3d52fee 100644 --- a/modules/etc/managed/wildfly/modules/system/layers/fuse/org/apache/camel/main/module.xml +++ b/modules/etc/managed/wildfly/modules/system/layers/fuse/org/apache/camel/main/module.xml @@ -26,7 +26,14 @@ - + + + + + + + + diff --git a/modules/etc/smartics/camel-modules.xml b/modules/etc/smartics/camel-modules.xml index d799f536d6..f886c7332f 100644 --- a/modules/etc/smartics/camel-modules.xml +++ b/modules/etc/smartics/camel-modules.xml @@ -57,6 +57,16 @@ + + + + + + + + + + diff --git a/modules/etc/smartics/spring-modules.xml b/modules/etc/smartics/spring-modules.xml index c9ec416933..f3a3bb49b3 100644 --- a/modules/etc/smartics/spring-modules.xml +++ b/modules/etc/smartics/spring-modules.xml @@ -67,8 +67,10 @@ + +