Help with GWTTestCase and GWT-RPC

138 views
Skip to first unread message

Mike Dee

unread,
Jun 12, 2012, 2:18:49 PM6/12/12
to google-we...@googlegroups.com
I'm having trouble getting a basic GWTTestCase running with a simple GWT-RPC.  Here is what it looks like.  What am I doing wrong.

Note that when the test is run the callback's onFailure() is called with a 404 error detail.

public class Test2 extends GWTTestCase
{
@Override
public String getModuleName()
{
return "com.test.app.MyApp";
}

public void testTwo()
{
System.out.println( "Test2 starting." );
MyServiceAsync srv = GWT.create( MyService.class );
DoitCallback doitCallback = new DoitCallback();
srv.doit( doitCallback );
delayTestFinish( 10000 );
System.out.println( "Test2 ending." );
}
/**
 * 
 */
private class DoitCallback extends AsyncCallback<String>
{
public void onFailure( Throwable caught )
{
assert false;
caught.printStackTrace();
}

public void onSuccess( String results )
{
System.out.println( results );
finishTest();
}
}
}

Mike Dee

unread,
Jun 12, 2012, 3:56:29 PM6/12/12
to google-we...@googlegroups.com
Figured it out.  Needed to add this to the module.gwt.xml file on order for the service servlet to run.

<!-- Specify the path to any remote services.                   -->
<servlet path="/myService" class="com.test.app.MyService" />

Found this out here:


Reply all
Reply to author
Forward
0 new messages