Package groovy.util
Class GroovyAssert
- java.lang.Object
- 
- groovy.util.GroovyAssert
 
- 
 @Deprecated public class GroovyAssert extends java.lang.ObjectDeprecated.Use theGroovyAssertclass instead
- 
- 
Constructor SummaryConstructors Constructor Description GroovyAssert()Deprecated.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.ThrowableshouldFail(Closure code)Deprecated.Asserts that the given code closure fails when it is evaluatedstatic java.lang.ThrowableshouldFail(java.lang.Class clazz, Closure code)Deprecated.Asserts that the given code closure fails when it is evaluated and that a particular exception is thrown.static java.lang.ThrowableshouldFailWithCause(java.lang.Class clazz, Closure code)Deprecated.Asserts that the given code closure fails when it is evaluated and that a particular exception can be attributed to the cause.
 
- 
- 
- 
Method Detail- 
shouldFailpublic static java.lang.Throwable shouldFail(Closure code) Deprecated.Asserts that the given code closure fails when it is evaluated- Parameters:
- code- the code expected to throw the exception
- Returns:
- the message of the thrown Throwable
 
 - 
shouldFailpublic static java.lang.Throwable shouldFail(java.lang.Class clazz, Closure code)Deprecated.Asserts that the given code closure fails when it is evaluated and that a particular exception is thrown.- Parameters:
- clazz- the class of the expected exception
- code- the closure that should fail
- Returns:
- the message of the expected Throwable
 
 - 
shouldFailWithCausepublic static java.lang.Throwable shouldFailWithCause(java.lang.Class clazz, Closure code)Deprecated.Asserts that the given code closure fails when it is evaluated and that a particular exception can be attributed to the cause. The expected exception class is compared recursively with any nested exceptions using getCause() until either a match is found or no more nested exceptions exist.If a match is found the error message associated with the matching exception is returned. If no match was found the method will fail. - Parameters:
- clazz- the class of the expected exception
- code- the closure that should fail
- Returns:
- the message of the expected Throwable
 
 
- 
 
-