"throws AssertionFailedError" repeated once for each test case would be
redundant noise. By analogy, the Java 1.4 assertion mechanism doesn't
require declaration. Some day soon we should have a 1.4-specific JUnit
that uses their assertions instead of our own.
[mailto:junit-devel-admin@...] On Behalf Of
Sent: Wednesday, February 12, 2003 9:04 AM
Subject: [Junit-devel] Error vs. RuntimeException
Here I am, writing test code and minding my own business, when I realize
that there are all these Throwables getting thrown that my catch
(Exception e) isn't catching. Much to my chagrin, AssertionFailedError
is a subclass of java.lang.Error. Is there a reason for this? The only
thing I can think of is to avoid having to declare the exception
everywhere. Based on what I know of java.lang.Error, this is
inappropriate (check the javadocs for that class.) I think you'd be
better served by subclassing java.lang.RuntimeException.
Wells Fargo Services Company