GwtMockito GWT 应用测试工具

程序名称:GwtMockito

授权协议: Apache

操作系统: 跨平台

开发语言: Java

GwtMockito 介绍

GwtMockito 是 GWT 应用测试工具。

使用 GWTTestCase 测试 GWT 应用会比纯 Java
测试慢,而且不能使用基于反射的工具,比如模拟测试框架。如果尝试使用常规测试示例,那么会遇到这个错误:

ERROR: GWT.create() is only usable in client code!  It cannot be called,
for example, from server code. If you are running a unit test, check that 
your test case extends GWTTestCase and that GWT.create() is not called
from within an initializer or constructor.

GwtMockito 就很好的解决了这个问题,允许从 JUnit 测试中调用 GWT.create。返回
Mockito mocks。

使用:

public class MyWidget extends Composite {
  interface MyUiBinder extends UiBinder<Widget, MyWidget> {}
  private final MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
  @UiField Label numberLabel;
  private final NumberFormatter formatter;
  public MyWidget(NumberFormatter formatter) {
    this.formatter = formatter;
    initWidget(uiBinder.createAndBindUi(this);
  }
  void setNumber(int number) {
    numberLabel.setText(formatter.format(number));
  }
}

GwtMockito 官网

http://google.github.io/gwtmockito/

相关编程语言

提到 EclEmma 首先就要说到著名的 Java 覆盖测试工具...
Solex是一个WEB应用测试用的Eclipse插件。Solex可以...
Apache为我们提供了一个强大的工具 Cactus!它是一套...
Google C Testing Framework是Google公司用来在各种...
JdbcProxy 是 SourceForge 上一个开源的 Java 项目,...
Ripplet是一款负载测试工具,特征如下: 1)基于Apa...