ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
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 <mariano@fuegolabs.com> 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();

to

    private CommandlineJava commandline = newCommandlineJava();

with

    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.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message