Successful JUnit coverage test won't turn green on exception checking methods

I have a small JUnit test waiting for an exception. The method throws an exception as expected, but when I run "Coverage As" in the Eclipse SpringSource ToolSuite, the two lines in the test method remain red, not green. This test passes - no problem.

MockPropertyReader is an empty class for reading property files. I just check the exception if the property is garbled or does not exist.

I just think the method lines should be highlighted in green. I like a lot of green.

@Test(expected = PropertyNotFoundException.class) public final void testGetMySQLNotFound() throws PropertyNotFoundException { subject.setSqlProps(mockPropertyReader); subject.getMySQL(); } 
+4
source share
1 answer

This is a known issue with Emma.

http://www.eclemma.org/faq.html#trouble05

+5
source

All Articles