Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2011-12-01 06:36:02 -0500
committerGlyn Normington2011-12-01 06:36:02 -0500
commitb0b35b9599f467240828fb01ecfcec58bf920a9f (patch)
tree8ce358cc8281d8660794d48418b1fc359b14c212 /org.eclipse.virgo.kernel.artifact/src/test
parent569b3450714b319e6221147b125f98150814b603 (diff)
downloadorg.eclipse.virgo.kernel-b0b35b9599f467240828fb01ecfcec58bf920a9f.tar.gz
org.eclipse.virgo.kernel-b0b35b9599f467240828fb01ecfcec58bf920a9f.tar.xz
org.eclipse.virgo.kernel-b0b35b9599f467240828fb01ecfcec58bf920a9f.zip
Bug 315869 - Support the plan 'provisioning' attribute syntax
Diffstat (limited to 'org.eclipse.virgo.kernel.artifact/src/test')
-rw-r--r--org.eclipse.virgo.kernel.artifact/src/test/java/org/eclipse/virgo/kernel/artifact/plan/PlanBridgeTests.java12
-rw-r--r--org.eclipse.virgo.kernel.artifact/src/test/java/org/eclipse/virgo/kernel/artifact/plan/PlanReaderTests.java28
-rw-r--r--org.eclipse.virgo.kernel.artifact/src/test/resources/plans/provisioning-auto.plan (renamed from org.eclipse.virgo.kernel.artifact/src/test/resources/plans/no-install-dependencies.plan)4
-rw-r--r--org.eclipse.virgo.kernel.artifact/src/test/resources/plans/provisioning-default.plan13
-rw-r--r--org.eclipse.virgo.kernel.artifact/src/test/resources/plans/provisioning-disabled.plan13
-rw-r--r--org.eclipse.virgo.kernel.artifact/src/test/resources/plans/provisioning-inherit.plan13
6 files changed, 70 insertions, 13 deletions
diff --git a/org.eclipse.virgo.kernel.artifact/src/test/java/org/eclipse/virgo/kernel/artifact/plan/PlanBridgeTests.java b/org.eclipse.virgo.kernel.artifact/src/test/java/org/eclipse/virgo/kernel/artifact/plan/PlanBridgeTests.java
index 1872f87d..1e8fe54f 100644
--- a/org.eclipse.virgo.kernel.artifact/src/test/java/org/eclipse/virgo/kernel/artifact/plan/PlanBridgeTests.java
+++ b/org.eclipse.virgo.kernel.artifact/src/test/java/org/eclipse/virgo/kernel/artifact/plan/PlanBridgeTests.java
@@ -84,18 +84,18 @@ public class PlanBridgeTests {
}
@Test
- public void testNoInstallDependenciesPlan() throws ArtifactGenerationException {
+ public void testProvisioningDisabledPlan() throws ArtifactGenerationException {
org.eclipse.virgo.repository.ArtifactDescriptor artefact = bridge.generateArtifactDescriptor(new File(
- "src/test/resources/plans/no-install-dependencies.plan"));
+ "src/test/resources/plans/provisioning-disabled.plan"));
assertEquals("plan", artefact.getType());
- assertEquals("noinstalldependencies.plan", artefact.getName());
+ assertEquals("provisioningdisabled.plan", artefact.getName());
assertEquals(new Version(1, 0, 0), artefact.getVersion());
- Set<Attribute> attributes = artefact.getAttribute("dependencies");
+ Set<Attribute> attributes = artefact.getAttribute("provisioning");
assertEquals(1, attributes.size());
Attribute attribute = attributes.iterator().next();
- assertEquals("dependencies", attribute.getKey());
- assertEquals("noinstall", attribute.getValue());
+ assertEquals("provisioning", attribute.getKey());
+ assertEquals("disabled", attribute.getValue());
assertEquals(0, attribute.getProperties().size());
}
diff --git a/org.eclipse.virgo.kernel.artifact/src/test/java/org/eclipse/virgo/kernel/artifact/plan/PlanReaderTests.java b/org.eclipse.virgo.kernel.artifact/src/test/java/org/eclipse/virgo/kernel/artifact/plan/PlanReaderTests.java
index 2e733761..3d962644 100644
--- a/org.eclipse.virgo.kernel.artifact/src/test/java/org/eclipse/virgo/kernel/artifact/plan/PlanReaderTests.java
+++ b/org.eclipse.virgo.kernel.artifact/src/test/java/org/eclipse/virgo/kernel/artifact/plan/PlanReaderTests.java
@@ -24,7 +24,7 @@ import org.osgi.framework.Version;
import org.eclipse.virgo.kernel.artifact.ArtifactSpecification;
import org.eclipse.virgo.kernel.artifact.plan.PlanDescriptor;
-import org.eclipse.virgo.kernel.artifact.plan.PlanDescriptor.Dependencies;
+import org.eclipse.virgo.kernel.artifact.plan.PlanDescriptor.Provisioning;
import org.eclipse.virgo.kernel.artifact.plan.PlanReader;
import org.eclipse.virgo.util.osgi.manifest.VersionRange;
@@ -43,7 +43,7 @@ public class PlanReaderTests {
assertEquals("single-artifact.plan", plan.getName());
assertEquals(new Version(1, 0, 0), plan.getVersion());
- assertEquals(Dependencies.INSTALL, plan.getDependencies());
+ assertEquals(Provisioning.INHERIT, plan.getProvisioning());
List<ArtifactSpecification> artifactSpecifications = plan.getArtifactSpecifications();
assertEquals(1, artifactSpecifications.size());
@@ -108,8 +108,26 @@ public class PlanReaderTests {
}
@Test
- public void testNoInstallDependenciesPlan() throws FileNotFoundException {
- PlanDescriptor plan = reader.read(new FileInputStream("src/test/resources/plans/no-install-dependencies.plan"));
- assertEquals(Dependencies.NO_INSTALL, plan.getDependencies());
+ public void testProvisioningDefaultPlan() throws FileNotFoundException {
+ PlanDescriptor plan = reader.read(new FileInputStream("src/test/resources/plans/provisioning-default.plan"));
+ assertEquals(Provisioning.INHERIT, plan.getProvisioning());
+ }
+
+ @Test
+ public void testProvisioningInheritPlan() throws FileNotFoundException {
+ PlanDescriptor plan = reader.read(new FileInputStream("src/test/resources/plans/provisioning-inherit.plan"));
+ assertEquals(Provisioning.INHERIT, plan.getProvisioning());
+ }
+
+ @Test
+ public void testProvisioningAutoPlan() throws FileNotFoundException {
+ PlanDescriptor plan = reader.read(new FileInputStream("src/test/resources/plans/provisioning-auto.plan"));
+ assertEquals(Provisioning.AUTO, plan.getProvisioning());
+ }
+
+ @Test
+ public void testProvisioningDisabledPlan() throws FileNotFoundException {
+ PlanDescriptor plan = reader.read(new FileInputStream("src/test/resources/plans/provisioning-disabled.plan"));
+ assertEquals(Provisioning.DISABLED, plan.getProvisioning());
}
}
diff --git a/org.eclipse.virgo.kernel.artifact/src/test/resources/plans/no-install-dependencies.plan b/org.eclipse.virgo.kernel.artifact/src/test/resources/plans/provisioning-auto.plan
index d11a5a7a..a2d5f560 100644
--- a/org.eclipse.virgo.kernel.artifact/src/test/resources/plans/no-install-dependencies.plan
+++ b/org.eclipse.virgo.kernel.artifact/src/test/resources/plans/provisioning-auto.plan
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<plan name="noinstalldependencies.plan" version="1.0.0" scoped="false"
- atomic="true" dependencies="noinstall" xmlns="http://www.eclipse.org/virgo/schema/plan"
+<plan name="provisioningauto.plan" version="1.0.0" scoped="false"
+ atomic="true" provisioning="auto" 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
diff --git a/org.eclipse.virgo.kernel.artifact/src/test/resources/plans/provisioning-default.plan b/org.eclipse.virgo.kernel.artifact/src/test/resources/plans/provisioning-default.plan
new file mode 100644
index 00000000..893d0f40
--- /dev/null
+++ b/org.eclipse.virgo.kernel.artifact/src/test/resources/plans/provisioning-default.plan
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plan name="provisioningdefault.plan" version="1.0.0" scoped="false"
+ atomic="true" 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="org.springframework.context.support"
+ version="[1.0.0, 2.0.0)" />
+
+
+</plan> \ No newline at end of file
diff --git a/org.eclipse.virgo.kernel.artifact/src/test/resources/plans/provisioning-disabled.plan b/org.eclipse.virgo.kernel.artifact/src/test/resources/plans/provisioning-disabled.plan
new file mode 100644
index 00000000..b8ac91d6
--- /dev/null
+++ b/org.eclipse.virgo.kernel.artifact/src/test/resources/plans/provisioning-disabled.plan
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plan name="provisioningdisabled.plan" version="1.0.0" scoped="false"
+ atomic="true" provisioning="disabled" 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="org.springframework.context.support"
+ version="[1.0.0, 2.0.0)" />
+
+
+</plan> \ No newline at end of file
diff --git a/org.eclipse.virgo.kernel.artifact/src/test/resources/plans/provisioning-inherit.plan b/org.eclipse.virgo.kernel.artifact/src/test/resources/plans/provisioning-inherit.plan
new file mode 100644
index 00000000..116f2598
--- /dev/null
+++ b/org.eclipse.virgo.kernel.artifact/src/test/resources/plans/provisioning-inherit.plan
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plan name="provisioninginherit.plan" version="1.0.0" scoped="false"
+ atomic="true" provisioning="inherit" 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="org.springframework.context.support"
+ version="[1.0.0, 2.0.0)" />
+
+
+</plan> \ No newline at end of file

Back to the top