I'd like to get the names of test cases that execute a particular statement using Clover, and use this information in my research. While this information is available in the HTML report if I click on a statement, it is lacking in the XML report, so I cannot parse this information automatically. Is there a way to export this information?
Hi Ali,
Please have a look at https://confluence.atlassian.com/display/CLOVER/Database+Structure, chapter "Reading from a Clover database" on how to load the Clover's database with coverage data.
In order to get list of test cases hitting given statement you have to call CloverDatabase#getTestHits() method, for example:
for (StatementInfo stmtInfo : methodInfo.getStatements()) { // cast is needed because StatementInfo interface does not expose this database.getTestHits((FullStatementInfo) stmtInfo); }
Cheers
Marek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.