Andrea Aime ha scritto: > Hi, ... > Glub... any better idea? Hum, I managed to get it sort of working using only junit3. I realized I could keep only the applicationContext and TestData fields as static, and setup/teardown would stay non static, but access the two static fields (which no subclass has legitimate needs to override). Basically, setup creates the static fields, and teardowns decides whether to kill them or not based on a method that provides a data/config modification flag.
However, there is a big downside for this approach... since the static field is the same (same base class), under surefire the same data dir will be used for all tests (even of different classes). Any idea of how to fix this??? I've tried this on two different configurations. One is a single test of WFS, GetFeatureTest. Testing in eclipse using a main with a text based test runner, the time went down from 11s to 9s. Eek, less than 20% gain! Looking with a profiler the problem became quite easy to spot: what's killing us in tests is classloading and JAI initialization, which happens one time anyways. Yet, doing the same for the whole wcs1_1 package (which only does read only tests so it was easy to change) I got a nice speedup, the whole "mvn test" went down from 54 seconds to 28s, which is sort of the gain I was hoping for (in this case the same VM is used for all the tests, so classloading is payed just once for _all_ the tests). So ok, it seems there is some goodness in one time initialization, the problem is getting it right, so that the static fields are wiped out when the suite for the current class is done. Hmmm.... ideas? :) Cheers Andrea ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Geoserver-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-devel
