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.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_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.String
getWrongExceptionMessage(java.lang.Throwable ite)
Get the message in case the Throwable thrown by the test is not matching.boolean
isThrowableMatching(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:
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
public java.lang.String getWrongExceptionMessage(java.lang.Throwable ite)
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
-
-