Reviewers: fabbott, Description: Description: ============ A recent GWTTestCase created a situation where JUnitShell could be created in a different thread than the one the test case is run in. Since JUnitShell initializes a SWT display when it is created, this generates a SWT error when the test is run.
This is a rare error but occurs with special Test runners that parallelize tests. Fix: ==== GWTTestCase no longer invokes JUnitShell.mustNotExecuteTest(), which was creating the JUnitShell in the wrong thread. Instead, the BatchingStrategy does the check from the correct thread. I also added some checks to ensure that most static methods in JUnitShell are called from the correct thread, and only when appropriate. Testing: ======== Verified that this fixes the error and updated tests to reflect the changes. Please review this at http://gwt-code-reviews.appspot.com/72807 Affected files: user/src/com/google/gwt/junit/BatchingStrategy.java user/src/com/google/gwt/junit/JUnitShell.java user/src/com/google/gwt/junit/RunStyle.java user/src/com/google/gwt/junit/RunStyleLocalHosted.java user/src/com/google/gwt/junit/client/GWTTestCase.java user/test/com/google/gwt/junit/BatchingStrategyTest.java user/test/com/google/gwt/junit/JUnitSuite.java --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
