I'm only just starting to look at adding a couple of features to
JUnit so I can't help with the question concerning the Protectable
interface. One of the enhancements I am interested in making
however is something along the lines that jpulley is describing -
i.e. allowing a test to continue following an assertion failure.
Initially I just want the tests to continue so that I can get
some kind of indication about how many assertions are failing
in each test case. Longer term I am thinking that it may be
useful to be able to indicate whether or not particular assertion
failure should cause a test case to halt - this might be on a per
assertion basis (perhaps a little tedious) or via some other
mechanism (say a flag that can be set to indicate whether
or not the next failure should end the test case).
The motivation for this extension is that most test cases
contain a whole bunch of assertions following the code
that is being tested. I am actually writing several hundred
test cases for code written by someone else - working
this way it makes much more sense to test a feature to
death in a single test case rather than writing a separate
test case for each aspect of a feature. I have test cases
that include 100 assertions with up to like 80 failures
(I currently have to comment out lines containing failures
in order to continue processing). Writing 100 separate
test cases would not be practical and would actually
make the test results harder to interpret.
It would be interesting to hear jpulley's approach - any chance
of you providing some guidance on what needs to be
----- Original Message -----
From: "Sharmila " <sharmila_pillai@...>
Sent: Thursday, January 04, 2001 12:43 AM
Subject: [junit] Re: Protectable - why?
> Could you throw some light on "extending JUnit to permit deferred
> collection of assertion failures"...am a newbie and havn't a clue how
> to go about this.
> Would appreciate any help.
> Thanks in advance,
> --- In firstname.lastname@example.org, jpulley@c... wrote:
> > Does anyone know why the Protectable interface is needed in the
> > design of JUnit? Why couldn't they just put the call to runBare()
> > directly in runProtected()? I'm extending JUnit to permit deferred
> > collection of assertion failures (so selected tests can continue if
> > assertion fails), and although the extension works I'm afraid I'm
> > missing something.