From: "Wannheden, Knut" <[EMAIL PROTECTED]>
> Hi,
>
> Here is an addition to the Jelly tag library junit.  It includes the tag
> <test:assertThrown/> which is used to assert that an exception is thrown
by
> its body.  The patch consists of the two attachments patch-java.txt and
> patch-test.txt.  The first includes the class implementing the new tag and
> the changes to the tag library class, whereas the second includes
additions
> to the junit tag library test suite to test the new tag.  For
documentation
> refer to the Javadoc and the examples in the test suite.

Great stuff Knut.

I've just committed your patch to CVS. I made 2 minor tweaks before
committing it.

* rather than expectedThrowable="..." I renamed the attribute to
expected="...". I though this would save typing and make the tag more
polymorphic with the assertEquals and assertDocumentEquals tags.  (If there
is such a thing as polymorphic tags ;-)

* if an exception class couldn't be found, rather than eating up the
exception I've left it to bubble up; then ClassPath errors can be found more
easily.

* I made a minor patch to avoid the use of Class.forName(), which is
considered evil...

http://radio.weblogs.com/0112098/2002/09/24.html#a114

and instead use both a customizable ClassLoader as well as defaulting to
either the class loader that loaded the tag library or the current threads
context class loader. Going forward it'd be nice to generalize all use of
ClassLoaders in Jelly scripts by using a nested <classLoader> tag, along
similar lines to Rod's recent patch. There's a few tags that are
ClassLoader-aware so it should be possible to do I think. I've created a new
task so we don't forget to do this...

http://jira.werken.com/secure/ViewIssue.jspa?key=JELLY-17

Thanks again for another good patch.

James
-------
http://radio.weblogs.com/0112098/

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to