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:28:01 UTC

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

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>.