You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ol...@apache.org on 2019/07/01 17:44:28 UTC

[sling-org-apache-sling-testing-paxexam] branch master updated (52f0da8 -> 0452edc)

This is an automated email from the ASF dual-hosted git repository.

olli pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-paxexam.git.


    from 52f0da8  update README (3.0.0)
     new ffe1250  SLING-8546 Provide Pax URL Wrap Option
     new 0452edc  SLING-8547 Provide Testcontainers Option

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 README.md                                              |  1 +
 pom.xml                                                |  8 +++++++-
 .../org/apache/sling/testing/paxexam/SlingOptions.java | 18 ++++++++++++++++++
 .../sling/testing/paxexam/SlingVersionResolver.java    |  5 +++++
 .../org/apache/sling/testing/paxexam/package-info.java |  2 +-
 src/main/resources/templates/SlingOptions.hbs          | 18 ++++++++++++++++++
 src/main/resources/templates/SlingVersionResolver.hbs  |  7 ++++++-
 ...ionsPaxUrlIT.java => SlingOptionsPaxUrlWrapIT.java} |  6 +++---
 ...eboardIT.java => SlingOptionsTestcontainersIT.java} |  6 +++---
 9 files changed, 62 insertions(+), 9 deletions(-)
 copy src/test/java/org/apache/sling/testing/paxexam/it/tests/{SlingOptionsPaxUrlIT.java => SlingOptionsPaxUrlWrapIT.java} (93%)
 copy src/test/java/org/apache/sling/testing/paxexam/it/tests/{SlingOptionsHttpWhiteboardIT.java => SlingOptionsTestcontainersIT.java} (89%)


[sling-org-apache-sling-testing-paxexam] 02/02: SLING-8547 Provide Testcontainers Option

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-paxexam.git

commit 0452edcc4b4db6b1ffcfe8af88022f09beaed440
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Jul 1 19:35:50 2019 +0200

    SLING-8547 Provide Testcontainers Option
---
 README.md                                          |  1 +
 .../apache/sling/testing/paxexam/SlingOptions.java |  9 ++++
 .../testing/paxexam/SlingVersionResolver.java      |  2 +
 src/main/resources/templates/SlingOptions.hbs      |  9 ++++
 .../resources/templates/SlingVersionResolver.hbs   |  2 +
 .../it/tests/SlingOptionsTestcontainersIT.java     | 48 ++++++++++++++++++++++
 6 files changed, 71 insertions(+)

diff --git a/README.md b/README.md
index 4d96d17..1887ab8 100644
--- a/README.md
+++ b/README.md
@@ -21,3 +21,4 @@ See Testing PaxExam's [documentation page](https://sling.apache.org/documentatio
 * Overriding of versions
 * Adjusting of provided Options (`ModifiableCompositeOption`s)
 * Build bundles with test content and OSGi DS services on-the-fly (no need for extra modules)
+* Start Docker containers via [Testcontainers](https://www.testcontainers.org/)
diff --git a/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java b/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java
index e835017..1e59c0a 100644
--- a/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java
+++ b/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java
@@ -26,6 +26,7 @@ import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.systemPackages;
 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
 import static org.ops4j.pax.exam.CoreOptions.vmOption;
+import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
 import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
 import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration;
 
@@ -166,6 +167,14 @@ public class SlingOptions {
         );
     }
 
