Top Description Fields Constructors Methods
org.testng

public Class TimeBombSkipException

extends SkipException
Class Inheritance
Imports
java.io.PrintStream, .PrintWriter, java.text.DateFormat, .ParseException, .SimpleDateFormat, java.util.Calendar, .Date

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

Field Summary

Modifier and TypeField and Description
private static final String
private Calendar
private DateFormat
private DateFormat
private final SimpleDateFormat
private static final long

Constructor Summary

AccessConstructor and Description
public
TimeBombSkipException(String
exception message
msg
,
Date
time limit after which the SKIP becomes a FAILURE
expirationDate
)

Creates a TimeBombedSkipException using the expirationDate.

public
TimeBombSkipException(String
exception message
msg
,
Date
time limit after which the SKIP becomes a FAILURE
expirationDate
,
String
format for the time comparison
format
)

Creates a TimeBombedSkipException using the expirationDate.

public
TimeBombSkipException(String
exception message
msg
,
String
time limit after which the SKIP becomes a FAILURE
date
)

Creates a TimeBombedSkipException using the date in the format yyyy/MM/dd.

public
TimeBombSkipException(String
exception message
msg
,
String
time limit after which the SKIP becomes a FAILURE
date
,
String
format of the passed in date and of the time comparison
format
)

Creates a TimeBombedSkipException using the date in the specified format format.

public
TimeBombSkipException(String
exception message
msg
,
String
time limit after which the SKIP becomes a FAILURE
date
,
String
format of the passed in date
inFormat
,
String
format of the time comparison
outFormat
)

Creates a TimeBombedSkipException using the date in the specified format inFormat.

public
TimeBombSkipException(String
exception message
msg
,
Date
time limit after which the SKIP becomes a FAILURE
expirationDate
,
Throwable
the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
cause
)

Creates a TimeBombedSkipException using the expirationDate.

public
TimeBombSkipException(String
exception message
msg
,
Date
time limit after which the SKIP becomes a FAILURE
expirationDate
,
String
format for the time comparison
format
,
Throwable
the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
cause
)

Creates a TimeBombedSkipException using the expirationDate.

public
TimeBombSkipException(String
exception message
msg
,
String
time limit after which the SKIP becomes a FAILURE
date
,
Throwable
the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
cause
)

Creates a TimeBombedSkipException using the date in the format yyyy/MM/dd.

public
TimeBombSkipException(String
exception message
msg
,
String
time limit after which the SKIP becomes a FAILURE
date
,
String
format of the passed in date and of the time comparison
format
,
Throwable
the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
cause
)

Creates a TimeBombedSkipException using the date in the specified format format.

public
TimeBombSkipException(String
exception message
msg
,
String
time limit after which the SKIP becomes a FAILURE
date
,
String
format of the passed in date
inFormat
,
String
format of the time comparison
outFormat
,
Throwable
the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
cause
)

Creates a TimeBombedSkipException using the date in the specified format inFormat.

Method Summary

Modifier and TypeMethod and Description
public String
getMessage()

Overrides java.lang.Throwable.getMessage.

Returns the detail message string of this throwable.
private void
initExpireDate(Date expireDate)

private void
public boolean
isSkip()

Overrides org.testng.SkipException.isSkip.

Flag if the current exception marks a skipped method (true) or a failure ( false).
public void
printStackTrace(PrintStream
PrintStream to use for output
s
)

Overrides java.lang.Throwable.printStackTrace.

Prints this throwable and its backtrace to the specified print stream.
public void
printStackTrace(PrintWriter
PrintWriter to use for output
s
)

Overrides java.lang.Throwable.printStackTrace.

Prints this throwable and its backtrace to the specified print writer.
Inherited from org.testng.SkipException:
reduceStackTracerestoreStackTrace

Field Detail

FORMATback to summary
private static final String FORMAT
m_expireDateback to summary
private Calendar m_expireDate
m_inFormatback to summary
private DateFormat m_inFormat
m_outFormatback to summary
private DateFormat m_outFormat
sdfback to summary
private final SimpleDateFormat sdf
serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.testng.SkipException.serialVersionUID.

Constructor Detail

TimeBombSkipExceptionback to summary
public TimeBombSkipException(String msg, Date expirationDate)

Creates a TimeBombedSkipException using the expirationDate. The format used for date comparison is yyyy/MM/dd

Parameters
msg:String

exception message

expirationDate:Date

time limit after which the SKIP becomes a FAILURE

TimeBombSkipExceptionback to summary
public TimeBombSkipException(String msg, Date expirationDate, String format)

