News for hackers. Stuff that matters.
Re:Unit testing best practices by gaul on Tuesday November 06, 2012 @03:13PM (#4750450)
One can precisely handle exceptions with JUnit's ExpectedException:

http://kentbeck.github.com/junit/javadoc/4.10/org/junit/rule...

This is more compact and declarative than the usual

  try {
      ...;
      fail();
  } catch (...) {
      // expected
  }

There are no comments on this comment yet.