Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Pazderski2019-11-07 10:06:56 +0000
committerPaul Pazderski2019-11-07 11:17:24 +0000
commit13c2a48f5a297a7804f467501eebd5cd4f6702ab (patch)
tree1a77cbb62ba98cf64d8aef8529b4a9681d9251a8
parentaa590b15c90a4f61e689ed489aef569d26613db0 (diff)
downloadeclipse.platform.ui-13c2a48f5a297a7804f467501eebd5cd4f6702ab.tar.gz
eclipse.platform.ui-13c2a48f5a297a7804f467501eebd5cd4f6702ab.tar.xz
eclipse.platform.ui-13c2a48f5a297a7804f467501eebd5cd4f6702ab.zip
Bug 485167 - ProgressConstantsTest.testKeepProperty should run with
UiTestSuite Change-Id: I3629ac9af8f81a4a52025ccc8965196aae3c1df7 Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressContantsTest.java82
1 files changed, 41 insertions, 41 deletions
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressContantsTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressContantsTest.java
index ac8d8095024..963174abac2 100644
--- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressContantsTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressContantsTest.java
@@ -19,6 +19,7 @@ import org.eclipse.core.commands.Category;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.IParameter;
import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.e4.core.commands.ECommandService;
@@ -31,6 +32,7 @@ import org.eclipse.ui.internal.progress.JobInfo;
import org.eclipse.ui.internal.progress.ProgressInfoItem;
import org.eclipse.ui.progress.IProgressConstants;
import org.eclipse.ui.progress.IProgressConstants2;
+import org.eclipse.ui.tests.TestPlugin;
/**
* @since 3.6
@@ -135,45 +137,43 @@ public class ProgressContantsTest extends ProgressTestCase {
return null;
}
- // Commented out due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=288358
-
-// public void testKeepProperty() throws Exception {
-//
-// openProgressView();
-//
-// DummyJob okJob = new DummyJob("OK Job", Status.OK_STATUS);
-// okJob.setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE);
-// okJob.schedule();
-//
-// DummyJob warningJob = new DummyJob("Warning Job", new Status(IStatus.WARNING, TestPlugin.PLUGIN_ID, "Warning message"));
-// warningJob.setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE);
-// warningJob.schedule();
-//
-// processEvents();
-//
-// okJob.join();
-// warningJob.join();
-//
-// processEvents();
-//
-// boolean okJobFound = false;
-// boolean warningJobFound = false;
-//
-// ProgressInfoItem[] progressInfoItems = progressView.getViewer().getProgressInfoItems();
-// for (int i = 0; i < progressInfoItems.length; i++) {
-// JobInfo[] jobInfos = progressInfoItems[i].getJobInfos();
-// for (int j = 0; j < jobInfos.length; j++) {
-// Job job = jobInfos[j].getJob();
-// if (job.equals(okJob)) {
-// okJobFound = true;
-// }
-// if (job.equals(warningJob)) {
-// warningJobFound = true;
-// }
-// }
-// }
-//
-// assertTrue(okJobFound);
-// assertTrue(warningJobFound);
-// }
+ public void testKeepProperty() throws Exception {
+ openProgressView();
+
+ DummyJob okJob = new DummyJob("OK Job", Status.OK_STATUS);
+ okJob.setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE);
+ okJob.schedule();
+
+ DummyJob warningJob = new DummyJob("Warning Job",
+ new Status(IStatus.WARNING, TestPlugin.PLUGIN_ID, "Warning message"));
+ warningJob.setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE);
+ warningJob.schedule();
+
+ processEvents();
+
+ okJob.join();
+ warningJob.join();
+
+ processEvents();
+
+ boolean okJobFound = false;
+ boolean warningJobFound = false;
+
+ ProgressInfoItem[] progressInfoItems = progressView.getViewer().getProgressInfoItems();
+ for (ProgressInfoItem progressInfoItem : progressInfoItems) {
+ JobInfo[] jobInfos = progressInfoItem.getJobInfos();
+ for (JobInfo jobInfo : jobInfos) {
+ Job job = jobInfo.getJob();
+ if (job.equals(okJob)) {
+ okJobFound = true;
+ }
+ if (job.equals(warningJob)) {
+ warningJobFound = true;
+ }
+ }
+ }
+
+ assertTrue(okJobFound);
+ assertTrue(warningJobFound);
+ }
}

Back to the top