Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprapicau2011-12-31 17:36:00 -0500
committerprapicau2011-12-31 17:36:00 -0500
commitaa9baa95e1cdf13c61404b82fdb1a33fce71c82f (patch)
treee4f3bfbc6577383c9546cd004408e88a47167b8c
parent84f87c957c51ee071101132ee112cf3f4a9bc84f (diff)
downloadrt.equinox.p2-aa9baa95e1cdf13c61404b82fdb1a33fce71c82f.tar.gz
rt.equinox.p2-aa9baa95e1cdf13c61404b82fdb1a33fce71c82f.tar.xz
rt.equinox.p2-aa9baa95e1cdf13c61404b82fdb1a33fce71c82f.zip
Reorganize the helper
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyHelper.java70
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest10.java71
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest2.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest3.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest4.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest5.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest6.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest7.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest8.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest9.java4
11 files changed, 144 insertions, 45 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyHelper.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyHelper.java
index fd5304713..6af11e879 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyHelper.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyHelper.java
@@ -20,18 +20,42 @@ import org.eclipse.equinox.p2.planner.*;
import org.eclipse.equinox.p2.query.*;
public class LuckyHelper {
- private final String INCLUSION_RULES = "org.eclipse.equinox.p2.internal.inclusion.rules"; //$NON-NLS-1$
+ private static final String INCLUSION_RULES = "org.eclipse.equinox.p2.internal.inclusion.rules"; //$NON-NLS-1$
+ private static final String INCLUSION_OPTIONAL = "OPTIONAL"; //$NON-NLS-1$
+ private static final String INCLUSION_STRICT = "STRICT"; //$NON-NLS-1$
- ProfileChangeRequest computeProfileChangeRequest(IProfile profile, IPlanner planner, IProfileChangeRequest originalRequest, ProvisioningContext context, IProgressMonitor monitor) {
+ private IProfile profile;
+ private IPlanner planner;
+ private IProfileChangeRequest originalRequest;
+ private ProvisioningContext provisioningContext;
+
+ private Set<IInstallableUnit> strictRoots;
+ private Set<IInstallableUnit> optionalRoots;
+
+ private IProfileChangeRequest updateFinderRequest;
+
+ IProfileChangeRequest computeProfileChangeRequest(IProfile profile, IPlanner plannor, IProfileChangeRequest request, ProvisioningContext context, IProgressMonitor monitor) {
// IProfileRegistry profileRegistry = (IProfileRegistry) session.getProvisioningAgent().getService(IProfileRegistry.SERVICE_NAME);
- IPlanner plan = planner; //(IPlanner) session.getProvisioningAgent().getService(IPlanner.SERVICE_NAME);
- IProfile prof = profile; //profileRegistry.getProfile(getProfileId());
+ this.planner = plannor; //(IPlanner) session.getProvisioningAgent().getService(IPlanner.SERVICE_NAME);
+ this.profile = profile; //profileRegistry.getProfile(getProfileId());
+ this.provisioningContext = context;
+ originalRequest = request;
+
+ gatherRoots();
+ CollectionResult<IInstallableUnit> allInitialRoots = buildUpdateFinderRequest();
- final String INCLUSION_OPTIONAL = "OPTIONAL"; //$NON-NLS-1$
- final String INCLUSION_STRICT = "STRICT"; //$NON-NLS-1$
+ IProvisioningPlan updateFinderPlan = planner.getProvisioningPlan(updateFinderRequest, provisioningContext, null);
+ if (updateFinderPlan.getAdditions().query(QueryUtil.ALL_UNITS, null).isEmpty()) {
+ return null;
+ }
- Set<IInstallableUnit> strictRoots = prof.query(new IUProfilePropertyQuery(INCLUSION_RULES, INCLUSION_STRICT), null).toSet();
- Set<IInstallableUnit> optionalRoots = prof.query(new IUProfilePropertyQuery(INCLUSION_RULES, INCLUSION_OPTIONAL), null).toSet();
+ return buildFinalRequest(allInitialRoots, updateFinderPlan);
+ }
+
+ //Gather the initial roots and merge them with those from the original request
+ private void gatherRoots() {
+ strictRoots = profile.query(new IUProfilePropertyQuery(INCLUSION_RULES, INCLUSION_STRICT), null).toSet();
+ optionalRoots = profile.query(new IUProfilePropertyQuery(INCLUSION_RULES, INCLUSION_OPTIONAL), null).toSet();
//Take into account the changes from the request (potential addition or removals)
if (originalRequest != null) {
@@ -48,22 +72,26 @@ public class LuckyHelper {
}
}
}
+ }
+ //Produce a profile change request which is used to find the best update
+ private CollectionResult<IInstallableUnit> buildUpdateFinderRequest() {
Set<IInstallableUnit> tmpRoots = new HashSet<IInstallableUnit>(strictRoots);
tmpRoots.addAll(optionalRoots);
CollectionResult<IInstallableUnit> allInitialRoots = new CollectionResult<IInstallableUnit>(tmpRoots);
- ProfileChangeRequest updateFinderRequest = (ProfileChangeRequest) plan.createChangeRequest(prof);
+ updateFinderRequest = planner.createChangeRequest(profile);
Collection<IRequirement> limitingRequirements = new ArrayList<IRequirement>();
- limitingRequirements.addAll(originalRequest.getExtraRequirements());
+ if (originalRequest != null && originalRequest.getExtraRequirements() != null)
+ limitingRequirements.addAll(originalRequest.getExtraRequirements());
//Create a profile change request that attempts at installing updates for all the existing roots.
for (Iterator<IInstallableUnit> iterator = allInitialRoots.query(QueryUtil.ALL_UNITS, null).iterator(); iterator.hasNext();) {
IInstallableUnit currentlyInstalled = iterator.next();
//find all the potential updates for the currentlyInstalled iu
- IQueryResult<IInstallableUnit> updatesAvailable = plan.updatesFor(currentlyInstalled, context, null);
+ IQueryResult<IInstallableUnit> updatesAvailable = planner.updatesFor(currentlyInstalled, provisioningContext, null);
for (Iterator<IInstallableUnit> iterator2 = updatesAvailable.iterator(); iterator2.hasNext();) {
IInstallableUnit update = iterator2.next();
updateFinderRequest.add(update);
@@ -75,15 +103,15 @@ public class LuckyHelper {
limitingRequirements.add(MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, currentlyInstalled.getId(), new VersionRange(currentlyInstalled.getVersion(), true, Version.MAX_VERSION, true), null, false, false));
}
updateFinderRequest.addExtraRequirements(limitingRequirements);
+ return allInitialRoots;
+ }
- IProvisioningPlan updateFinderPlan = plan.getProvisioningPlan(updateFinderRequest, context, null);
- if (updateFinderPlan.getAdditions().query(QueryUtil.ALL_UNITS, null).isEmpty()) {
- return null;
- }
-
+ //Analyze the plan produced by the execution of the updateFinderRequest, and produce a plan representing the recommended changes
+ private IProfileChangeRequest buildFinalRequest(CollectionResult<IInstallableUnit> allInitialRoots, IProvisioningPlan updateFinderPlan) {
//Take into account all the removals
- IProfileChangeRequest finalChangeRequest = plan.createChangeRequest(prof);
- finalChangeRequest.addExtraRequirements(originalRequest.getExtraRequirements());
+ IProfileChangeRequest finalChangeRequest = planner.createChangeRequest(profile);
+ if (originalRequest != null && originalRequest.getExtraRequirements() != null)
+ finalChangeRequest.addExtraRequirements(originalRequest.getExtraRequirements());
IQueryResult<IInstallableUnit> removals = updateFinderPlan.getRemovals().query(QueryUtil.ALL_UNITS, null);
for (Iterator<IInstallableUnit> iterator = removals.iterator(); iterator.hasNext();) {
IInstallableUnit iu = iterator.next();
@@ -98,7 +126,7 @@ public class LuckyHelper {
IQueryResult<IInstallableUnit> update = updateFinderPlan.getAdditions().query(new UpdateQuery(formerRoot), null);
if (!update.isEmpty())
finalChangeRequest.addAll(update.toUnmodifiableSet());
- else if (originalRequest.getAdditions().contains(formerRoot)) //deal with the case of the elements added by the request
+ else if (originalRequest != null && originalRequest.getAdditions().contains(formerRoot)) //deal with the case of the elements added by the request
finalChangeRequest.add(formerRoot);
}
@@ -112,12 +140,12 @@ public class LuckyHelper {
finalChangeRequest.add(updatedOptionalIU);
finalChangeRequest.setInstallableUnitInclusionRules(updatedOptionalIU, ProfileInclusionRules.createOptionalInclusionRule(updatedOptionalIU));
}
- } else if (originalRequest.getAdditions().contains(formerRoot)) {
+ } else if (originalRequest != null && originalRequest.getAdditions().contains(formerRoot)) {
finalChangeRequest.add(formerRoot);
finalChangeRequest.setInstallableUnitInclusionRules(formerRoot, ProfileInclusionRules.createOptionalInclusionRule(formerRoot));
}
}
- return (ProfileChangeRequest) finalChangeRequest;
+ return finalChangeRequest;
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest.java
index 900907564..01fa438a3 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest.java
@@ -9,10 +9,10 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
import org.eclipse.equinox.p2.tests.*;
public class LuckyTest extends AbstractProvisioningTest {
@@ -28,7 +28,7 @@ public class LuckyTest extends AbstractProvisioningTest {
@IUDescription(content = "package: platform \n" + "singleton: true\n" + "version: 2 \n")
public IInstallableUnit platform2;
- IProfile profile = createProfile("TestProfile." + getName());
+ IProfile profile = createProfile("TestProfile." + getClass().getSimpleName());
private IPlanner planner;
@@ -47,7 +47,7 @@ public class LuckyTest extends AbstractProvisioningTest {
public void testInstallSDK2() {
assertNotOK(install(profile, new IInstallableUnit[] {platform2}, true, planner, engine));
- ProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, null, new ProvisioningContext(getAgent()), getMonitor());
+ IProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, null, new ProvisioningContext(getAgent()), getMonitor());
assertTrue(res.getAdditions().contains(sdk2));
assertTrue(res.getRemovals().contains(sdk1));
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest10.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest10.java
new file mode 100644
index 000000000..6cb63c7b7
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest10.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Sonatype, Inc. 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:
+ * Sonatype, Inc. - initial implementation and ideas
+ ******************************************************************************/
+package org.eclipse.equinox.p2.tests.planner;
+
+import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
+import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
+import org.eclipse.equinox.p2.query.QueryUtil;
+import org.eclipse.equinox.p2.tests.*;
+
+public class LuckyTest10 extends AbstractProvisioningTest {
+ @IUDescription(content = "package: sdk \n" + "singleton: true\n" + "version: 1 \n" + "depends: platform = 1")
+ public IInstallableUnit sdk1;
+
+ @IUDescription(content = "package: platform \n" + "singleton: true\n" + "version: 1 \n")
+ public IInstallableUnit platform1;
+
+ @IUDescription(content = "package: sdk \n" + "singleton: true\n" + "version: 2 \n" + "depends: platform = 2")
+ public IInstallableUnit sdk2;
+
+ @IUDescription(content = "package: platform \n" + "singleton: true\n" + "version: 2 \n")
+ public IInstallableUnit platform2;
+
+ @IUDescription(content = "package: egit \n" + "singleton: true\n" + "version: 1 \n" + "depends: platform = 1")
+ public IInstallableUnit egit1;
+
+ @IUDescription(content = "package: egit \n" + "singleton: true\n" + "version: 2 \n" + "depends: platform = 2")
+ public IInstallableUnit egit2;
+
+ IProfile profile = createProfile("TestProfile." + getName());
+
+ private IPlanner planner;
+
+ private IEngine engine;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ IULoader.loadIUs(this);
+ createTestMetdataRepository(new IInstallableUnit[] {sdk1, platform1, sdk2, platform2, egit1, egit2});
+ planner = createPlanner();
+ engine = createEngine();
+ assertOK(install(profile, new IInstallableUnit[] {sdk1}, true, planner, engine));
+ }
+
+ public void testRemovalIsTakenIntoAccount() {
+ IProfileChangeRequest changeRequest = new ProfileChangeRequest(profile);
+ changeRequest.remove(egit1);
+
+ IProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, changeRequest, new ProvisioningContext(getAgent()), getMonitor());
+ assertEquals(1, res.getAdditions().size());
+ assertTrue(res.getAdditions().contains(sdk2));
+ assertEquals(1, res.getRemovals().size());
+ assertTrue(res.getRemovals().contains(sdk1));
+
+ assertOK(install(res, planner, engine));
+ assertProfileContains("validate new profile", profile, new IInstallableUnit[] {sdk2, platform2});
+ assertTrue(profile.query(QueryUtil.createIUQuery(egit1), null).isEmpty());
+ assertTrue(profile.query(QueryUtil.createIUQuery(egit2), null).isEmpty());
+ assertEquals("STRICT", profile.getInstallableUnitProperty(sdk2, "org.eclipse.equinox.p2.internal.inclusion.rules"));
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest2.java
index d30a4f447..65de55a24 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest2.java
@@ -9,10 +9,10 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
import org.eclipse.equinox.p2.tests.*;
public class LuckyTest2 extends AbstractProvisioningTest {
@@ -31,7 +31,7 @@ public class LuckyTest2 extends AbstractProvisioningTest {
@IUDescription(content = "package: egit \n" + "singleton: true\n" + "version: 1 \n")
public IInstallableUnit egit1;
- IProfile profile = createProfile("TestProfile." + getName());
+ IProfile profile = createProfile("TestProfile." + getClass().getSimpleName());
private IPlanner planner;
@@ -50,7 +50,7 @@ public class LuckyTest2 extends AbstractProvisioningTest {
public void testInstallSDK2() {
assertNotOK(install(profile, new IInstallableUnit[] {platform2}, true, planner, engine));
- ProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, null, new ProvisioningContext(getAgent()), getMonitor());
+ IProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, null, new ProvisioningContext(getAgent()), getMonitor());
assertEquals(1, res.getAdditions().size());
assertTrue(res.getAdditions().contains(sdk2));
assertEquals(1, res.getRemovals().size());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest3.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest3.java
index a6ea060df..11825ab74 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest3.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest3.java
@@ -9,10 +9,10 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
import org.eclipse.equinox.p2.tests.*;
public class LuckyTest3 extends AbstractProvisioningTest {
@@ -31,7 +31,7 @@ public class LuckyTest3 extends AbstractProvisioningTest {
@IUDescription(content = "package: egit \n" + "singleton: true\n" + "version: 1 \n")
public IInstallableUnit egit1;
- IProfile profile = createProfile("TestProfile." + getName());
+ IProfile profile = createProfile("TestProfile." + getClass().getSimpleName());
private IPlanner planner;
@@ -54,7 +54,7 @@ public class LuckyTest3 extends AbstractProvisioningTest {
public void testInstallSDK2() {
assertNotOK(install(profile, new IInstallableUnit[] {platform2}, true, planner, engine));
- ProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, null, new ProvisioningContext(getAgent()), getMonitor());
+ IProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, null, new ProvisioningContext(getAgent()), getMonitor());
assertEquals(1, res.getAdditions().size());
assertTrue(res.getAdditions().contains(sdk2));
assertEquals(1, res.getRemovals().size());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest4.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest4.java
index a4b062a1c..7d4aa4869 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest4.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest4.java
@@ -9,10 +9,10 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
import org.eclipse.equinox.p2.tests.*;
public class LuckyTest4 extends AbstractProvisioningTest {
@@ -60,7 +60,7 @@ public class LuckyTest4 extends AbstractProvisioningTest {
public void testInstallSDK2() {
assertNotOK(install(profile, new IInstallableUnit[] {platform2, egit2}, true, planner, engine));
- ProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, null, new ProvisioningContext(getAgent()), getMonitor());
+ IProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, null, new ProvisioningContext(getAgent()), getMonitor());
assertEquals(2, res.getAdditions().size());
assertTrue(res.getAdditions().contains(sdk2));
assertTrue(res.getAdditions().contains(egit2));
@@ -79,7 +79,7 @@ public class LuckyTest4 extends AbstractProvisioningTest {
public void updateWithInterference() {
assertNotOK(install(profile, new IInstallableUnit[] {platform2, egit2}, true, planner, engine));
- ProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, null, new ProvisioningContext(getAgent()), getMonitor());
+ IProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, null, new ProvisioningContext(getAgent()), getMonitor());
assertEquals(2, res.getAdditions().size());
assertTrue(res.getAdditions().contains(sdk2));
assertTrue(res.getAdditions().contains(egit2));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest5.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest5.java
index 9ad1d8b5d..3283b9c17 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest5.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest5.java
@@ -9,10 +9,10 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
import org.eclipse.equinox.p2.tests.*;
public class LuckyTest5 extends AbstractProvisioningTest {
@@ -25,7 +25,7 @@ public class LuckyTest5 extends AbstractProvisioningTest {
@IUDescription(content = "package: platform \n" + "singleton: true\n" + "version: 2 \n")
public IInstallableUnit platform2;
- IProfile profile = createProfile("TestProfile." + getName());
+ IProfile profile = createProfile("TestProfile." + getClass().getSimpleName());
private IPlanner planner;
@@ -44,7 +44,7 @@ public class LuckyTest5 extends AbstractProvisioningTest {
//Verify that no plan is provided when the update is not possible
public void testInstallSDK2() {
assertNotOK(install(profile, new IInstallableUnit[] {platform2}, true, planner, engine));
- ProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, null, new ProvisioningContext(getAgent()), getMonitor());
+ IProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, null, new ProvisioningContext(getAgent()), getMonitor());
assertNull(res);
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest6.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest6.java
index fb6f6ff68..1c3fb81ec 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest6.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest6.java
@@ -9,10 +9,10 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
import org.eclipse.equinox.p2.tests.*;
public class LuckyTest6 extends AbstractProvisioningTest {
@@ -31,7 +31,7 @@ public class LuckyTest6 extends AbstractProvisioningTest {
@IUDescription(content = "package: sdk \n" + "singleton: true\n" + "version: 3 \n" + "depends: platform = 2")
public IInstallableUnit sdk3;
- IProfile profile = createProfile("TestProfile." + getName());
+ IProfile profile = createProfile("TestProfile." + getClass().getSimpleName());
private IPlanner planner;
@@ -51,7 +51,7 @@ public class LuckyTest6 extends AbstractProvisioningTest {
public void testInstallSDK3() {
assertNotOK(install(profile, new IInstallableUnit[] {platform2}, true, planner, engine));
- ProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, null, new ProvisioningContext(getAgent()), getMonitor());
+ IProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, null, new ProvisioningContext(getAgent()), getMonitor());
assertTrue(res.getAdditions().contains(sdk3));
assertTrue(res.getRemovals().contains(sdk1));
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest7.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest7.java
index 74cde18a4..ba46e73fb 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest7.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest7.java
@@ -32,7 +32,7 @@ public class LuckyTest7 extends AbstractProvisioningTest {
@IUDescription(content = "package: egit \n" + "singleton: true\n" + "version: 2 \n" + "depends: platform = 2")
public IInstallableUnit egit2;
- IProfile profile = createProfile("TestProfile." + getName());
+ IProfile profile = createProfile("TestProfile." + getClass().getSimpleName());
private IPlanner planner;
@@ -53,7 +53,7 @@ public class LuckyTest7 extends AbstractProvisioningTest {
changeRequest.add(egit2);
assertNotOK(planner.getProvisioningPlan(changeRequest, null, null).getStatus());
- ProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, changeRequest, new ProvisioningContext(getAgent()), getMonitor());
+ IProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, changeRequest, new ProvisioningContext(getAgent()), getMonitor());
assertEquals(2, res.getAdditions().size());
assertTrue(res.getAdditions().contains(sdk2));
assertEquals(1, res.getRemovals().size());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest8.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest8.java
index 7a2750a7a..34d8757f6 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest8.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest8.java
@@ -32,7 +32,7 @@ public class LuckyTest8 extends AbstractProvisioningTest {
@IUDescription(content = "package: egit \n" + "singleton: true\n" + "version: 2 \n" + "depends: platform = 2")
public IInstallableUnit egit2;
- IProfile profile = createProfile("TestProfile." + getName());
+ IProfile profile = createProfile("TestProfile." + getClass().getSimpleName());
private IPlanner planner;
@@ -54,7 +54,7 @@ public class LuckyTest8 extends AbstractProvisioningTest {
changeRequest.setInstallableUnitInclusionRules(egit2, ProfileInclusionRules.createOptionalInclusionRule(egit2));
assertTrue(planner.getProvisioningPlan(changeRequest, null, null).getAdditions().query(QueryUtil.createIUQuery(egit2), null).isEmpty());
- ProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, changeRequest, new ProvisioningContext(getAgent()), getMonitor());
+ IProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, changeRequest, new ProvisioningContext(getAgent()), getMonitor());
assertEquals(2, res.getAdditions().size());
assertTrue(res.getAdditions().contains(sdk2));
assertEquals(1, res.getRemovals().size());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest9.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest9.java
index e07b59f04..a88767ba8 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest9.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/LuckyTest9.java
@@ -36,7 +36,7 @@ public class LuckyTest9 extends AbstractProvisioningTest {
@IUDescription(content = "package: egit \n" + "singleton: true\n" + "version: 2 \n" + "depends: platform = 2")
public IInstallableUnit egit2;
- IProfile profile = createProfile("TestProfile." + getName());
+ IProfile profile = createProfile("TestProfile." + getClass().getSimpleName());
private IPlanner planner;
@@ -56,7 +56,7 @@ public class LuckyTest9 extends AbstractProvisioningTest {
IProfileChangeRequest changeRequest = new ProfileChangeRequest(profile);
changeRequest.remove(egit1);
- ProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, changeRequest, new ProvisioningContext(getAgent()), getMonitor());
+ IProfileChangeRequest res = new LuckyHelper().computeProfileChangeRequest(profile, planner, changeRequest, new ProvisioningContext(getAgent()), getMonitor());
assertEquals(1, res.getAdditions().size());
assertTrue(res.getAdditions().contains(sdk2));
assertEquals(1, res.getRemovals().size());

Back to the top