Revision: 6288 Author: [email protected] Date: Fri Oct 2 11:49:06 2009 Log: Get JUnitShell working with UI abstraction, fix headless operation in SwingUI.
Headless logging level needs to be fixed still. http://code.google.com/p/google-web-toolkit/source/detail?r=6288 Modified: /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/HostedModeBase.java /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/SwingUI.java /changes/jat/abstractui/user/src/com/google/gwt/junit/JUnitShell.java ======================================= --- /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/HostedModeBase.java Fri Oct 2 09:35:30 2009 +++ /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/HostedModeBase.java Fri Oct 2 11:49:06 2009 @@ -762,9 +762,6 @@ * creating the main window and optionally starting an embedded web server. */ public final void run() { - if (ui == null) { - ui = new SwingUI(this); - } try { if (startUp()) { // Eager AWT init for OS X to ensure safe coexistence with SWT. @@ -999,6 +996,10 @@ if (started) { throw new IllegalStateException("Startup code has already been run"); } + + if (ui == null) { + ui = new SwingUI(this); + } started = true; ======================================= --- /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/SwingUI.java Fri Oct 2 08:37:20 2009 +++ /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/SwingUI.java Fri Oct 2 11:49:06 2009 @@ -143,6 +143,9 @@ @Override public TreeLogger getWebServerLogger(String serverName, String iconName) { + if (hostedModeBase.isHeadless()) { + return topLogger; + } if (webServerLog == null) { RestartAction restartAction = null; if (hasCallback(RESTART_SERVER)) { ======================================= --- /changes/jat/abstractui/user/src/com/google/gwt/junit/JUnitShell.java Fri Oct 2 08:37:20 2009 +++ /changes/jat/abstractui/user/src/com/google/gwt/junit/JUnitShell.java Fri Oct 2 11:49:06 2009 @@ -29,7 +29,6 @@ import com.google.gwt.dev.javac.CompilationUnit; import com.google.gwt.dev.shell.CheckForUpdates; import com.google.gwt.dev.util.arg.ArgHandlerLogLevel; -import com.google.gwt.dev.util.log.PrintWriterTreeLogger; import com.google.gwt.junit.client.GWTTestCase; import com.google.gwt.junit.client.TimeoutException; import com.google.gwt.junit.client.impl.JUnitResult; @@ -96,7 +95,7 @@ while (true) { boolean stillGoing = notDone(); if (!stillGoing) { - // ui.callback(DevelopmentModeUI.DONE, null); + setDone(); break; } try { @@ -571,11 +570,6 @@ private CompileStrategy compileStrategy = new SimpleCompileStrategy( JUnitShell.this); - /** - * When headless, all logging goes to the console. - */ - private PrintWriterTreeLogger consoleLogger; - /** * Name of the module containing the current/last module to run. */ @@ -695,8 +689,6 @@ @Override protected boolean doStartup() { - // TODO(jat): refactor so we can avoid startup up the OOPHM listener if we - // aren't running in development mode if (!super.doStartup()) { return false; } @@ -708,10 +700,16 @@ new MessageQueueThread().start(); return true; } + + @Override + protected void ensureOophmListener() { + if (developmentMode) { + super.ensureOophmListener(); + } + } /** - * Overrides {...@link GWTShell#notDone()} to wait for the currently-running test - * to complete. + * Checks to see if this test run is complete. */ protected boolean notDone() { int activeClients = messageQueue.getNumClientsRetrievedTest(currentTestInfo); --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
