Package org.testng
Class TimeBombSkipException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.testng.SkipException
org.testng.TimeBombSkipException
- All Implemented Interfaces:
Serializable
A
SkipException extension that transforms a skipped method into a failed method based on
a time trigger.
By default the time format is yyyy/MM/dd (according to SimpleDateFormat). You can
customize this by using the specialized constructors. Supported date formats are according to the
SimpleDateFormat.
- Since:
- 5.6
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate Calendarprivate DateFormatprivate DateFormatprivate final SimpleDateFormatprivate static final long -
Constructor Summary
ConstructorsConstructorDescriptionTimeBombSkipException(String msg, String date) Creates aTimeBombedSkipExceptionusing thedatein the formatyyyy/MM/dd.TimeBombSkipException(String msg, String date, String format) Creates aTimeBombedSkipExceptionusing thedatein the specified formatformat.TimeBombSkipException(String msg, String date, String inFormat, String outFormat) Creates aTimeBombedSkipExceptionusing thedatein the specified formatinFormat.Creates aTimeBombedSkipExceptionusing thedatein the specified formatinFormat.TimeBombSkipException(String msg, String date, String format, Throwable cause) Creates aTimeBombedSkipExceptionusing thedatein the specified formatformat.TimeBombSkipException(String msg, String date, Throwable cause) Creates aTimeBombedSkipExceptionusing thedatein the formatyyyy/MM/dd.TimeBombSkipException(String msg, Date expirationDate) Creates aTimeBombedSkipExceptionusing theexpirationDate.TimeBombSkipException(String msg, Date expirationDate, String format) Creates aTimeBombedSkipExceptionusing theexpirationDate.TimeBombSkipException(String msg, Date expirationDate, String format, Throwable cause) Creates aTimeBombedSkipExceptionusing theexpirationDate.TimeBombSkipException(String msg, Date expirationDate, Throwable cause) Creates aTimeBombedSkipExceptionusing theexpirationDate. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidinitExpireDate(String date) private voidinitExpireDate(Date expireDate) booleanisSkip()Flag if the current exception marks a skipped method (true) or a failure (false).voidvoidMethods inherited from class org.testng.SkipException
reduceStackTrace, restoreStackTraceMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
FORMAT
- See Also:
-
sdf
-
m_expireDate
-
m_inFormat
-
m_outFormat
-
-
Constructor Details
-
TimeBombSkipException
Creates aTimeBombedSkipExceptionusing theexpirationDate. The format used for date comparison isyyyy/MM/dd- Parameters:
msg- exception messageexpirationDate- time limit after which the SKIP becomes a FAILURE
-
TimeBombSkipException
Creates aTimeBombedSkipExceptionusing theexpirationDate. Theformatparameter will be used for performing the time comparison.- Parameters:
msg- exception messageexpirationDate- time limit after which the SKIP becomes a FAILUREformat- format for the time comparison
-
TimeBombSkipException
Creates aTimeBombedSkipExceptionusing thedatein the formatyyyy/MM/dd.- Parameters:
msg- exception messagedate- time limit after which the SKIP becomes a FAILURE
-
TimeBombSkipException
Creates aTimeBombedSkipExceptionusing thedatein the specified formatformat. The same format is used when performing the time comparison.- Parameters:
msg- exception messagedate- time limit after which the SKIP becomes a FAILUREformat- format of the passed indateand of the time comparison
-
TimeBombSkipException
Creates aTimeBombedSkipExceptionusing thedatein the specified formatinFormat. TheoutFormatwill be used to perform the time comparison and display.- Parameters:
msg- exception messagedate- time limit after which the SKIP becomes a FAILUREinFormat- format of the passed indateoutFormat- format of the time comparison
-
TimeBombSkipException
Creates aTimeBombedSkipExceptionusing theexpirationDate. The format used for date comparison isyyyy/MM/dd- Parameters:
msg- exception messageexpirationDate- time limit after which the SKIP becomes a FAILUREcause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (Anullvalue is permitted, and indicates that the cause is nonexistent or unknown.)
-
TimeBombSkipException
Creates aTimeBombedSkipExceptionusing theexpirationDate. Theformatparameter will be used for performing the time comparison.- Parameters:
msg- exception messageexpirationDate- time limit after which the SKIP becomes a FAILUREformat- format for the time comparisoncause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (Anullvalue is permitted, and indicates that the cause is nonexistent or unknown.)
-
TimeBombSkipException
Creates aTimeBombedSkipExceptionusing thedatein the formatyyyy/MM/dd.- Parameters:
msg- exception messagedate- time limit after which the SKIP becomes a FAILUREcause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (Anullvalue is permitted, and indicates that the cause is nonexistent or unknown.)
-
TimeBombSkipException
Creates aTimeBombedSkipExceptionusing thedatein the specified formatformat. The same format is used when performing the time comparison.- Parameters:
msg- exception messagedate- time limit after which the SKIP becomes a FAILUREformat- format of the passed indateand of the time comparisoncause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (Anullvalue is permitted, and indicates that the cause is nonexistent or unknown.)
-
TimeBombSkipException
public TimeBombSkipException(String msg, String date, String inFormat, String outFormat, Throwable cause) Creates aTimeBombedSkipExceptionusing thedatein the specified formatinFormat. TheoutFormatwill be used to perform the time comparison and display.- Parameters:
msg- exception messagedate- time limit after which the SKIP becomes a FAILUREinFormat- format of the passed indateoutFormat- format of the time comparisoncause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (Anullvalue is permitted, and indicates that the cause is nonexistent or unknown.)
-
-
Method Details
-
initExpireDate
-
initExpireDate
-
isSkip
public boolean isSkip()Description copied from class:SkipExceptionFlag if the current exception marks a skipped method (true) or a failure (false). By default Subclasses should override this method in order to provide smarter behavior.- Overrides:
isSkipin classSkipException- Returns:
trueif the method should be considered a skip,falseif the method should be considered failed. If not overwritten it returnstrue
-
getMessage
- Overrides:
getMessagein classThrowable
-
printStackTrace
- Overrides:
printStackTracein classThrowable
-
printStackTrace
- Overrides:
printStackTracein classThrowable
-