Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2009-10-07 13:59:31 -0400
committerSusan Franklin2009-10-07 13:59:31 -0400
commit4b09f2aa7cdd1090b60152db0a92c9ec3dca3990 (patch)
tree37b1561071b128be741b98761565f970d708b226 /bundles/org.eclipse.equinox.p2.tests.ui
parent70a5a61fcfbc3064a944d448fc6ba79bd7f94709 (diff)
downloadrt.equinox.p2-4b09f2aa7cdd1090b60152db0a92c9ec3dca3990.tar.gz
rt.equinox.p2-4b09f2aa7cdd1090b60152db0a92c9ec3dca3990.tar.xz
rt.equinox.p2-4b09f2aa7cdd1090b60152db0a92c9ec3dca3990.zip
Bug 290931 - [ui] InstallationHistoryPageTest fails in N20090929
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/dialogs/InstallationHistoryPageTest.java32
1 files changed, 18 insertions, 14 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/InstallationHistoryPageTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/InstallationHistoryPageTest.java
index b4062b6e7..413bb1585 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/InstallationHistoryPageTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/InstallationHistoryPageTest.java
@@ -29,8 +29,8 @@ import org.eclipse.swt.widgets.Control;
* somewhere besides the about dialog
*/
public class InstallationHistoryPageTest extends AbstractProvisioningUITest {
- int jobs;
- int done;
+ volatile int jobs;
+ volatile int done;
class TestDialog extends Dialog {
RevertProfilePage page;
@@ -67,28 +67,32 @@ public class InstallationHistoryPageTest extends AbstractProvisioningUITest {
jobs = 0;
done = 0;
+ final Object family = jobFamily.get(provider);
+
+ Job.getJobManager().addJobChangeListener(new JobChangeAdapter() {
+ public void done(IJobChangeEvent e) {
+ if (e.getJob().belongsTo(family)) {
+ done++;
+ int status = e.getResult().getSeverity();
+ if (status != IStatus.CANCEL && status != IStatus.OK) {
+ // something unexpected happened.
+ fail("Fetch job failed unexpectedly " + e.getResult().getMessage());
+ }
+ }
+ }
+ });
+
// hammer the elements repetitively to start multiple fast running fetch jobs
for (int i = 0; i < 5; i++) {
provider.getElements(input);
Job job = (Job) jobField.get(provider);
if (job != null) {
jobs++;
- job.addJobChangeListener(new JobChangeAdapter() {
- public void done(IJobChangeEvent e) {
- done++;
- int status = e.getResult().getSeverity();
- if (status != IStatus.CANCEL && status != IStatus.OK) {
- // something unexpected happened.
- fail("Fetch job failed unexpectedly " + e.getResult().getMessage());
- }
- }
- });
}
}
// We need to wait for all the fetch jobs to finish and then verify that they did
- Object family = jobFamily.get(provider);
Job.getJobManager().join(family, null);
- assertTrue("No fetch occurred", jobs > 0);
+ assertTrue("Something's wrong. No fetch occurred", jobs > 0);
assertEquals("Not all jobs finished as expected", jobs, done);
} catch (Exception e) {
fail("Failure during reflection", e);

Back to the top