Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
JMockit xml coverage contains wrong file path #322
Ok, but how can JMockit know that the source file is under the "src/main/java/" directory, rather than, say, "src/"?
The coverage tool obtains "com/mycorp/MyClass.java" from the "MyClass.class" file, which comes from some "classes/" directory somewhere, usually. To figure out what directory is the correct source root, it would need to search the filesystem (as the HTML report does, but that one needs to locate the sources anyway in order to read them). I would think that generation of an XML data file would not need to be concerned with the location of source files.
If the coverage.xml file is inteded to follow the conventions of the Sonar Qube generic coverage file (http://docs.sonarqube.org/display/PLUG/Generic+Test+Coverage), it should contain the file name of the Java file relative to the module root. The sourceDir is already a configuration parameter. And as you say, the HTML report already tries to find the source file.