COMPRESS-443 use native container and reference URI for bundle
Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/9146faa1 Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/9146faa1 Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/9146faa1 Branch: refs/heads/master Commit: 9146faa1d7f1375c50c2732f4a18fe955772a1b6 Parents: 0de76f1 Author: Stefan Bodewig <bode...@apache.org> Authored: Wed Apr 25 20:20:09 2018 +0200 Committer: Stefan Bodewig <bode...@apache.org> Committed: Wed Apr 25 20:20:09 2018 +0200 ---------------------------------------------------------------------- pom.xml | 30 +++++----- .../org/apache/commons/compress/OsgiITest.java | 58 +++++--------------- 2 files changed, 28 insertions(+), 60 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-compress/blob/9146faa1/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 9698e7f..36e5530 100644 --- a/pom.xml +++ b/pom.xml @@ -55,8 +55,7 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj. <commons.japicmp.breakBuildOnBinaryIncompatibleModifications>false</commons.japicmp.breakBuildOnBinaryIncompatibleModifications> <pax.exam.version>4.11.0</pax.exam.version> - <karaf.version>3.0.3</karaf.version> - <slf4j.version>1.6.6</slf4j.version> + <slf4j.version>1.7.21</slf4j.version> </properties> <issueManagement> @@ -105,7 +104,7 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj. <!-- integration test verifiying OSGi bundle works --> <dependency> <groupId>org.ops4j.pax.exam</groupId> - <artifactId>pax-exam-container-karaf</artifactId> + <artifactId>pax-exam-container-native</artifactId> <version>${pax.exam.version}</version> <scope>test</scope> </dependency> @@ -117,28 +116,26 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj. </dependency> <dependency> <groupId>org.ops4j.pax.exam</groupId> - <artifactId>pax-exam</artifactId> + <artifactId>pax-exam-cm</artifactId> <version>${pax.exam.version}</version> <scope>test</scope> </dependency> <dependency> - <groupId>org.ops4j.pax.url</groupId> - <artifactId>pax-url-aether</artifactId> - <version>1.6.0</version> + <groupId>org.ops4j.pax.exam</groupId> + <artifactId>pax-exam-link-mvn</artifactId> + <version>${pax.exam.version}</version> <scope>test</scope> </dependency> <dependency> - <groupId>javax.inject</groupId> - <artifactId>javax.inject</artifactId> - <version>1</version> + <groupId>org.apache.felix</groupId> + <artifactId>org.apache.felix.framework</artifactId> + <version>5.6.10</version> <scope>test</scope> </dependency> <dependency> - <groupId>org.apache.karaf.features</groupId> - <artifactId>standard</artifactId> - <version>${karaf.version}</version> - <classifier>features</classifier> - <type>xml</type> + <groupId>javax.inject</groupId> + <artifactId>javax.inject</artifactId> + <version>1</version> <scope>test</scope> </dependency> <dependency> @@ -151,7 +148,7 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj. <dependency> <groupId>org.osgi</groupId> <artifactId>org.osgi.core</artifactId> - <version>4.3.1</version> + <version>6.0.0</version> <scope>provided</scope> </dependency> </dependencies> @@ -340,6 +337,7 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj. <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <configuration> + <manifestLocation>${project.build.outputDirectory}/META-INF</manifestLocation> <instructions> <Import-Package>org.tukaani.xz;resolution:=optional,org.brotli.dec;resolution:=optional,com.github.luben.zstd;resolution:=optional</Import-Package> </instructions> http://git-wip-us.apache.org/repos/asf/commons-compress/blob/9146faa1/src/test/java/org/apache/commons/compress/OsgiITest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/compress/OsgiITest.java b/src/test/java/org/apache/commons/compress/OsgiITest.java index 3ca3187..fe13d71 100644 --- a/src/test/java/org/apache/commons/compress/OsgiITest.java +++ b/src/test/java/org/apache/commons/compress/OsgiITest.java @@ -18,67 +18,37 @@ */ package org.apache.commons.compress; -import static org.ops4j.pax.exam.CoreOptions.maven; +import static org.ops4j.pax.exam.CoreOptions.bundle; +import static org.ops4j.pax.exam.CoreOptions.composite; import static org.ops4j.pax.exam.CoreOptions.mavenBundle; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder; - -import java.io.File; +import static org.ops4j.pax.exam.CoreOptions.systemProperty; import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.ConfigurationManager; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.options.MavenArtifactUrlReference; -import org.ops4j.pax.exam.options.MavenUrlReference; @RunWith(PaxExam.class) public class OsgiITest { @Configuration public Option[] config() { - MavenArtifactUrlReference karafUrl = maven() - .groupId("org.apache.karaf") - .artifactId("apache-karaf") - .version(karafVersion()) - .type("zip"); - - MavenUrlReference karafStandardRepo = maven() - .groupId("org.apache.karaf.features") - .artifactId("standard") - .version(karafVersion()) - .classifier("features") - .type("xml"); return new Option[] { - // KarafDistributionOption.debugConfiguration("5005", true), - karafDistributionConfiguration() - .frameworkUrl(karafUrl) - .unpackDirectory(new File("target", "exam")) - .useDeployFolder(false), - keepRuntimeFolder(), - configureConsole().ignoreLocalConsole(), - features(karafStandardRepo , "scr"), - mavenBundle() - .groupId("org.apache.commons") - .artifactId("commons-compress") - .version(commonsCompressVersion()).start(), + systemProperty("pax.exam.osgi.unresolved.fail").value("true"), + mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.scr") + .version("2.0.14"), + mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.configadmin") + .version("1.8.16"), + composite(systemProperty("pax.exam.invoker").value("junit"), + bundle("link:classpath:META-INF/links/org.ops4j.pax.tipi.junit.link"), + bundle("link:classpath:META-INF/links/org.ops4j.pax.exam.invoker.junit.link"), + mavenBundle().groupId("org.apache.servicemix.bundles") + .artifactId("org.apache.servicemix.bundles.hamcrest").version("1.3_1")), + bundle("reference:file:target/classes/").start() }; } - public static String karafVersion() { - ConfigurationManager cm = new ConfigurationManager(); - String karafVersion = cm.getProperty("pax.exam.karaf.version", "3.0.0"); - return karafVersion; - } - - public static String commonsCompressVersion() { - return new ConfigurationManager().getProperty("commons-compress.version", ""); - } - @Test public void loadBundle() { }