ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Surette <psure...@espial.com>
Subject RE: Is there any way to run a single test _method_ with <junit> ?
Date Fri, 08 Feb 2002 22:11:03 GMT
Thanks for the info, but no, I cannot solve
my problem that way. The problem is that things
are left lying around the classloader. Actually
I am using URL.setContentHandlerFactory, which
can only be called once per VM, to load a 3rd
party library. The problem is that the library
holds onto stuff between test runs in some static
variables which are hidden from me (private).

-----Original Message-----
From: Ylan Segal [mailto:ylan@digiworks.tv]
Sent: Friday, February 08, 2002 4:54 PM
To: Ant Users List
Subject: RE: Is there any way to run a single test _method_ with <junit>
?


Phil,
> The reason I want to do this is that there is some static
> cruft left around by a class used by the tests which
> messes up subsequent tests, so I'd like to run each
> test method separately with fork='true'.
>
As do not think that you can do what you want, but there is a little bit of
hope. Each time a test method is run, the setUp method is called before and
the tearDown methods after.
This means that whatever happens in one test, should not ruin the others,
because you can take care of cleaning in the tearDown.

For example, when I write test form some classes that access a database and
need data in place in the database, I insert the data in the setUp method,
and then clean it up in the tearDown method. This way, the initial data in
the db is exactly the same for all the test methods.

Does any of this help you? Does it make sense?

Happy Debugging!.

Ylan Segal.



--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message