Class RegexpExpectedExceptionsHolder

java.lang.Object
org.testng.internal.RegexpExpectedExceptionsHolder
All Implemented Interfaces:
IExpectedExceptionsHolder

public class RegexpExpectedExceptionsHolder extends Object implements IExpectedExceptionsHolder
A class that contains the expected exceptions and the message regular expression.
Author:
cbeust
  • Field Details

  • Constructor Details

  • Method Details

    • isThrowableMatching

      public boolean isThrowableMatching(Throwable ite)
      message / regEx .* other null true false non-null true match
      Specified by:
      isThrowableMatching in interface IExpectedExceptionsHolder
      Parameters:
      ite - The Throwable thrown by the test
      Returns:
      true if the Throwable is matching with the holder logic, false otherwise
    • getWrongExceptionMessage

      public String getWrongExceptionMessage(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 interface IExpectedExceptionsHolder
      Parameters:
      ite - The Throwable thrown by the test
      Returns:
      The message which will be displayed as test result