Imagine a following scenario:
AssertionError
for JUnit) because verification is performed in later phaseHow to solve this?
You can update Clover's Optimization Snapshot file "manually". Exact integration would depend on the framework you are using and you need to write such integration, but in general it works this way:
1) Instrument code and run integration-tests (mvn clean clover:setup integration-test)
2) Save optimization snapshot file (clover2:snapshot)
3) Run test result verification (mvn verify) and store failed test results (somewhere)
4) Update optimization snapshot file and set status for failed tests (see code example below)
A simple application which sets test duration and test failure for certain test case:
https://bitbucket.org/atlassian/maven-clover2-plugin (src/it/optmized/snapshot-hacking)
You must use com.cenqua.clover:clover version 3.1.11 or later.