com.google.gwt.junit.client
Class GWTTestCase

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bycom.google.gwt.junit.client.GWTTestCase
All Implemented Interfaces:
Test

public abstract class GWTTestCase
extends TestCase

Acts as a bridge between the JUnit environment and the GWT environment. We hook the run method and stash the TestResult object for later communication between the test runner and the unit test shell that drives the test case inside a hosted browser.

There are two versions of this class. One is used in hosted mode and the other is used in hybrid mode. Implementations are very different between the two modes, making it simpler to have a separate implementation for each. Please see the translatable subpackage for the other implementation.


Field Summary
 
Fields inherited from class java.lang.Object
typeId, typeName
 
Constructor Summary
GWTTestCase()
           
 
Method Summary
 void addCheckpoint(String msg)
          Accumulates messages that are printed along with failures (useful in hybrid mode as a substitute for stack traces).
 boolean catchExceptions()
          Determines whether or not exceptions will be caught by the test fixture.
 void clearCheckpoints()
          Resets the current checkpoint messages.
 String[] getCheckpoints()
          Gets the current checkpoint messages.
abstract  String getModuleName()
          Tests can only be run in the context of a module.
 void run(TestResult result)
          Stashes the TestResult object so that it can be accessed from the unit test shell.
protected  void runTest()
          Runs the test by delegating to the unit test shell.
protected  void setUp()
          Not supported in the current implemenation.
protected  void tearDown()
          Not supported in the current implementation.
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, runBare
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
equals, finalize, hashCode, toString
 

Constructor Detail

GWTTestCase

public GWTTestCase()
Method Detail

addCheckpoint

public void addCheckpoint(String msg)
Accumulates messages that are printed along with failures (useful in hybrid mode as a substitute for stack traces).


catchExceptions

public boolean catchExceptions()
Determines whether or not exceptions will be caught by the test fixture.


clearCheckpoints

public void clearCheckpoints()
Resets the current checkpoint messages.


getCheckpoints

public String[] getCheckpoints()
Gets the current checkpoint messages.


getModuleName

public abstract String getModuleName()
Tests can only be run in the context of a module. Therefore, the concrete TestCase must provide an implementation for this method.

Returns:
the fully qualified name of the module to use for this test.

run

public void run(TestResult result)
Stashes the TestResult object so that it can be accessed from the unit test shell.


runTest

protected void runTest()
                throws Throwable
Runs the test by delegating to the unit test shell.

Throws:
Throwable

setUp

protected final void setUp()
                    throws Exception
Not supported in the current implemenation.

Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Not supported in the current implementation.

Throws:
Exception


This javadoc distribution was not produced by Google. The official documentation is here.