5

I have a small JUnit test that expects an exception to be thrown. The method throws the exception as expected but when I'm running a "Coverage As" run in Eclipse SpringSource ToolSuite, the two lines in the test method stay red instead of turning green. This test passes--no issues there.

The mockPropertyReader is an empty Properties file reader class. I'm simply testing for the exception if the property is malformed or doesn't exist.

I'm just thinking the method lines should be highlighted to green. I like lots of green.

@Test(expected = PropertyNotFoundException.class)
public final void testGetMySQLNotFound() throws PropertyNotFoundException {
    subject.setSqlProps(mockPropertyReader);
    subject.getMySQL();
}
Davidson
  • 1,064
  • 3
  • 20
  • 35

1 Answers1

7

This is a known issue with Emma.

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

artbristol
  • 32,010
  • 5
  • 70
  • 103
  • Thanks... I'm ok with things generally, if I can know the reason. Thanks again. I'm devoted to adding Junit testing to all my applications. It's a personal goal more than a corporate goal, so it's up to me to figure out it all. – Davidson Dec 06 '12 at 17:10