views:

74

answers:

1

I'm running JUnit tests on a large code base, and I've been realizing that sometimes I get "Errors" while other times I get "Failures". What's the difference?

+7  A: 

Ok, I've just noticed a pattern and think I've figured it out (correct me if I'm wrong). It seems to me that failures are when your test cases fail - i.e. your assertions are incorrect. Errors are unexpected errors that occur while trying to actually run the test - exceptions, etc.

froadie
You are correct, sir.
Jesse J
Though if anything extending `java.lang.AssertionError` is thrown it will be shown as a test failure instead of a test error. You should consider accepting your own answer because it is correct.
ponzao