At my company we have extensively customized Junit to fit our needs.
One of them was the ability to skip a test and have it being shown in
What we did is we have a new RuntimeException (SkipTestException) which
is thrown when a test is being skipped.
We have extended TestResult and overridden runProtected to catch this
exception before the throwable. The TestResult keeps track of the
skipped test and gives access to them with an added method skips
(similar to errors()).
Finally we have our own TestRunner which extends BaseTestRunner in which
we have modified the report which is printed at the end.
Hope this helps.
> -----Original Message-----
> From: junit-devel-admin@...=20
> [mailto:junit-devel-admin@...] On Behalf Of=20
> Robert Baccus
> Sent: Monday, September 06, 2004 2:47 PM
> To: junit-devel@...
> Subject: [Junit-devel] Adding a Skip Error type to JUnit and=20
> I have a customer that would like to know when a test case=20
> has been skipped. I have choosen to use JUnit as I am most=20
> familiar with this framework. But I found that this one=20
> request may cause me to abandon JUnit becuase I have not=20
> found an easy way to get a "Skip" type like a "Failure" or=20
> "Error" type message.
> I have been looking at the code for the JUnit and have not=20
> found an easy way to add an extended type of "skip" that will=20
> out put just like a Failure or Error but with a different name.
> Is there an easy way to subclass the TestResults class or=20
> something else that would allow me to get this functionality?
> Once we have this output would JUnitReports from ANT be able=20
> to pick it up or would I have to extend that tool also?
> Rob Baccus
> Email: rbaccus@...
> Do you Yahoo!?
> New and Improved Yahoo! Mail - 100MB free storage!
> This SF.Net email is sponsored by BEA Weblogic Workshop FREE=20
> Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> Junit-devel mailing list