ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: can I change junit runner main class
Date Wed, 11 Feb 2004 11:54:05 GMT
On Tue, 10 Feb 2004, Mariano Benitez <> wrote:

> another option would be to let people extend CommandLineJava and
> overwrite the method getCommandLine() to change the arguments, so I
> can customize my command line while you maintain the contract of
> JUnitRunner.

This sounds simple to do inside the task, simply change

    private CommandlineJava commandline = new CommandlineJava();


    private CommandlineJava commandline = newCommandlineJava();


    protected CommandlineJava newCommandlineJava() {
        return new CommandlineJava();

well, maybe a bit more than that to avoid invoking overridden methods
before the constructor has been through.  But this would solve the
situation for you.

While we are at it, we may as well review the JUnitTask to see whether
we should change some other things, now that we'd consider subclassing
the task something we expect to happen.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message