|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectTestCase
com.google.gwt.junit.client.GWTTestCase
public abstract class GWTTestCase
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. This version is the binary version that
derives from JUnit's TestCase and handles all the work of starting up
the GWT environment. The other version is a translatable class that is used
within the browser. See the translatable subpackage for the
translatable implementation.
| Nested Class Summary | |
|---|---|
static class |
GWTTestCase.BaseStrategy
The base class for strategies to use for tests. |
static class |
GWTTestCase.TestModuleInfo
Information about a synthetic module used for testing. |
| Field Summary | |
|---|---|
static java.util.Map<java.lang.String,GWTTestCase.TestModuleInfo> |
ALL_GWT_TESTS
Records all live GWTTestCases by synthetic module name so we can optimize run they are compiled and run. |
| Constructor Summary | |
|---|---|
GWTTestCase()
A new instance of your subclass is constructed for each test method that is to be run. |
|
| Method Summary | |
|---|---|
void |
addCheckpoint(java.lang.String msg)
Deprecated. This method will be removed when web mode supports stack traces. It can be useful for debugging web mode failures, but production code should not depend on it. |
boolean |
catchExceptions()
Determines whether or not exceptions will be caught by the test fixture. |
void |
clearCheckpoints()
Deprecated. This method will be removed if and when web mode supports stack traces. It can be useful for debugging web mode failures, but production code should not depend on it |
static java.lang.String[] |
getAllTestModuleNames()
Get the names of all test modules. |
java.lang.String[] |
getCheckpoints()
Deprecated. This method will be removed if and when web mode supports stack traces. It can be useful for debugging web mode failures, but production code should not depend on it |
static int |
getModuleCount()
Get the number of modules. |
abstract java.lang.String |
getModuleName()
Specifies a module to use when running this test case. |
JUnitShell.Strategy |
getStrategy()
Get the GWTTestCase.BaseStrategy to use when compiling and running this test. |
java.lang.String |
getSyntheticModuleName()
Get the synthetic module name, which includes the synthetic extension defined by the GWTTestCase.BaseStrategy. |
static GWTTestCase.TestModuleInfo |
getTestsForModule(java.lang.String syntheticModuleName)
Get the set of all JUnitHost.TestInfo for the specified module. |
boolean |
isPureJava()
Returns whether this test case should be run in pure Java mode (non-GWT). |
void |
run(TestResult result)
Stashes result so that it can be accessed during
runTest(). |
void |
setForcePureJava(boolean forcePureJava)
Specifies whether this test case should be always run in pure Java mode (non-GWT). |
void |
setName(java.lang.String name)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.Map<java.lang.String,GWTTestCase.TestModuleInfo> ALL_GWT_TESTS
| Constructor Detail |
|---|
public GWTTestCase()
UnsatisfiedLinkError, and trying to call
GWT.create(Class) could throw an
UnsupportedOperationException. Instead, override
gwtSetUp() and perform any initialization code there.
| Method Detail |
|---|
public static java.lang.String[] getAllTestModuleNames()
public static int getModuleCount()
public static GWTTestCase.TestModuleInfo getTestsForModule(java.lang.String syntheticModuleName)
JUnitHost.TestInfo for the specified module.
syntheticModuleName - the synthetic module name
@Deprecated public final void addCheckpoint(java.lang.String msg)
msg - the checkpoint message to addpublic boolean catchExceptions()
false to let exceptions
escape to the browser. This will break the normal JUnit reporting
functionality, but can be useful in web mode with a JavaScript debugger to
pin down where exceptions are originating.
true for normal JUnit behavior, or
false to disable normal JUnit getException reporting@Deprecated public final void clearCheckpoints()
addCheckpoint(String)@Deprecated public final java.lang.String[] getCheckpoints()
null array of checkpoint messagesaddCheckpoint(String)public abstract java.lang.String getModuleName()
null to run
as a pure Java (non-GWT) test case (same effect as passing
true to setForcePureJava(boolean))isPureJava()public JUnitShell.Strategy getStrategy()
GWTTestCase.BaseStrategy to use when compiling and running this test.
GWTTestCase.BaseStrategypublic final java.lang.String getSyntheticModuleName()
GWTTestCase.BaseStrategy.
null if this test case
is run in pure Java mode (non-GWT)isPureJava()public boolean isPureJava()
true if and only if getModuleName() returns
null, or setForcePureJava(boolean) was last invoked with
true.
public final void run(TestResult result)
result so that it can be accessed during
runTest().
public void setForcePureJava(boolean forcePureJava)
true has the same effect as returning
null in getModuleName(). The setting is
false by default.
forcePureJava - true to always run this test case in pure
Java mode (non-GWT); false to run this test case in GWT
mode if getModuleName() does not return nullisPureJava()public void setName(java.lang.String name)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||