Class AssertUtil

java.lang.Object
com.itextpdf.test.AssertUtil

public class AssertUtil extends Object
Utilities class for assertion operation.
  • Method Details

    • doesNotThrow

      public static void doesNotThrow (Executor executor)
      Asserts that Executor.execute() method call doesn't produce any Exception otherwise test will fail by throwing AssertionError.
      Parameters:
      executor - the instance of Executor whose Executor.execute() method will be checked for exception throwing
    • doesNotThrow

      public static void doesNotThrow (Executor executor, String message)
      Asserts that Executor.execute() method call doesn't produce any Exception otherwise test will fail by throwing AssertionError.
      Parameters:
      executor - the instance of Executor whose Executor.execute() method will be checked for exception throwing
      message - the identifying message for the AssertionError may be null
    • assertPassedWithinTimeout

      public static void assertPassedWithinTimeout (AssertUtil.ThrowingRunnable assertion, Duration timeout) throws Exception
      Assert that the assertion passed within the timeout.
      Parameters:
      assertion - Callback to the actuals asserts to be safeguarded.
      timeout - The maximum tilme it can take before passing the assertions.
      Throws:
      Exception - Any exception thrown by the assertion callback.
    • assertPassedWithinTimeout

      public static void assertPassedWithinTimeout (AssertUtil.ThrowingRunnable assertion, Duration timeout, Duration sleepTime) throws Exception
      Assert that the assertion passed within the timeout.
      Parameters:
      assertion - Callback to the actuals asserts to be safeguarded.
      timeout - The maximum tilme it can take before passing the assertions.
      sleepTime - The time to sleep between polls.
      Throws:
      Exception - Any exception thrown by the assertion callback.