mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user