Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.virgo.kernel.deployer.test/src/test/java')
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/DMSPlanDeploymentTests.java17
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/DeployerEdgeTests.java13
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentTests.java20
3 files changed, 36 insertions, 14 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..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
@@ -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,20 @@ 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();
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 8777c965..99037a11 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
@@ -263,17 +263,4 @@ public class DeployerEdgeTests extends AbstractDeployerIntegrationTest {
this.appDeployer.deploy(dirURI);
}
- @Test(expected = DeploymentException.class)
- public void testWar() throws Exception {
- URI warURI = new File("src/test/resources/waralientokernel.war").toURI();
-
- this.appDeployer.deploy(warURI);
- }
-
- @Test(expected = DeploymentException.class)
- public void testInvalidDigest() throws Exception {
- URI warURI = new File("src/test/resources/invalidDigest.jar").toURI();
-
- this.appDeployer.deploy(warURI);
- }
}
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