Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2011-12-02 12:07:46 +0000
committerGlyn Normington2011-12-02 12:07:46 +0000
commit114a6c03ede7b4b1a8fca536ea078836cd0df209 (patch)
treeb30d3914c99927479a6c5364769c361a8809136d /org.eclipse.virgo.kernel.deployer.test/src/test
parent58de854a5d061a7b08b5223f000ac71a6868f185 (diff)
downloadorg.eclipse.virgo.kernel-114a6c03ede7b4b1a8fca536ea078836cd0df209.tar.gz
org.eclipse.virgo.kernel-114a6c03ede7b4b1a8fca536ea078836cd0df209.tar.xz
org.eclipse.virgo.kernel-114a6c03ede7b4b1a8fca536ea078836cd0df209.zip
Bug 315869 - test plan provisioning
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/PlanProvisioningTests.java74
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.repository.properties5
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/auto-inherit.plan11
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/auto.plan11
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/default.plan11
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/disabled-default.plan11
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/disabled-inherit.plan11
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/disabled.plan11
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/inherit.plan11
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/parent-with-exporter-disabled.plan13
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/pexporter.jarbin0 -> 405 bytes
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/pimporter.jarbin0 -> 404 bytes
12 files changed, 168 insertions, 1 deletions
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanProvisioningTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanProvisioningTests.java
new file mode 100644
index 00000000..74a98ac9
--- /dev/null
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PlanProvisioningTests.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2011 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.virgo.kernel.deployer.test;
+
+import java.io.File;
+
+import org.eclipse.virgo.kernel.deployer.core.DeploymentException;
+import org.eclipse.virgo.kernel.deployer.core.DeploymentIdentity;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Version;
+
+public class PlanProvisioningTests extends AbstractDeployerIntegrationTest {
+
+ @Test
+ public void testDefaultProvisioning() throws Exception {
+ testPlanDeployment("src/test/resources/plan-provisioning/default.plan");
+ }
+
+ @Test
+ public void testInheritProvisioning() throws Exception {
+ testPlanDeployment("src/test/resources/plan-provisioning/inherit.plan");
+ }
+
+ @Test
+ public void testAutoProvisioning() throws Exception {
+ testPlanDeployment("src/test/resources/plan-provisioning/auto.plan");
+ }
+
+ @Test(expected = DeploymentException.class)
+ public void testDisabledProvisioning() throws Exception {
+ testPlanDeployment("src/test/resources/plan-provisioning/disabled.plan");
+ }
+
+ @Test
+ public void testAutoInheritProvisioning() throws Exception {
+ testPlanDeployment("src/test/resources/plan-provisioning/auto-inherit.plan");
+ }
+
+ @Test(expected = DeploymentException.class)
+ public void testDisabledInheritProvisioning() throws Exception {
+ testPlanDeployment("src/test/resources/plan-provisioning/disabled-inherit.plan");
+ }
+
+ @Test(expected = DeploymentException.class)
+ public void testDisabledDefaultProvisioning() throws Exception {
+ testPlanDeployment("src/test/resources/plan-provisioning/disabled-default.plan");
+ }
+
+ @Test
+ public void testParentWithExporterDisabledProvisioning() throws Exception {
+ testPlanDeployment("src/test/resources/plan-provisioning/parent-with-exporter-disabled.plan");
+ }
+
+ private void testPlanDeployment(String planPath) throws Exception {
+ DeploymentIdentity deploymentIdentity = this.deployer.deploy(new File(planPath).toURI());
+ this.deployer.undeploy(deploymentIdentity);
+ Bundle exporter = getBundle("plan.provisioning.p.exporter", Version.emptyVersion);
+ if (exporter != null) {
+ exporter.uninstall();
+ }
+ }
+
+
+}
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.repository.properties b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.repository.properties
index 0f7502d3..3fde24ea 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.repository.properties
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.repository.properties
@@ -35,5 +35,8 @@ src-test-resources-7.searchPattern=src/test/resources/properties/*
src-test-resources-8.type=external
src-test-resources-8.searchPattern=src/test/resources/service-scoping/repository/*
+src-test-resources-9.type=external
+src-test-resources-9.searchPattern=src/test/resources/plan-provisioning/*
-chain=target-watched,bundles,ivy-cache-bundles,ivy-cache-libraries,src-test-resources-1,src-test-resources-2,src-test-resources-3,src-test-resources-4,src-test-resources-5,src-test-resources-6,src-test-resources-7,src-test-resources-8
+
+chain=target-watched,bundles,ivy-cache-bundles,ivy-cache-libraries,src-test-resources-1,src-test-resources-2,src-test-resources-3,src-test-resources-4,src-test-resources-5,src-test-resources-6,src-test-resources-7,src-test-resources-8,src-test-resources-9
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/auto-inherit.plan b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/auto-inherit.plan
new file mode 100644
index 00000000..46ca0abd
--- /dev/null
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/auto-inherit.plan
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plan name="auto.inherit" 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
+ http://www.eclipse.org/virgo/schema/plan/eclipse-virgo-plan.xsd">
+
+ <artifact type="plan" name="inherit" version="1"/>
+
+</plan> \ No newline at end of file
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/auto.plan b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/auto.plan
new file mode 100644
index 00000000..7e9313a3
--- /dev/null
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/auto.plan
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plan name="auto" 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
+ http://www.eclipse.org/virgo/schema/plan/eclipse-virgo-plan.xsd">
+
+ <artifact type="bundle" name="plan.provisioning.p.importer" version="0"/>
+
+</plan> \ No newline at end of file
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/default.plan b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/default.plan
new file mode 100644
index 00000000..a09e5b2f
--- /dev/null
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/default.plan
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plan name="default" 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="plan.provisioning.p.importer" version="0"/>
+
+</plan> \ No newline at end of file
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/disabled-default.plan b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/disabled-default.plan
new file mode 100644
index 00000000..328f755b
--- /dev/null
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/disabled-default.plan
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plan name="disabled.default" 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="plan" name="inherit" version="1"/>
+
+</plan> \ No newline at end of file
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/disabled-inherit.plan b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/disabled-inherit.plan
new file mode 100644
index 00000000..80e4c262
--- /dev/null
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/disabled-inherit.plan
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plan name="disabled.inherit" 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="plan" name="inherit" version="1"/>
+
+</plan> \ No newline at end of file
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/disabled.plan b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/disabled.plan
new file mode 100644
index 00000000..ec361aa9
--- /dev/null
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/disabled.plan
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plan name="disabled" 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="plan.provisioning.p.importer" version="0"/>
+
+</plan> \ No newline at end of file
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/inherit.plan b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/inherit.plan
new file mode 100644
index 00000000..57a678ac
--- /dev/null
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/inherit.plan
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plan name="inherit" 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="plan.provisioning.p.importer" version="0"/>
+
+</plan> \ No newline at end of file
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/parent-with-exporter-disabled.plan b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/parent-with-exporter-disabled.plan
new file mode 100644
index 00000000..b9a1cc6a
--- /dev/null
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/parent-with-exporter-disabled.plan
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plan name="parent.with.exporter.disabled" 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="plan" name="inherit" version="1"/>
+ <artifact type="bundle" name="plan.provisioning.p.exporter" version="0"/>
+
+
+</plan> \ No newline at end of file
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/pexporter.jar b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/pexporter.jar
new file mode 100644
index 00000000..05a23e67
--- /dev/null
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/pexporter.jar
Binary files differ
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/pimporter.jar b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/pimporter.jar
new file mode 100644
index 00000000..d641c91e
--- /dev/null
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-provisioning/pimporter.jar
Binary files differ

Back to the top