If you want to have one instance of Turbine used for all the test cases you
need to use the junit.extension.Setup class like the example on the tdk
site.  The drawback is you'll need an AllTest test case that sets up the
extension and adds all the tests that need Turbine started.  This means you
can't run those tests individually since Turbine won't be started.

Are you are forking junit, so each test case has a new jvm, and thus the
static initializer doesn't by you anything?  BaseTest.setUp shouldn't mess
with the suite method.  I might be confused, but it sounds like something
isn't quite right.

=================================================================
Jeffrey D. Brekke                                   Quad/Graphics
[EMAIL PROTECTED]                              http://www.qg.com


> -----Original Message-----
> From: Stephen Haberman [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 19, 2002 5:17 PM
> To: 'Turbine Maven Users List'
> Subject: RE: junit fixtures
> 
> 
> Everything is working surprisingly well now that I'm calling
> TurbineConfig.init instead of just Torque.init. :-)
> 
> I can't use inheritance of either the static initializer or setUp
> because then the init code gets called once for every test case. (I
> thought it worked, until then I set the logs to append=true and the
> services get inited three times, once for every test class I have).
> 
> And even if Turbine is inited by one test case (say the first one that
> gets run), the next (non-child) test case won't see it and 
> throw errors
> saying services/log appenders can't be found.
> 
> For the init code to be called only once per maven:test, I 
> have to use a
> BaseTest that overrides the suite method so that the init 
> code is called
> in BaseTest.setUp, then all of the suites are executed at once in the
> same context that BaseTest.setUp was run in.
> 
> I know it's weird, but if the tests are in a different test case were
> Turbine is not explicitly inited for them, it seems JUnit unloads the
> previously-inited Turbine stuff. I don't know the innerworkings of
> JUnit, but it seems to be doing some funny class loading stuff and not
> just reflection? I don't know.
> 
> - Stephen
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to