+    public static ModifiableCompositeOption testcontainers() {
+        return composite(
+            paxUrlWrap(),
+            wrappedBundle(mavenBundle().groupId("org.rnorth.duct-tape").artifactId("duct-tape").version(versionResolver)),
+            wrappedBundle(mavenBundle().groupId("org.testcontainers").artifactId("testcontainers").version(versionResolver))
+        );
+    }
+
     public static ModifiableCompositeOption sling() {
         return composite(
             config(),
diff --git a/src/main/java/org/apache/sling/testing/paxexam/SlingVersionResolver.java b/src/main/java/org/apache/sling/testing/paxexam/SlingVersionResolver.java
index 08f3bfe..22b55c0 100644
--- a/src/main/java/org/apache/sling/testing/paxexam/SlingVersionResolver.java
+++ b/src/main/java/org/apache/sling/testing/paxexam/SlingVersionResolver.java
@@ -67,8 +67,10 @@ public class SlingVersionResolver implements VersionResolver {
         versions.put("org.osgi:org.osgi.util.function", "1.1.0");
         versions.put("org.osgi:org.osgi.util.promise", "1.1.0");
         versions.put("org.ow2.asm:asm", "7.1");
+        versions.put("org.rnorth.duct-tape:duct-tape", "1.0.8");
         versions.put("org.slf4j:slf4j-api", "1.7.26");
         versions.put("org.slf4j:jcl-over-slf4j", "1.7.26");
+        versions.put("org.testcontainers:testcontainers", "1.11.3");
         versions.put("ch.qos.logback:logback-core", "1.2.3");
         versions.put("ch.qos.logback:logback-classic", "1.2.3");
         versions.put("biz.aQute.bnd:biz.aQute.bndlib", "3.5.0");
diff --git a/src/main/resources/templates/SlingOptions.hbs b/src/main/resources/templates/SlingOptions.hbs
index 6ba4b18..9599ade 100644
--- a/src/main/resources/templates/SlingOptions.hbs
+++ b/src/main/resources/templates/SlingOptions.hbs
@@ -26,6 +26,7 @@ import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.systemPackages;
 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
 import static org.ops4j.pax.exam.CoreOptions.vmOption;
+import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
 import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
 import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration;
 
@@ -163,6 +164,14 @@ public class SlingOptions {
             config()
         );
     }
+
+    public static ModifiableCompositeOption testcontainers() {
+        return composite(
+            paxUrlWrap(),
+            wrappedBundle(mavenBundle().groupId("org.rnorth.duct-tape").artifactId("duct-tape").version(versionResolver)),
+            wrappedBundle(mavenBundle().groupId("org.testcontainers").artifactId("testcontainers").version(versionResolver))
+        );
+    }
 {{#each features}}
     public static ModifiableCompositeOption {{javaName}}() {
         return composite({{#each features}}
diff --git a/src/main/resources/templates/SlingVersionResolver.hbs b/src/main/resources/templates/SlingVersionResolver.hbs
index d746d69..528b168 100644
--- a/src/main/resources/templates/SlingVersionResolver.hbs
+++ b/src/main/resources/templates/SlingVersionResolver.hbs
@@ -67,8 +67,10 @@ public class SlingVersionResolver implements VersionResolver {
         versions.put("org.osgi:org.osgi.util.function", "1.1.0");
         versions.put("org.osgi:org.osgi.util.promise", "1.1.0");
         versions.put("org.ow2.asm:asm", "7.1");
+        versions.put("org.rnorth.duct-tape:duct-tape", "1.0.8");
         versions.put("org.slf4j:slf4j-api", "1.7.26");
         versions.put("org.slf4j:jcl-over-slf4j", "1.7.26");
+        versions.put("org.testcontainers:testcontainers", "1.11.3");
         versions.put("ch.qos.logback:logback-core", "1.2.3");
         versions.put("ch.qos.logback:logback-classic", "1.2.3");
         versions.put("biz.aQute.bnd:biz.aQute.bndlib", "3.5.0");
diff --git a/src/test/java/org/apache/sling/testing/paxexam/it/tests/SlingOptionsTestcontainersIT.java b/src/test/java/org/apache/sling/testing/paxexam/it/tests/SlingOptionsTestcontainersIT.java
new file mode 100644
index 0000000..6dbaac4
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/paxexam/it/tests/SlingOptionsTestcontainersIT.java
@@ -0,0 +1,48 @@
+/*
+ * 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.sling.testing.paxexam.it.tests;
+
+import org.apache.sling.testing.paxexam.it.SlingOptionsTestSupport;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+
+import static org.apache.sling.testing.paxexam.SlingOptions.testcontainers;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class SlingOptionsTestcontainersIT extends SlingOptionsTestSupport {
+
+    @Configuration
+    public Option[] configuration() {
+        return new Option[]{
+            baseConfiguration(),
+            testcontainers()
+        };
+    }
+
+    @Test
+    public void test() {
+    }
+
+}


[sling-org-apache-sling-testing-paxexam] 01/02: SLING-8546 Provide Pax URL Wrap Option

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-paxexam.git

commit ffe1250ce81cef22641355655fe89ac4f304e80c
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Jul 1 07:51:50 2019 +0200

    SLING-8546 Provide Pax URL Wrap Option
---
 pom.xml                                            |  8 +++-
 .../apache/sling/testing/paxexam/SlingOptions.java |  9 ++++
 .../testing/paxexam/SlingVersionResolver.java      |  3 ++
 .../apache/sling/testing/paxexam/package-info.java |  2 +-
 src/main/resources/templates/SlingOptions.hbs      |  9 ++++
 .../resources/templates/SlingVersionResolver.hbs   |  5 ++-
 .../paxexam/it/tests/SlingOptionsPaxUrlWrapIT.java | 48 ++++++++++++++++++++++
 7 files changed, 81 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1c2b210..9c968a9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
   </parent>
 
   <artifactId>org.apache.sling.testing.paxexam</artifactId>
-  <version>3.0.1-SNAPSHOT</version>
+  <version>3.1.0-SNAPSHOT</version>
 
   <name>Apache Sling Testing PaxExam</name>
   <description>Test support for use with Pax Exam.</description>
@@ -158,6 +158,12 @@
       <version>${org.ops4j.pax.exam.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.url</groupId>
+      <artifactId>pax-url-wrap</artifactId>
+      <version>2.6.1</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
 </project>
diff --git a/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java b/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java
index e91ca8d..e835017 100644
--- a/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java
+++ b/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java
@@ -138,6 +138,15 @@ public class SlingOptions {
         );
     }
 
+    public static ModifiableCompositeOption paxUrlWrap() {
+        return composite(
+            mavenBundle().groupId("org.ops4j.pax.url").artifactId("pax-url-wrap").version(versionResolver),
+            mavenBundle().groupId("org.ops4j.pax.swissbox").artifactId("pax-swissbox-bnd").version(versionResolver),
+            mavenBundle().groupId("biz.aQute.bnd").artifactId("bndlib").version(versionResolver),
+            paxUrl()
+        );
+    }
+
     public static ModifiableCompositeOption paxTinybundles() {
         return composite(
             mavenBundle().groupId("org.ops4j.pax.tinybundles").artifactId("tinybundles").version(versionResolver),
diff --git a/src/main/java/org/apache/sling/testing/paxexam/SlingVersionResolver.java b/src/main/java/org/apache/sling/testing/paxexam/SlingVersionResolver.java
index dbb3a0b..08f3bfe 100644
--- a/src/main/java/org/apache/sling/testing/paxexam/SlingVersionResolver.java
+++ b/src/main/java/org/apache/sling/testing/paxexam/SlingVersionResolver.java
@@ -58,9 +58,11 @@ public class SlingVersionResolver implements VersionResolver {
         versions.put("org.apache.felix:org.apache.felix.webconsole", "4.3.12");
         versions.put("org.ops4j.base:ops4j-base-lang", "1.5.0");
         versions.put("org.ops4j.base:ops4j-base-util-property", "1.5.0");
+        versions.put("org.ops4j.pax.swissbox:pax-swissbox-bnd", "1.8.3");
         versions.put("org.ops4j.pax.swissbox:pax-swissbox-property", "1.8.3");
         versions.put("org.ops4j.pax.url:pax-url-classpath", "2.6.1");
         versions.put("org.ops4j.pax.url:pax-url-commons", "2.6.1");
+        versions.put("org.ops4j.pax.url:pax-url-wrap", "2.6.1");
         versions.put("org.ops4j.pax.tinybundles:tinybundles", "3.0.0");
         versions.put("org.osgi:org.osgi.util.function", "1.1.0");
         versions.put("org.osgi:org.osgi.util.promise", "1.1.0");
@@ -70,6 +72,7 @@ public class SlingVersionResolver implements VersionResolver {
         versions.put("ch.qos.logback:logback-core", "1.2.3");
         versions.put("ch.qos.logback:logback-classic", "1.2.3");
         versions.put("biz.aQute.bnd:biz.aQute.bndlib", "3.5.0");
+        versions.put("biz.aQute.bnd:bndlib", "2.4.0");
         versions.put("com.composum.sling.core:composum-sling-core-commons", "1.9.4");
         versions.put("com.composum.sling.core:composum-sling-core-config", "1.9.4");
         versions.put("com.composum.sling.core:composum-sling-core-console", "1.9.4");
diff --git a/src/main/java/org/apache/sling/testing/paxexam/package-info.java b/src/main/java/org/apache/sling/testing/paxexam/package-info.java
index 72fd2cd..e9f9d1f 100644
--- a/src/main/java/org/apache/sling/testing/paxexam/package-info.java
+++ b/src/main/java/org/apache/sling/testing/paxexam/package-info.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-@Version("4.0.0")
+@Version("4.1.0")
 package org.apache.sling.testing.paxexam;
 
 import org.osgi.annotation.versioning.Version;
diff --git a/src/main/resources/templates/SlingOptions.hbs b/src/main/resources/templates/SlingOptions.hbs
index d60534c..6ba4b18 100644
--- a/src/main/resources/templates/SlingOptions.hbs
+++ b/src/main/resources/templates/SlingOptions.hbs
@@ -136,6 +136,15 @@ public class SlingOptions {
         );
     }
 
+    public static ModifiableCompositeOption paxUrlWrap() {
+        return composite(
+            mavenBundle().groupId("org.ops4j.pax.url").artifactId("pax-url-wrap").version(versionResolver),
+            mavenBundle().groupId("org.ops4j.pax.swissbox").artifactId("pax-swissbox-bnd").version(versionResolver),
+            mavenBundle().groupId("biz.aQute.bnd").artifactId("bndlib").version(versionResolver),
+            paxUrl()
+        );
+    }
+
     public static ModifiableCompositeOption paxTinybundles() {
         return composite(
             mavenBundle().groupId("org.ops4j.pax.tinybundles").artifactId("tinybundles").version(versionResolver),
diff --git a/src/main/resources/templates/SlingVersionResolver.hbs b/src/main/resources/templates/SlingVersionResolver.hbs
index 527d221..d746d69 100644
--- a/src/main/resources/templates/SlingVersionResolver.hbs
+++ b/src/main/resources/templates/SlingVersionResolver.hbs
@@ -58,9 +58,11 @@ public class SlingVersionResolver implements VersionResolver {
         versions.put("org.apache.felix:org.apache.felix.webconsole", "4.3.12");
         versions.put("org.ops4j.base:ops4j-base-lang", "1.5.0");
         versions.put("org.ops4j.base:ops4j-base-util-property", "1.5.0");
+        versions.put("org.ops4j.pax.swissbox:pax-swissbox-bnd", "1.8.3");
         versions.put("org.ops4j.pax.swissbox:pax-swissbox-property", "1.8.3");
         versions.put("org.ops4j.pax.url:pax-url-classpath", "2.6.1");
         versions.put("org.ops4j.pax.url:pax-url-commons", "2.6.1");
+        versions.put("org.ops4j.pax.url:pax-url-wrap", "2.6.1");
         versions.put("org.ops4j.pax.tinybundles:tinybundles", "3.0.0");
         versions.put("org.osgi:org.osgi.util.function", "1.1.0");
         versions.put("org.osgi:org.osgi.util.promise", "1.1.0");
@@ -69,7 +71,8 @@ public class SlingVersionResolver implements VersionResolver {
         versions.put("org.slf4j:jcl-over-slf4j", "1.7.26");
         versions.put("ch.qos.logback:logback-core", "1.2.3");
         versions.put("ch.qos.logback:logback-classic", "1.2.3");
-        versions.put("biz.aQute.bnd:biz.aQute.bndlib", "3.5.0");{{#each bundles}}
+        versions.put("biz.aQute.bnd:biz.aQute.bndlib", "3.5.0");
+        versions.put("biz.aQute.bnd:bndlib", "2.4.0");{{#each bundles}}
         versions.put("{{groupId}}:{{artifactId}}", "{{version}}");{{/each}}
     }
 
diff --git a/src/test/java/org/apache/sling/testing/paxexam/it/tests/SlingOptionsPaxUrlWrapIT.java b/src/test/java/org/apache/sling/testing/paxexam/it/tests/SlingOptionsPaxUrlWrapIT.java
new file mode 100644
index 0000000..51550fa
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/paxexam/it/tests/SlingOptionsPaxUrlWrapIT.java
@@ -0,0 +1,48 @@
+/*
+ * 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.sling.testing.paxexam.it.tests;
+
+import org.apache.sling.testing.paxexam.it.SlingOptionsTestSupport;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+
+import static org.apache.sling.testing.paxexam.SlingOptions.paxUrlWrap;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class SlingOptionsPaxUrlWrapIT extends SlingOptionsTestSupport {
+
+    @Configuration
+    public Option[] configuration() {
+        return new Option[]{
+            baseConfiguration(),
+            paxUrlWrap()
+        };
+    }
+
+    @Test
+    public void test() {
+    }
+
+}