ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 28474] New: - JUnitResultFormatter throws BuildException due to classloading issues
Date Mon, 19 Apr 2004 17:51:29 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28474>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28474

JUnitResultFormatter throws BuildException due to classloading issues 

           Summary: JUnitResultFormatter throws BuildException due to
                    classloading issues
           Product: Ant
           Version: 1.6.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: cthiele@ct42.de


In case of loading junit task and junit.jar with its own clasloader (using
taskdef) and junit runs inJVM (no fork) an exception occurs:

-----------------------------------------------------------------------------
org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter is not a
JUnitResultFormatter
        at
org.apache.tools.ant.taskdefs.optional.junit.FormatterElement.createFormatter(FormatterElement.java:254)
        at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTask.java:987)
        at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:663)
        at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:637)
-------------CUT -----------------

The reason should be in line 253 of FormatterElement.java:

253:        if (!(o instanceof JUnitResultFormatter)) {
254:            throw new BuildException(classname
255:                + " is not a JUnitResultFormatter");
256:        }

JUnitResultFormatter and o will be loaded by different classloaders in the
described scenario.

Setting fork to true will be a workaround.

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


Mime
View raw message