Package org.fest.test

Class ExpectedFailure.Message

java.lang.Object
org.fest.test.ExpectedFailure.Message
Enclosing class:
ExpectedFailure

public static class ExpectedFailure.Message extends Object
Understands executing test code that is expected to fail.
  • Field Details

    • errorType

      private final Class<? extends Throwable> errorType
    • message

      private final String message
  • Constructor Details

  • Method Details

    • on

      public void on(CodeToTest codeToTest)
      Executes the given code to test.
      Parameters:
      codeToTest - the code to test.
      Throws:
      AssertionError - if an exception of the expected type is never thrown by the code to test.
      AssertionError - if the type of the thrown exception is different than the expected type.
      AssertionError - if the message of the thrown exception is different than the expected message.
    • errorTypeName

      private String errorTypeName()
    • fail

      private void fail(String failureMessage)