Vladislav Kaznacheev
-
2006-09-27
- summary: Excep --> Exceptions
A junit test case has code like this near the end of it:
try {
q1.receive(1);
fail("Should have thrown exception");
} catch (IOException e) {
assertEquals("Socket closed", e.getMessage());
}
When I run this test, it succeeds, but most of the
lines before this snippet are marked as not run.
If I comment out this section of code, then the
preceding lines *are* marked as executed. Apparently
something about exceptions is breaking code coverage
instrumentation.