ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Michali <...@cisco.com>
Subject Re: Using TestSetup in JUnit with Ant (was: How to set a property from a custom task?)
Date Thu, 20 Sep 2001 21:19:35 GMT
> > Timothy Shadel wrote:
> > [The following link is on info about using TestSetup to perform one time
> >  action for all tests]
> > http://junit.sourceforge.net/doc/faq/faq.htm#How%20do%20I%20run%20setup%20code%20only%20once


> I Wrote:
> Will that work, given that I'm running JUnit from Ant and letting JUnit
> find all my test cases via Reflection? If not, is there a way to do this?


Timothy Shadel then wrote:

> [info on building suites from test cases and suites from suites...]
> ...
> 
> I'm pretty sure you could wrap your test case classes using the TestSetup class described
in the first URL, and where it said "...add your tests and suites here... ", you could use
the methods above (e.g. TestSuite suite= new TestSuite(MoneyTest.class);) to allow Java Reflection
to figure out which tests to run.

I thought the way JUnit worked was that it used to reflection to find
all Test classes
and test methods and then invoked the test methods (ones that start with
test...). In
that case, if I override TestCase with TestSetup, will JUnit use that or
will it just
grab and run the tests (thus not running the TestSetup.setup() method)?

Has anyone done this? I'd like to find out before I make the decision to
alter my
test suite (as I trying to figure out how to either do this with a
custom Task in Ant
or through the JUnit suite itself).


PCM (Paul Michali)

Carrier Voice Gateway Business Unit (CVGBU)
Cisco Systems, Inc.
250 Apollo Drive
Chelmsford, MA 01824

Phone : (800) 572-6771 x 45817  (978) 244-5817 [direct]
Paging: (800) 365-4578 [voice]  pcm@epage.cisco.com [email page]

Mime
View raw message