Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2012-07-17 05:20:41 -0400
committerGlyn Normington2012-07-17 05:20:41 -0400
commit711089f9e9b16ff0e09402c07da12fa00040bf05 (patch)
tree405bcf83c04ab51f4e020b2b0f8260be75aeb3a4
parent841de2679c12426cc9b0b20a3b78a65323660883 (diff)
downloadorg.eclipse.virgo.kernel-711089f9e9b16ff0e09402c07da12fa00040bf05.tar.gz
org.eclipse.virgo.kernel-711089f9e9b16ff0e09402c07da12fa00040bf05.tar.xz
org.eclipse.virgo.kernel-711089f9e9b16ff0e09402c07da12fa00040bf05.zip
385264: improve test cleanup
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/DMSPlanDeploymentTests.java1
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentTests.java20
2 files changed, 20 insertions, 1 deletions
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 c865af14..c6c15495 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
@@ -147,6 +147,7 @@ public class DMSPlanDeploymentTests extends AbstractDeployerIntegrationTest {
}
}
}
+
private void checkConfigAvailable(String pid, File propertiesFile) throws IOException {
Configuration configuration = this.configAdmin.getConfiguration(pid, null);
Dictionary<String, Object> dictionary = configuration.getProperties();
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 ff3d1262..062561d1 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
@@ -142,6 +142,8 @@ public class PlanDeploymentTests extends AbstractDeployerIntegrationTest {
if (propertiesFile != null) {
checkConfigUnavailable(pid);
}
+
+ uninstallBundles(afterUndeployBundles, "simple.fragment.one");
}
private void testPlanDeploymentStartingEvents(File plan, String... candidateBsns) throws Exception {
@@ -179,8 +181,24 @@ public class PlanDeploymentTests extends AbstractDeployerIntegrationTest {
this.deployer.undeploy(deploymentIdentity);
Bundle[] afterUndeployBundles = this.context.getBundles();
assertBundlesNotInstalled(afterUndeployBundles, candidateBsns);
+
+ uninstallBundles(afterUndeployBundles, "simple.fragment.one");
}
-
+
+ private void uninstallBundles(Bundle[] bundles, String... uninstallBsns) {
+ for (Bundle bundle : bundles) {
+ String symbolicName = bundle.getSymbolicName();
+ for (String uninstallBsn : uninstallBsns) {
+ if (uninstallBsn.equals(symbolicName)) {
+ try {
+ bundle.uninstall();
+ } catch (BundleException _) {
+ }
+ }
+ }
+ }
+ }
+
private class StartBundleRunnable implements Runnable {
BundleContext context = null;

Back to the top