And if one wants a protocol using overriden functions, one has to have
an @Before that uses a static boolean to make it run once. 

> -----Original Message-----
> From: Christopher Moesel [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 19, 2007 7:26 AM
> To: [email protected]
> Subject: RE: Junit 4 versus us
> 
> Yes, I've found that any code I want only to run once (per 
> test class) needs to go in a static block outside the 
> constructor.  That way it only gets processed the first time 
> the JVM loads the class.
> 
> -Chris
> 
> -----Original Message-----
> From: Benson Margulies [mailto:[EMAIL PROTECTED]
> Sent: Saturday, November 17, 2007 1:02 PM
> To: [email protected]
> Subject: Junit 4 versus us
> 
> 
> We have a fair number of junit tests that have code in their 
> constructor
> that should only be run once.
>  
> Imagine my surprise to discover that this is really not a good idea,
> since JUnit reconstructs for each test function.
>  
> 

Reply via email to