I assume that your class understands all the command line argumentsMy class is just a bootstrap that do some classloading stuff regarding my application and then invokes the main class (JUnitRunner) with the parameteres it received in the first place.
Ant's testrunner uses and passes them along. How would your class
deal with new arguments we add?
The main problem with opening up access to the test runner class isI agree 100% with you on this, it is just that I need to take control "before" the main class is executed, actually I build a classloader where the main class (Runner) is loaded and executed.
just that. As soon as we do it, we run the risk of breaking other
people's builds when we change the protocol between the task and the
test runner. There is no danger now, as we always know the main class
that gets invoked.
I know this is a quite unique situation but I just wanted to expose my case to see if it is so unique that is ok that I handle it myself only. I have patched JUnitTask to specify another main class that I built that ultimately call JUnitRunner as usual.
I have scripts since they always have problems with different OS, etc, that was the first option, but I end up having 3 bash processes wrapping java.1) leave <junit forked="true" jvm="launcher"> and have "launcher"
script change the command line
Ugly but portable accross Ant versions.
what you can do to support extension of JUnit is to leave a hook to alter the commandline, this way I can do whatever I need directly before invoking the runner. You could just leave a method protected so I can extend it and alter the command line in a custom task.2) patch junit to allow me to put a boot class
3) extend junit (the problem is that JUnitTask.executeAsForked and
commandline are private, so I should patch the task anyway)
Thanks a lot for the attention,
MAriano
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]