| com.google.gwt.junit.client.GWTTestCase
All known Subclasses: com.google.gwt.user.client.CommandExecutorTest, com.google.gwt.user.client.ui.WidgetOnLoadTest, com.google.gwt.emultest.java.lang.ByteTest, com.google.gwt.user.client.rpc.CustomFieldSerializerTest, com.google.gwt.emultest.java.lang.SystemTest, com.google.gwt.user.client.ui.TabBarTest, com.google.gwt.dev.jjs.test.ClassObjectTest, com.google.gwt.dev.jjs.test.AutoboxTest, com.google.gwt.dev.jjs.test.NativeLongTest, com.google.gwt.user.client.ui.RichTextAreaTest, com.google.gwt.dev.jjs.test.EnhancedForLoopTest, com.google.gwt.user.client.ui.PanelTest, com.google.gwt.dev.jjs.test.ClassCastTest, com.google.gwt.user.client.ui.WidgetIteratorsTest, com.google.gwt.i18n.client.I18N2Test, com.google.gwt.user.client.ui.ListBoxTest, com.google.gwt.user.client.ui.LinearPanelTest, com.google.gwt.emultest.java.lang.DoubleTest, com.google.gwt.user.client.rpc.ObjectGraphTest, com.google.gwt.user.client.ui.AbsolutePanelTest, com.google.gwt.emultest.java.lang.ObjectTest, com.google.gwt.junit.client.TestManualAsync, com.google.gwt.user.client.CookieTest, com.google.gwt.dev.jjs.test.HostedTest, com.google.gwt.dev.jjs.test.MethodBindTest, com.google.gwt.emultest.java.lang.ShortTest, com.google.gwt.user.client.ui.CustomButtonTest, test.ServletMappingTest, com.google.gwt.user.client.ui.impl.ClippedImagePrototypeTest, com.google.gwt.emultest.java.lang.StringBufferTest, com.google.gwt.user.client.rpc.EnumsTest, com.google.gwt.user.client.ui.TreeTest, com.google.gwt.http.client.RequestBuilderTest, com.google.gwt.dev.jjs.test.BlankInterfaceTest, com.google.gwt.user.client.RandomTest, com.google.gwt.user.client.ui.WidgetCollectionTest, com.google.gwt.dev.jjs.test.CompilerTest, com.google.gwt.i18n.client.NumberParse_fr_Test, com.google.gwt.user.client.ui.PopupTest, com.google.gwt.dev.shell.test.MultiModuleTest, com.google.gwt.emultest.java.util.StackTest, com.google.gwt.dev.jjs.test.MethodCallTest, com.google.gwt.emultest.java.util.EmulTestBase, com.google.gwt.user.client.ui.DelegatingKeyboardListenerCollectionTest, com.google.gwt.user.client.ui.HistoryTest, com.google.gwt.user.client.ui.ImageTest, com.google.gwt.user.client.ui.FastStringMapTest, com.google.gwt.i18n.client.NumberParse_en_Test, com.google.gwt.dev.jjs.test.EnumsTest, com.google.gwt.user.client.ui.DisclosurePanelTest, com.google.gwt.user.client.ui.PrefixTreeTest, com.google.gwt.i18n.client.NumberFormat_fr_Test, com.google.gwt.dev.jjs.test.InnerOuterSuperTest, com.google.gwt.i18n.client.DateTimeParse_zh_CN_Test, com.google.gwt.emultest.java.util.EnumMapTest, com.google.gwt.http.client.RequestTest, com.google.gwt.user.client.ui.UIObjectTest, com.google.gwt.user.client.rpc.UnicodeEscapingTest, com.google.gwt.user.client.rpc.CollectionsTest, com.google.gwt.json.client.JSONTest, com.google.gwt.user.client.ui.TabPanelTest, com.google.gwt.user.client.ui.StackPanelTest, com.google.gwt.module.client.SingleScriptInjectionTest, com.google.gwt.user.client.ui.FormPanelTest, com.google.gwt.i18n.client.I18NTest, com.google.gwt.user.client.ui.SplitPanelTest, com.google.gwt.i18n.client.NumberFormat_en_Test, com.google.gwt.user.client.ui.FocusPanelTest, com.google.gwt.user.client.ui.TextAreaTest, com.google.gwt.dev.jjs.test.MiscellaneousTest, com.google.gwt.emultest.java.lang.IntegerTest, com.google.gwt.user.client.ui.HiddenTest, com.google.gwt.dev.jjs.test.MemberShadowingTest, com.google.gwt.emultest.java.util.EnumSetTest, com.google.gwt.user.client.ui.RadioButtonTest, com.google.gwt.dev.jjs.test.InnerClassTest, com.google.gwt.emultest.java.lang.BooleanTest, com.google.gwt.user.client.ui.DOMTest, com.google.gwt.user.client.ui.HorizontalPanelTest, com.google.gwt.module.client.DoubleScriptInjectionTest, com.google.gwt.emultest.java.util.DateTest, com.google.gwt.user.client.WindowTest, com.google.gwt.user.client.rpc.ValueTypesTest, com.google.gwt.user.client.ui.HTMLTableTestBase, com.google.gwt.junit.client.Benchmark, com.google.gwt.dev.jjs.test.VarargsTest, com.google.gwt.http.client.ResponseTest, com.google.gwt.emultest.java.lang.StringTest, com.google.gwt.user.client.ui.CheckBoxTest, com.google.gwt.dev.jjs.test.MethodInterfaceTest, com.google.gwt.junit.client.GWTTestCaseTest, com.google.gwt.user.client.rpc.RemoteServiceServletTest, com.google.gwt.user.client.ui.DockPanelTest, com.google.gwt.user.client.ui.NamedFrameTest, com.google.gwt.user.client.ui.ScrollPanelTest, com.google.gwt.emultest.java.lang.FloatTest, com.google.gwt.http.client.URLTest, com.google.gwt.user.client.rpc.InheritanceTest, com.google.gwt.user.client.ui.VerticalPanelTest, com.google.gwt.emultest.java.lang.CharacterTest, com.google.gwt.user.client.ui.FlowPanelTest, com.google.gwt.xml.client.XMLTest, com.google.gwt.i18n.client.DateTimeFormat_de_Test, com.google.gwt.junit.client.ParallelRemoteTest, com.google.gwt.i18n.client.DateTimeParse_en_Test, com.google.gwt.user.client.ui.HTMLPanelTest, com.google.gwt.user.client.Profile,
GWTTestCase | abstract public class GWTTestCase extends TestCase (Code) | | 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.
|
Method Summary | |
final public void | addCheckpoint(String msg) Add a checkpoint message to the current test. | public boolean | catchExceptions() Determines whether or not exceptions will be caught by the test fixture.
Override this method and return false to let exceptions
escape to the browser. | final public void | clearCheckpoints() Clears the accumulated list of checkpoint messages. | final protected void | delayTestFinish(int timeoutMillis) Put the current test in asynchronous mode. | final protected void | finishTest() Cause this test to succeed during asynchronous mode. | final public String[] | getCheckpoints() Returns the current set of checkpoint messages. | abstract public String | getModuleName() Specifies a module to use when running this test case. | final protected TestResults | getTestResults() Returns the overall test results for this unit test. | final public void | run(TestResult result) Stashes result so that it can be accessed during
GWTTestCase.runTest() . | final protected void | runTest() Runs the test via the
JUnitShell environment. |
addCheckpoint | final public void addCheckpoint(String msg)(Code) | | Add a checkpoint message to the current test. If this test fails, all
checkpoint messages will be appended to the getException description. This can
be useful in web mode for determining how far test execution progressed
before a failure occurs.
Parameters: msg - the checkpoint message to add |
catchExceptions | public boolean catchExceptions()(Code) | | Determines whether or not exceptions will be caught by the test fixture.
Override this method and return 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, orfalse to disable normal JUnit getException reporting |
delayTestFinish | final protected void delayTestFinish(int timeoutMillis)(Code) | | Put the current test in asynchronous mode. If the test method completes
normally, this test will not immediately succeed. Instead, a delay
period begins. During the delay period, the test system will wait for
one of three things to happen:
- If
GWTTestCase.finishTest() is called before the delay period expires,
the test will succeed.
- If any getException escapes from an event handler during the delay
period, the test will error with the thrown getException.
- If the delay period expires and neither of the above has happened, the
test will error with a
TimeoutException .
This method is typically used to test event driven functionality.
Example:
Parameters: timeoutMillis - how long to wait before the current test will time out See Also: GWTTestCase.finishTest() throws: UnsupportedOperationException - if this test case is aBenchmark |
finishTest | final protected void finishTest()(Code) | | Cause this test to succeed during asynchronous mode. After calling
GWTTestCase.delayTestFinish(int) , call this method during the delay period to
cause this test to succeed. This method is typically called from an event
handler some time after the test method returns control to the caller.
Calling this method before the test method completes, will undo the effect
of having called delayTestFinish() . The test will revert to
normal, non-asynchronous mode.
Example:
throws: IllegalStateException - if this test is not in asynchronous mode. throws: UnsupportedOperationException - if this test case is aBenchmark See Also: GWTTestCase.delayTestFinish(int) |
getModuleName | abstract public String getModuleName()(Code) | | Specifies a module to use when running this test case. Subclasses must
return the name of a module that will cause the source for that subclass to
be included.
the fully qualified name of a module |
getTestResults | final protected TestResults getTestResults()(Code) | | Returns the overall test results for this unit test.
These TestResults are more comprehensive than JUnit's default test results,
and are automatically collected by GWT's testing infrastructure.
|
|
|