开发者

GWT unit test for Activity and View

开发者 https://www.devze.com 2023-02-09 13:58 出处:网络
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?

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

精彩评论

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