Author: davsclaus Date: Thu Oct 21 18:10:44 2010 New Revision: 1026089 URL: http://svn.apache.org/viewvc?rev=1026089&view=rev Log: CAMEL-3248: Added feature for camel-exec. Thanks to Jean for patch.
Added: camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelExecTest.java (with props) camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/exec/ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/exec/ExecTest.java (with props) Modified: camel/trunk/components/camel-exec/pom.xml camel/trunk/parent/pom.xml camel/trunk/platforms/karaf/features/src/main/resources/features-spring2.xml camel/trunk/platforms/karaf/features/src/main/resources/features.xml Modified: camel/trunk/components/camel-exec/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-exec/pom.xml?rev=1026089&r1=1026088&r2=1026089&view=diff ============================================================================== --- camel/trunk/components/camel-exec/pom.xml (original) +++ camel/trunk/components/camel-exec/pom.xml Thu Oct 21 18:10:44 2010 @@ -28,13 +28,6 @@ <description>Camel support for system command execution</description> <properties> - <!-- - TODO: move the versions to section dependencyManagement of the parent pom, - and then remove the versions underneath - --> - <commons-exec-version>1.0.1</commons-exec-version> - <commons-io-version>1.4</commons-io-version> - <commons-lang-version>2.5</commons-lang-version> <camel.osgi.export.pkg>org.apache.camel.component.exec.*</camel.osgi.export.pkg> </properties> @@ -51,7 +44,7 @@ <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> - <version>${commons-io-version}</version> + <version>1.4</version> </dependency> <dependency> <groupId>commons-lang</groupId> Modified: camel/trunk/parent/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=1026089&r1=1026088&r2=1026089&view=diff ============================================================================== --- camel/trunk/parent/pom.xml (original) +++ camel/trunk/parent/pom.xml Thu Oct 21 18:10:44 2010 @@ -44,6 +44,7 @@ <cometd-bayeux-version>6.1.11</cometd-bayeux-version> <commons-codec>1.4</commons-codec> <commons-csv>1.0-r706899_3</commons-csv> + <commons-exec-version>1.0.1</commons-exec-version> <commons-io-version>1.3.2</commons-io-version> <commons-lang-version>2.4</commons-lang-version> <commons-logging-version>1.1.1</commons-logging-version> Modified: camel/trunk/platforms/karaf/features/src/main/resources/features-spring2.xml URL: http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/src/main/resources/features-spring2.xml?rev=1026089&r1=1026088&r2=1026089&view=diff ============================================================================== --- camel/trunk/platforms/karaf/features/src/main/resources/features-spring2.xml (original) +++ camel/trunk/platforms/karaf/features/src/main/resources/features-spring2.xml Thu Oct 21 18:10:44 2010 @@ -129,6 +129,13 @@ <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-beanutils/${commons-beanutils-bundle-version}</bundle> <bundle>mvn:org.apache.camel/camel-dozer/${pom.version}</bundle> </feature> + <feature name='camel-exec' version='${pom.version}'> + <feature version='${pom.version}'>camel-core</feature> + <bundle>mvn:org.apache.commons/commons-exec/${commons-exec-version}</bundle> + <!-- Force the commons-io version as it's specific to camel-exec --> + <bundle>mvn:commons-io/commons-io/1.4</bundle> + <bundle>mvn:org.apache.camel/camel-exec/${pom.version}</bundle> + </feature> <feature name='camel-http' version='${pom.version}'> <feature version='${pom.version}'>camel-core</feature> <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient/${commons-httpclient-bundle-version}</bundle> Modified: camel/trunk/platforms/karaf/features/src/main/resources/features.xml URL: http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/src/main/resources/features.xml?rev=1026089&r1=1026088&r2=1026089&view=diff ============================================================================== --- camel/trunk/platforms/karaf/features/src/main/resources/features.xml (original) +++ camel/trunk/platforms/karaf/features/src/main/resources/features.xml Thu Oct 21 18:10:44 2010 @@ -247,6 +247,13 @@ <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-beanutils/${commons-beanutils-bundle-version}</bundle> <bundle>mvn:org.apache.camel/camel-dozer/${pom.version}</bundle> </feature> + <feature name='camel-exec' version='${pom.version}'> + <feature version='${pom.version}'>camel-core</feature> + <bundle>mvn:org.apache.commons/commons-exec/${commons-exec-version}</bundle> + <!-- Force the commons-io version as it's specific to camel-exec --> + <bundle>mvn:commons-io/commons-io/1.4</bundle> + <bundle>mvn:org.apache.camel/camel-exec/${pom.version}</bundle> + </feature> <feature name='camel-flatpack' version='${pom.version}'> <feature version='${pom.version}'>camel-spring</feature> <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jdom/${jdom-bundle-version}</bundle> Added: camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelExecTest.java URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelExecTest.java?rev=1026089&view=auto ============================================================================== --- camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelExecTest.java (added) +++ camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelExecTest.java Thu Oct 21 18:10:44 2010 @@ -0,0 +1,41 @@ +/** + * 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.karaf; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.ops4j.pax.exam.Option; +import org.ops4j.pax.exam.junit.Configuration; +import org.ops4j.pax.exam.junit.JUnit4TestRunner; + +...@runwith(JUnit4TestRunner.class) +public class CamelExecTest extends AbstractFeatureTest { + + public static final String COMPONENT = extractName(CamelExecTest.class); + + @Test + public void test() throws Exception { + testComponent(COMPONENT); + testComponent("exec"); + } + + @Configuration + public static Option[] configure() { + return configure(COMPONENT); + } + +} Propchange: camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelExecTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelExecTest.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Added: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/exec/ExecTest.java URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/exec/ExecTest.java?rev=1026089&view=auto ============================================================================== --- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/exec/ExecTest.java (added) +++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/exec/ExecTest.java Thu Oct 21 18:10:44 2010 @@ -0,0 +1,75 @@ +/** + * 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.osgi.exec; + +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.ops4j.pax.exam.Option; +import org.ops4j.pax.exam.junit.Configuration; +import org.ops4j.pax.exam.junit.JUnit4TestRunner; + +import static org.ops4j.pax.exam.CoreOptions.equinox; +import static org.ops4j.pax.exam.CoreOptions.felix; +import static org.ops4j.pax.exam.CoreOptions.options; +import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.profile; +import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures; +import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory; + +...@runwith(JUnit4TestRunner.class) +...@ignore("We need a test which runs on all platforms") +public class ExecTest extends OSGiIntegrationTestSupport { + + @Test + public void testExec() throws Exception { + getMockEndpoint("mock:result").expectedBodiesReceived("test"); + template.sendBody("direct:exec", "test"); + assertMockEndpointsSatisfied(); + } + + @Override + protected RouteBuilder createRouteBuilder() { + return new RouteBuilder() { + public void configure() { + from("direct:exec").to("exec:echo?args=-n test").to("mock:result"); + } + }; + } + + @Configuration + public static Option[] configure() { + Option[] options = options( + // install the spring dm profile + profile("spring.dm").version("1.2.0"), + + // this is how you set the default log level when using pax logging (logProfile) + org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"), + + // using the features to install the camel components + scanFeatures(getCamelKarafFeatureUrl(), + "camel-core", "camel-spring", "camel-test", "camel-exec"), + + workingDirectory("target/paxrunner/"), + + felix(), equinox()); + + return options; + } + +} Propchange: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/exec/ExecTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/exec/ExecTest.java ------------------------------------------------------------------------------ svn:keywords = Rev Date