gui-tests-framework: changed system property name to "idea.test.guimode"

This commit is contained in:
Sergey Karashevich
2016-10-09 17:59:25 +03:00
parent beba0c0697
commit 98753221d1
3 changed files with 16 additions and 15 deletions
@@ -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();
@@ -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()));
@@ -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