ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephane Bailliez" <>
Subject Re: JUnit task: setUp() called before every test method
Date Sun, 16 Dec 2001 15:45:30 GMT
"Guillory, Stanford" wrote:

> I am using the junit task. However, I am noticing that the
> setUp() method of my TestCase classes is being called
> before every testX() method in the class, as opposed to
> once before all the testX() methods are called.

Depends on the case.
Since you are probably setting values or whatever in each test method, I
would not want to reconfigure it each time the object I'm testing or get an
unstable object. the setUp method does this for you otherwise you could
inherit values from a preceding test method and since the order of
introspection depends on the JVM (for instance IBM does the reverse of Sun)
you can obviouslly get interesting results....

> This appears quite wrong, but I haven't looked into whether
> it's an ant junit task thing or a junit thing. Any ideas

As designed. See JUnit FAQ. do I run setup code only


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message