开发者

GWT unit test for Activity and View

Does anybody have a link for a tutorial on how to write JRE junit tests (extending TestCase and not GWTTestCase) that tests Activity and开发者_StackOverflow Views in GWT 2.1?

Best regards

Pich


Views can only be unit tested using GWTTestCase because they call (either explicitly or implicitly) GWT.create().

To test Activities use mock Views to avoid use of GWT.create().


I have managed to test views, which of course contains reference to the objects that calls GWT.create(), using PowerMock.

For Activities it is easy todo using Mockito for instance to mock the View.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