Package org.testng

Class TimeBombSkipException

  • All Implemented Interfaces:
    Serializable

    public class TimeBombSkipException
    extends SkipException
    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. Suppported date formats are according to the SimpleDateFormat.

    Since:
    5.6
    See Also:
    Serialized Form
    • Constructor Detail

      • TimeBombSkipException

        public TimeBombSkipException​(String msg,
                                     Date expirationDate)
        Creates a TimeBombedSkipException using the expirationDate. The format used for date comparison is yyyy/MM/dd
        Parameters:
        msg - exception message
        expirationDate - time limit after which the SKIP becomes a FAILURE
      • TimeBombSkipException

        public TimeBombSkipException​(String msg,
                                     Date expirationDate,
                                     String format)
        Creates a TimeBombedSkipException using the expirationDate. The format parameter wiil be used for performing the time comparison.
        Parameters:
        msg - exception message
        expirationDate - time limit after which the SKIP becomes a FAILURE
        format - format for the time comparison
      • TimeBombSkipException

        public TimeBombSkipException​(String msg,
                                     String date)
        Creates a TimeBombedSkipException using the date in the format yyyy/MM/dd.
        Parameters:
        msg - exception message
        date - time limit after which the SKIP becomes a FAILURE
      • TimeBombSkipException

        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 - exception message
        date - time limit after which the SKIP becomes a FAILURE
        format - format of the passed in date and of the time comparison
      • TimeBombSkipException

        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 - exception message
        date - time limit after which the SKIP becomes a FAILURE
        inFormat - format of the passed in date
        outFormat - format of the time comparison
      • TimeBombSkipException

        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 - exception message
        expirationDate - time limit after which the SKIP becomes a FAILURE
        cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
      • TimeBombSkipException

        public TimeBombSkipException​(String msg,
                                     Date expirationDate,
                                     String format,
                                     Throwable cause)
        Creates a TimeBombedSkipException using the expirationDate. The format parameter wiil be used for performing the time comparison.
        Parameters:
        msg - exception message
        expirationDate - time limit after which the SKIP becomes a FAILURE
        format - format for the time comparison
        cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
      • TimeBombSkipException

        public TimeBombSkipException​(String msg,
                                     String date,
                                     Throwable cause)
        Creates a TimeBombedSkipException using the date in the format yyyy/MM/dd.
        Parameters:
        msg - exception message
        date - time limit after which the SKIP becomes a FAILURE
        cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
      • TimeBombSkipException

        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 - exception message
        date - time limit after which the SKIP becomes a FAILURE
        format - format of the passed in date and of the time comparison
        cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value 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 a TimeBombedSkipException using the date in the specified format inFormat. The outFormat will be used to perform the time comparison and display.
        Parameters:
        msg - exception message
        date - time limit after which the SKIP becomes a FAILURE
        inFormat - format of the passed in date
        outFormat - format of the time comparison
        cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
    • Method Detail

      • isSkip

        public boolean isSkip()
        Description copied from class: SkipException
        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.
        Overrides:
        isSkip in class SkipException
        Returns:
        true if the method should be considered a skip, false if the method should be considered failed. If not overwritten it returns true