diff --git a/community-tests/src/com/intellij/tests/gui/framework/GuiTestCase.java b/community-tests/src/com/intellij/tests/gui/framework/GuiTestCase.java index 3591008b4f23..21751ccea33f 100644 --- a/community-tests/src/com/intellij/tests/gui/framework/GuiTestCase.java +++ b/community-tests/src/com/intellij/tests/gui/framework/GuiTestCase.java @@ -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. diff --git a/platform/testFramework/src/_FirstInSuiteTest.java b/platform/testFramework/src/_FirstInSuiteTest.java index 671659a77c8b..139606763d8c 100644 --- a/platform/testFramework/src/_FirstInSuiteTest.java +++ b/platform/testFramework/src/_FirstInSuiteTest.java @@ -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