diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/InstallationHistoryPageTest.java')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/InstallationHistoryPageTest.java | 10 |
1 files changed, 7 insertions, 3 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 10d356d8f..b4062b6e7 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 @@ -50,7 +50,7 @@ public class InstallationHistoryPageTest extends AbstractProvisioningUITest { /** * Tests the dialog */ - public void testDialog() { + public void testDialogBackgroundFetch() { TestDialog dialog = new TestDialog(); dialog.setBlockOnOpen(false); dialog.open(); @@ -62,6 +62,9 @@ public class InstallationHistoryPageTest extends AbstractProvisioningUITest { Object input = viewer.getInput(); Field jobField = ProvElementContentProvider.class.getDeclaredField("fetchJob"); jobField.setAccessible(true); + Field jobFamily = ProvElementContentProvider.class.getDeclaredField("fetchFamily"); + jobFamily.setAccessible(true); + jobs = 0; done = 0; // hammer the elements repetitively to start multiple fast running fetch jobs @@ -80,10 +83,11 @@ public class InstallationHistoryPageTest extends AbstractProvisioningUITest { } } }); - if (i == 4 && job != null) - job.join(); } } + // 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); assertEquals("Not all jobs finished as expected", jobs, done); } catch (Exception e) { |