Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2015-02-20 21:37:47 -0500
committerGerrit Code Review @ Eclipse.org2015-02-21 22:07:10 -0500
commit32d1a28f49fc85639e024b9f1d19367410422e96 (patch)
tree9bf19c2b98f25bef1b9bd45f4881d4cd667c5faa /codan/org.eclipse.cdt.codan.core.test
parent2fca26b8e54ae703bffc4f8b94533ba38db66e30 (diff)
downloadorg.eclipse.cdt-32d1a28f49fc85639e024b9f1d19367410422e96.tar.gz
org.eclipse.cdt-32d1a28f49fc85639e024b9f1d19367410422e96.tar.xz
org.eclipse.cdt-32d1a28f49fc85639e024b9f1d19367410422e96.zip
codan tests - removed sleeps and made sure it runs in non-ui thread
Diffstat (limited to 'codan/org.eclipse.cdt.codan.core.test')
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixTestCase.java35
1 files changed, 23 insertions, 12 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixTestCase.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixTestCase.java
index f7144b1f02..cae78762be 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixTestCase.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixTestCase.java
@@ -81,11 +81,17 @@ public abstract class QuickFixTestCase extends CheckerTestCase {
@Override
public void tearDown() throws CoreException {
- IWorkbenchPage[] pages = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPages();
- for (IWorkbenchPage page : pages) {
- page.closeAllEditors(false);
- dispatch(200);
- }
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ IWorkbenchPage[] pages = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPages();
+ for (IWorkbenchPage page : pages) {
+ page.closeAllEditors(false);
+ dispatch(0);
+ }
+ }
+ });
+
super.tearDown();
}
@@ -107,18 +113,23 @@ public abstract class QuickFixTestCase extends CheckerTestCase {
// need to load before running codan because otherwise marker is lost when doing quick fix 8[]
runCodan();
doRunQuickFix();
- dispatch(500);
String result = TestUtils.loadFile(currentIFile.getContents());
return result;
}
public void doRunQuickFix() {
- for (int i = 0; i < markers.length; i++) {
- IMarker marker = markers[i];
- quickFix.run(marker);
- dispatch(200);
- }
- PlatformUI.getWorkbench().saveAllEditors(false);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ for (int i = 0; i < markers.length; i++) {
+ IMarker marker = markers[i];
+ quickFix.run(marker);
+ dispatch(0);
+ }
+ PlatformUI.getWorkbench().saveAllEditors(false);
+ }
+ });
+
}
/**

Back to the top