You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Cumbers <rl...@kent.ac.uk> on 2005/01/14 18:59:54 UTC

Define order of tests

Hey guys

I have a need to specify the order in which the tests for cactus are 
executed as one class I have defines retrieving data from the database, 
and another class defines storing data to the database. I would like the 
class that retrieves data to be run first, allowing this class to be 
'verified' as returning the correctly requested data. Then I would like 
to run the 'storing' class and then as a test of that use the 
'retrieving' class to verify that the stored data was indeed stored. I 
am using ant integration if that is on any assistance.

Cheers

Rich

RE: Define order of tests

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Rich,

Just use the Suite feature of JUnit. See the JUnit FAQ.

Basically you create a suite in a static suite() method and add the tests
you wish to the suite, in the order you wish to execute them.

All that said, it's not good to have any order (tests should be independent
of each other) and I don't understand why you absolutely need one. You could
use a fixture instead, ensuring that each tests has a correct setup before
it runs.

Thanks
-Vincent

> -----Original Message-----
> From: Cumbers [mailto:rlc5@kent.ac.uk]
> Sent: vendredi 14 janvier 2005 19:00
> To: Cactus Users List
> Subject: Define order of tests
> 
> Hey guys
> 
> I have a need to specify the order in which the tests for cactus are
> executed as one class I have defines retrieving data from the database,
> and another class defines storing data to the database. I would like the
> class that retrieves data to be run first, allowing this class to be
> 'verified' as returning the correctly requested data. Then I would like
> to run the 'storing' class and then as a test of that use the
> 'retrieving' class to verify that the stored data was indeed stored. I
> am using ant integration if that is on any assistance.
> 
> Cheers
> 
> Rich
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org