Forum Discussion

djangofan's avatar
djangofan
Contributor
11 years ago

How do I begin to implement a custom JUnitReportCollector?

Maybe biting off more than I can chew, but I am looking for advice on how to implement the new feature in maven-soapui-extension-plugin for "configuring the JunitReportCollector to be able to modify xml junit files generation" but I am having trouble figuring out where to start.

I basically want a ReportCollector that is capable of printing out the test steps (in the HTML report) as it runs through each test case within a suite. I am not sure this is even possible. I can do this, I just need a basic idea of where to start. I have read all the related threads and help docs on this matter and everything is very vague.

Here is my project template, which is the point I want to start from, in order to implement this:
https://github.com/djangofan/soapui-test

I am guessing this might involve building sub-nodes into the report.xml "testcase" node, like so?


....
<testcase name="RequestTime TestCase" time="0.292">
<teststep name="Step1" time="0.122"/>
<teststep name="Step2">
<failure type="Assertion" message="Test failure.">That statement is not true!</failure>
</teststep>
<teststep name="Step3">
<failure type="Exception">java.lang.NullPointerException</failure>
</teststep>
</testcase>
</testsuite>
</testsuites>


If this is not possible, then the workaround, of course, is to put each of my test steps into it's own test case. This would be perfectly acceptable if I could attach a link to specific console output to each test case.

12 Replies