Boa noite pessoal,
estou com um problema difícil. Eu quero aplicar testes automatizados em uma aplicação GWT, com componentes da API SmartGWT. Criei uma classe de teste do GWT (GWTTestCase) que funciona muito bem quando a classe testada possui somente componentes do GWT. Porém, quando coloco um componente do SmartGWT e tento fazer o bind do template com a classe, ele acusa o seguinte erro:
O interessante, é que a aplicação funciona normalmente, ou seja, a dificuldade está em instanciar classes do GWT no ambiente de testes. A stack completa do erro é essa:
java.lang.RuntimeException: Remote test failed at 10.1.1.79 / Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0
at com.google.gwt.junit.JUnitShell.processTestResult(JUnitShell.java:1288)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1408)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1309)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:653)
at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:441)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:296)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.Exception: com.google.gwt.core.client.JavaScriptException: (ReferenceError): $debox is not defined
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.smartgwt.client.widgets.IButton.create(IButton.java)
at com.smartgwt.client.widgets.BaseWidget.getOrCreateJsObj(BaseWidget.java:361)
at com.smartgwt.client.widgets.layout.Layout.addMember(Layout.java:1129)
at com.smartgwt.client.widgets.layout.Layout.addMember(Layout.java:1117)
at org.synthful.smartgwt.client.HasWidgetsUtil.add(HasWidgetsUtil.java:40)
at org.synthful.smartgwt.client.widgets.UIVLayout.add(UIVLayout.java:20)
at br.com.sonner.client.patrimonio.ui.relatorio.cadastro.fichacadastral.FichaCadastralReportView_FichaCadastralReportViewUiBinderImpl.createAndBindUi(FichaCadastralReportView_FichaCadastralReportViewUiBinderImpl.java:20)
at br.com.sonner.client.patrimonio.ui.relatorio.cadastro.fichacadastral.FichaCadastralReportView_FichaCadastralReportViewUiBinderImpl.createAndBindUi(FichaCadastralReportView_FichaCadastralReportViewUiBinderImpl.java:1)
at br.com.sonner.client.patrimonio.ui.relatorio.cadastro.fichacadastral.FichaCadastralReportView.<init>(FichaCadastralReportView.java:28)
at br.com.sonner.client.patrimonio.ui.relatorio.cadastro.fichacadastral.GwtTestFichaCadastralBem.gwtSetUp(GwtTestFichaCadastralBem.java:20)
at com.google.gwt.junit.client.GWTTestCase.setUp(GWTTestCase.java:255)
at com.google.gwt.junit.client.GWTTestCase.runBare(GWTTestCase.java:187)
at com.google.gwt.junit.client.GWTTestCase.__doRunTest(GWTTestCase.java:129)
at com.google.gwt.junit.client.impl.GWTRunner.runTest(GWTRunner.java:389)
at com.google.gwt.junit.client.impl.GWTRunner.doRunTest(GWTRunner.java:318)
at com.google.gwt.junit.client.impl.GWTRunner.access$9(GWTRunner.java:312)
at com.google.gwt.junit.client.impl.GWTRunner$TestBlockListener.onSuccess(GWTRunner.java:107)
at com.google.gwt.junit.client.impl.GWTRunner$InitialResponseListener.onSuccess(GWTRunner.java:63)
at com.google.gwt.junit.client.impl.GWTRunner$InitialResponseListener.onSuccess(GWTRunner.java:1)
at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:232)
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:220)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
at java.lang.Thread.run(Thread.java:662)