SLING-5779 : Packaged OSGi config intermittently do not get installed before bundle...
authorCarsten Ziegeler <cziegeler@apache.org>
Mon, 31 Oct 2016 10:01:07 +0000 (10:01 +0000)
committerCarsten Ziegeler <cziegeler@apache.org>
Mon, 31 Oct 2016 10:01:07 +0000 (10:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1767234 13f79535-47bb-0310-9956-ffa450edef68

src/test/java/org/apache/sling/installer/it/BundleInstallBlackListTest.java
src/test/java/org/apache/sling/installer/it/OsgiInstallerTestBase.java

index e1ea586..864ff17 100644 (file)
@@ -36,6 +36,11 @@ public class BundleInstallBlackListTest extends OsgiInstallerTestBase {
 
     final String symbolicName = "osgi-installer-testbundle";
 
+    @Override
+    protected String requiredServices() {
+        return "";
+    }
+
     @org.ops4j.pax.exam.Configuration
     public Option[] config() {
         return defaultConfiguration();
@@ -152,18 +157,10 @@ public class BundleInstallBlackListTest extends OsgiInstallerTestBase {
 
     private void updateInstallerBundle() throws BundleException {
         // wait a little bit for updating bundle
-        try {
-            Thread.sleep(2000);
-        } catch (InterruptedException e) {
-            // ignore
-        }
+        sleep(2000);
         bundleContext.getServiceReference(OsgiInstaller.class).getBundle().update();
         // wait a little bit after updating bundle
-        try {
-            Thread.sleep(2000);
-        } catch (InterruptedException e) {
-            // ignore
-        }
+        sleep(2000);
         setupInstaller();
     }
 
index 03cd016..2d5dd02 100644 (file)
@@ -19,6 +19,7 @@ package org.apache.sling.installer.it;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
+import static org.ops4j.pax.exam.CoreOptions.frameworkProperty;
 import static org.ops4j.pax.exam.CoreOptions.junitBundles;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.options;
@@ -475,6 +476,10 @@ public class OsgiInstallerTestBase implements FrameworkListener {
        log.log(level, msg);
     }
 
+    protected String requiredServices() {
+        return "resourcetransformer:org.osgi.service.cm,installtaskfactory:org.osgi.service.cm";
+    }
+
     protected Option[] defaultConfiguration() {
        String vmOpt = "-Dosgi.installer.testing";
 
@@ -503,6 +508,7 @@ public class OsgiInstallerTestBase implements FrameworkListener {
                         systemProperty("org.ops4j.pax.url.mvn.localRepository").value(localRepo)
                 ),
                 systemProperty( "org.ops4j.pax.logging.DefaultServiceLog.level" ).value(paxDebugLevel),
+                frameworkProperty("sling.installer.requiredservices").value(requiredServices()),
                 provision(
                         mavenBundle("org.apache.sling", "org.apache.sling.commons.log", "4.0.6"),
                         mavenBundle("org.apache.sling", "org.apache.sling.commons.logservice", "1.0.6"),