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
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
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanDeploymentWithDAGTests.java35
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-deployment-dag/simple.bundle.three.jarbin0 -> 604 bytes
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/testunscopednonatomicC.plan11
-rw-r--r--test-apps/plan-deployment/simple.bundle.one/build.xml2
-rw-r--r--test-apps/plan-deployment/simple.bundle.three/.classpath10
-rw-r--r--test-apps/plan-deployment/simple.bundle.three/.project17
-rw-r--r--test-apps/plan-deployment/simple.bundle.three/build.xml9
-rw-r--r--test-apps/plan-deployment/simple.bundle.three/ivy.xml22
-rw-r--r--test-apps/plan-deployment/simple.bundle.three/src/main/java/.gitignore0
-rw-r--r--test-apps/plan-deployment/simple.bundle.three/src/main/resources/META-INF/MANIFEST.MF4
-rw-r--r--test-apps/plan-deployment/simple.bundle.three/src/test/java/.gitignore0
-rw-r--r--test-apps/plan-deployment/simple.bundle.three/src/test/resources/.gitignore0
12 files changed, 109 insertions, 1 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) {
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-deployment-dag/simple.bundle.three.jar b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-deployment-dag/simple.bundle.three.jar
new file mode 100644
index 00000000..454c88ad
--- /dev/null
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-deployment-dag/simple.bundle.three.jar
Binary files differ
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/testunscopednonatomicC.plan b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/testunscopednonatomicC.plan
new file mode 100644
index 00000000..92fc05ac
--- /dev/null
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/testunscopednonatomicC.plan
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plan name="testC.plan" version="1.0.0" scoped="false" atomic="false"
+ xmlns="http://www.eclipse.org/virgo/schema/plan"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.eclipse.org/virgo/schema/plan
+ http://www.eclipse.org/virgo/schema/plan/eclipse-virgo-plan.xsd">
+
+ <artifact type="bundle" name="simple.bundle.three" version="[1, 2)"/>
+
+</plan> \ No newline at end of file
diff --git a/test-apps/plan-deployment/simple.bundle.one/build.xml b/test-apps/plan-deployment/simple.bundle.one/build.xml
index 42498ca9..c53d35b3 100644
--- a/test-apps/plan-deployment/simple.bundle.one/build.xml
+++ b/test-apps/plan-deployment/simple.bundle.one/build.xml
@@ -4,6 +4,6 @@
<property file="${basedir}/../build.properties"/>
<property file="${basedir}/../../../build.versions"/>
<property name="jar.output.file" value="${basedir}/../../../org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-deployment/simple.bundle.one.jar"/>
- <import file="${basedir}/../../../spring-build/standard/default.xml"/>
+ <import file="${basedir}/../../../virgo-build/standard/default.xml"/>
</project>
diff --git a/test-apps/plan-deployment/simple.bundle.three/.classpath b/test-apps/plan-deployment/simple.bundle.three/.classpath
new file mode 100644
index 00000000..adebb12a
--- /dev/null
+++ b/test-apps/plan-deployment/simple.bundle.three/.classpath
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-4.7.0.jar" sourcepath="/KERNEL_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-sources-4.7.0.jar"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/test-apps/plan-deployment/simple.bundle.three/.project b/test-apps/plan-deployment/simple.bundle.three/.project
new file mode 100644
index 00000000..995f6054
--- /dev/null
+++ b/test-apps/plan-deployment/simple.bundle.three/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>simple.bundle.three</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/test-apps/plan-deployment/simple.bundle.three/build.xml b/test-apps/plan-deployment/simple.bundle.three/build.xml
new file mode 100644
index 00000000..b98daf5e
--- /dev/null
+++ b/test-apps/plan-deployment/simple.bundle.three/build.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="simple.bundle.three">
+
+ <property file="${basedir}/../build.properties"/>
+ <property file="${basedir}/../../../build.versions"/>
+ <property name="jar.output.file" value="${basedir}/../../../org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-deployment-dag/simple.bundle.three.jar"/>
+ <import file="${basedir}/../../../virgo-build/standard/default.xml"/>
+
+</project>
diff --git a/test-apps/plan-deployment/simple.bundle.three/ivy.xml b/test-apps/plan-deployment/simple.bundle.three/ivy.xml
new file mode 100644
index 00000000..584d2f45
--- /dev/null
+++ b/test-apps/plan-deployment/simple.bundle.three/ivy.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type="text/xsl" href="http://ivyrep.jayasoft.org/ivy-doc.xsl"?>
+<ivy-module
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://incubator.apache.org/ivy/schemas/ivy.xsd"
+ version="1.3">
+
+ <info organisation="plan-deployment" module="${ant.project.name}">
+ <ivyauthor name="gnormington"/>
+ </info>
+
+ <configurations>
+ <include file="${virgo.build.dir}/common/default-ivy-configurations.xml"/>
+ </configurations>
+
+ <publications>
+ </publications>
+
+ <dependencies>
+ </dependencies>
+
+</ivy-module>
diff --git a/test-apps/plan-deployment/simple.bundle.three/src/main/java/.gitignore b/test-apps/plan-deployment/simple.bundle.three/src/main/java/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test-apps/plan-deployment/simple.bundle.three/src/main/java/.gitignore
diff --git a/test-apps/plan-deployment/simple.bundle.three/src/main/resources/META-INF/MANIFEST.MF b/test-apps/plan-deployment/simple.bundle.three/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..2b5a6fc0
--- /dev/null
+++ b/test-apps/plan-deployment/simple.bundle.three/src/main/resources/META-INF/MANIFEST.MF
@@ -0,0 +1,4 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: simple.bundle.three
+Bundle-Version: 1
diff --git a/test-apps/plan-deployment/simple.bundle.three/src/test/java/.gitignore b/test-apps/plan-deployment/simple.bundle.three/src/test/java/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test-apps/plan-deployment/simple.bundle.three/src/test/java/.gitignore
diff --git a/test-apps/plan-deployment/simple.bundle.three/src/test/resources/.gitignore b/test-apps/plan-deployment/simple.bundle.three/src/test/resources/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test-apps/plan-deployment/simple.bundle.three/src/test/resources/.gitignore

Back to the top