saeg / jaguar2

🐆
Eclipse Public License 1.0
3 stars 1 forks source link

Fix exported XML and ensure file is well-formed #51

Closed andrioli closed 1 year ago

andrioli commented 1 year ago

fix #48

andrioli commented 1 year ago

The build is failing:

Error:  Failed to execute goal org.codehaus.mojo:xml-maven-plugin:1.0.2:validate (default) on project jaguar2-validations: While parsing /home/runner/work/jaguar2/jaguar2/jaguar2-examples/jaguar2-example-junit4-ba-dua/target/jaguar2.xml, at file:/home/runner/work/jaguar2/jaguar2/jaguar2-examples/jaguar2-example-junit4-ba-dua/target/jaguar2.xml, line 1,  column 23: fatal error: Premature end of file.
Error:  While parsing /home/runner/work/jaguar2/jaguar2/jaguar2-examples/jaguar2-example-junit4-ba-dua/target/jaguar2.xml, at file:/home/runner/work/jaguar2/jaguar2/jaguar2-examples/jaguar2-example-junit4-ba-dua/target/jaguar2.xml, line 1,  column 23: fatal error: Premature end of file.

The XML file generated on Jaguar2 Example JUnit4 BA-DUA is empty and this is invalid!

On the other hand, the XML file generated on Jaguar2 Example JUnit4 JaCoCo was not reported as invalid and we failed in detect the bug #48.

Note that in the example we have only one Java class, so the exported XML have only one class (root) element, and indeed, in this case the file is valid.

We need to update the example to have more than one suspiciousness class.