Repository: camel Updated Branches: refs/heads/master 9863ac9e4 -> 2f8bc8045
CAMEL-7741 Added karaf3 profile for running itest with karaf3 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2f8bc804 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2f8bc804 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2f8bc804 Branch: refs/heads/master Commit: 2f8bc804586f41ba346ccb30b1bcf96b5c702c09 Parents: 9863ac9 Author: Willem Jiang <willem.ji...@gmail.com> Authored: Tue Aug 26 14:41:35 2014 +0800 Committer: Willem Jiang <willem.ji...@gmail.com> Committed: Tue Aug 26 14:51:54 2014 +0800 ---------------------------------------------------------------------- parent/pom.xml | 1 + tests/camel-itest-karaf/pom.xml | 14 ++++++++ .../camel/itest/karaf/AbstractFeatureTest.java | 13 ++++++- tests/camel-itest-osgi/pom.xml | 36 ++++++++++++++------ .../itest/osgi/OSGiIntegrationTestSupport.java | 15 +++++++- 5 files changed, 66 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/2f8bc804/parent/pom.xml ---------------------------------------------------------------------- diff --git a/parent/pom.xml b/parent/pom.xml index 8a6293e..6cb99a9 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -269,6 +269,7 @@ <kafka-version>0.8.1</kafka-version> <kafka-bundle-version>0.8.1_1</kafka-bundle-version> <karaf-version>2.3.6</karaf-version> + <karaf3-version>3.0.1</karaf3-version> <kie-version>6.0.0.Final</kie-version> <krati-version>0.4.9</krati-version> <kxml2-bundle-version>2.3.0_2</kxml2-bundle-version> http://git-wip-us.apache.org/repos/asf/camel/blob/2f8bc804/tests/camel-itest-karaf/pom.xml ---------------------------------------------------------------------- diff --git a/tests/camel-itest-karaf/pom.xml b/tests/camel-itest-karaf/pom.xml index 219ac8c..9944170 100644 --- a/tests/camel-itest-karaf/pom.xml +++ b/tests/camel-itest-karaf/pom.xml @@ -66,6 +66,14 @@ <groupId>org.eclipse</groupId> <artifactId>osgi</artifactId> </exclusion> + <exclusion> + <groupId>org.apache.karaf</groupId> + <artifactId>org.apache.karaf.client</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache.felix</groupId> + <artifactId>org.apache.felix.framework</artifactId> + </exclusion> </exclusions> </dependency> <dependency> @@ -200,6 +208,12 @@ </plugins> </build> </profile> + <profile> + <id>karaf3</id> + <properties> + <karaf-version>${karaf3-version}</karaf-version> + </properties> + </profile> </profiles> </project> http://git-wip-us.apache.org/repos/asf/camel/blob/2f8bc804/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java index c164b9a..736b465 100644 --- a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java +++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java @@ -176,14 +176,25 @@ public abstract class AbstractFeatureTest { } } + private static String getKarafVersion() { + String karafVersion = System.getProperty("karafVersion"); + if (karafVersion == null) { + // setup the default version of it + karafVersion = "2.3.6"; + } + return karafVersion; + } + public static Option[] configure(String feature) { switchPlatformEncodingToUTF8(); + String karafVersion = getKarafVersion(); + LOG.info("*** The karaf version is " + karafVersion + " ***"); Option[] options = new Option[]{ KarafDistributionOption.karafDistributionConfiguration() .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").versionAsInProject()) - .karafVersion("2.3.6") + .karafVersion(karafVersion) .name("Apache Karaf") .useDeployFolder(false).unpackDirectory(new File("target/paxexam/unpack/")), http://git-wip-us.apache.org/repos/asf/camel/blob/2f8bc804/tests/camel-itest-osgi/pom.xml ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/pom.xml b/tests/camel-itest-osgi/pom.xml index a6dc6c4..0d89681 100644 --- a/tests/camel-itest-osgi/pom.xml +++ b/tests/camel-itest-osgi/pom.xml @@ -76,16 +76,24 @@ <version>${karaf-version}</version> <type>tar.gz</type> <scope>test</scope> - <exclusions> - <exclusion> - <groupId>org.apache.karaf.shell</groupId> - <artifactId>org.apache.karaf.shell.dev</artifactId> - </exclusion> - <exclusion> - <groupId>org.eclipse</groupId> - <artifactId>osgi</artifactId> - </exclusion> - </exclusions> + <exclusions> + <exclusion> + <groupId>org.apache.karaf.shell</groupId> + <artifactId>org.apache.karaf.shell.dev</artifactId> + </exclusion> + <exclusion> + <groupId>org.eclipse</groupId> + <artifactId>osgi</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache.karaf</groupId> + <artifactId>org.apache.karaf.client</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache.felix</groupId> + <artifactId>org.apache.felix.framework</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.activemq</groupId> @@ -383,7 +391,7 @@ <scope>test</scope> </dependency> <dependency> - <groupId>org.apache.cxf</goupId> + <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-ws-security</artifactId> <version>${cxf-version}</version> <scope>test</scope> @@ -590,6 +598,12 @@ </plugins> </build> </profile> + <profile> + <id>karaf3</id> + <properties> + <karaf-version>${karaf3-version}</karaf-version> + </properties> + </profile> </profiles> </project> http://git-wip-us.apache.org/repos/asf/camel/blob/2f8bc804/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java index a3cd45c..6543f60 100644 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java +++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java @@ -137,13 +137,26 @@ public class OSGiIntegrationTestSupport extends CamelTestSupport { "karaf.framework", "equinox"); } + + private static String getKarafVersion() { + String karafVersion = System.getProperty("karafVersion"); + if (karafVersion == null) { + // setup the default version of it + karafVersion = "2.3.6"; + } + return karafVersion; + } + public static Option[] getDefaultCamelKarafOptions() { + String karafVersion = getKarafVersion(); + LOG.info("*** The karaf version is " + karafVersion + " ***"); + Option[] options = // Set the karaf environment with some customer configuration new Option[] { KarafDistributionOption.karafDistributionConfiguration() .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").versionAsInProject()) - .karafVersion("2.3.6") + .karafVersion(karafVersion) .name("Apache Karaf") .useDeployFolder(false).unpackDirectory(new File("target/paxexam/unpack/")),