Creates a TimeBombedSkipException using the expirationDate. The format parameter will be used for performing the time comparison.

Parameters
msg:String

exception message

expirationDate:Date

time limit after which the SKIP becomes a FAILURE

format:String

format for the time comparison

TimeBombSkipExceptionback to summary
public TimeBombSkipException(String msg, String date)

Creates a TimeBombedSkipException using the date in the format yyyy/MM/dd.

Parameters
msg:String

exception message

date:String

time limit after which the SKIP becomes a FAILURE

TimeBombSkipExceptionback to summary
public TimeBombSkipException(String msg, String date, String format)

Creates a TimeBombedSkipException using the date in the specified format format. The same format is used when performing the time comparison.

Parameters
msg:String

exception message

date:String

time limit after which the SKIP becomes a FAILURE

format:String

format of the passed in date and of the time comparison

TimeBombSkipExceptionback to summary
public TimeBombSkipException(String msg, String date, String inFormat, String outFormat)

Creates a TimeBombedSkipException using the date in the specified format inFormat. The outFormat will be used to perform the time comparison and display.

Parameters
msg:String

exception message

date:String

time limit after which the SKIP becomes a FAILURE

inFormat:String

format of the passed in date

outFormat:String

format of the time comparison

TimeBombSkipExceptionback to summary
public TimeBombSkipException(String msg, Date expirationDate, Throwable cause)

Creates a TimeBombedSkipException using the expirationDate. The format used for date comparison is yyyy/MM/dd

Parameters
msg:String

exception message

expirationDate:Date

time limit after which the SKIP becomes a FAILURE

cause:Throwable

the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

TimeBombSkipExceptionback to summary
public TimeBombSkipException(String msg, Date expirationDate, String format, Throwable cause)

Creates a TimeBombedSkipException using the expirationDate. The format parameter will be used for performing the time comparison.

Parameters
msg:String

exception message

expirationDate:Date

time limit after which the SKIP becomes a FAILURE

format:String

format for the time comparison

cause:Throwable

the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

TimeBombSkipExceptionback to summary
public TimeBombSkipException(String msg, String date, Throwable cause)

Creates a TimeBombedSkipException using the date in the format yyyy/MM/dd.

Parameters
msg:String

exception message

date:String

time limit after which the SKIP becomes a FAILURE

cause:Throwable

the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

TimeBombSkipExceptionback to summary
public TimeBombSkipException(String msg, String date, String format, Throwable cause)

Creates a TimeBombedSkipException using the date in the specified format format. The same format is used when performing the time comparison.

Parameters
msg:String

exception message

date:String

time limit after which the SKIP becomes a FAILURE

format:String

format of the passed in date and of the time comparison

cause:Throwable

the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

TimeBombSkipExceptionback to summary
public TimeBombSkipException(String msg, String date, String inFormat, String outFormat, Throwable cause)

Creates a TimeBombedSkipException using the date in the specified format inFormat. The outFormat will be used to perform the time comparison and display.

Parameters
msg:String

exception message

date:String

time limit after which the SKIP becomes a FAILURE

inFormat:String

format of the passed in date

outFormat:String

format of the time comparison

cause:Throwable

the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

Method Detail

getMessageback to summary
public String getMessage()

Overrides java.lang.Throwable.getMessage.

Doc from java.lang.Throwable.getMessage.

Returns the detail message string of this throwable.

Returns:String

the detail message string of this Throwable instance (which may be null).

Annotations
@Override
initExpireDateback to summary
private void initExpireDate(Date expireDate)
initExpireDateback to summary
private void initExpireDate(String date)
isSkipback to summary
public boolean isSkip()

Overrides org.testng.SkipException.isSkip.

Doc from org.testng.SkipException.isSkip.

Flag 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.

Returns:boolean

true if the method should be considered a skip, false if the method should be considered failed. If not overwritten it returns true

Annotations
@Override
printStackTraceback to summary
public void printStackTrace(PrintStream s)

Overrides java.lang.Throwable.printStackTrace.

Doc from java.lang.Throwable.printStackTrace.

Prints this throwable and its backtrace to the specified print stream.

Parameters
s:PrintStream

PrintStream to use for output

Annotations
@Override
printStackTraceback to summary
public void printStackTrace(PrintWriter s)

Overrides java.lang.Throwable.printStackTrace.

Doc from java.lang.Throwable.printStackTrace.

Prints this throwable and its backtrace to the specified print writer.

Parameters
s:PrintWriter

PrintWriter to use for output

Annotations
@Override