Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2010-01-23 17:11:26 +0000
committerSusan Franklin2010-01-23 17:11:26 +0000
commitdb1bbc0f377a95638d858e1eb6cd596c66c0ab87 (patch)
treeaf00d153f4c04ea8c490ba3f3bd405c7fff82360
parentbc3ce087cea1293e57fd36a263013bcf3bbcd928 (diff)
downloadrt.equinox.p2-db1bbc0f377a95638d858e1eb6cd596c66c0ab87.tar.gz
rt.equinox.p2-db1bbc0f377a95638d858e1eb6cd596c66c0ab87.tar.xz
rt.equinox.p2-db1bbc0f377a95638d858e1eb6cd596c66c0ab87.zip
regression test for Bug 300445 - [ui] Can't update from I20100119-0800
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/planning/UpdatePlanning.java31
1 files changed, 20 insertions, 11 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/planning/UpdatePlanning.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/planning/UpdatePlanning.java
index 827dabf0c..e723ddf1e 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/planning/UpdatePlanning.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/planning/UpdatePlanning.java
@@ -10,27 +10,20 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.ui.planning;
-import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.VersionRange;
-
-import org.eclipse.equinox.p2.metadata.IRequirementChange;
-import org.eclipse.equinox.p2.metadata.IUpdateDescriptor;
-
-import org.eclipse.equinox.p2.metadata.IInstallableUnitPatch;
-
import java.util.Arrays;
import java.util.HashSet;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
-import org.eclipse.equinox.internal.provisional.p2.metadata.*;
+import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.core.ProvisionException;
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.operations.Update;
import org.eclipse.equinox.p2.operations.UpdateOperation;
import org.eclipse.equinox.p2.tests.ui.AbstractProvisioningUITest;
public class UpdatePlanning extends AbstractProvisioningUITest {
- IInstallableUnit a1;
+ IInstallableUnit a1, b1;
+ IInstallableUnit b12;
IInstallableUnit a120WithDifferentId;
IInstallableUnit a130;
IInstallableUnit a140WithDifferentId;
@@ -53,6 +46,9 @@ public class UpdatePlanning extends AbstractProvisioningUITest {
IRequiredCapability lifeCycle2 = MetadataFactory.createRequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, "A", new VersionRange("[2.0.0, 3.2.0]"), null, false, false);
patchFora2 = createIUPatch("P", Version.create("1.0.0"), true, new IRequirementChange[] {change2}, new IRequiredCapability[][] {{MetadataFactory.createRequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, "A", VersionRange.emptyRange, null, false, false)}}, lifeCycle2);
+ b1 = createIU("B", Version.create("1.0.0"));
+ update = MetadataFactory.createUpdateDescriptor("B", new VersionRange("[1.0.0, 1.0.0]"), 0, "update description");
+ b12 = createIU("B", Version.createOSGi(1, 2, 0), null, NO_REQUIRES, NO_PROVIDES, NO_PROPERTIES, null, NO_TP_DATA, false, update, NO_REQUIRES);
// Ensure that all versions, not just the latest, are considered by the UI
getPolicy().setShowLatestVersionsOnly(false);
}
@@ -158,4 +154,17 @@ public class UpdatePlanning extends AbstractProvisioningUITest {
// All three patches and all three updates can be chosen
assertEquals("1.2", 6, op.getPossibleUpdates().length);
}
+
+ // bug 300445
+ public void testRemoveSelectionAfterResolve() throws ProvisionException {
+ createTestMetdataRepository(new IInstallableUnit[] {a1, a130, b1, b12});
+ install(a1, true, false);
+ UpdateOperation op = getProvisioningUI().getUpdateOperation(new IInstallableUnit[] {a1, b1}, null);
+ op.resolveModal(getMonitor());
+ Update[] updates = op.getSelectedUpdates();
+ assertTrue("1.0", updates.length == 2);
+ // choose just one
+ op.setSelectedUpdates(new Update[] {updates[0]});
+ op.resolveModal(getMonitor());
+ }
}

Back to the top