GWT 应用测试工具 GwtMockito

码农软件 · 软件分类 · 测试工具 · 2019-11-22 15:43:09

软件介绍

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));
  }
}


本文地址:https://codercto.com/soft/d/19555.html

Docker从入门到实战

Docker从入门到实战

黄靖钧 / 机械工业出版社 / 2017-6 / 69.00元

本书从Docker的相关概念与基础知识讲起,结合实际应用,通过不同开发环境的实战例子,详细介绍了Docker的基础知识与进阶实战的相关内容,以引领读者快速入门并提高。 本书共19章,分3篇。第1篇容器技术与Docker概念,涵盖的内容有容器技术、Docker简介、安装Docker等。第2篇Docker基础知识,涵盖的内容有Docker基础、Docker镜像、Dockerfile文件、Dock......一起来看看 《Docker从入门到实战》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

在线进制转换器
在线进制转换器

各进制数互转换器

html转js在线工具
html转js在线工具

html转js在线工具