You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2018/04/25 18:21:44 UTC
[1/2] commons-compress git commit: crude attempt for adding a PAX
Exam test
Repository: commons-compress
Updated Branches:
refs/heads/master 97867f6fa -> 9146faa1d
crude attempt for adding a PAX Exam test
Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/0de76f15
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/0de76f15
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/0de76f15
Branch: refs/heads/master
Commit: 0de76f159c6cd6b65947ddc3fb6481b737ca39a2
Parents: 97867f6
Author: Stefan Bodewig <bo...@apache.org>
Authored: Mon Apr 23 22:11:27 2018 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Mon Apr 23 22:11:27 2018 +0200
----------------------------------------------------------------------
pom.xml | 66 +++++++++++++++
.../org/apache/commons/compress/OsgiITest.java | 85 ++++++++++++++++++++
2 files changed, 151 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/0de76f15/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 72a8f60..9698e7f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,6 +53,10 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.
<!-- generate report even if there are binary incompatible changes -->
<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>
</properties>
<issueManagement>
@@ -97,6 +101,59 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
+
+ <!-- integration test verifiying OSGi bundle works -->
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-container-karaf</artifactId>
+ <version>${pax.exam.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-junit4</artifactId>
+ <version>${pax.exam.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam</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>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</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>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4j.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>4.3.1</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<developers>
@@ -321,6 +378,15 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <pax.exam.karaf.version>${karaf.version}</pax.exam.karaf.version>
+ <commons-compress.version>${project.version}</commons-compress.version>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
</plugins>
</build>
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/0de76f15/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
new file mode 100644
index 0000000..3ca3187
--- /dev/null
+++ b/src/test/java/org/apache/commons/compress/OsgiITest.java
@@ -0,0 +1,85 @@
+/*
+ * 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.commons.compress;
+
+import static org.ops4j.pax.exam.CoreOptions.maven;
+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 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(),
+ };
+ }
+
+ 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() {
+ }
+}
[2/2] commons-compress git commit: COMPRESS-443 use native container
and reference URI for bundle
Posted by bo...@apache.org.
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 <bo...@apache.org>
Authored: Wed Apr 25 20:20:09 2018 +0200
Committer: Stefan Bodewig <bo...@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() {
}