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 2020/04/01 06:40:46 UTC

[sling-org-apache-sling-testing-paxexam] 08/10: SLING-9300 Provide Commons OSGi Option

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 62b3e891ef5c1d4fbe0aaa1d38133db85a081903
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Mar 31 12:28:44 2020 +0200

    SLING-9300 Provide Commons OSGi Option
---
 .../apache/sling/testing/paxexam/SlingOptions.java | 13 ++++--
 .../it/tests/SlingOptionsSlingCommonsOsgiIT.java   | 49 ++++++++++++++++++++++
 2 files changed, 59 insertions(+), 3 deletions(-)

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 0d48d3b..e72de4e 100644
--- a/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java
+++ b/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java
@@ -215,6 +215,7 @@ public class SlingOptions {
             http(),
             httpWhiteboard(),
             slingCommonsFsclassloader(),
+            slingCommonsOsgi(),
             slingCommonsScheduler(),
             slingCommonsThreads(),
             mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.api").version(versionResolver),
@@ -225,7 +226,6 @@ public class SlingOptions {
             mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.settings").version(versionResolver),
             mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.commons.johnzon").version(versionResolver),
             mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.commons.mime").version(versionResolver),
-            mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.commons.osgi").version(versionResolver),
             mavenBundle().groupId("commons-codec").artifactId("commons-codec").version(versionResolver),
             mavenBundle().groupId("commons-collections").artifactId("commons-collections").version(versionResolver),
             mavenBundle().groupId("commons-fileupload").artifactId("commons-fileupload").version(versionResolver),
@@ -284,8 +284,8 @@ public class SlingOptions {
             scr(),
             webconsole(),
             slingCommonsClassloader(),
+            slingCommonsOsgi(),
             mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.commons.fsclassloader").version(versionResolver),
-            mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.commons.osgi").version(versionResolver),
             mavenBundle().groupId("commons-io").artifactId("commons-io").version(versionResolver),
             mavenBundle().groupId("org.apache.commons").artifactId("commons-lang3").version(versionResolver)
         );
@@ -295,7 +295,7 @@ public class SlingOptions {
         return composite(
             scr(),
             mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.commons.html").version(versionResolver),
-            mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.commons.osgi").version(versionResolver)
+            slingCommonsOsgi()
         );
     }
 
@@ -307,6 +307,13 @@ public class SlingOptions {
         );
     }
 
+    public static ModifiableCompositeOption slingCommonsOsgi() {
+        return composite(
+            eventadmin(),
+            mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.commons.osgi").version(versionResolver)
+        );
+    }
+
     public static ModifiableCompositeOption slingCommonsScheduler() {
         return composite(
             scr(),
diff --git a/src/test/java/org/apache/sling/testing/paxexam/it/tests/SlingOptionsSlingCommonsOsgiIT.java b/src/test/java/org/apache/sling/testing/paxexam/it/tests/SlingOptionsSlingCommonsOsgiIT.java
new file mode 100644
index 0000000..6675904
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/paxexam/it/tests/SlingOptionsSlingCommonsOsgiIT.java
@@ -0,0 +1,49 @@
+/*
+ * 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.slingCommonsOsgi;
+import static org.ops4j.pax.exam.CoreOptions.options;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class SlingOptionsSlingCommonsOsgiIT extends SlingOptionsTestSupport {
+
+    @Configuration
+    public Option[] configuration() {
+        return options(
+            baseConfiguration(),
+            slingCommonsOsgi()
+        );
+    }
+
+    @Test
+    public void test() {
+    }
+
+}