Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2012-07-17 08:42:10 +0000
committerGlyn Normington2012-07-17 08:42:10 +0000
commit841de2679c12426cc9b0b20a3b78a65323660883 (patch)
treee6e8dd1eb2ed2c1dece3b405418fd2b5afc3d5bf /org.eclipse.virgo.kernel.deployer.test/src/test
parentf7c6f20ec373e5a007f5c0cbe4d83eaecb7c509b (diff)
downloadorg.eclipse.virgo.kernel-841de2679c12426cc9b0b20a3b78a65323660883.tar.gz
org.eclipse.virgo.kernel-841de2679c12426cc9b0b20a3b78a65323660883.tar.xz
org.eclipse.virgo.kernel-841de2679c12426cc9b0b20a3b78a65323660883.zip
385264: improve test cleanup
Diffstat (limited to 'org.eclipse.virgo.kernel.deployer.test/src/test')
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/DMSPlanDeploymentTests.java16
1 files changed, 16 insertions, 0 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 93017532..c865af14 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
@@ -31,6 +31,7 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.Configuration;
import org.osgi.service.cm.ConfigurationAdmin;
@@ -118,6 +119,8 @@ public class DMSPlanDeploymentTests extends AbstractDeployerIntegrationTest {
if (propertiesFile != null) {
checkConfigUnavailable(pid);
}
+
+ uninstallBundles(afterUndeployBundles, "simple.fragment.one");
}
private void assertBundlesNotInstalled(Bundle[] bundles, String... candidateBsns) {
@@ -131,6 +134,19 @@ public class DMSPlanDeploymentTests extends AbstractDeployerIntegrationTest {
}
}
+ 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 void checkConfigAvailable(String pid, File propertiesFile) throws IOException {
Configuration configuration = this.configAdmin.getConfiguration(pid, null);
Dictionary<String, Object> dictionary = configuration.getProperties();

Back to the top