There are quite a few test cases that have code like:

public void testSomething(){
    try {
      something();
      fail("an exception should have been caught");
    } catch (EstimationException ee) {
      // expected behavior
    } catch (Exception e) {
      fail("wrong exception type caught");
    }
}

This is unnecessary code; worse, the actual Exception is lost.

I propose to fix these by converting them to:

public void testSomething() throws Exception {
    try {
      something();
      fail("Expecting EstimationException ");
    } catch (EstimationException ee) {
      // expected behavior
}

Any objections?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to