Hello,
I tried to made some unit tests useing smartGWT, code here:
public class GWTServicesTest extends GWTTestCase {
private static final String USERNAME = "mcristescu";
private static final String PASSWORD = "marius";
@Override
public String getModuleName() {
return "com.core.CoreModule";
}
public void testLogin() {
DMI.call("name", "com.core.server.DatabaseService", "getUser", new RPCCallback() {
@Override
public void execute(RPCResponse response, Object rawData, RPCRequest request) {
assertNotNull(rawData);
}
}, new Object[] { USERNAME, PASSWORD});
}
}
but is not working.What is wrong in my code? How can I write some unit tests for smartGWT services? I received the following exception:
Exception in thread “JS executor for com.gargoylesoftware.htmlunit.WebClient@3bc5cc” java.lang.NoSuchMethodError: com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(Lcom/gargoylesoftware/htmlunit/html/HtmlPage;Lnet/sourceforge/htmlunit/corejs/javascript/Function;Lnet/sourceforge/htmlunit/corejs/javascript/Context;Lnet/sourceforge/htmlunit/corejs/javascript/Scriptable;Lnet/sourceforge/htmlunit/corejs/javascript/Scriptable;[Ljava/lang/Object;)Ljava/lang/Object;
at com.google.gwt.dev.shell.HtmlUnitSessionHandler.invoke(HtmlUnitSessionHandler.java:223)
at com.google.gwt.dev.shell.BrowserChannelClient.reactToMessages(BrowserChannelClient.java:214)
at com.google.gwt.dev.shell.BrowserChannelClient.process(BrowserChannelClient.java:149)
at com.google.gwt.dev.shell.HostedModePluginObject.connect(HostedModePluginObject.java:188)
at com.google.gwt.dev.shell.HostedModePluginObject$ConnectMethod.call(HostedModePluginObject.java:60)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1701)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:854)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:429)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:267)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3183)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:538)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:589)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:545)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:520)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:896)
at com.gargoylesoftware.htmlunit.javascript.background.JavaScriptFunctionJob.runJavaScript(JavaScriptFunctionJob.java:53)
at com.gargoylesoftware.htmlunit.javascript.background.JavaScriptExecutionJob.run(JavaScriptExecutionJob.java:84)
at com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl.runSingleJob(JavaScriptJobManagerImpl.java:313)
at com.gargoylesoftware.htmlunit.javascript.background.JavaScriptExecutor.run(JavaScriptExecutor.java:148)
at java.lang.Thread.run(Thread.java:662)