ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Martin <jeff.mar...@synamic.co.uk>
Subject RE: [PATCH]Pre and Post targets for junit
Date Thu, 05 Oct 2000 13:43:12 GMT
This is probably due to the way I've been using testsuites in the past.
Surely if you want to have something that runs before and after the whole of
your tests you can just  do this using the target tag like so

<target name="tests" depends="pre_test,the_tests,post_tests" />

-----Original Message-----
From: Dirk Weigenand [mailto:Dirk.Weigenand@oracle.com]
Sent: 05 October 2000 13:56
To: ant-dev@jakarta.apache.org
Subject: Re: [PATCH]Pre and Post targets for junit


Jeff Martin <jeff.martin@synamic.co.uk> writes:

Hello Jeff,

> This patch adds the attributes pretarget and posttarget to the test and
> batchtest tags for the junit task.
> 
> The targets will be run before and after each test.

Mmh, i don't think this is not quite what i was reffering to. I was talking
about setting the scene for a whole test suite (though you can have one in a
single class).

I meant starting a server before running the tests and stopping it
afterwards. So the granularity of your patch is way too fine. This could be
accomodated by adding <setUp> and <tearDown> elements to the junit task.

Pre- and Posttargets as you call them are already in the junit (3.2)
package. Have a look at the TestDecorator class. I think it has already
setUp
and tearDown to set the fixture for a test and tear it down when run.

regards,
        Dirk 

Mime
View raw message