has someone here experiences with GWT SyncProxy?
I try to test an asynchronous rpc, but the code under onFailure and onSuccess is not tested. Unfortunately there is no error log, but maybe someone can help me. The example is from this page: http://code.google.com/p/gwt-syncproxy/
Edit:
I want that the test fails. So i added 'assertNull(result);'. The strange thing is that the console gives as result first 'async good' and after that 'async bad'. So the function is running twice?! And Junit gives as result green.
public class Greeet extends TestCase {
@Test
public void testGreetingServiceAsync() throws Exception {
GreetingServiceAsync rpcServiceAsync = (GreetingServiceAsync) SyncProxy.newProxyInstance(
GreetingServiceAsync.class,
"http://127.0.0.1:8888/greettest/", "greet");
rpcServiceAsync.greetServer("SyncProxy", new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
System.out.println("Async bad " );
}
public void onSuccess(String result) {
System.out.println("Async good " );
assertNull(result);
}
});
Thread.sleep(100); // configure a sleep time similar to the time spend by the request
}
}