Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

JUnit report generation #932

alexz ·
Hi Robin,
Our test script generates custom text report. To import this report I am trying to convert it to JUnit XML format.
It is unclear how to divide my results in to packages with separate names. I could not find such an example on Internet <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
Could yo please provide me an example of JUnit XML report including package defenition?
Thank you,
Alex
  • replies 7
  • views 3420
  • stars 0
steveluo ADMIN ·
Hi Alex:
If you want to convert your custom report to JUnit, you need not divide into packages. What you need do is just use XSLT to transform your report into JUnit format. Below is an example of the JUnit report snippet:

<testsuite tests="20" errors="1" failures="1" name="com.your.organization.mypackage">
<properties>
<!-- Not used by QuickBuild -->
</properties>
<testcase classname="com.your.organization.mypackage.MyTest" name="testFoo1" time="0.30" />
<testcase classname="com.your.organization.mypackage.MyTest" name="testFoo2" time="12.30" >
<failure message="some failure message" type="some failure type">Detailed failure message</failure>
</testcase>
<testcase classname="com.your.organization.mypackage.MyTest" name="testFoo3" time="12.30" >
<error message="some error message" type="some error type">Detailed error message</failure>
</testcase>
... ...
<system-out>System out message</system-out>
<system-err>System error message</system-err>
</testsuite>
<testsuite ....


Below format is also used for separate test suite report (by default the Ant JUnit test task will generate the report use this format):

<testsuite errors="1" failures="0" name="com.your.organization.mypackage.MyTest" tests="1" time="0.0" timestamp="2009-08-19T09:48:00">
<testcase classname="com.your.organization.mypackage.MyTest" name="testFoo1" time="0.0010">
<error message="Some error message" type="error type">Detailed error message here.</error>
</testcase>
</testsuite>


QuickBuild can merge all of the reports you specified in Publish Step for both cases. So you do not need to worry about how to separate them, just need follow the format mentioned above.

Hope this can help you.
steveluo ADMIN ·
By the way, the unit of time attribute is second which is a double value.
alexz ·
i have a lot of tests and i want to organize them by splitting them in to packages and test suites, so it will be easier to browse the results.
Is there an option to create packages from JUnit report?
steveluo ADMIN ·
I am confused. You generate the report yourself or generate by Ant JUnit task? What kind of results you want to browse, from QuickBuild or something else?
If your test results are using the format like JUnit which I mentioned above, then you can add a publish JUnit step to publish your test reports, QuickBuild can organize the results by packages, test suites and test cases.
Or, you can transform your test results to html, and then publish the html report which you can organize the results whatever you want.
alexz ·
I generate JUnit report by parsing existing text log file.
After i import generated JUnit report to QuickBuild there is a section of Junit reports. In this section all my results are separated by Test Suites. All my test suites are located under same package called "(empty)".
I'm wondering how can i give more meaningful name to this package?
And how can i create more than one package?
alexz ·
Hi,
I have another question.
Is there an option to manage fields presented for each test?
For example now each test contains following fields:
Test Suite
Error Type
Error Message
Failure Type
Failure Message
I want remove "Error Type" and "Error Message" fields and add multi line log filed.
Thank you,
Alex
steveluo ADMIN ·
The short answer is no. Currently, to add your custom fields are not supported directly. But you may write a plugin to do so. The details can be found here:
http://wiki.pmease.com/display/QB21/Developer%27s+Guide