Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2012-02-01 11:03:34 -0500
committerGlyn Normington2012-02-01 11:03:34 -0500
commitfcb5175eaae234059ec0a49d499159831322a010 (patch)
tree4fd6cace8be01a02366d3e6e99c9e016bbbbbaaa /org.eclipse.virgo.kernel.deployer.test/src/test/java
parenta6a6f2ff32b5a092f0880dad517a5094020b550d (diff)
downloadorg.eclipse.virgo.kernel-fcb5175eaae234059ec0a49d499159831322a010.tar.gz
org.eclipse.virgo.kernel-fcb5175eaae234059ec0a49d499159831322a010.tar.xz
org.eclipse.virgo.kernel-fcb5175eaae234059ec0a49d499159831322a010.zip
365034: add test for case where plan references an already deployed artefact not in the repository
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/PlanDeploymentWithDAGTests.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentWithDAGTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentWithDAGTests.java
index 6ecd0cbe..8d093c8d 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentWithDAGTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentWithDAGTests.java
@@ -28,6 +28,8 @@ import org.osgi.framework.Bundle;
public class PlanDeploymentWithDAGTests extends AbstractDeployerIntegrationTest {
private static final String BUNDLE_ONE_SYMBOLIC_NAME = "simple.bundle.one";
+
+ private static final String BUNDLE_THREE_SYMBOLIC_NAME = "simple.bundle.three";
@Test
// 1a. (@see https://bugs.eclipse.org/bugs/show_bug.cgi?id=365034)
@@ -145,7 +147,40 @@ public class PlanDeploymentWithDAGTests extends AbstractDeployerIntegrationTest
this.deployer.undeploy(deploymentIdentity);
}
+ @Test
+ public void planReferencingAnAlreadyInstalledBundleNotInRepository() throws Exception {
+
+ File file = new File("src/test/resources/plan-deployment-dag/simple.bundle.three.jar");
+ DeploymentIdentity bundleDeploymentId = this.deployer.deploy(file.toURI());
+ assertBundlesInstalled(this.context.getBundles(), BUNDLE_THREE_SYMBOLIC_NAME);
+
+ DeploymentIdentity planDeploymentId = this.deployer.deploy(new File("src/test/resources/testunscopednonatomicC.plan").toURI());
+ assertBundlesInstalled(this.context.getBundles(), BUNDLE_THREE_SYMBOLIC_NAME);
+
+ this.deployer.undeploy(planDeploymentId);
+ assertBundlesInstalled(this.context.getBundles(), BUNDLE_THREE_SYMBOLIC_NAME);
+
+ this.deployer.undeploy(bundleDeploymentId.getType(), bundleDeploymentId.getSymbolicName(), bundleDeploymentId.getVersion());
+ assertBundlesNotInstalled(this.context.getBundles(), BUNDLE_THREE_SYMBOLIC_NAME);
+ }
+
+ @Test
+ public void planReferencingAnAlreadyInstalledBundleNotInRepositoryUndeployBundleFirst() throws Exception {
+
+ File file = new File("src/test/resources/plan-deployment/simple.bundle.three.jar");
+ DeploymentIdentity deploymentId = this.deployer.deploy(file.toURI());
+ assertBundlesInstalled(this.context.getBundles(), BUNDLE_THREE_SYMBOLIC_NAME);
+
+ DeploymentIdentity deploymentIdentity = this.deployer.deploy(new File("src/test/resources/testunscopednonatomicC.plan").toURI());
+ assertNoDuplicatesInstalled(this.context.getBundles(), BUNDLE_THREE_SYMBOLIC_NAME);
+ assertBundlesInstalled(this.context.getBundles(), BUNDLE_THREE_SYMBOLIC_NAME);
+ this.deployer.undeploy(deploymentId.getType(), deploymentId.getSymbolicName(), deploymentId.getVersion());
+ assertBundlesInstalled(this.context.getBundles(), BUNDLE_THREE_SYMBOLIC_NAME);
+
+ this.deployer.undeploy(deploymentIdentity);
+ assertBundlesNotInstalled(this.context.getBundles(), BUNDLE_THREE_SYMBOLIC_NAME);
+ }
static void assertBundlesActive(Bundle[] bundles, String... bsns) {
for (String bsn : bsns) {

Back to the top