Package org.testng.internal
Class RegexpExpectedExceptionsHolder
- java.lang.Object
-
- org.testng.internal.RegexpExpectedExceptionsHolder
-
- All Implemented Interfaces:
IExpectedExceptionsHolder
public class RegexpExpectedExceptionsHolder extends java.lang.Object implements IExpectedExceptionsHolder
A class that contains the expected exceptions and the message regular expression.- Author:
- cbeust
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_REGEXP
-
Constructor Summary
Constructors Constructor Description RegexpExpectedExceptionsHolder(IAnnotationFinder finder, ITestNGMethod method)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetWrongExceptionMessage(java.lang.Throwable ite)Get the message in case the Throwable thrown by the test is not matching.booleanisThrowableMatching(java.lang.Throwable ite)message / regEx .* other null true false non-null true match
-
-
-
Field Detail
-
DEFAULT_REGEXP
public static final java.lang.String DEFAULT_REGEXP
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RegexpExpectedExceptionsHolder
public RegexpExpectedExceptionsHolder(IAnnotationFinder finder, ITestNGMethod method)
-
-
Method Detail
-
isThrowableMatching
public boolean isThrowableMatching(java.lang.Throwable ite)
message / regEx .* other null true false non-null true match- Specified by:
isThrowableMatchingin interfaceIExpectedExceptionsHolder- Parameters:
ite- The Throwable thrown by the test- Returns:
- true if the Throwable is matching with the holder logic, false otherwise
-
getWrongExceptionMessage
public java.lang.String getWrongExceptionMessage(java.lang.Throwable ite)
Description copied from interface:IExpectedExceptionsHolderGet the message in case the Throwable thrown by the test is not matching.- Specified by:
getWrongExceptionMessagein interfaceIExpectedExceptionsHolder- Parameters:
ite- The Throwable thrown by the test- Returns:
- The message which will be displayed as test result
-
-