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 2018/01/02 10:27:59 UTC

[sling-org-apache-sling-testing-paxexam] branch master updated (a60e866 -> d609533)

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 a60e866  SLING-7080 Update options and versions to latest features
     new 16b194f  SLING-7340 Provide Tinybundles Option
     new d609533  SLING-7341 Provide BND bundle builder in TestSupport

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:
 pom.xml                                                 |  8 ++++++++
 .../org/apache/sling/testing/paxexam/SlingOptions.java  |  7 +++++++
 .../sling/testing/paxexam/SlingVersionResolver.java     |  2 ++
 .../org/apache/sling/testing/paxexam/TestSupport.java   | 17 ++++++++++++++++-
 src/main/resources/templates/SlingOptions.txt           |  7 +++++++
 src/main/resources/templates/SlingVersionResolver.txt   |  4 +++-
 ...teboardIT.java => SlingOptionsPaxTinybundlesIT.java} |  6 +++---
 7 files changed, 46 insertions(+), 5 deletions(-)
 copy src/test/java/org/apache/sling/testing/paxexam/it/tests/{SlingOptionsHttpWhiteboardIT.java => SlingOptionsPaxTinybundlesIT.java} (89%)

-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-testing-paxexam] 01/02: SLING-7340 Provide Tinybundles 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 16b194fd2345fd3ca3d5b138bbbbb3dfaef3742a
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Jan 2 11:15:21 2018 +0100

    SLING-7340 Provide Tinybundles Option
---
 pom.xml                                            |  8 ++++
 .../apache/sling/testing/paxexam/SlingOptions.java |  7 ++++
 .../testing/paxexam/SlingVersionResolver.java      |  2 +
 src/main/resources/templates/SlingOptions.txt      |  7 ++++
 .../resources/templates/SlingVersionResolver.txt   |  4 +-
 .../it/tests/SlingOptionsPaxTinybundlesIT.java     | 48 ++++++++++++++++++++++
 6 files changed, 75 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index fbf394b..076f691 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,6 +59,7 @@
             <Import-Package>
               org.osgi.service.cm.*;resolution:=optional,
               org.ops4j.pax.exam.cm.*;resolution:=optional,
+              org.ops4j.pax.tinybundles.*;resolution:=optional,
               *
             </Import-Package>
           </instructions>
@@ -113,6 +114,13 @@
       <version>5.6.10</version>
       <scope>test</scope>
     </dependency>
+    <!-- OPS4J Pax -->
+    <dependency>
+      <groupId>org.ops4j.pax.tinybundles</groupId>
+      <artifactId>tinybundles</artifactId>
+      <version>3.0.0</version>
+      <scope>provided</scope>
+    </dependency>
     <!-- testing -->
     <dependency>
       <groupId>junit</groupId>
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 73c52a1..75279ee 100644
--- a/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java
+++ b/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java
@@ -106,6 +106,13 @@ public class SlingOptions {
         );
     }
 
