com.google.gwt.junit
Class JUnitShell

java.lang.Object
  extended by DevMode
      extended by com.google.gwt.junit.JUnitShell

public class JUnitShell
extends DevMode

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

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.


Nested Class Summary
static interface JUnitShell.Strategy
          A strategy for running the test.
 
Method Summary
static JUnitMessageQueue getMessageQueue()
          Called by JUnitHostImpl to get an interface into the test process.
 java.lang.String getModuleUrl(java.lang.String moduleName)
           
static java.lang.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(java.lang.String moduleName, TestCase testCase, TestResult testResult)
          Deprecated. use runTest(GWTTestCase, TestResult) instead
static void runTest(java.lang.String moduleName, TestCase testCase, TestResult testResult, JUnitShell.Strategy strategy)
          Deprecated. use runTest(GWTTestCase, TestResult) instead
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMessageQueue

public static JUnitMessageQueue getMessageQueue()
Called by JUnitHostImpl to get an interface into the test process.

Returns:
The JUnitMessageQueue interface that belongs to the singleton JUnitShell, or null if no such singleton exists.

getRemoteUserAgents

public static java.lang.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

mustNotExecuteTest

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.

runTest

public static void runTest(GWTTestCase testCase,
                           TestResult testResult)
                    throws UnableToCompleteException
Entry point for GWTTestCase. Gets or creates the singleton JUnitShell and invokes its runTestImpl(GWTTestCase, TestResult).

Throws:
UnableToCompleteException

runTest

@Deprecated
public static void runTest(java.lang.String moduleName,
                                      TestCase testCase,
                                      TestResult testResult)
                    throws UnableToCompleteException
Deprecated. use runTest(GWTTestCase, TestResult) instead

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

Throws:
UnableToCompleteException

runTest

@Deprecated
public static void runTest(java.lang.String moduleName,
                                      TestCase testCase,
                                      TestResult testResult,
                                      JUnitShell.Strategy strategy)
                    throws UnableToCompleteException
Deprecated. use runTest(GWTTestCase, TestResult) instead

Throws:
UnableToCompleteException

getModuleUrl

public java.lang.String getModuleUrl(java.lang.String moduleName)