I've been working on adding forking to the surefire plugin, really into the surefire package, in order to allow clover to work and to allow our implementation to offer features similar to those provided by the JUnit Ant task

I've run into a number of problems:

1) on windows using both plexus.util.cli and runtime.exec I haven't been able to construct classpaths containing embedded spaces - my repo is located at c:\documents and settings\user\.m2\repository and so the 1st reference to a jar in the repo is causing the exec to fail - it doesn't matter if i wrap the classpath specification in double quotes or not

does anybody have any experience setting classpath as an environment variable on runtime.exec()? if that would work it might be a work around for setting classpath in the args list in CommandLine or runtime.exec()

2) the Surefire class uses a custom classLoader IsolatedClassLoader, which lives in the surefire-booter subproject, In the method instantiateReports the interface org.codehaus.surefire.report.Reporter is used as a cast for the concrete implementation classes which implement the Reporter interface. They are explicitly loaded with the custom classloader and the cast is causing a ClassCastException because the Reporter class is declared in the Surefire class and it is being loaded by the application class loader. Since the classes are loaded by different ClassLoaders they are not related. This strange behavior is a function of Java's class loading strategy which actually creates sets of namespaces which are distinguished by class/classloader pairs.

Given the previous explanation, does the following seem workable? Using the classes ThreadedExecutor, ThreadFactory, FutureResult and Callable from Doug Lea's concurrency package construct a mechanism for Surefire so that it can run in a thread whose contextClassLoader is an IsolatedClassLoader and which can produce a result object or throw an exception.

I'd appreciate feedback.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to