+    public static Option paxTinybundles() {
+        return composite(
+            mavenBundle().groupId("org.ops4j.pax.tinybundles").artifactId("tinybundles").version(versionResolver),
+            mavenBundle().groupId("biz.aQute.bnd").artifactId("biz.aQute.bndlib").version(versionResolver)
+        );
+    }
+
     public static Option logback() {
         final String filename = String.format("file:%s/src/test/resources/logback.xml", PathUtils.getBaseDir());
         return composite(
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 eb21841..40fc3e1 100644
--- a/src/main/java/org/apache/sling/testing/paxexam/SlingVersionResolver.java
+++ b/src/main/java/org/apache/sling/testing/paxexam/SlingVersionResolver.java
@@ -55,10 +55,12 @@ public class SlingVersionResolver implements VersionResolver {
         versions.put("org.ops4j.pax.swissbox:pax-swissbox-property", "1.8.3");
         versions.put("org.ops4j.pax.url:pax-url-classpath", "2.5.4");
         versions.put("org.ops4j.pax.url:pax-url-commons", "2.5.4");
+        versions.put("org.ops4j.pax.tinybundles:tinybundles", "3.0.0");
         versions.put("org.slf4j:slf4j-api", "1.7.25");
         versions.put("org.slf4j:jcl-over-slf4j", "1.7.25");
         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("com.composum.sling.core:composum-sling-core-commons", "1.8.2");
         versions.put("com.composum.sling.core:composum-sling-core-console", "1.8.2");
         versions.put("com.composum.sling.core:composum-sling-core-jslibs", "1.8.2");
diff --git a/src/main/resources/templates/SlingOptions.txt b/src/main/resources/templates/SlingOptions.txt
index 411cadb..e4e1154 100644
--- a/src/main/resources/templates/SlingOptions.txt
+++ b/src/main/resources/templates/SlingOptions.txt
@@ -106,6 +106,13 @@ public class SlingOptions {
         );
     }
 
+    public static Option paxTinybundles() {
+        return composite(
+            mavenBundle().groupId("org.ops4j.pax.tinybundles").artifactId("tinybundles").version(versionResolver),
+            mavenBundle().groupId("biz.aQute.bnd").artifactId("biz.aQute.bndlib").version(versionResolver)
+        );
+    }
+
     public static Option logback() {
         final String filename = String.format("file:%s/src/test/resources/logback.xml", PathUtils.getBaseDir());
         return composite(
diff --git a/src/main/resources/templates/SlingVersionResolver.txt b/src/main/resources/templates/SlingVersionResolver.txt
index add3a8c..df9cb0c 100644
--- a/src/main/resources/templates/SlingVersionResolver.txt
+++ b/src/main/resources/templates/SlingVersionResolver.txt
@@ -55,10 +55,12 @@ public class SlingVersionResolver implements VersionResolver {
         versions.put("org.ops4j.pax.swissbox:pax-swissbox-property", "1.8.3");
         versions.put("org.ops4j.pax.url:pax-url-classpath", "2.5.4");
         versions.put("org.ops4j.pax.url:pax-url-commons", "2.5.4");
+        versions.put("org.ops4j.pax.tinybundles:tinybundles", "3.0.0");
         versions.put("org.slf4j:slf4j-api", "1.7.25");
         versions.put("org.slf4j:jcl-over-slf4j", "1.7.25");
         versions.put("ch.qos.logback:logback-core", "1.2.3");
-        versions.put("ch.qos.logback:logback-classic", "1.2.3");[# th:each="bundle : ${bundles}"]
+        versions.put("ch.qos.logback:logback-classic", "1.2.3");
+        versions.put("biz.aQute.bnd:biz.aQute.bndlib", "3.5.0");[# th:each="bundle : ${bundles}"]
         versions.put("[(${bundle.groupId})]:[(${bundle.artifactId})]", "[(${bundle.version})]");
 [/]    }
 
diff --git a/src/test/java/org/apache/sling/testing/paxexam/it/tests/SlingOptionsPaxTinybundlesIT.java b/src/test/java/org/apache/sling/testing/paxexam/it/tests/SlingOptionsPaxTinybundlesIT.java
new file mode 100644
index 0000000..5cf3df9
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/paxexam/it/tests/SlingOptionsPaxTinybundlesIT.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.paxTinybundles;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class SlingOptionsPaxTinybundlesIT extends SlingOptionsTestSupport {
+
+    @Configuration
+    public Option[] configuration() {
+        return new Option[]{
+            baseConfiguration(),
+            paxTinybundles()
+        };
+    }
+
+    @Test
+    public void test() {
+    }
+
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-paxexam] 02/02: SLING-7341 Provide BND bundle builder in TestSupport

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 d6095332ac44922bc38405c5abdc593b4ab782af
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Jan 2 11:16:33 2018 +0100

    SLING-7341 Provide BND bundle builder in TestSupport
---
 .../org/apache/sling/testing/paxexam/TestSupport.java   | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/testing/paxexam/TestSupport.java b/src/main/java/org/apache/sling/testing/paxexam/TestSupport.java
index 6f056cb..5fb5e1c 100644
--- a/src/main/java/org/apache/sling/testing/paxexam/TestSupport.java
+++ b/src/main/java/org/apache/sling/testing/paxexam/TestSupport.java
@@ -28,15 +28,19 @@ import javax.inject.Inject;
 import org.ops4j.pax.exam.CoreOptions;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.util.PathUtils;
+import org.ops4j.pax.tinybundles.core.TinyBundle;
 import org.osgi.service.cm.ConfigurationAdmin;
 
+import static org.apache.sling.testing.paxexam.SlingOptions.paxTinybundles;
 import static org.ops4j.pax.exam.CoreOptions.bundle;
 import static org.ops4j.pax.exam.CoreOptions.composite;
 import static org.ops4j.pax.exam.CoreOptions.keepCaches;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.repository;
+import static org.ops4j.pax.exam.CoreOptions.streamBundle;
 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
 import static org.ops4j.pax.exam.CoreOptions.when;
+import static org.ops4j.pax.tinybundles.core.TinyBundles.withBnd;
 
 public abstract class TestSupport {
 
@@ -72,7 +76,8 @@ public abstract class TestSupport {
             localMavenRepo(),
             repository("https://repository.apache.org/snapshots/").id("apache-snapshots").allowSnapshots(),
             CoreOptions.workingDirectory(workingDirectory()),
-            mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.testing.paxexam").versionAsInProject()
+            mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.testing.paxexam").versionAsInProject(),
+            paxTinybundles()
         );
     }
 
@@ -93,4 +98,14 @@ public abstract class TestSupport {
         return bundle(file.toURI().toString());
     }
 
+    protected Option buildBundleWithBnd(Class... classes) {
+        final TinyBundle bundle = org.ops4j.pax.tinybundles.core.TinyBundles.bundle();
+        for (final Class clazz : classes) {
+            bundle.add(clazz);
+        }
+        return streamBundle(
+            bundle.build(withBnd())
+        ).start();
+    }
+
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.