Package org.testng.internal
Class RegexpExpectedExceptionsHolder
java.lang.Object
org.testng.internal.RegexpExpectedExceptionsHolder
- All Implemented Interfaces:
IExpectedExceptionsHolder
A class that contains the expected exceptions and the message regular expression.
- Author:
- cbeust
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRegexpExpectedExceptionsHolder
(IAnnotationFinder finder, ITestNGMethod method) -
Method Summary
Modifier and TypeMethodDescriptionGet the message in case the Throwable thrown by the test is not matching.boolean
message / regEx .* other null true false non-null true match
-
Field Details
-
DEFAULT_REGEXP
- See Also:
-
-
Constructor Details
-
RegexpExpectedExceptionsHolder
-
-
Method Details
-
isThrowableMatching
message / regEx .* other null true false non-null true match- Specified by:
isThrowableMatching
in interfaceIExpectedExceptionsHolder
- Parameters:
ite
- The Throwable thrown by the test- Returns:
- true if the Throwable is matching with the holder logic, false otherwise
-
getWrongExceptionMessage
Description copied from interface:IExpectedExceptionsHolder
Get the message in case the Throwable thrown by the test is not matching.- Specified by:
getWrongExceptionMessage
in interfaceIExpectedExceptionsHolder
- Parameters:
ite
- The Throwable thrown by the test- Returns:
- The message which will be displayed as test result
-