Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

invalid testsuite XML document for junitreport task

843785Dec 27 2008 — edited Dec 27 2008
Hi everyone, I'm new to this forum and apologies if this is the incorrect place for me to post this thread. Basically I'm having some issues with the junitreport task with my junit test project.

I have a dummy class called Money and dummy test suite called MoneyTest that contains 4 test cases. The test is run through ANT <junit> task and they all passed with no problems. The problem occurred when I tried to perform the automatic test report generation using <junitreport> task, and the generated HTML pages contain no test results at all, indicated by "Tests:0 Failures:0 Errors:0 Success rate:0 Time:0.000" (in which case it should be 4 for Tests, etc.).

The error message says "TESTS-TestSuites.xml is not a valid testsuite XML document". I assume this file is auto-generated by the <junitreport> task which defines how the output HTML should look like. However, it only contains the folloing 2 lines:<?xml version="1.0"?> <testsuites />. I suspect this should be the cause of the empty output. So could anyone who's familar with this issue shed any light on how I should go about deal with this issue please? Thank you very much in advance!

By the way, the task code in build.xml for reporting is as follows:
<target name="report">
<junitreport todir="./reports">
<fileset dir="./reports" includes="*.xml" />
<report format="frames" todir="./report/html" />
</junitreport>
</target>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 24 2009
Added on Dec 27 2008
1 comment
1,230 views