installer.it: stop using deprecated PackageAdmin
authorRobert Munteanu <rombert@apache.org>
Thu, 24 Nov 2016 10:46:00 +0000 (10:46 +0000)
committerRobert Munteanu <rombert@apache.org>
Thu, 24 Nov 2016 10:46:00 +0000 (10:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1771110 13f79535-47bb-0310-9956-ffa450edef68

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

index bbad6c0..24b2bdb 100644 (file)
@@ -61,10 +61,10 @@ import org.osgi.framework.Version;
 import org.osgi.framework.namespace.PackageNamespace;
 import org.osgi.framework.wiring.BundleCapability;
 import org.osgi.framework.wiring.BundleWiring;
+import org.osgi.framework.wiring.FrameworkWiring;
 import org.osgi.service.cm.Configuration;
 import org.osgi.service.cm.ConfigurationAdmin;
 import org.osgi.service.log.LogService;
-import org.osgi.service.packageadmin.PackageAdmin;
 import org.osgi.util.tracker.ServiceTracker;
 
 /** Base class for OsgiInstaller testing */
@@ -184,8 +184,7 @@ public class OsgiInstallerTestBase implements FrameworkListener {
         final int targetEventCount = packageRefreshEventsCount + 1;
         final long timeout = System.currentTimeMillis() + MAX_REFRESH_PACKAGES_WAIT_SECONDS * 1000L;
 
-        final PackageAdmin pa = getService(PackageAdmin.class);
-        pa.refreshPackages(null);
+        bundleContext.getBundle(Constants.SYSTEM_BUNDLE_ID).adapt(FrameworkWiring.class).refreshBundles(null);
 
         try {
             while(true) {