Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest10.java')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest10.java32
1 files changed, 17 insertions, 15 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest10.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest10.java
index 0cf1378ed..2f72df7f9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest10.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest10.java
@@ -10,14 +10,16 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.VersionRange;
+import org.eclipse.equinox.p2.metadata.Version;
+import org.eclipse.equinox.p2.metadata.VersionRange;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
-import org.eclipse.equinox.internal.provisional.p2.engine.IEngine;
-import org.eclipse.equinox.internal.provisional.p2.engine.IProfile;
+import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
+import org.eclipse.equinox.internal.provisional.p2.director.IPlanner;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
+import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest10 extends AbstractProvisioningTest {
@@ -34,15 +36,15 @@ public class PatchTest10 extends AbstractProvisioningTest {
protected void setUp() throws Exception {
super.setUp();
- a1 = createIU("A", new Version("1.0.0"), new IRequiredCapability[] {MetadataFactory.createRequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, "B", new VersionRange("[1.0.0, 1.1.0)"), null, false, true)});
- b1 = createIU("B", new Version(1, 0, 0), true);
- b2 = createIU("B", new Version(1, 2, 0), true);
- b3 = createIU("B", new Version(1, 3, 0), true);
+ a1 = createIU("A", Version.create("1.0.0"), new IRequiredCapability[] {MetadataFactory.createRequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, "B", new VersionRange("[1.0.0, 1.1.0)"), null, false, true)});
+ b1 = createIU("B", Version.createOSGi(1, 0, 0), true);
+ b2 = createIU("B", Version.createOSGi(1, 2, 0), true);
+ b3 = createIU("B", Version.createOSGi(1, 3, 0), true);
IRequirementChange change = MetadataFactory.createRequirementChange(MetadataFactory.createRequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, "B", VersionRange.emptyRange, null, false, false, false), MetadataFactory.createRequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, "B", new VersionRange("[1.2.0, 1.2.0]"), null, false, false, true));
- p1 = createIUPatch("P", new Version("1.0.0"), true, new IRequirementChange[] {change}, new IRequiredCapability[][] {{MetadataFactory.createRequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, "A", VersionRange.emptyRange, null, false, false)}}, null);
+ p1 = createIUPatch("P", Version.create("1.0.0"), true, new IRequirementChange[] {change}, new IRequiredCapability[][] {{MetadataFactory.createRequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, "A", VersionRange.emptyRange, null, false, false)}}, null);
IRequirementChange anotherChangeB = MetadataFactory.createRequirementChange(MetadataFactory.createRequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, "B", VersionRange.emptyRange, null, false, false, false), MetadataFactory.createRequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, "B", new VersionRange("[1.3.0, 1.3.0]"), null, false, false, true));
- pp1 = createIUPatch("PP", new Version("1.0.0"), true, new IRequirementChange[] {anotherChangeB}, new IRequiredCapability[][] {{MetadataFactory.createRequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, "A", VersionRange.emptyRange, null, false, false)}}, null);
+ pp1 = createIUPatch("PP", Version.create("1.0.0"), true, new IRequirementChange[] {anotherChangeB}, new IRequiredCapability[][] {{MetadataFactory.createRequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, "A", VersionRange.emptyRange, null, false, false)}}, null);
createTestMetdataRepository(new IInstallableUnit[] {a1, b1, b2, b3, p1, pp1});
@@ -55,7 +57,7 @@ public class PatchTest10 extends AbstractProvisioningTest {
//a1 and p1 can be installed together
ProfileChangeRequest req1 = new ProfileChangeRequest(profile1);
req1.addInstallableUnits(new IInstallableUnit[] {a1, p1});
- ProvisioningPlan plan1 = planner.getProvisioningPlan(req1, null, null);
+ IProvisioningPlan plan1 = planner.getProvisioningPlan(req1, null, null);
assertEquals(IStatus.OK, plan1.getStatus().getSeverity());
assertInstallOperand(plan1, a1);
assertInstallOperand(plan1, p1);
@@ -64,7 +66,7 @@ public class PatchTest10 extends AbstractProvisioningTest {
//a1 and pp1 can be installed together
ProfileChangeRequest req2 = new ProfileChangeRequest(profile1);
req2.addInstallableUnits(new IInstallableUnit[] {a1, pp1});
- ProvisioningPlan plan2 = planner.getProvisioningPlan(req2, null, null);
+ IProvisioningPlan plan2 = planner.getProvisioningPlan(req2, null, null);
assertEquals(IStatus.OK, plan2.getStatus().getSeverity());
assertInstallOperand(plan2, a1);
assertInstallOperand(plan2, pp1);
@@ -73,14 +75,14 @@ public class PatchTest10 extends AbstractProvisioningTest {
//a1, p1, and pp1 can not be installed together
ProfileChangeRequest req3 = new ProfileChangeRequest(profile1);
req3.addInstallableUnits(new IInstallableUnit[] {a1, p1, pp1});
- ProvisioningPlan plan3 = planner.getProvisioningPlan(req3, null, null);
+ IProvisioningPlan plan3 = planner.getProvisioningPlan(req3, null, null);
assertEquals(IStatus.ERROR, plan3.getStatus().getSeverity());
}
public void testExplanation() {
ProfileChangeRequest req3 = new ProfileChangeRequest(profile1);
req3.addInstallableUnits(new IInstallableUnit[] {a1, p1, pp1});
- ProvisioningPlan plan3 = planner.getProvisioningPlan(req3, null, null);
+ IProvisioningPlan plan3 = planner.getProvisioningPlan(req3, null, null);
assertEquals(IStatus.ERROR, plan3.getStatus().getSeverity());
// Set problems = plan3.getRequestStatus().getConflictsWithInstalledRoots();
// System.out.println(problems);

Back to the top