Clover reports a "failure" when running Instinct specifications that expect an exception. Instinct does not propagate the exception (perhaps JUnit 4 does), and instead handles it during specification running.
Here's an example of what causes the failure, a screenshot is attached shoing how this manifests in the HTML report).
@Specification(expectedException = IllegalArgumentException.class, withMessage = "Population cannot be chunked with chunk size (-1) less than 1")
public void shouldNotAcceptNegativeChunkSize() {
new PopulationToChunkMapperImpl(-1);
}
Changing the code to the following "works" (i.e. doesn't cause Clover to fail).
public void shouldNotAcceptNegativeChunkSize() {
try {
new PopulationToChunkMapperImpl(-1);
throw new RuntimeException("Expected exception not thrown");
} catch (IllegalArgumentException e) {
}
}
Clover is enabled/configured as follows:
<clover-setup initstring="${coverage.db}" tmpdir="${coverage.results.dir}/tmp" flushpolicy="threaded"
flushinterval="${coverage.flush.interval}">
<fileset refid="main.covered.fileset"/>
<testsources dir="${spec.src.dir}">
<testclass>
<testmethod annotation="Specification"/>
</testclass>
</testsources>
</clover-setup>
Maybe it's got something to do with how clover is configured. For example Instinct will also run spec methods (analogous to JUnit test methods) beginning with "should" and "must" however these do not appear to work correctly in all circumstances.
This may be related to this issue: http://jira.atlassian.com/browse/CLOV-90.
I have documented Instinct and all other supported frameworks here: Clover+test+detection