okay, to summarize: 1- we want non static one time setup and tear down 2- we want to be able to run a single test case from eclipse ui, but eclipse does not cares and run all of the tests in the suite 3- we try to avoid switching to testNG, which would fill our expectations if we choose the correct (outdated) version, but forces to get completely rid of junit 4- we don't mind using Junit3 or Junit4 as long as it works
About 2), I found a reason, there's a bug in eclipse's Junit4 plugin when running in Juni3 compatibility mode. If so, and you try to run a single test case from a Junit3 test class, eclipse will run all the others and show them under a tree node called "unrooted tests". The solution (workaround) is to stick to Junit3 AND eclipse's Junit3 plugin. This way it all works perfectly. If nobody has a strong argument against that, that'd be it. Otherwise we're all ears. Cheers, Gabriel On Friday 11 April 2008 08:34:37 am Andrea Aime wrote: > Gabriel Roldán ha scritto: > ... > > >>> Question: will we be able to do the setup in the base class alone? Or > >>> is this something that individual tests will need to know about? > >> > >> No, unfortunately it's not possible. With junit4 I did not manage to > >> get it fully working (one time tear down I cannot define, so the > >> subclass would have to manually invoke it), with junit3 you have > >> to define that suite() method and the comment it out each time > >> you have to run a single test (otherwise due to the suite() method > >> being there, you end up running them all anyways). > > > > here is where I'm getting lost. I can swear I can run a single test case > > from ArcSdeDataStoreTest inside eclipse, even if it uses the junit3 > > "static suite() returns wrapper" approach, since suite() is not called at > > all when running a single test from inside eclipse, I just need to check > > in the normal setUp() if the one time setup initialization was done and > > if not just call it. > > Don't know. Try for yourself with the project I sent. On my PC Eclipse > first run the chosen test, then runs all of the others as "unrooted > tests" (which it places in a subnode, never knew the junit view was > in fact a tree). > > >> So yeah, so far an unsatisfactory situation. I'm hoping Gabriel, > >> by the power of the unit testing book he ate, will find a better > >> solution. > > > > If the above does not work I'm out of ideas, but I still don't understand > > why it doesnt. Anyways, I'll give a try at the examples you sent tomorrow > > morning and we can talk in real time. > > Excellent > Cheers > Andrea > > !DSPAM:4045,47ff0687149841030819293! ------------------------------------------------------------------------- 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
