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

CSS商业网站布局之道

CSS商业网站布局之道

朱印宏 / 清华大学出版社 / 2007-1 / 75.00元

本书是一本CSS技术专著。 主要从布局角度全面、系统和深入地讲解CSS在标准网站布局之中的应用。很多读者经过初步的学习之后就能够使用CSS设计出一些漂亮的网页样式,于是便乐在其中,踌躇满志,这是好事,但千万不要自我陶醉,因为你还未领略CSS的博大精深。用CSS容易,难的是全部都用CSS。CSS的精髓是布局,而不是样式,布局是需要缜密的逻辑思维和系统设计的,而样式只需要简单地编写代码或复制即可。本书......一起来看看 《CSS商业网站布局之道》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具