Attempt to fix failin test cases.

This commit is contained in:
Kris De Volder
2018-05-04 15:02:44 -07:00
parent 6a5a023557
commit d26cf6c5d7

View File

@@ -44,6 +44,15 @@ import junit.framework.AssertionFailedError;
*/
public abstract class ACondition {
private static boolean headless;
static {
try {
Display.getDefault();
headless = false;
} catch (Exception e) {
headless = true;
}
}
private String description = null;
/**
@@ -240,7 +249,7 @@ public abstract class ACondition {
}
public static boolean inUIThread() {
return Display.getDefault().getThread() == Thread.currentThread();
return !headless && Display.getDefault().getThread() == Thread.currentThread();
}
public static StringBuffer getStackDumps() {