If you are using the @ExpectedAnnotation from spring, clover will report 0% code coverage and indicate the tests failed. e.g. the following test case will report no code coverage:
@Test @ExpectedException(Exception.class) public void testApp() throws Exception { App a = new App(); a.doStuff(); //a.doStuff throws an exception }
Using the JUnit 4.x annotations works and the report will show the test passed and the code coverage will be reported correctly:
@Test(expected = Exception.class) public void testApp() throws Exception { App a = new App(); a.doStuff(); //a.doStuff throws an exception }
Would be nice if clover could understand the spring annotations too.
[CLOV-838] Support for Spring's @ExpectedException annotation
Workflow | Original: JAC Suggestion Workflow [ 3342324 ] | New: JAC Suggestion Workflow 3 [ 3584074 ] |
Status | Original: RESOLVED [ 5 ] | New: Closed [ 6 ] |
Backlog Order (Obsolete) | Original: 20000000 | |
Workflow | Original: New Clover Workflow [ 897987 ] | New: JAC Suggestion Workflow [ 3342324 ] |
Issue Type | Original: New Feature [ 2 ] | New: Suggestion [ 10000 ] |
Status | Original: Closed [ 6 ] | New: Resolved [ 5 ] |
Workflow | Original: Clover Workflow [ 896263 ] | New: New Clover Workflow [ 897987 ] |
Workflow | Original: reviewflow [ 199737 ] | New: Clover Workflow [ 896263 ] |
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Resolution | New: Fixed [ 1 ] | |
Status | Original: Implemented [ 10025 ] | New: Resolved [ 5 ] |
Fix Version/s | New: 3.0 [ 14870 ] | |
Fix Version/s | Original: 2.6.4 [ 15053 ] |
Attachment | New: clov-838.zip [ 64090 ] |
Fix Version/s | New: 2.6.4 [ 15053 ] | |
Status | Original: Open [ 1 ] | New: Implemented [ 10025 ] |
Assignee | New: Michael Studman [ mstudman ] | |
Priority | Original: Minor [ 4 ] | New: Major [ 3 ] |