Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2009-04-13 15:37:22 -0400
committerSusan Franklin2009-04-13 15:37:22 -0400
commit1baa82b593ba3653fdc48a9324b9a8a9e7d7cd69 (patch)
tree36cdd462f4507deaf88722e71e34e1feb55ba24c /bundles/org.eclipse.equinox.p2.tests.ui
parent8aa3ff912efbae249ad9b17bb835fbc4ad3d86af (diff)
downloadrt.equinox.p2-1baa82b593ba3653fdc48a9324b9a8a9e7d7cd69.tar.gz
rt.equinox.p2-1baa82b593ba3653fdc48a9324b9a8a9e7d7cd69.tar.xz
rt.equinox.p2-1baa82b593ba3653fdc48a9324b9a8a9e7d7cd69.zip
Bug 271190 - [ui] ElementUtils removes composite child repos
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests.ui')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/actions/ElementUtilsTest.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/actions/ElementUtilsTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/actions/ElementUtilsTest.java
index 5b79f9b64..a82574d37 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/actions/ElementUtilsTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/actions/ElementUtilsTest.java
@@ -15,7 +15,8 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.jobs.*;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.IJobChangeListener;
import org.eclipse.equinox.internal.p2.ui.ProvUIMessages;
import org.eclipse.equinox.internal.p2.ui.model.ElementUtils;
import org.eclipse.equinox.internal.p2.ui.model.MetadataRepositoryElement;
@@ -91,10 +92,12 @@ public class ElementUtilsTest extends ProfileModificationActionTest {
// We expect known2 to get added because it was in the elements
// We expect uri3 to get removed (as if it had been removed from a pref page)
// System repos shouldn't be touched
- ElementUtils.updateRepositoryUsingElements(elements, PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+ // All this happens asynchronously so we have to install a listener to know
+ // that it has completed.
+ // The repo update happens in a job, so we need to ensure it finished
final boolean[] done = new boolean[1];
done[0] = false;
- // The repo update happens in a job, so we need to ensure it finished
+
Platform.getJobManager().addJobChangeListener(new IJobChangeListener() {
public void aboutToRun(IJobChangeEvent event) {
@@ -115,13 +118,10 @@ public class ElementUtilsTest extends ProfileModificationActionTest {
public void running(IJobChangeEvent event) {
// TODO Auto-generated method stub
-
}
public void scheduled(IJobChangeEvent event) {
- if (event.getJob().getName().equals(ProvUIMessages.ElementUtils_UpdateJobTitle))
- event.getJob().setPriority(Job.INTERACTIVE);
-
+ // TODO Auto-generated method stub
}
public void sleeping(IJobChangeEvent event) {
@@ -131,6 +131,8 @@ public class ElementUtilsTest extends ProfileModificationActionTest {
});
+ ElementUtils.updateRepositoryUsingElements(elements, PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+
// spin event loop until job is done
Display display = PlatformUI.getWorkbench().getDisplay();
while (!done[0]) {

Back to the top