我正在编写一个简单的测试类,为使用UiBinder创建的组件扩展GwtTestCase,并且使用mvn gwt:test
运行失败,如下所示。
问题类似于:How to test a gwt composite component with ui binder using GwtTestCase?;对于未使用UiBinder创建的组件的其他测试在当前项目配置下运行正常。
user.agent
包含gecko1_8
。我尝试使用-Dgwt.args="-war www-test -runStyle HtmlUnit:IE8"
从IntelliJ运行,但我遇到了另一个问题(net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot read property "__gwtDevModeHook:com.mypackage.MyEntryPoint.Junit"
)。
[INFO] Caused by: java.lang.Exception: com.google.gwt.core.client.JavaScriptException: (null) @com.google.gwt.dom.client.DOMImplStandard::isOrHasChild(Lcom/google/gwt/dom/client/Node;Lcom/google/gwt/dom/client/Node;)([JavaScript object(29), JavaScript object(30)]): null
[INFO] at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
[INFO] at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
[INFO] at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
[INFO] at com.google.gwt.dev.shell.ModuleSpace.invokeNativeBoolean(ModuleSpace.java:194)
[INFO] at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeBoolean(JavaScriptHost.java:35)
[INFO] at com.google.gwt.dom.client.DOMImplStandard.isOrHasChild(DOMImplStandard.java)
[INFO] at com.google.gwt.dom.client.Node$.isOrHasChild$(Node.java:280)
[INFO] at com.google.gwt.user.client.ui.HTMLPanel.addAndReplaceElement(HTMLPanel.java:220)
[INFO] at com.google.gwt.user.client.ui.HTMLPanel.addAndReplaceElement(HTMLPanel.java:190)
[INFO] at com.mypackage.client.widgets.ScreenHeader_ScreenHeaderUiBinderImpl$Widgets.build_f_HTMLPanel1(ScreenHeader_ScreenHeaderUiBinderImpl.java:128)
[INFO] at com.mypackage.client.widgets.ScreenHeader_ScreenHeaderUiBinderImpl$Widgets.get_f_HTMLPanel1(ScreenHeader_ScreenHeaderUiBinderImpl.java:112)
[INFO] at com.mypackage.client.widgets.ScreenHeader_ScreenHeaderUiBinderImpl$Widgets.access$0(ScreenHeader_ScreenHeaderUiBinderImpl.java:111)
[INFO] at com.mypackage.client.widgets.ScreenHeader_ScreenHeaderUiBinderImpl.createAndBindUi(ScreenHeader_ScreenHeaderUiBinderImpl.java:33)
[INFO] at com.mypackage.client.widgets.ScreenHeader_ScreenHeaderUiBinderImpl.createAndBindUi(ScreenHeader_ScreenHeaderUiBinderImpl.java:1)
[INFO] at com.mypackage.client.widgets.ScreenHeader.<init>(ScreenHeader.java:38)
[INFO] at com.mypackage.client.widgets.ScreenHeaderGwtTest.testConstructor(ScreenHeaderGwtTest.java:12)
[INFO] at com.mypackage.client.widgets.__ScreenHeaderGwtTest_unitTestImpl.doRunTest(__ScreenHeaderGwtTest_unitTestImpl.java:7)
[INFO] at junit.framework.TestCase.runTest(TestCase.java:62)
[INFO] at com.google.gwt.junit.client.GWTTestCase.runBare(GWTTestCase.java:188)