Top Description Fields Constructors Methods
org.testng.internal

public Class RegexpExpectedExceptionsHolder

extends Object
implements IExpectedExceptionsHolder
Class Inheritance
All Implemented Interfaces
org.testng.IExpectedExceptionsHolder
Imports
java.util.regex.Pattern, org.testng.IExpectedExceptionsHolder, .ITestNGMethod, org.testng.annotations.ITestAnnotation, org.testng.internal.annotations.IAnnotationFinder

A class that contains the expected exceptions and the message regular expression.
Author
cbeust

Field Summary

Modifier and TypeField and Description
public static final String
private final IAnnotationFinder
private final ITestNGMethod

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private String
public String
getWrongExceptionMessage(Throwable
The Throwable thrown by the test
ite
)

Implements org.testng.IExpectedExceptionsHolder.getWrongExceptionMessage.

Get the message in case the Throwable thrown by the test is not matching.
public boolean
isThrowableMatching(Throwable
The Throwable thrown by the test
ite
)

Implements org.testng.IExpectedExceptionsHolder.isThrowableMatching.

message / regEx .* other null true false non-null true match
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_REGEXPback to summary
public static final String DEFAULT_REGEXP
finderback to summary
private final IAnnotationFinder finder
methodback to summary
private final ITestNGMethod method

Constructor Detail

RegexpExpectedExceptionsHolderback to summary
public RegexpExpectedExceptionsHolder(IAnnotationFinder finder, ITestNGMethod method)

Method Detail

getRegExpback to summary
private String getRegExp()
getWrongExceptionMessageback to summary
public String getWrongExceptionMessage(Throwable ite)

Implements org.testng.IExpectedExceptionsHolder.getWrongExceptionMessage.

Doc from org.testng.IExpectedExceptionsHolder.getWrongExceptionMessage.

Get the message in case the Throwable thrown by the test is not matching.

Parameters
ite:Throwable

The Throwable thrown by the test

Returns:String

The message which will be displayed as test result

isThrowableMatchingback to summary
public boolean isThrowableMatching(Throwable ite)

Implements org.testng.IExpectedExceptionsHolder.isThrowableMatching.

message / regEx .* other null true false non-null true match

Parameters
ite:Throwable

Doc from org.testng.IExpectedExceptionsHolder.isThrowableMatching.

The Throwable thrown by the test

Returns:boolean

Doc from org.testng.IExpectedExceptionsHolder.isThrowableMatching.

true if the Throwable is matching with the holder logic, false otherwise

Annotations
@Override