Changes the internals of how JUnit works.  Previously, each individual test class would run in its own compilation and do a fresh page load.  Methods within that class would run within a single compilation and page load.  Now, an entire GWT module is compiled, which is capable of running any GWTTestCase class in that entire module.  This means any Suite containing classes all from the same GWT module can run entirely in a single compilation.  This ends up being much more efficient-- CompilerSuite can run in around 40 seconds in web mode or hosted mode; it would have taken several minutes before.

Implementation notes:

- Prevously, GWTTestCase had dual responsibility for 1) running its own method by name String and 2) handling onModuleLoad and driving the client-side listening process.  I split this responsibility into two classes with separate rebinds.  GWTRunner now handles onModuleLoad and the drives the whole process, handling all RPCs.  The class is also rebound and generated so that it can serve as a factory for instantiating new GWTTestCase subclasses by fully-qualified name String.  GWTTestCase subclasses are still rebound and generated to perform the run-by-method-name.

- The server-side RPC had to be refactored to return a class name AND a method name to the client.  Previously, the class name was implied by the compilation.

A few other changes in this patch:

- I removed the hackish ModuleDefLoader.forceInherits stuff which we'd been using to shoehorn the JUnit inclusion into other modules.  The new pattern is to create a synthetic module and have it inherit both JUnit and the user's module.  If a user runs the module "com.example.Foo", the synthetic module will be named "com.example.Foo.JUnit".  This has the additional nice feature that it allows compilations to be cached.

- I removed ModuleDefLoader.enableCaching because it's always on now anyway, and Toby made the necessary changes to CacheManager to make it safe.

- GWTShellServlet's call to loadModule does not actually need to refresh on the first load.  It doesn't refresh on subsequent accesses, and there's nothing particularly special about the first one.

Review by: tobyr (TBR, partial), mmendez


git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1817 8db76d5a-ed1c-0410-87a9-c151d255dfc7
20 files changed