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 21751ccea33f..94f936d0075a 100644 --- a/community-tests/src/com/intellij/tests/gui/framework/GuiTestCase.java +++ b/community-tests/src/com/intellij/tests/gui/framework/GuiTestCase.java @@ -95,8 +95,6 @@ public abstract class GuiTestCase { return; } - assertEquals(System.getProperty("idea.test.guiTestMode"), "true"); - Application application = ApplicationManager.getApplication(); assertNotNull(application); // verify that we are using the IDE's ClassLoader. setUpDefaultProjectCreationLocationPath(); diff --git a/platform/testFramework/src/_FirstInSuiteTest.java b/platform/testFramework/src/_FirstInSuiteTest.java index 139606763d8c..3684cdf6c338 100644 --- a/platform/testFramework/src/_FirstInSuiteTest.java +++ b/platform/testFramework/src/_FirstInSuiteTest.java @@ -66,7 +66,8 @@ public class _FirstInSuiteTest extends TestCase { // so we try to forcibly terminate EDT here to urge JVM to re-spawn new shiny permanent EDT-1 //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")) { + boolean guiTestMode = Boolean.getBoolean("idea.test.guimode"); + if (!guiTestMode) { TestRunnerUtil.replaceIdeEventQueueSafely(); } SwingUtilities.invokeAndWait(() -> System.out.println("EDT is " + Thread.currentThread())); diff --git a/platform/testFramework/src/_LastInSuiteTest.java b/platform/testFramework/src/_LastInSuiteTest.java index ed9402e2afa7..d91e86479ca6 100644 --- a/platform/testFramework/src/_LastInSuiteTest.java +++ b/platform/testFramework/src/_LastInSuiteTest.java @@ -43,18 +43,20 @@ import java.util.concurrent.TimeUnit; @SuppressWarnings("JUnitTestClassNamingConvention") public class _LastInSuiteTest extends TestCase { public void testProjectLeak() throws Exception { - if (System.getProperty("GuiTestMode") == null || System.getProperty("GuiTestMode").equals("false")) { - UIUtil.invokeAndWaitIfNeeded(new Runnable() { - @Override - public void run() { - try { - LightPlatformTestCase.initApplication(); // in case nobody cared to init. LightPlatformTestCase.disposeApplication() would not work otherwise. - } - catch (RuntimeException e) { - throw e; - } - catch (Exception e) { - throw new RuntimeException(e); + boolean guiTestMode = Boolean.getBoolean("idea.test.guimode"); + if (!guiTestMode) { + UIUtil.invokeAndWaitIfNeeded(new Runnable() { + @Override + public void run() { + try { + LightPlatformTestCase.initApplication(); // in case nobody cared to init. LightPlatformTestCase.disposeApplication() would not work otherwise. + } + catch (RuntimeException e) { + throw e; + } + catch (Exception e) { + throw new RuntimeException(e); + } } // disposes default projects too