public class AssertThrowsTag extends AssertTagSupport
expected
was specified the body must throw
an exception of the given class, otherwise the assertion fails. The
exception thrown by the body can also be of any subtype of the specified
exception class. The optional var
attribute can be specified if
the caught exception is to be exported to a variable.body, context, parent
Constructor and Description |
---|
AssertThrowsTag() |
Modifier and Type | Method and Description |
---|---|
void |
doTag(XMLOutput output)
Evaluates this tag after all the tags properties have been initialized.
|
java.lang.ClassLoader |
getClassLoader() |
protected java.lang.Class |
getThrowableClass()
Returns the
Class corresponding to the class
specified by expected . |
void |
setClassLoader(java.lang.ClassLoader classLoader)
Sets the class loader to be used to load the exception type
|
void |
setExpected(java.lang.String expected)
Sets the class name of exception expected to be thrown by the body.
|
void |
setVar(java.lang.String var)
Sets the variable name to define for this expression.
|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, fail, failNotEquals
getXPathContext
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
public void doTag(XMLOutput output) throws JellyTagException
Tag
JellyTagException
public void setExpected(java.lang.String expected)
java.lang.Throwable
.public void setVar(java.lang.String var)
public void setClassLoader(java.lang.ClassLoader classLoader)
public java.lang.ClassLoader getClassLoader()
protected java.lang.Class getThrowableClass() throws java.lang.ClassNotFoundException
Class
corresponding to the class
specified by expected
. If
expected
was either not specified then java. lang.
Throwable
is returned.
Otherwise if the class couldn't be
found or doesn't denote an exception class then an exception is thrown.java.lang.ClassNotFoundException
Copyright © 2012. All Rights Reserved.