Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
Executing junit tests with differing classpaths

Executing junit tests with differing classpaths

2005-06-26       - By Stefan Bodewig
Reply:     1     2     3  

On Sun, 26 Jun 2005, Simon Kitching <skitching@(protected)> wrote:

> Am I right in thinking that the <junit> task provides no way for the
> classloader setup in the forked JVM to be tweaked before the test is
> executed?

Not sure.  You can pass a <classpath> to the forked VM.  You could
turn your current classloader-logic into an Ant task that creates a
Path reference, something like

<create-classpath forTest="testclass" useId="first-batch"/>
<junit classpathref="first-batch" ....>

> If so, would anyone be interested in extending Ant with a hook to
> allow this? I *think* it's just a matter of providing the <junit>
> task with an attribute "testRunnerClass" which defaults to
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner rather
> than hardwiring that string into the JUnitTask class.

Something like this is way down on my TODO list, so I'd be glad if
anybody else picked it up.  In my case it is as a way to provide a
JUnit 4 Testrunner.

It's not that simple, though.  Ant's TestRunner is responsible for
routing events to the formatters, for example.  So we can't take an
arbitrary test-runner, we do have some additional requirements.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.