<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          GwtMockitoGWT 應用測試工具

          聯合創(chuàng)作 · 2023-10-01 17:49

          GwtMockito 是 GWT 應用測試工具。

          使用 GWTTestCase 測試 GWT 應用會比純 Java 測試慢,而且不能使用基于反射的工具,比如模擬測試框架。如果嘗試使用常規(guī)測試示例,那么會遇到這個錯誤:

          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));
            }
          }
          
          瀏覽 22
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  影音先锋成人视频 | 精品视频在线观看免费 | 日韩中文字幕网 | 欧美日韩国产中文精品字幕自在 | 18禁黄无码一区二区免费网站 |