ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wunderlich, Patrick" <Patrick.Wunderl...@3SOFT.de>
Subject [Junit] <formatter type="xml" /> throws NullPointerException
Date Fri, 21 Oct 2005 10:57:15 GMT
Hey Ant users and friends!
 
I've a strange problem using the junit ant task.
Everything works fine, but when i add <formatter type="xml" />
i get following Exception:
 
    [junit] Exception in thread "main" java.lang.NullPointerException
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.for
matOutput(XMLJUnitResultFormatter.java:253)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.set
SystemOutput(XMLJUnitResultFormatter.java:92)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.sendOutAndE
rr(JUnitTestRunner.java:435)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTe
stRunner.java:319)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUni
tTestRunner.java:672)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitT
estRunner.java:567)

=== code snippet form XMLJUnitResultFormatter ===

private void formatOutput(String type, String output) {
    Element nested = doc.createElement(type);
    rootElement.appendChild(nested);
    nested.appendChild(doc.createCDATASection(output));
}

=== code snippet form XMLJUnitResultFormatter ===
 
"doc" is null! There seems to be a problem with xml processing...
I've tested this with JDK 1.4.2_08 and 1.5.0_04 under WinXP.
Ant-Version: 1.6.5
 
Any hints?
 
Kind Regards,
Patrick Wunderlich (Germany)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message