Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2010-12-07 07:57:19 -0500
committerGlyn Normington2010-12-07 07:57:19 -0500
commit8c0e7abff5c0ca925115ce702073048e9fd19ceb (patch)
tree49e612e1a56ce965fe04757f5bd8f5f0ecaaac9e
parent400bb8d4b5de9482aa1e831ccb5704fe35a7beff (diff)
downloadorg.eclipse.virgo.kernel-8c0e7abff5c0ca925115ce702073048e9fd19ceb.tar.gz
org.eclipse.virgo.kernel-8c0e7abff5c0ca925115ce702073048e9fd19ceb.tar.xz
org.eclipse.virgo.kernel-8c0e7abff5c0ca925115ce702073048e9fd19ceb.zip
bug 330236: fix warnings
-rw-r--r--org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/ContextPropagatingTaskExecutor.java2
-rw-r--r--org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/config/internal/ConfigurationInitialiser.java2
-rw-r--r--org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/DumpCoordinator.aj4
-rw-r--r--org.eclipse.virgo.kernel.core/src/test/java/org/eclipse/virgo/kernel/core/internal/blueprint/ApplicationContextDependencyMonitorTests.java4
-rw-r--r--org.eclipse.virgo.kernel.deployer.dm/src/main/java/org/eclipse/virgo/kernel/deployer/app/spring/UserRegionModuleContextAccessor.java11
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/AbstractDeployerIntegrationTest.java76
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/AbstractParTests.java6
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ApplicationContextUtils.java2
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/BundleRefreshTests.java2
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ClasspathScanningTests.java4
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ConfigurationDeploymentTests.java8
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/DMSPlanDeploymentTests.java6
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/DeployerEdgeTests.java6
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/InterdependentBundleDeploymentTests.java6
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/MultiBundleApplicationDeploymentTests.java20
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/NestedPlanIntegrationTests.java5
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/OnStartedFailureTests.java6
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PipelinedDeployerIntegrationTests.java10
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PipelinedDeployerTimeOutTests.java11
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentTests.java6
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RAMBundleRefreshTests.java1
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RAMDeploymentIntegrationTests.java32
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RedeployRefreshTests.java6
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RefreshTests.java6
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ServiceScopingTests.java26
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/Spring256ABundleTests.java6
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/TransitiveConstraintFailureDiagnosisTests.java6
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/Plumber.java1
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/RegionAwarePackageAdminAccessor.java1
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/management/StandardDeployer.java1
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/pipeline/stage/resolve/internal/ResolveStage.java1
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/internal/StandardPipelineTests.java2
32 files changed, 143 insertions, 143 deletions
diff --git a/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/ContextPropagatingTaskExecutor.java b/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/ContextPropagatingTaskExecutor.java
index 0f70c71a..0388076d 100644
--- a/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/ContextPropagatingTaskExecutor.java
+++ b/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/ContextPropagatingTaskExecutor.java
@@ -65,7 +65,7 @@ public final class ContextPropagatingTaskExecutor implements TaskExecutor, Dispo
return localTracingService;
}
- ServiceReference serviceReference = this.bundleContext.getServiceReference(TracingService.class.getName());
+ ServiceReference<TracingService> serviceReference = this.bundleContext.getServiceReference(TracingService.class);
if (serviceReference != null) {
localTracingService = (TracingService) this.bundleContext.getService(serviceReference);
}
diff --git a/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/config/internal/ConfigurationInitialiser.java b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/config/internal/ConfigurationInitialiser.java
index 19ee78ab..8962142a 100644
--- a/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/config/internal/ConfigurationInitialiser.java
+++ b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/config/internal/ConfigurationInitialiser.java
@@ -40,7 +40,7 @@ public final class ConfigurationInitialiser {
public KernelConfiguration start(BundleContext context, EventLogger eventLogger) throws IOException {
- ServiceReference configurationAdminReference = context.getServiceReference(ConfigurationAdmin.class.getName());
+ ServiceReference<ConfigurationAdmin> configurationAdminReference = context.getServiceReference(ConfigurationAdmin.class);
ConfigurationAdmin configAdmin = null;
diff --git a/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/DumpCoordinator.aj b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/DumpCoordinator.aj
index fb6f6e74..4308ae80 100644
--- a/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/DumpCoordinator.aj
+++ b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/DumpCoordinator.aj
@@ -55,9 +55,9 @@ public final aspect DumpCoordinator {
// TODO Consider using a ServiceTracker
public void setBundleContext(BundleContext bundleContext) {
- ServiceReference serviceReference = bundleContext.getServiceReference(DumpGenerator.class.getName());
+ ServiceReference<DumpGenerator> serviceReference = bundleContext.getServiceReference(DumpGenerator.class);
if (serviceReference != null) {
- DumpGenerator dumpGenerator = (DumpGenerator) bundleContext.getService(serviceReference);
+ DumpGenerator dumpGenerator = bundleContext.getService(serviceReference);
if (dumpGenerator != null) {
setDumpGenerator(dumpGenerator);
} else {
diff --git a/org.eclipse.virgo.kernel.core/src/test/java/org/eclipse/virgo/kernel/core/internal/blueprint/ApplicationContextDependencyMonitorTests.java b/org.eclipse.virgo.kernel.core/src/test/java/org/eclipse/virgo/kernel/core/internal/blueprint/ApplicationContextDependencyMonitorTests.java
index 168dc5a6..9659ad5d 100644
--- a/org.eclipse.virgo.kernel.core/src/test/java/org/eclipse/virgo/kernel/core/internal/blueprint/ApplicationContextDependencyMonitorTests.java
+++ b/org.eclipse.virgo.kernel.core/src/test/java/org/eclipse/virgo/kernel/core/internal/blueprint/ApplicationContextDependencyMonitorTests.java
@@ -249,7 +249,7 @@ public class ApplicationContextDependencyMonitorTests {
}
@SuppressWarnings("unchecked")
- private Dictionary createProperties(String filter, String beanName, boolean mandatory) {
+ private Dictionary<String, ?> createProperties(String filter, String beanName, boolean mandatory) {
Dictionary properties = createProperties();
properties.put("dependencies", new String[] { filter });
@@ -260,7 +260,7 @@ public class ApplicationContextDependencyMonitorTests {
}
@SuppressWarnings("unchecked")
- private Dictionary createProperties() {
+ private Dictionary<String, ?> createProperties() {
Dictionary properties = new Hashtable();
properties.put(EventConstants.BUNDLE, this.bundle);
return properties;
diff --git a/org.eclipse.virgo.kernel.deployer.dm/src/main/java/org/eclipse/virgo/kernel/deployer/app/spring/UserRegionModuleContextAccessor.java b/org.eclipse.virgo.kernel.deployer.dm/src/main/java/org/eclipse/virgo/kernel/deployer/app/spring/UserRegionModuleContextAccessor.java
index 0821a1e7..5471f663 100644
--- a/org.eclipse.virgo.kernel.deployer.dm/src/main/java/org/eclipse/virgo/kernel/deployer/app/spring/UserRegionModuleContextAccessor.java
+++ b/org.eclipse.virgo.kernel.deployer.dm/src/main/java/org/eclipse/virgo/kernel/deployer/app/spring/UserRegionModuleContextAccessor.java
@@ -11,6 +11,8 @@
package org.eclipse.virgo.kernel.deployer.app.spring;
+import java.util.Collection;
+
import org.eclipse.virgo.kernel.serviceability.Assert;
import org.eclipse.virgo.kernel.serviceability.NonNull;
import org.osgi.framework.Bundle;
@@ -23,7 +25,6 @@ import org.springframework.osgi.context.ConfigurableOsgiBundleApplicationContext
import org.eclipse.virgo.kernel.module.ModuleContext;
import org.eclipse.virgo.kernel.module.ModuleContextAccessor;
-
/**
* {@link UserRegionModuleContextAccessor} accesses {@link ModuleContext ModuleContexts} in the user region.
* <p />
@@ -44,10 +45,10 @@ final class UserRegionModuleContextAccessor implements ModuleContextAccessor {
if (bundleContext != null) {
String symbolicName = bundle.getSymbolicName();
try {
- ServiceReference[] refs = bundleContext.getServiceReferences(ApplicationContext.class.getName(), "(Bundle-SymbolicName="
- + symbolicName + ")");
- if (refs != null) {
- for (ServiceReference ref : refs) {
+ Collection<ServiceReference<ApplicationContext>> refs = bundleContext.getServiceReferences(ApplicationContext.class,
+ "(Bundle-SymbolicName=" + symbolicName + ")");
+ if (refs.size() != 0) {
+ for (ServiceReference<ApplicationContext> ref : refs) {
ApplicationContext appCtx = (ApplicationContext) bundleContext.getService(ref);
try {
if (appCtx instanceof ConfigurableOsgiBundleApplicationContext) {
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/AbstractDeployerIntegrationTest.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/AbstractDeployerIntegrationTest.java
index 26080dc6..7c326acd 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/AbstractDeployerIntegrationTest.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/AbstractDeployerIntegrationTest.java
@@ -47,72 +47,76 @@ public abstract class AbstractDeployerIntegrationTest {
protected final BundleContext context = FrameworkUtil.getBundle(getClass()).getBundleContext();
protected volatile OsgiFramework framework;
-
+
protected volatile ApplicationDeployer deployer;
-
+
protected volatile BundleContext kernelContext;
-
+
protected volatile PackageAdmin packageAdmin;
@Before
public void setup() {
- ServiceReference serviceReference = context.getServiceReference(OsgiFramework.class.getName());
- if (serviceReference != null) {
- this.framework = (OsgiFramework) context.getService(serviceReference);
- }
-
- serviceReference = this.context.getServiceReference(ApplicationDeployer.class.getName());
- this.deployer = (ApplicationDeployer) this.context.getService(serviceReference);
-
+ ServiceReference<OsgiFramework> osgiFrameworkServiceReference = context.getServiceReference(OsgiFramework.class);
+ if (osgiFrameworkServiceReference != null) {
+ this.framework = context.getService(osgiFrameworkServiceReference);
+ }
+
+ ServiceReference<ApplicationDeployer> applicationDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class);
+ if (applicationDeployerServiceReference != null) {
+ this.deployer = this.context.getService(applicationDeployerServiceReference);
+ }
+
Bundle bundle = this.context.getBundle(1);
if (bundle instanceof SurrogateBundle) {
- this.kernelContext = ((SurrogateBundle)bundle).getCompositeBundleContext();
+ this.kernelContext = ((SurrogateBundle) bundle).getCompositeBundleContext();
+ }
+
+ ServiceReference<PackageAdmin> packageAdminServiceReference = context.getServiceReference(PackageAdmin.class);
+ if (packageAdminServiceReference != null) {
+ this.packageAdmin = context.getService(packageAdminServiceReference);
}
-
- serviceReference = context.getServiceReference(PackageAdmin.class.getName());
- if (serviceReference != null) {
- this.packageAdmin = (PackageAdmin) context.getService(serviceReference);
- }
}
-
+
@BeforeClass
public static void awaitKernelStartup() throws Exception {
- MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer();
- int sleepCount = 600;
- while (!"STARTED".equals(platformMBeanServer.getAttribute(new ObjectName("org.eclipse.virgo.kernel:type=KernelStatus"), "Status"))) {
- Thread.sleep(50);
- if(--sleepCount==0) break;
- }
- assertFalse("Waited for Kernel too long.", sleepCount==0);
+ MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer();
+ int sleepCount = 600;
+ while (!"STARTED".equals(platformMBeanServer.getAttribute(new ObjectName("org.eclipse.virgo.kernel:type=KernelStatus"), "Status"))) {
+ Thread.sleep(50);
+ if (--sleepCount == 0)
+ break;
+ }
+ assertFalse("Waited for Kernel too long.", sleepCount == 0);
}
- protected static void assertDeploymentIdentityEquals(DeploymentIdentity deploymentIdentity, String name, String type, String symbolicName, String version) {
+ protected static void assertDeploymentIdentityEquals(DeploymentIdentity deploymentIdentity, String name, String type, String symbolicName,
+ String version) {
String header = String.format("DeploymentIdentity('%s').", name);
-
- assertEquals(header+"type is incorrect", type, deploymentIdentity.getType());
- assertEquals(header+"symbolicName is incorrect", symbolicName, deploymentIdentity.getSymbolicName());
- assertEquals(header+"version is incorrect", new Version(version), new Version(deploymentIdentity.getVersion()));
+
+ assertEquals(header + "type is incorrect", type, deploymentIdentity.getType());
+ assertEquals(header + "symbolicName is incorrect", symbolicName, deploymentIdentity.getSymbolicName());
+ assertEquals(header + "version is incorrect", new Version(version), new Version(deploymentIdentity.getVersion()));
}
-
+
protected Configuration getConfiguration(String pid) throws IOException, InvalidSyntaxException {
- ServiceReference serviceReference = this.context.getServiceReference(ConfigurationAdmin.class.getName());
+ ServiceReference<?> serviceReference = this.context.getServiceReference(ConfigurationAdmin.class.getName());
ConfigurationAdmin configurationAdmin = (ConfigurationAdmin) this.context.getService(serviceReference);
try {
Configuration[] listConfigurations = configurationAdmin.listConfigurations(null);
-
+
Configuration match = null;
-
+
for (Configuration configuration : listConfigurations) {
if (pid.equals(configuration.getPid())) {
match = configuration;
}
- }
+ }
return match;
} finally {
this.context.ungetService(serviceReference);
}
}
-
+
protected Bundle getBundle(String symbolicName, Version version) {
Bundle[] bundles = this.context.getBundles();
for (Bundle bundle : bundles) {
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/AbstractParTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/AbstractParTests.java
index 94ed47e0..b9e8f522 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/AbstractParTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/AbstractParTests.java
@@ -26,12 +26,12 @@ import org.eclipse.virgo.kernel.module.ModuleContextFailedEvent;
/**
*/
public abstract class AbstractParTests extends AbstractDeployerIntegrationTest {
-
+
protected DeploymentIdentity deploy(File file) throws Throwable {
String appSymbolicName = getApplicationSymbolicName(file);
FailureTrackingListener listener = new FailureTrackingListener(appSymbolicName);
- ServiceRegistration registration = this.context.registerService(ModuleContextEventListener.class.getName(), listener, null);
+ ServiceRegistration<ModuleContextEventListener> registration = this.context.registerService(ModuleContextEventListener.class, listener, null);
try {
DeploymentIdentity deploymentIdentity = this.deployer.deploy(file.toURI());
@@ -62,7 +62,7 @@ public abstract class AbstractParTests extends AbstractDeployerIntegrationTest {
jar.close();
}
}
- }
+ }
private final class FailureTrackingListener implements ModuleContextEventListener {
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ApplicationContextUtils.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ApplicationContextUtils.java
index aebcc4d0..159e8be6 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ApplicationContextUtils.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ApplicationContextUtils.java
@@ -29,7 +29,7 @@ final class ApplicationContextUtils {
}
static ApplicationContext getApplicationContext(BundleContext bundleContext, String symbolicName) {
- ServiceReference[] serviceReferences = null;
+ ServiceReference<?>[] serviceReferences = null;
try {
serviceReferences = bundleContext.getServiceReferences(ApplicationContext.class.getName(), "(Bundle-SymbolicName=" + symbolicName + ")");
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/BundleRefreshTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/BundleRefreshTests.java
index 1f3b0970..b8029142 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/BundleRefreshTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/BundleRefreshTests.java
@@ -44,7 +44,7 @@ public class BundleRefreshTests extends AbstractDeployerIntegrationTest {
@Test
public void testBundleRefresh() throws DeploymentException, InterruptedException {
UninstallTrackingInstallArtifactLifecycleListener listener = new UninstallTrackingInstallArtifactLifecycleListener();
- ServiceRegistration listenerRegistration = this.context.registerService(InstallArtifactLifecycleListener.class.getName(), listener, null);
+ ServiceRegistration<InstallArtifactLifecycleListener> listenerRegistration = this.context.registerService(InstallArtifactLifecycleListener.class, listener, null);
new PathReference("./target/bundle-refresh").createDirectory();
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ClasspathScanningTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ClasspathScanningTests.java
index 5727760c..de55759a 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ClasspathScanningTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ClasspathScanningTests.java
@@ -24,7 +24,7 @@ import org.eclipse.virgo.util.io.PathReference;
public class ClasspathScanningTests extends AbstractDeployerIntegrationTest {
- private ServiceReference appDeployerServiceReference;
+ private ServiceReference<ApplicationDeployer> appDeployerServiceReference;
private ApplicationDeployer appDeployer;
@@ -32,7 +32,7 @@ public class ClasspathScanningTests extends AbstractDeployerIntegrationTest {
public void setUp() throws Exception {
cleanUp();
- this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class.getName());
+ this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class);
this.appDeployer = (ApplicationDeployer) this.context.getService(this.appDeployerServiceReference);
}
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ConfigurationDeploymentTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ConfigurationDeploymentTests.java
index 2854323f..a20d956f 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ConfigurationDeploymentTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ConfigurationDeploymentTests.java
@@ -39,19 +39,19 @@ import org.eclipse.virgo.util.io.FileCopyUtils;
*/
public class ConfigurationDeploymentTests extends AbstractDeployerIntegrationTest {
- private ServiceReference appDeployerServiceReference;
+ private ServiceReference<ApplicationDeployer> appDeployerServiceReference;
private ApplicationDeployer appDeployer;
- private ServiceReference configAdminServiceReference;
+ private ServiceReference<ConfigurationAdmin> configAdminServiceReference;
private ConfigurationAdmin configAdmin;
@Before
public void setUp() throws Exception {
- this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class.getName());
+ this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class);
this.appDeployer = (ApplicationDeployer) this.context.getService(this.appDeployerServiceReference);
- this.configAdminServiceReference = this.context.getServiceReference(ConfigurationAdmin.class.getName());
+ this.configAdminServiceReference = this.context.getServiceReference(ConfigurationAdmin.class);
this.configAdmin = (ConfigurationAdmin) this.context.getService(this.configAdminServiceReference);
}
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/DMSPlanDeploymentTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/DMSPlanDeploymentTests.java
index d8537a61..582d7e47 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/DMSPlanDeploymentTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/DMSPlanDeploymentTests.java
@@ -38,7 +38,7 @@ import org.osgi.service.cm.ConfigurationAdmin;
public class DMSPlanDeploymentTests extends AbstractDeployerIntegrationTest {
- private ServiceReference configAdminServiceReference;
+ private ServiceReference<ConfigurationAdmin> configAdminServiceReference;
private ConfigurationAdmin configAdmin;
@@ -92,8 +92,8 @@ public class DMSPlanDeploymentTests extends AbstractDeployerIntegrationTest {
@Before
public void setUp() throws Exception {
- this.configAdminServiceReference = this.context.getServiceReference(ConfigurationAdmin.class.getName());
- this.configAdmin = (ConfigurationAdmin) this.context.getService(this.configAdminServiceReference);
+ this.configAdminServiceReference = this.context.getServiceReference(ConfigurationAdmin.class);
+ this.configAdmin = this.context.getService(this.configAdminServiceReference);
}
private void testPlanDeployment(File plan, File propertiesFile, String... candidateBsns) throws Exception {
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/DeployerEdgeTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/DeployerEdgeTests.java
index ad4bb4d5..9a927e0c 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/DeployerEdgeTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/DeployerEdgeTests.java
@@ -36,7 +36,7 @@ public class DeployerEdgeTests extends AbstractDeployerIntegrationTest {
private final String TEST_PAR_BUNDLE_SYMBOLIC_NAME = "MyApp-1-com.springsource.kernel.deployer.testbundle";
- private ServiceReference appDeployerServiceReference;
+ private ServiceReference<ApplicationDeployer> appDeployerServiceReference;
private ApplicationDeployer appDeployer;
@@ -59,8 +59,8 @@ public class DeployerEdgeTests extends AbstractDeployerIntegrationTest {
pr = new PathReference("./target/deployer-edge-test/other");
pr.createDirectory();
- this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class.getName());
- this.appDeployer = (ApplicationDeployer) this.context.getService(this.appDeployerServiceReference);
+ this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class);
+ this.appDeployer = this.context.getService(this.appDeployerServiceReference);
parCopy1 = new PathReference("./target/deployer-edge-test/app0.par");
parCopy2 = new PathReference("./target/deployer-edge-test/app0copy.par");
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/InterdependentBundleDeploymentTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/InterdependentBundleDeploymentTests.java
index 4dd10241..46fda9dd 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/InterdependentBundleDeploymentTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/InterdependentBundleDeploymentTests.java
@@ -28,7 +28,7 @@ import org.eclipse.virgo.util.io.PathReference;
*/
public class InterdependentBundleDeploymentTests extends AbstractDeployerIntegrationTest {
- private ServiceReference appDeployerServiceReference;
+ private ServiceReference<ApplicationDeployer> appDeployerServiceReference;
private ApplicationDeployer appDeployer;
@@ -37,8 +37,8 @@ public class InterdependentBundleDeploymentTests extends AbstractDeployerIntegra
pr.delete(true);
pr.createDirectory();
- this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class.getName());
- this.appDeployer = (ApplicationDeployer) this.context.getService(this.appDeployerServiceReference);
+ this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class);
+ this.appDeployer = this.context.getService(this.appDeployerServiceReference);
}
@After public void tearDown() throws Exception {
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/MultiBundleApplicationDeploymentTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/MultiBundleApplicationDeploymentTests.java
index add24507..712da6e3 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/MultiBundleApplicationDeploymentTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/MultiBundleApplicationDeploymentTests.java
@@ -36,7 +36,6 @@ import org.junit.Test;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
-
/**
* Test deploying an OSGi application containing a simple bundle.
*
@@ -47,21 +46,20 @@ public class MultiBundleApplicationDeploymentTests extends AbstractDeployerInteg
private static final String TEST_BUNDLE_Q_SYMBOLIC_NAME = "MultiBundleApp-1-com.springsource.server.apps.app4.q";
- private ServiceReference appDeployerServiceReference;
+ private ServiceReference<ApplicationDeployer> appDeployerServiceReference;
private ApplicationDeployer appDeployer;
- private ServiceRegistration listenerRegistration = null;
+ private ServiceRegistration<DeploymentListener> listenerRegistration = null;
private List<EventInfo> events = null;
@Before
public void setUp() throws Exception {
- this.listenerRegistration =
- this.context.registerService("org.eclipse.virgo.kernel.deployer.core.event.DeploymentListener", this, null);
+ this.listenerRegistration = this.context.registerService(DeploymentListener.class, this, null);
- this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class.getName());
- this.appDeployer = (ApplicationDeployer) this.context.getService(this.appDeployerServiceReference);
+ this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class);
+ this.appDeployer = this.context.getService(this.appDeployerServiceReference);
this.events = new ArrayList<EventInfo>();
}
@@ -93,7 +91,7 @@ public class MultiBundleApplicationDeploymentTests extends AbstractDeployerInteg
// Check that the test bundle's application contexts are destroyed.
assertNull(ApplicationContextUtils.getApplicationContext(this.context, TEST_BUNDLE_P_SYMBOLIC_NAME));
assertNull(ApplicationContextUtils.getApplicationContext(this.context, TEST_BUNDLE_Q_SYMBOLIC_NAME));
-
+
assertFalse("File " + file + " deployed after test!", this.appDeployer.isDeployed(fileURI));
@SuppressWarnings("unused")
@@ -130,7 +128,7 @@ public class MultiBundleApplicationDeploymentTests extends AbstractDeployerInteg
public void installAParWithInternalRequireBundle() throws Exception {
File file = new File("src/test/resources/requirebundle/bundles/parWithInternalRequireBundle.par");
URI fileURI = file.toURI();
-
+
assertFalse("File " + file + " deployed before test!", this.appDeployer.isDeployed(fileURI));
DeploymentIdentity deploymentId = this.appDeployer.deploy(fileURI);
assertTrue("File " + file + " not deployed.", this.appDeployer.isDeployed(fileURI));
@@ -147,7 +145,7 @@ public class MultiBundleApplicationDeploymentTests extends AbstractDeployerInteg
this.appDeployer.deploy(file.toURI());
}
-// @Ignore
+ // @Ignore
@Test
public void installAParWithTwoBundlesThatImportTheSameLibrary() throws DeploymentException {
@@ -190,7 +188,7 @@ public class MultiBundleApplicationDeploymentTests extends AbstractDeployerInteg
"org.eclipse.virgo.kernel.deployer.core.event.ApplicationBundleStopped TwoBundlesThatImportTheSameLibrary 1 TwoBundlesThatImportTheSameLibrary-1-TwoBundlesThatImportTheSameLibrary-synthetic.context",
"org.eclipse.virgo.kernel.deployer.core.event.ApplicationBundleUndeployed TwoBundlesThatImportTheSameLibrary 1 TwoBundlesThatImportTheSameLibrary-1-TwoBundlesThatImportTheSameLibrary-synthetic.context",
"org.eclipse.virgo.kernel.deployer.core.event.ApplicationUndeployed TwoBundlesThatImportTheSameLibrary 1" };
- //FIXME: [DMS-1388] reinstate checkEvents(expectedEvents);
+ // FIXME: [DMS-1388] reinstate checkEvents(expectedEvents);
// NB: no onEvent() calls are made.
}
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/NestedPlanIntegrationTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/NestedPlanIntegrationTests.java
index 4cb6d68d..8bb533c1 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/NestedPlanIntegrationTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/NestedPlanIntegrationTests.java
@@ -55,6 +55,7 @@ import org.osgi.service.packageadmin.ExportedPackage;
* the parent and child plans.
*
*/
+@SuppressWarnings("deprecation")
public class NestedPlanIntegrationTests extends AbstractDeployerIntegrationTest {
private static final String GLOBAL_PACKAGE = "global";
@@ -118,9 +119,9 @@ public class NestedPlanIntegrationTests extends AbstractDeployerIntegrationTest
@Before
public void setUp() throws Exception {
- ServiceReference serviceReference = context.getServiceReference(RuntimeArtifactRepository.class.getName());
+ ServiceReference<RuntimeArtifactRepository> serviceReference = context.getServiceReference(RuntimeArtifactRepository.class);
if (serviceReference != null) {
- this.ram = (RuntimeArtifactRepository) context.getService(serviceReference);
+ this.ram = context.getService(serviceReference);
}
globalBundleDeploymentIdentity = deploy(GLOBAL_BUNDLE_INFO);
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/OnStartedFailureTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/OnStartedFailureTests.java
index 9b27aca9..c538097e 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/OnStartedFailureTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/OnStartedFailureTests.java
@@ -44,14 +44,14 @@ public class OnStartedFailureTests extends AbstractRAMIntegrationTests {
private final OnStartedFailureLifecycleListener lifecycleListener = new OnStartedFailureLifecycleListener();
- private volatile ServiceRegistration registration;
+ private volatile ServiceRegistration<InstallArtifactLifecycleListener> registration;
private void registerListener() {
- this.registration = this.context.registerService(InstallArtifactLifecycleListener.class.getName(), this.lifecycleListener, null);
+ this.registration = this.context.registerService(InstallArtifactLifecycleListener.class, this.lifecycleListener, null);
}
private void unregisterListener() {
- ServiceRegistration localRegistration = this.registration;
+ ServiceRegistration<InstallArtifactLifecycleListener> localRegistration = this.registration;
if (localRegistration != null) {
localRegistration.unregister();
}
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PipelinedDeployerIntegrationTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PipelinedDeployerIntegrationTests.java
index 49b65c21..8a0a6ac5 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PipelinedDeployerIntegrationTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PipelinedDeployerIntegrationTests.java
@@ -43,15 +43,13 @@ public class PipelinedDeployerIntegrationTests extends AbstractDeployerIntegrati
private static final int POLLING_INTERVAL_MILLIS = 100;
- private ServiceRegistration dummyModuleDeployerServiceRegistration;
-
private final PathReference pickup = new PathReference("./target/pickup");
private final PathReference target = new PathReference("./target");
private StubInstallArtifactLifecycleListener lifecycleListener;
- private ServiceRegistration lifecycleListenerRegistration;
+ private ServiceRegistration<InstallArtifactLifecycleListener> lifecycleListenerRegistration;
private DeploymentIdentity deploymentIdentity;
@@ -64,8 +62,7 @@ public class PipelinedDeployerIntegrationTests extends AbstractDeployerIntegrati
clearPickup();
this.lifecycleListener = new StubInstallArtifactLifecycleListener();
- this.lifecycleListenerRegistration = this.kernelContext.registerService(InstallArtifactLifecycleListener.class.getName(),
- this.lifecycleListener, null);
+ this.lifecycleListenerRegistration = this.kernelContext.registerService(InstallArtifactLifecycleListener.class, this.lifecycleListener, null);
}
private void clearPickup() {
@@ -78,9 +75,6 @@ public class PipelinedDeployerIntegrationTests extends AbstractDeployerIntegrati
public void tearDown() throws Exception {
undeploy();
clearPickup();
- if (this.dummyModuleDeployerServiceRegistration != null) {
- this.dummyModuleDeployerServiceRegistration.unregister();
- }
if (this.lifecycleListenerRegistration != null) {
this.lifecycleListenerRegistration.unregister();
}
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PipelinedDeployerTimeOutTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PipelinedDeployerTimeOutTests.java
index c844716e..12492dd3 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PipelinedDeployerTimeOutTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PipelinedDeployerTimeOutTests.java
@@ -35,7 +35,7 @@ import org.eclipse.virgo.util.io.PathReference;
// TODO This test is not robust: it passes without the change to the configured timeout value
public class PipelinedDeployerTimeOutTests extends AbstractDeployerIntegrationTest {
- private ServiceReference appDeployerServiceReference;
+ private ServiceReference<ApplicationDeployer> appDeployerServiceReference;
private ApplicationDeployer appDeployer;
@@ -43,7 +43,7 @@ public class PipelinedDeployerTimeOutTests extends AbstractDeployerIntegrationTe
private StubInstallArtifactLifecycleListener lifecycleListener;
- private ServiceRegistration lifecycleListenerRegistration;
+ private ServiceRegistration<InstallArtifactLifecycleListener> lifecycleListenerRegistration;
@Before
public void setUp() throws Exception {
@@ -53,11 +53,10 @@ public class PipelinedDeployerTimeOutTests extends AbstractDeployerIntegrationTe
clearPickup();
- this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class.getName());
- this.appDeployer = (ApplicationDeployer) this.context.getService(this.appDeployerServiceReference);
+ this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class);
+ this.appDeployer = this.context.getService(this.appDeployerServiceReference);
this.lifecycleListener = new StubInstallArtifactLifecycleListener();
- this.lifecycleListenerRegistration = this.context.registerService(InstallArtifactLifecycleListener.class.getName(), this.lifecycleListener,
- null);
+ this.lifecycleListenerRegistration = this.context.registerService(InstallArtifactLifecycleListener.class, this.lifecycleListener, null);
}
private void clearPickup() {
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentTests.java
index d05de1b2..031e2036 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentTests.java
@@ -38,7 +38,7 @@ import org.osgi.service.cm.ConfigurationAdmin;
public class PlanDeploymentTests extends AbstractDeployerIntegrationTest {
- private ServiceReference configAdminServiceReference;
+ private ServiceReference<ConfigurationAdmin> configAdminServiceReference;
private ConfigurationAdmin configAdmin;
@@ -92,8 +92,8 @@ public class PlanDeploymentTests extends AbstractDeployerIntegrationTest {
@Before
public void setUp() throws Exception {
- this.configAdminServiceReference = this.context.getServiceReference(ConfigurationAdmin.class.getName());
- this.configAdmin = (ConfigurationAdmin) this.context.getService(this.configAdminServiceReference);
+ this.configAdminServiceReference = this.context.getServiceReference(ConfigurationAdmin.class);
+ this.configAdmin = this.context.getService(this.configAdminServiceReference);
}
private void testPlanDeployment(File plan, File propertiesFile, String... candidateBsns) throws Exception {
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RAMBundleRefreshTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RAMBundleRefreshTests.java
index c07bb8a7..06c72302 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RAMBundleRefreshTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RAMBundleRefreshTests.java
@@ -36,6 +36,7 @@ import org.eclipse.virgo.util.io.PathReference;
* <p />
*
*/
+@SuppressWarnings("deprecation")
public class RAMBundleRefreshTests extends AbstractRAMIntegrationTests {
@Test
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RAMDeploymentIntegrationTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RAMDeploymentIntegrationTests.java
index f3d910c2..27f14e06 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RAMDeploymentIntegrationTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RAMDeploymentIntegrationTests.java
@@ -34,33 +34,27 @@ import org.eclipse.virgo.kernel.model.RuntimeArtifactRepository;
*/
public class RAMDeploymentIntegrationTests extends AbstractDeployerIntegrationTest {
- private ServiceRegistration dummyModuleDeployerServiceRegistration;
-
private StubInstallArtifactLifecycleListener lifecycleListener;
- private ServiceRegistration lifecycleListenerRegistration;
+ private ServiceRegistration<InstallArtifactLifecycleListener> lifecycleListenerRegistration;
private DeploymentIdentity deploymentIdentity;
- private ServiceReference ramReference;
+ private ServiceReference<RuntimeArtifactRepository> ramReference;
private RuntimeArtifactRepository ram;
@Before
- public void setUp() throws Exception {
+ public void setUp() throws Exception {
this.lifecycleListener = new StubInstallArtifactLifecycleListener();
- this.lifecycleListenerRegistration = this.kernelContext.registerService(InstallArtifactLifecycleListener.class.getName(),
- this.lifecycleListener, null);
+ this.lifecycleListenerRegistration = this.kernelContext.registerService(InstallArtifactLifecycleListener.class, this.lifecycleListener, null);
- this.ramReference = this.kernelContext.getServiceReference(RuntimeArtifactRepository.class.getName());
- this.ram = (RuntimeArtifactRepository) this.kernelContext.getService(ramReference);
+ this.ramReference = this.kernelContext.getServiceReference(RuntimeArtifactRepository.class);
+ this.ram = this.kernelContext.getService(ramReference);
}
@After
public void tearDown() throws Exception {
- if (this.dummyModuleDeployerServiceRegistration != null) {
- this.dummyModuleDeployerServiceRegistration.unregister();
- }
if (this.lifecycleListenerRegistration != null) {
this.lifecycleListenerRegistration.unregister();
}
@@ -77,21 +71,23 @@ public class RAMDeploymentIntegrationTests extends AbstractDeployerIntegrationTe
this.lifecycleListener.assertLifecycleCounts(0, 0, 0, 0);
this.deploymentIdentity = this.deployer.deploy(file.toURI());
this.lifecycleListener.assertLifecycleCounts(1, 1, 0, 0);
- Artifact artifact = this.ram.getArtifact(this.deploymentIdentity.getType(), this.deploymentIdentity.getSymbolicName(), new Version(this.deploymentIdentity.getVersion()));
+ Artifact artifact = this.ram.getArtifact(this.deploymentIdentity.getType(), this.deploymentIdentity.getSymbolicName(), new Version(
+ this.deploymentIdentity.getVersion()));
assertNotNull(artifact);
artifact.uninstall();
this.lifecycleListener.assertLifecycleCounts(1, 1, 1, 1);
}
-
- @Test(expected=DeploymentException.class)
+
+ @Test(expected = DeploymentException.class)
public void testRAMUndeploymentFollowedByDeployerUndeployment() throws Exception {
File file = new File("src/test/resources/dummy.jar");
this.deploymentIdentity = this.deployer.deploy(file.toURI());
- Artifact artifact = this.ram.getArtifact(this.deploymentIdentity.getType(), this.deploymentIdentity.getSymbolicName(), new Version(this.deploymentIdentity.getVersion()));
+ Artifact artifact = this.ram.getArtifact(this.deploymentIdentity.getType(), this.deploymentIdentity.getSymbolicName(), new Version(
+ this.deploymentIdentity.getVersion()));
artifact.uninstall();
-
+
// The following deployer operation should throw DeploymentException.
- this.deployer.undeploy(this.deploymentIdentity);
+ this.deployer.undeploy(this.deploymentIdentity);
}
}
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RedeployRefreshTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RedeployRefreshTests.java
index 3bf263f4..4c3399c8 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RedeployRefreshTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RedeployRefreshTests.java
@@ -36,7 +36,7 @@ public class RedeployRefreshTests extends AbstractDeployerIntegrationTest {
private static final DeploymentOptions OPTIONS_OWNED = new DeploymentOptions(false, true, true);
- private ServiceReference appDeployerServiceReference;
+ private ServiceReference<ApplicationDeployer> appDeployerServiceReference;
private ApplicationDeployer appDeployer;
@@ -52,8 +52,8 @@ public class RedeployRefreshTests extends AbstractDeployerIntegrationTest {
pr.createDirectory();
simpleModule = pr.newChild("simple.module.jar");
- this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class.getName());
- this.appDeployer = (ApplicationDeployer) this.context.getService(this.appDeployerServiceReference);
+ this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class);
+ this.appDeployer = this.context.getService(this.appDeployerServiceReference);
}
@After
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RefreshTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RefreshTests.java
index 831cb6bd..4188f98e 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RefreshTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/RefreshTests.java
@@ -52,7 +52,7 @@ public class RefreshTests extends AbstractDeployerIntegrationTest {
private final String TEST_IMPORT_BUNDLE_IMPORTER_BUNDLE_SYMBOLIC_NAME = "RefreshTest-Import-Bundle-1-RefreshImporter";
- private ServiceReference appDeployerServiceReference;
+ private ServiceReference<ApplicationDeployer> appDeployerServiceReference;
private ApplicationDeployer appDeployer;
@@ -80,8 +80,8 @@ public class RefreshTests extends AbstractDeployerIntegrationTest {
pr.delete(true);
pr.createDirectory();
- this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class.getName());
- this.appDeployer = (ApplicationDeployer) this.context.getService(this.appDeployerServiceReference);
+ this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class);
+ this.appDeployer = this.context.getService(this.appDeployerServiceReference);
explodedPar = new PathReference("./target/refresh-test/refresh.par");
explodedPar.delete(true);
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ServiceScopingTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ServiceScopingTests.java
index e8da9dab..a15014d7 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ServiceScopingTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/ServiceScopingTests.java
@@ -20,6 +20,7 @@ import static org.junit.Assert.fail;
import java.io.File;
import java.lang.management.ManagementFactory;
+import java.util.Collection;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.List;
@@ -59,10 +60,10 @@ public class ServiceScopingTests extends AbstractParTests {
BundleContext context = this.framework.getBundleContext();
// check global is wired to b
- ServiceReference[] refs = context.getServiceReferences(Appendable.class.getName(), "(provider=global)");
+ Collection<ServiceReference<Appendable>> refs = context.getServiceReferences(Appendable.class, "(provider=global)");
assertNotNull(refs);
- assertEquals(1, refs.length);
- Bundle[] usingBundles = refs[0].getUsingBundles();
+ assertEquals(1, refs.size());
+ Bundle[] usingBundles = refs.iterator().next().getUsingBundles();
assertEquals(1, usingBundles.length);
Bundle b = usingBundles[0];
assertNotNull(b);
@@ -78,11 +79,11 @@ public class ServiceScopingTests extends AbstractParTests {
}
// check unable to access scoped service from unscoped view
- refs = context.getServiceReferences(Appendable.class.getName(), "(provider=local)");
- assertNull("refs should not be null", refs);
+ refs = context.getServiceReferences(Appendable.class, "(provider=local)");
+ assertEquals("refs should be empty", refs.size(), 0);
// check able to publish into global from app
- ServiceReference serviceReference = context.getServiceReference(CharSequence.class.getName());
+ ServiceReference<CharSequence> serviceReference = context.getServiceReference(CharSequence.class);
assertNotNull("cannot see service in global scope", serviceReference);
this.deployer.undeploy(parDeploymentIdentity);
@@ -174,19 +175,20 @@ public class ServiceScopingTests extends AbstractParTests {
assertNotNull(bundle);
// Check that bundle two is wired to the service from bundle one.
- ServiceReference serviceReference = bundle.getBundleContext().getServiceReference(List.class.getName());
+ @SuppressWarnings("rawtypes")
+ ServiceReference<List> serviceReference = bundle.getBundleContext().getServiceReference(List.class);
assertEquals("service-scoping-1-service.scoping.one", serviceReference.getBundle().getSymbolicName());
// Check that the service is not visible outside the scope
- serviceReference = this.context.getServiceReference(List.class.getName());
+ serviceReference = this.context.getServiceReference(List.class);
assertNull(serviceReference);
this.deployer.undeploy(deployed);
}
- private void assertContainsServiceReference(ServiceReference[] refs, String filter) throws InvalidSyntaxException {
+ private void assertContainsServiceReference(ServiceReference<?>[] refs, String filter) throws InvalidSyntaxException {
Filter f = FrameworkUtil.createFilter(filter);
- for (ServiceReference serviceReference : refs) {
+ for (ServiceReference<?> serviceReference : refs) {
if (f.match(serviceReference)) {
return;
}
@@ -196,8 +198,8 @@ public class ServiceScopingTests extends AbstractParTests {
private Set<String> knownScopes() throws Exception {
BundleContext context = this.framework.getBundleContext();
- ServiceReference reference = context.getServiceReference(ScopeServiceRepository.class.getName());
- ScopeServiceRepository scopeServiceRepository = (ScopeServiceRepository)context.getService(reference);
+ ServiceReference<ScopeServiceRepository> reference = context.getServiceReference(ScopeServiceRepository.class);
+ ScopeServiceRepository scopeServiceRepository = context.getService(reference);
Set<String> knownScopes = scopeServiceRepository.knownScopes();
context.ungetService(reference);
return knownScopes;
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/Spring256ABundleTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/Spring256ABundleTests.java
index f1cac0ee..13195e94 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/Spring256ABundleTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/Spring256ABundleTests.java
@@ -44,15 +44,15 @@ public class Spring256ABundleTests extends AbstractDeployerIntegrationTest {
private ApplicationDeployer appDeployer;
- private ServiceReference appDeployerServiceReference;
+ private ServiceReference<ApplicationDeployer> appDeployerServiceReference;
@Before
public void setUp() throws Exception {
PathReference pr = new PathReference("./target/work/org.eclipse.virgo.kernel");
pr.delete(true);
- this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class.getName());
- this.appDeployer = (ApplicationDeployer) this.context.getService(this.appDeployerServiceReference);
+ this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class);
+ this.appDeployer = this.context.getService(this.appDeployerServiceReference);
}
@After
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/TransitiveConstraintFailureDiagnosisTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/TransitiveConstraintFailureDiagnosisTests.java
index 82da8f8c..bd72ae74 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/TransitiveConstraintFailureDiagnosisTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/TransitiveConstraintFailureDiagnosisTests.java
@@ -36,14 +36,14 @@ import org.eclipse.virgo.kernel.deployer.test.modules.TesterModuleImport;
*/
public class TransitiveConstraintFailureDiagnosisTests extends AbstractDeployerIntegrationTest {
- private ServiceReference appDeployerServiceReference;
+ private ServiceReference<ApplicationDeployer> appDeployerServiceReference;
private ApplicationDeployer appDeployer;
@Before
public void setUp() throws Exception {
- this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class.getName());
- this.appDeployer = (ApplicationDeployer) this.context.getService(this.appDeployerServiceReference);
+ this.appDeployerServiceReference = this.context.getServiceReference(ApplicationDeployer.class);
+ this.appDeployer = this.context.getService(this.appDeployerServiceReference);
}
@After
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/Plumber.java b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/Plumber.java
index 7205e8ab..d880ce84 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/Plumber.java
+++ b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/Plumber.java
@@ -39,6 +39,7 @@ import org.eclipse.virgo.kernel.osgi.quasi.QuasiFrameworkFactory;
* This class is thread safe.
*
*/
+@SuppressWarnings("deprecation")
final class Plumber {
private final PackageAdmin packageAdmin;
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/RegionAwarePackageAdminAccessor.java b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/RegionAwarePackageAdminAccessor.java
index 700b4f28..05adc0d7 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/RegionAwarePackageAdminAccessor.java
+++ b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/RegionAwarePackageAdminAccessor.java
@@ -17,6 +17,7 @@ import org.osgi.service.packageadmin.PackageAdmin;
import org.eclipse.virgo.kernel.osgi.framework.OsgiFrameworkUtils;
import org.eclipse.virgo.kernel.osgi.region.Region;
+@SuppressWarnings("deprecation")
final class RegionAwarePackageAdminAccessor {
public static PackageAdmin getPackageAdmin(Region region) {
BundleContext bundleContext = region.getBundleContext();
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/management/StandardDeployer.java b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/management/StandardDeployer.java
index 5924f6f2..54a1aa81 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/management/StandardDeployer.java
+++ b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/management/StandardDeployer.java
@@ -55,6 +55,7 @@ public class StandardDeployer implements Deployer {
/**
* {@inheritDoc}
*/
+ @SuppressWarnings("deprecation")
public void undeploy(String applicationSymbolicName, String version) throws DeploymentException {
this.applicationDeployer.undeploy(applicationSymbolicName, version);
}
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/pipeline/stage/resolve/internal/ResolveStage.java b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/pipeline/stage/resolve/internal/ResolveStage.java
index 2e1057e6..f19a6a86 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/pipeline/stage/resolve/internal/ResolveStage.java
+++ b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/pipeline/stage/resolve/internal/ResolveStage.java
@@ -41,6 +41,7 @@ import org.eclipse.virgo.util.common.Tree.TreeVisitor;
* This class is thread safe.
*
*/
+@SuppressWarnings("deprecation")
public final class ResolveStage implements PipelineStage {
private final PackageAdmin packageAdmin;
diff --git a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/internal/StandardPipelineTests.java b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/internal/StandardPipelineTests.java
index 7855bfea..67f0b93f 100644
--- a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/internal/StandardPipelineTests.java
+++ b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/internal/StandardPipelineTests.java
@@ -85,7 +85,7 @@ public class StandardPipelineTests {
@Before
public void setUp() {
- this.installTree = new ThreadSafeArrayListTree<InstallArtifact>(null);;
+ this.installTree = new ThreadSafeArrayListTree<InstallArtifact>(null);
this.installEnvironment = createMock(InstallEnvironment.class);
this.installLog = createMock(InstallLog.class);
this.stageTrace = new ArrayList<PipelineStage>();

Back to the top