1.) use https://code.google.com/p/gwt-syncproxy/ 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 google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment