public class

JUnitShell

extends DevMode
java.lang.Object
   ↳ com.google.gwt.dev.DevModeBase
     ↳ com.google.gwt.dev.DevMode
       ↳ com.google.gwt.junit.JUnitShell

Class Overview

This class is responsible for hosting JUnit test case execution. There are three main pieces to the JUnit system.

  • Test environment
  • Client classes
  • Server classes

The test environment consists of this class and the non-translatable version of GWTTestCase. These two classes integrate directly into the real JUnit test process.

The client classes consist of the translatable version of GWTTestCase, translatable JUnit classes, and the user's own GWTTestCase-derived class. The client communicates to the server via RPC.

The server consists of JUnitHostImpl, an RPC servlet which communicates back to the test environment through a JUnitMessageQueue, thus closing the loop.

Summary

Nested Classes
interface JUnitShell.Strategy A strategy for running the test. 
[Expand]
Inherited Fields
From class com.google.gwt.dev.DevMode
From class com.google.gwt.dev.DevModeBase
Public Methods
static JUnitMessageQueue getMessageQueue()
Called by JUnitHostImpl to get an interface into the test process.
String getModuleUrl(String moduleName)
static String[] getRemoteUserAgents()
Get the list of remote user agents to compile.
static boolean mustNotExecuteTest(JUnitHost.TestInfo testInfo)
Checks if a testCase should not be executed.
static void runTest(GWTTestCase testCase, TestResult testResult)
Entry point for GWTTestCase.
static void runTest(String moduleName, TestCase testCase, TestResult testResult)
This method is deprecated. use runTest(GWTTestCase, TestResult) instead
static void runTest(String moduleName, TestCase testCase, TestResult testResult, JUnitShell.Strategy strategy)
This method is deprecated. use runTest(GWTTestCase, TestResult) instead
Protected Methods
long checkForUpdatesInterval()
Check for updates once a minute.
boolean doStartup()
void ensureCodeServerListener()
void inferStartupUrls()
ModuleDef loadModule(TreeLogger logger, String moduleName, boolean refresh)
boolean notDone()
Checks to see if this test run is complete.
void warnAboutNoStartupUrls()
[Expand]
Inherited Methods
From class com.google.gwt.dev.DevMode
From class com.google.gwt.dev.DevModeBase
From class java.lang.Object
From interface com.google.gwt.dev.ui.DoneCallback
From interface com.google.gwt.dev.ui.RestartServerCallback

Public Methods

public static JUnitMessageQueue getMessageQueue ()

Called by JUnitHostImpl to get an interface into the test process.

Returns

public String getModuleUrl (String moduleName)

public static String[] getRemoteUserAgents ()

Get the list of remote user agents to compile. This method returns null until all clients have connected.

Returns
  • the list of remote user agents

public static boolean mustNotExecuteTest (JUnitHost.TestInfo testInfo)

Checks if a testCase should not be executed. Currently, a test is either executed on all clients (mentioned in this test) or on no clients.

Parameters
testInfo the test info to check
Returns
  • true iff the test should not be executed on any of the specified clients.

public static void runTest (GWTTestCase testCase, TestResult testResult)

Entry point for GWTTestCase. Gets or creates the singleton JUnitShell and invokes its #runTestImpl(GWTTestCase, TestResult).

Throws
UnableToCompleteException

public static void runTest (String moduleName, TestCase testCase, TestResult testResult)

This method is deprecated.
use runTest(GWTTestCase, TestResult) instead

Entry point for GWTTestCase. Gets or creates the singleton JUnitShell and invokes its #runTestImpl(GWTTestCase, TestResult).

Throws
UnableToCompleteException

public static void runTest (String moduleName, TestCase testCase, TestResult testResult, JUnitShell.Strategy strategy)

This method is deprecated.
use runTest(GWTTestCase, TestResult) instead

Throws
UnableToCompleteException

Protected Methods

protected long checkForUpdatesInterval ()

Check for updates once a minute.

protected boolean doStartup ()

protected void ensureCodeServerListener ()

protected void inferStartupUrls ()

protected ModuleDef loadModule (TreeLogger logger, String moduleName, boolean refresh)

Throws
UnableToCompleteException

protected boolean notDone ()

Checks to see if this test run is complete.

protected void warnAboutNoStartupUrls ()