【发布时间】:2012-04-19 07:45:15
【问题描述】:
我有简单的测试用例:
@Test
public void test() throws Exception{
TableElement table = mock(TableElement.class);
table.insertRow(0);
}
其中 TableElement 是 GWT 类,其方法 insertRow 定义为:
public final native TableRowElement insertRow(int index);
当我启动测试时,我得到:
java.lang.UnsatisfiedLinkError: com.google.gwt.dom.client.TableElement.insertRow(I)Lcom/google/gwt/dom/client/TableRowElement;
at com.google.gwt.dom.client.TableElement.insertRow(Native Method)
我认为这与本机的 insertRow 方法有关。是否有任何方法或解决方法可以使用 Mockito 模拟此类方法?
【问题讨论】:
标签: java gwt mockito native-methods