Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDJ Houghton2011-11-29 15:30:18 -0500
committerDJ Houghton2011-11-29 15:35:40 -0500
commite50188320c5e998c80ee4a4c6a3e60d426336e68 (patch)
treeedcb669d66d66879828409112c758555cc20f1b5
parent6af7b1119469961d1d702921249cdaea63fc535e (diff)
downloadrt.equinox.p2-e50188320c5e998c80ee4a4c6a3e60d426336e68.tar.gz
rt.equinox.p2-e50188320c5e998c80ee4a4c6a3e60d426336e68.tar.xz
rt.equinox.p2-e50188320c5e998c80ee4a4c6a3e60d426336e68.zip
Bug 365124 - Filters on requirements not taken into account when
installing features
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug365124.java46
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SlicerBug365124Test.java58
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/bug365124/p2/org.eclipse.equinox.p2.engine/profileRegistry/PlatformProfile.profile/1322516577071.profile.gzbin0 -> 63113 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/bug365124/repo/content.xml153
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/slicerBug365124Test/content.xml153
5 files changed, 410 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug365124.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug365124.java
new file mode 100644
index 000000000..122ddc118
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug365124.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.planner;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.equinox.internal.p2.engine.*;
+import org.eclipse.equinox.p2.engine.IProvisioningPlan;
+import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
+import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
+public class Bug365124 extends AbstractPlannerTest {
+
+ // path to our data
+ protected String getTestDataPath() {
+ return "testData/bug365124";
+ }
+
+ // profile id
+ protected String getProfileId() {
+ return "PlatformProfile";
+ }
+
+ public void testInstall() {
+ IPlanner planner = createPlanner();
+
+ IQueryResult allIUs = repo.query(QueryUtil.createIUQuery("f1.feature.group"), new NullProgressMonitor());
+ IProfileChangeRequest actualChangeRequest = createProfileChangeRequest(null, allIUs.toSet(), null);
+ IProvisioningPlan plan = planner.getProvisioningPlan(actualChangeRequest, null, new NullProgressMonitor());
+ Operand[] operands = ((ProvisioningPlan) plan).getOperands();
+ for (Operand operand : operands) {
+ if (operand instanceof InstallableUnitOperand)
+ fail("1.0: " + operand);
+ }
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SlicerBug365124Test.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SlicerBug365124Test.java
new file mode 100644
index 000000000..09c304987
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SlicerBug365124Test.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.planner;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.equinox.internal.p2.director.Slicer;
+import org.eclipse.equinox.p2.engine.IProfileRegistry;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
+import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
+
+public class SlicerBug365124Test extends AbstractProvisioningTest {
+ private IMetadataRepository repo;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ File repoFile = getTestData("Repo for slicer test", "testData/slicerBug365124Test");
+ repo = getMetadataRepositoryManager().loadRepository(repoFile.toURI(), new NullProgressMonitor());
+ }
+
+ private Map<String, String> getProperties() {
+ Map<String, String> result = new HashMap<String, String>();
+ result.put("org.eclipse.equinox.p2.installFolder", "/Users/equinox/Downloads/eclipse");
+ result.put("osgi.nl", "en_US");
+ result.put("osgi.ws", "cocoa");
+ result.put("org.eclipse.equinox.p2.cache", "/Users/equinox/Downloads/eclipse");
+ result.put("org.eclipse.equinox.p2.cache.extensions", "file:/Users/equinox/Downloads/eclipse/.eclipseextension|file:/Users/equinox/Downloads/eclipse/configuration/org.eclipse.osgi/bundles/84/data/listener_1925729951/");
+ result.put("osgi.os", "macosx");
+ result.put("osgi.arch", "x86_64");
+ result.put("org.eclipse.update.install.features", "true");
+ result.put("eclipse.touchpoint.launcherName", "eclipse");
+ result.put("org.eclipse.equinox.p2.roaming", "true");
+ result.put("org.eclipse.equinox.p2.environments", "osgi.nl=en_US,osgi.ws=cocoa,osgi.arch=x86_64,osgi.os=macosx");
+ return result;
+ }
+
+ public void testSlice() {
+ Slicer slicer = new Slicer(getProfile(IProfileRegistry.SELF), getProperties(), true);
+ IQueryResult c = repo.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor());
+ slicer.slice((IInstallableUnit[]) c.toArray(IInstallableUnit.class), new NullProgressMonitor());
+ assertNotOK("1.0", slicer.getStatus());
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/bug365124/p2/org.eclipse.equinox.p2.engine/profileRegistry/PlatformProfile.profile/1322516577071.profile.gz b/bundles/org.eclipse.equinox.p2.tests/testData/bug365124/p2/org.eclipse.equinox.p2.engine/profileRegistry/PlatformProfile.profile/1322516577071.profile.gz
new file mode 100644
index 000000000..b750ef6fd
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/bug365124/p2/org.eclipse.equinox.p2.engine/profileRegistry/PlatformProfile.profile/1322516577071.profile.gz
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/bug365124/repo/content.xml b/bundles/org.eclipse.equinox.p2.tests/testData/bug365124/repo/content.xml
new file mode 100644
index 000000000..bc59b41e9
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/bug365124/repo/content.xml
@@ -0,0 +1,153 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?metadataRepository version='1.1.0'?>
+<repository name='Exported Repository' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1.0.0'>
+ <properties size='2'>
+ <property name='p2.timestamp' value='1322516471452'/>
+ <property name='p2.compressed' value='true'/>
+ </properties>
+ <units size='5'>
+ <unit id='f2.feature.jar' version='1.0.0'>
+ <properties size='3'>
+ <property name='org.eclipse.equinox.p2.name' value='f2'/>
+ <property name='org.eclipse.equinox.p2.description' value='[Enter Feature Description here.]'/>
+ <property name='org.eclipse.equinox.p2.description.url' value='http://www.example.com/description'/>
+ </properties>
+ <provides size='3'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='f2.feature.jar' version='1.0.0'/>
+ <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='feature' version='1.0.0'/>
+ <provided namespace='org.eclipse.update.feature' name='f2' version='1.0.0'/>
+ </provides>
+ <filter>
+ (org.eclipse.update.install.features=true)
+ </filter>
+ <artifacts size='1'>
+ <artifact classifier='org.eclipse.update.feature' id='f2' version='1.0.0'/>
+ </artifacts>
+ <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='1'>
+ <instruction key='zipped'>
+ true
+ </instruction>
+ </instructions>
+ </touchpointData>
+ <licenses size='1'>
+ <license uri='http://www.example.com/license' url='http://www.example.com/license'>
+ [Enter License Description here.]
+ </license>
+ </licenses>
+ <copyright uri='http://www.example.com/copyright' url='http://www.example.com/copyright'>
+ [Enter Copyright Description here.]
+ </copyright>
+ </unit>
+ <unit id='f1.feature.jar' version='1.0.0'>
+ <properties size='3'>
+ <property name='org.eclipse.equinox.p2.name' value='f1'/>
+ <property name='org.eclipse.equinox.p2.description' value='[Enter Feature Description here.]'/>
+ <property name='org.eclipse.equinox.p2.description.url' value='http://www.example.com/description'/>
+ </properties>
+ <provides size='3'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='f1.feature.jar' version='1.0.0'/>
+ <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='feature' version='1.0.0'/>
+ <provided namespace='org.eclipse.update.feature' name='f1' version='1.0.0'/>
+ </provides>
+ <filter>
+ (org.eclipse.update.install.features=true)
+ </filter>
+ <artifacts size='1'>
+ <artifact classifier='org.eclipse.update.feature' id='f1' version='1.0.0'/>
+ </artifacts>
+ <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='1'>
+ <instruction key='zipped'>
+ true
+ </instruction>
+ </instructions>
+ </touchpointData>
+ <licenses size='1'>
+ <license uri='http://www.example.com/license' url='http://www.example.com/license'>
+ [Enter License Description here.]
+ </license>
+ </licenses>
+ <copyright uri='http://www.example.com/copyright' url='http://www.example.com/copyright'>
+ [Enter Copyright Description here.]
+ </copyright>
+ </unit>
+ <unit id='f2.feature.group' version='1.0.0' singleton='false'>
+ <update id='f2.feature.group' range='[0.0.0,1.0.0)' severity='0'/>
+ <properties size='4'>
+ <property name='org.eclipse.equinox.p2.name' value='f2'/>
+ <property name='org.eclipse.equinox.p2.description' value='[Enter Feature Description here.]'/>
+ <property name='org.eclipse.equinox.p2.description.url' value='http://www.example.com/description'/>
+ <property name='org.eclipse.equinox.p2.type.group' value='true'/>
+ </properties>
+ <provides size='1'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='f2.feature.group' version='1.0.0'/>
+ </provides>
+ <requires size='2'>
+ <required namespace='org.eclipse.equinox.p2.iu' name='f2.feature.jar' range='[1.0.0,1.0.0]'>
+ <filter>
+ (org.eclipse.update.install.features=true)
+ </filter>
+ </required>
+ <required namespace='org.eclipse.equinox.p2.iu' name='f2.filter' range='0.0.0'>
+ <filter>
+ (osgi.os=win32)
+ </filter>
+ </required>
+ </requires>
+ <touchpoint id='null' version='0.0.0'/>
+ <licenses size='1'>
+ <license uri='http://www.example.com/license' url='http://www.example.com/license'>
+ [Enter License Description here.]
+ </license>
+ </licenses>
+ <copyright uri='http://www.example.com/copyright' url='http://www.example.com/copyright'>
+ [Enter Copyright Description here.]
+ </copyright>
+ </unit>
+ <unit id='f2.filter' version='1.0.0' singleton='false'>
+ <provides size='1'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='f2.filter' version='1.0.0'/>
+ </provides>
+ <filter>
+ (osgi.os=win32)
+ </filter>
+ <touchpoint id='null' version='0.0.0'/>
+ </unit>
+ <unit id='f1.feature.group' version='1.0.0' singleton='false'>
+ <update id='f1.feature.group' range='[0.0.0,1.0.0)' severity='0'/>
+ <properties size='4'>
+ <property name='org.eclipse.equinox.p2.name' value='f1'/>
+ <property name='org.eclipse.equinox.p2.description' value='[Enter Feature Description here.]'/>
+ <property name='org.eclipse.equinox.p2.description.url' value='http://www.example.com/description'/>
+ <property name='org.eclipse.equinox.p2.type.group' value='true'/>
+ </properties>
+ <provides size='1'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='f1.feature.group' version='1.0.0'/>
+ </provides>
+ <requires size='2'>
+ <required namespace='org.eclipse.equinox.p2.iu' name='f1.feature.jar' range='[1.0.0,1.0.0]'>
+ <filter>
+ (org.eclipse.update.install.features=true)
+ </filter>
+ </required>
+ <required namespace='org.eclipse.equinox.p2.iu' name='f2.feature.group' range='0.0.0'>
+ <filter>
+ (osgi.os=win32)
+ </filter>
+ </required>
+ </requires>
+ <touchpoint id='null' version='0.0.0'/>
+ <licenses size='1'>
+ <license uri='http://www.example.com/license' url='http://www.example.com/license'>
+ [Enter License Description here.]
+ </license>
+ </licenses>
+ <copyright uri='http://www.example.com/copyright' url='http://www.example.com/copyright'>
+ [Enter Copyright Description here.]
+ </copyright>
+ </unit>
+ </units>
+</repository>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/slicerBug365124Test/content.xml b/bundles/org.eclipse.equinox.p2.tests/testData/slicerBug365124Test/content.xml
new file mode 100644
index 000000000..bc59b41e9
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/slicerBug365124Test/content.xml
@@ -0,0 +1,153 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?metadataRepository version='1.1.0'?>
+<repository name='Exported Repository' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1.0.0'>
+ <properties size='2'>
+ <property name='p2.timestamp' value='1322516471452'/>
+ <property name='p2.compressed' value='true'/>
+ </properties>
+ <units size='5'>
+ <unit id='f2.feature.jar' version='1.0.0'>
+ <properties size='3'>
+ <property name='org.eclipse.equinox.p2.name' value='f2'/>
+ <property name='org.eclipse.equinox.p2.description' value='[Enter Feature Description here.]'/>
+ <property name='org.eclipse.equinox.p2.description.url' value='http://www.example.com/description'/>
+ </properties>
+ <provides size='3'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='f2.feature.jar' version='1.0.0'/>
+ <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='feature' version='1.0.0'/>
+ <provided namespace='org.eclipse.update.feature' name='f2' version='1.0.0'/>
+ </provides>
+ <filter>
+ (org.eclipse.update.install.features=true)
+ </filter>
+ <artifacts size='1'>
+ <artifact classifier='org.eclipse.update.feature' id='f2' version='1.0.0'/>
+ </artifacts>
+ <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='1'>
+ <instruction key='zipped'>
+ true
+ </instruction>
+ </instructions>
+ </touchpointData>
+ <licenses size='1'>
+ <license uri='http://www.example.com/license' url='http://www.example.com/license'>
+ [Enter License Description here.]
+ </license>
+ </licenses>
+ <copyright uri='http://www.example.com/copyright' url='http://www.example.com/copyright'>
+ [Enter Copyright Description here.]
+ </copyright>
+ </unit>
+ <unit id='f1.feature.jar' version='1.0.0'>
+ <properties size='3'>
+ <property name='org.eclipse.equinox.p2.name' value='f1'/>
+ <property name='org.eclipse.equinox.p2.description' value='[Enter Feature Description here.]'/>
+ <property name='org.eclipse.equinox.p2.description.url' value='http://www.example.com/description'/>
+ </properties>
+ <provides size='3'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='f1.feature.jar' version='1.0.0'/>
+ <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='feature' version='1.0.0'/>
+ <provided namespace='org.eclipse.update.feature' name='f1' version='1.0.0'/>
+ </provides>
+ <filter>
+ (org.eclipse.update.install.features=true)
+ </filter>
+ <artifacts size='1'>
+ <artifact classifier='org.eclipse.update.feature' id='f1' version='1.0.0'/>
+ </artifacts>
+ <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='1'>
+ <instruction key='zipped'>
+ true
+ </instruction>
+ </instructions>
+ </touchpointData>
+ <licenses size='1'>
+ <license uri='http://www.example.com/license' url='http://www.example.com/license'>
+ [Enter License Description here.]
+ </license>
+ </licenses>
+ <copyright uri='http://www.example.com/copyright' url='http://www.example.com/copyright'>
+ [Enter Copyright Description here.]
+ </copyright>
+ </unit>
+ <unit id='f2.feature.group' version='1.0.0' singleton='false'>
+ <update id='f2.feature.group' range='[0.0.0,1.0.0)' severity='0'/>
+ <properties size='4'>
+ <property name='org.eclipse.equinox.p2.name' value='f2'/>
+ <property name='org.eclipse.equinox.p2.description' value='[Enter Feature Description here.]'/>
+ <property name='org.eclipse.equinox.p2.description.url' value='http://www.example.com/description'/>
+ <property name='org.eclipse.equinox.p2.type.group' value='true'/>
+ </properties>
+ <provides size='1'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='f2.feature.group' version='1.0.0'/>
+ </provides>
+ <requires size='2'>
+ <required namespace='org.eclipse.equinox.p2.iu' name='f2.feature.jar' range='[1.0.0,1.0.0]'>
+ <filter>
+ (org.eclipse.update.install.features=true)
+ </filter>
+ </required>
+ <required namespace='org.eclipse.equinox.p2.iu' name='f2.filter' range='0.0.0'>
+ <filter>
+ (osgi.os=win32)
+ </filter>
+ </required>
+ </requires>
+ <touchpoint id='null' version='0.0.0'/>
+ <licenses size='1'>
+ <license uri='http://www.example.com/license' url='http://www.example.com/license'>
+ [Enter License Description here.]
+ </license>
+ </licenses>
+ <copyright uri='http://www.example.com/copyright' url='http://www.example.com/copyright'>
+ [Enter Copyright Description here.]
+ </copyright>
+ </unit>
+ <unit id='f2.filter' version='1.0.0' singleton='false'>
+ <provides size='1'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='f2.filter' version='1.0.0'/>
+ </provides>
+ <filter>
+ (osgi.os=win32)
+ </filter>
+ <touchpoint id='null' version='0.0.0'/>
+ </unit>
+ <unit id='f1.feature.group' version='1.0.0' singleton='false'>
+ <update id='f1.feature.group' range='[0.0.0,1.0.0)' severity='0'/>
+ <properties size='4'>
+ <property name='org.eclipse.equinox.p2.name' value='f1'/>
+ <property name='org.eclipse.equinox.p2.description' value='[Enter Feature Description here.]'/>
+ <property name='org.eclipse.equinox.p2.description.url' value='http://www.example.com/description'/>
+ <property name='org.eclipse.equinox.p2.type.group' value='true'/>
+ </properties>
+ <provides size='1'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='f1.feature.group' version='1.0.0'/>
+ </provides>
+ <requires size='2'>
+ <required namespace='org.eclipse.equinox.p2.iu' name='f1.feature.jar' range='[1.0.0,1.0.0]'>
+ <filter>
+ (org.eclipse.update.install.features=true)
+ </filter>
+ </required>
+ <required namespace='org.eclipse.equinox.p2.iu' name='f2.feature.group' range='0.0.0'>
+ <filter>
+ (osgi.os=win32)
+ </filter>
+ </required>
+ </requires>
+ <touchpoint id='null' version='0.0.0'/>
+ <licenses size='1'>
+ <license uri='http://www.example.com/license' url='http://www.example.com/license'>
+ [Enter License Description here.]
+ </license>
+ </licenses>
+ <copyright uri='http://www.example.com/copyright' url='http://www.example.com/copyright'>
+ [Enter Copyright Description here.]
+ </copyright>
+ </unit>
+ </units>
+</repository>

Back to the top