Thursday, June 27, 2013

Re: Running GWT JUNIT programatically

Phew no idea. But if you just want to test your RemoteService implementation then you could:

1.) use to access your GWT RemoteServie through ordinary Java = pure JUnit TestCase.
2.) refactor your RemoteService implementation so that it does not depend on servlets so you can unit test it more easily, e.g.

PersonServiceServlet extends RemoteServiceServlet {

  private PersonService service = //... initialize with testing in mind

  public Person getPerson() {
    return service.getPerson();


In addition you could write a generic TestCase that scans your classpath for GWT-RPC services and then tests all classes involved if they meet GWT-RPC requirements, e.g. implement Serializable, no-arg default constructor present, no final fields, all fields are serializable themselves.

I think that way you can completely avoid GWTTestCase unless you want to test the communication itself (which I assume is already tested by GWT itself).

-- J.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment