Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2010-04-01 14:22:54 -0400
committerSusan Franklin2010-04-01 14:22:54 -0400
commit3c345275066f9d2b3dceccea16c4d1fa300d3030 (patch)
tree33061fce145f6092a083541233fb38d61cc4c48a /bundles
parent76a4844d9c51ad5087681ba76e9b15d70f74a95e (diff)
downloadrt.equinox.p2-3c345275066f9d2b3dceccea16c4d1fa300d3030.tar.gz
rt.equinox.p2-3c345275066f9d2b3dceccea16c4d1fa300d3030.tar.xz
rt.equinox.p2-3c345275066f9d2b3dceccea16c4d1fa300d3030.zip
Bug 305534 - Potential unused code in ProvisioningSession
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/operations/AllTests.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/operations/InstallerPlanTest.java41
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/installPlan/artifacts.xml159
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/installPlan/content.xml73
4 files changed, 274 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/operations/AllTests.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/operations/AllTests.java
index 49a26d748..331cf99a5 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/operations/AllTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/operations/AllTests.java
@@ -20,6 +20,7 @@ public class AllTests extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite(AllTests.class.getName());
suite.addTestSuite(SizingTest.class);
+ suite.addTestSuite(InstallerPlanTest.class);
return suite;
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/operations/InstallerPlanTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/operations/InstallerPlanTest.java
new file mode 100644
index 000000000..6f2b9f159
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/operations/InstallerPlanTest.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.tests.ui.operations;
+
+import java.net.URI;
+import java.util.Set;
+import org.eclipse.equinox.p2.core.ProvisionException;
+import org.eclipse.equinox.p2.engine.ProvisioningContext;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.operations.InstallOperation;
+import org.eclipse.equinox.p2.query.QueryUtil;
+import org.eclipse.equinox.p2.tests.ui.AbstractProvisioningUITest;
+
+/**
+ * Tests for the ability to install an IU that has an installer plan by
+ * using the operation API.
+ */
+public class InstallerPlanTest extends AbstractProvisioningUITest {
+ public void testInstallerPlan() throws ProvisionException {
+ URI uri = getTestData("InstallHandler", "testData/installPlan").toURI();
+ Set<IInstallableUnit> ius = getMetadataRepositoryManager().loadRepository(uri, getMonitor()).query(QueryUtil.createIUQuery("A"), getMonitor()).toSet();
+ assertTrue("One IU", ius.size() == 1);
+ InstallOperation op = new InstallOperation(getSession(), ius);
+ op.setProfileId(TESTPROFILE);
+ ProvisioningContext pc = new ProvisioningContext(getAgent());
+ pc.setArtifactRepositories(new URI[] {uri});
+ pc.setMetadataRepositories(new URI[] {uri});
+ op.setProvisioningContext(pc);
+ assertTrue("Should resolve", op.resolveModal(getMonitor()).isOK());
+ assertTrue("Should install", op.getProvisioningJob(null).runModal(getMonitor()).isOK());
+ assertFalse("Action1 should have been installed", getProfile(TESTPROFILE).query(QueryUtil.createIUQuery("Action1"), getMonitor()).isEmpty());
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/installPlan/artifacts.xml b/bundles/org.eclipse.equinox.p2.tests/testData/installPlan/artifacts.xml
new file mode 100644
index 000000000..9bbacfbca
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/installPlan/artifacts.xml
@@ -0,0 +1,159 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?artifactRepository class='org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository' version='1.0.0'?>
+<repository name='file:/D:/eclipse34_p2/eclipse/workspace/update/ - artifacts' type='org.eclipse.equinox.p2.artifact.repository.simpleRepository' version='1.0.0'>
+ <properties size='2'>
+ <property name='p2.compressed' value='false'/>
+ <property name='p2.timestamp' value='1210866441640'/>
+ </properties>
+ <mappings size='3'>
+ <rule filter='(&amp; (classifier=osgi.bundle))' output='${repoUrl}/plugins/${id}_${version}.jar'/>
+ <rule filter='(&amp; (classifier=binary))' output='${repoUrl}/binary/${id}_${version}'/>
+ <rule filter='(&amp; (classifier=org.eclipse.update.feature))' output='${repoUrl}/features/${id}_${version}.jar'/>
+ </mappings>
+ <artifacts size='24'>
+ <artifact classifier='osgi.bundle' id='org.eclipse.rse.processes.ui' version='3.0.0.v20080416'>
+ <properties size='2'>
+ <property name='artifact.size' value='64583'/>
+ <property name='download.size' value='64583'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='com.ibm.test1' version='1.0.1'>
+ <properties size='2'>
+ <property name='artifact.size' value='3611'/>
+ <property name='download.size' value='3611'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='com.ibm.test2' version='1.0.2'>
+ <properties size='2'>
+ <property name='artifact.size' value='3611'/>
+ <property name='download.size' value='3611'/>
+ </properties>
+ </artifact>
+ <artifact classifier='org.eclipse.update.feature' id='com.ibm.test.parent' version='1.0.2'>
+ <properties size='2'>
+ <property name='artifact.size' value='770'/>
+ <property name='download.size' value='770'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='org.eclipse.rse.services' version='3.0.0.v20080507'>
+ <properties size='2'>
+ <property name='artifact.size' value='243770'/>
+ <property name='download.size' value='243770'/>
+ </properties>
+ </artifact>
+ <artifact classifier='org.eclipse.update.feature' id='com.ibm.test.parent' version='1.0.1'>
+ <properties size='2'>
+ <property name='artifact.size' value='770'/>
+ <property name='download.size' value='770'/>
+ </properties>
+ </artifact>
+ <artifact classifier='org.eclipse.update.feature' id='com.ibm.test.parent' version='1.0.0'>
+ <properties size='2'>
+ <property name='artifact.size' value='703'/>
+ <property name='download.size' value='703'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='org.eclipse.rse.importexport' version='1.0.100.v20080505'>
+ <properties size='2'>
+ <property name='artifact.size' value='142363'/>
+ <property name='download.size' value='142363'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='com.ibm.test1' version='1.0.0'>
+ <properties size='2'>
+ <property name='artifact.size' value='3610'/>
+ <property name='download.size' value='3610'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='org.eclipse.rse.shells.ui' version='3.0.0.v20080506'>
+ <properties size='2'>
+ <property name='artifact.size' value='127342'/>
+ <property name='download.size' value='127342'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='com.ibm.test2' version='1.0.0'>
+ <properties size='2'>
+ <property name='artifact.size' value='3610'/>
+ <property name='download.size' value='3610'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='org.eclipse.rse.efs' version='3.0.0.v20080402'>
+ <properties size='2'>
+ <property name='artifact.size' value='16555'/>
+ <property name='download.size' value='16555'/>
+ </properties>
+ </artifact>
+ <artifact classifier='org.eclipse.update.feature' id='org.eclipse.rse.core.source' version='3.0.0.v20080507-7b-_7EB7sQS9ROVU'>
+ <properties size='2'>
+ <property name='artifact.size' value='10723'/>
+ <property name='download.size' value='10723'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='org.eclipse.rse.subsystems.shells.core' version='3.0.0.v20080411'>
+ <properties size='2'>
+ <property name='artifact.size' value='58302'/>
+ <property name='download.size' value='58302'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='org.eclipse.rse.core.source' version='3.0.0.v20080507-7b-_7EB7sQS9ROVU'>
+ <properties size='2'>
+ <property name='artifact.size' value='2776657'/>
+ <property name='download.size' value='2776657'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='org.eclipse.rse.subsystems.processes.core' version='3.0.0.v20080411'>
+ <properties size='2'>
+ <property name='artifact.size' value='21561'/>
+ <property name='download.size' value='21561'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='org.eclipse.rse.files.ui' version='3.0.0.v20080506'>
+ <properties size='2'>
+ <property name='artifact.size' value='451310'/>
+ <property name='download.size' value='451310'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='org.eclipse.rse.core' version='3.0.0.v20080505'>
+ <properties size='2'>
+ <property name='artifact.size' value='377004'/>
+ <property name='download.size' value='377004'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='org.eclipse.rse.subsystems.processes.shell.linux' version='1.0.100.v20080409'>
+ <properties size='2'>
+ <property name='artifact.size' value='23483'/>
+ <property name='download.size' value='23483'/>
+ </properties>
+ </artifact>
+ <artifact classifier='org.eclipse.update.feature' id='org.eclipse.rse.core' version='3.0.0.v20080507-7b-_7EB7sQS9ROVU'>
+ <properties size='2'>
+ <property name='artifact.size' value='11035'/>
+ <property name='download.size' value='11035'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='org.eclipse.rse.ui' version='3.0.0.v20080505'>
+ <properties size='2'>
+ <property name='artifact.size' value='1554912'/>
+ <property name='download.size' value='1554912'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='org.eclipse.rse.doc.user' version='3.0.0.v20080315'>
+ <properties size='2'>
+ <property name='artifact.size' value='197119'/>
+ <property name='download.size' value='197119'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='org.eclipse.rse.efs.ui' version='3.0.0.v20080505'>
+ <properties size='2'>
+ <property name='artifact.size' value='13103'/>
+ <property name='download.size' value='13103'/>
+ </properties>
+ </artifact>
+ <artifact classifier='osgi.bundle' id='org.eclipse.rse.subsystems.files.core' version='3.0.0.v20080506'>
+ <properties size='2'>
+ <property name='artifact.size' value='116566'/>
+ <property name='download.size' value='116566'/>
+ </properties>
+ </artifact>
+ </artifacts>
+</repository>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/installPlan/content.xml b/bundles/org.eclipse.equinox.p2.tests/testData/installPlan/content.xml
new file mode 100644
index 000000000..01c66f910
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/installPlan/content.xml
@@ -0,0 +1,73 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?metadataRepository version='1.1.0'?>
+
+<repository name='Installer Plan' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1'>
+
+<properties size='1'>
+
+<property name='p2.timestamp' value='1239212031654'/>
+
+</properties>
+
+<units size='4'>
+
+<unit id='TestCategory' version='0.0.0'>
+<properties size='3'>
+ <property name='org.eclipse.equinox.p2.name' value='Test Category' />
+ <property name='org.eclipse.equinox.p2.description' value='This is a test category.' />
+ <property name='org.eclipse.equinox.p2.type.category' value='true' />
+ </properties>
+<requires size='1'>
+<required namespace="org.eclipse.equinox.p2.iu" name='A' range='[0.0.0,1.1.0]' />
+</requires>
+</unit>
+<unit id='Action1' version='1.0.0'>
+
+<provides size='2'>
+
+<provided namespace='org.eclipse.equinox.p2.iu' name='Action1' version='1.0.0'/>
+
+<provided namespace='p2.action' name='action1' version='1.0.0'/>
+</provides>
+ <touchpoint id='null' version='0.0.0'/>
+<touchpointData size='1'/>
+</unit>
+
+<unit id='A' version='1.0.0'>
+
+<properties>
+<property name='org.eclipse.equinox.p2.type.group' value='true'/>
+
+</properties>
+<metaRequirements size='1'>
+<required namespace='p2.action' name='action1' range='[0.0.0,1.0.0]'/>
+
+</metaRequirements>
+
+<provides size='1'>
+<provided namespace='org.eclipse.equinox.p2.iu' name='A' version='1.0.0'/>
+</provides>
+
+<touchpoint id='null' version='0.0.0'/>
+
+<touchpointData size='1'/>
+
+</unit>
+
+<unit id='B' version='1.0.0' singleton='false'>
+
+<properties>
+<property name='org.eclipse.equinox.p2.type.group' value='true'/>
+</properties>
+
+<provides size='2'>
+<provided namespace='org.eclipse.equinox.p2.iu' name='B' version='1.0.0'/>
+<provided namespace='eclipse.touchpoint' name='bundle' version='1.0.0'/>
+</provides>
+ <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
+<touchpointData size='1'/>
+
+</unit>
+</units>
+
+</repository>

Back to the top