Wednesday, January 21, 2009

Creating Unit Tests in Eclipse

In eclipse, with Designer, you can create a unit test with New -> Other -> Designer -> GWT -> JUnit Test Case

Choose the class you want to test.

This will create a source directory called src-test, the test case which extends GWTTestCase? , and it willl automatically add the module name for you.

Add the jar gwt-dev-windows.jar in the GWT distro to your classpath.

To run from within eclipse, you can just choose "Run as GWT Junit Test"

To run from ant, make sure the source and test source directories are on the classpath.

Example ant file:

  































No comments: