gui-tests-framework: we are muting TestRunnerUtil.replaceIdeEventQueueSafely() for _FirstInSuiteTest.testNothing() because it raises problem with RepaintManager and EventQueue, and as a result we have JFrames with unrendered content. Adding system property idea.test.guiTestMode=true

This commit is contained in:
Sergey Karashevich
2016-10-09 17:59:25 +03:00
parent c103cd2903
commit beba0c0697
2 changed files with 8 additions and 3 deletions
@@ -68,6 +68,7 @@ import static junit.framework.Assert.assertNotNull;
import static org.fest.swing.edt.GuiActionRunner.execute;
import static org.fest.swing.timing.Pause.pause;
import static org.fest.util.Strings.quote;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -91,10 +92,10 @@ public abstract class GuiTestCase {
@Before
public void setUp() throws Exception {
if (!canRunGuiTests()) {
// We currently do not support running UI tests in headless environments.
return;
}
System.setProperty("GuiTestMode", "true");
assertEquals(System.getProperty("idea.test.guiTestMode"), "true");
Application application = ApplicationManager.getApplication();
assertNotNull(application); // verify that we are using the IDE's ClassLoader.
@@ -64,7 +64,11 @@ public class _FirstInSuiteTest extends TestCase {
// in tests EDT inexplicably shuts down sometimes during the first access,
// which leads to nasty problems in ApplicationImpl which assumes there is only one EDT.
// so we try to forcibly terminate EDT here to urge JVM to re-spawn new shiny permanent EDT-1
TestRunnerUtil.replaceIdeEventQueueSafely();
//replacing of IdeEventQueue may cause problems with RepaintManager and EventQueue especially on Windows for GUI tests
if (!System.getProperty("idea.test.guiTestMode").toLowerCase().equals("true")) {
TestRunnerUtil.replaceIdeEventQueueSafely();
}
SwingUtilities.invokeAndWait(() -> System.out.println("EDT is " + Thread.currentThread()));
// force platform JNA load