Package com.itextpdf.test
Class AssertUtil
java.lang.Object
com.itextpdf.test.AssertUtil
Utilities class for assertion operation.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic void
assertPassedWithinTimeout
(AssertUtil.ThrowingRunnable assertion, Duration timeout) Assert that the assertion passed within the timeout.static void
assertPassedWithinTimeout
(AssertUtil.ThrowingRunnable assertion, Duration timeout, Duration sleepTime) Assert that the assertion passed within the timeout.static void
doesNotThrow
(Executor executor) Asserts thatExecutor.execute()
method call doesn't produce anyException
otherwise test will fail by throwingAssertionError
.static void
doesNotThrow
(Executor executor, String message) Asserts thatExecutor.execute()
method call doesn't produce anyException
otherwise test will fail by throwingAssertionError
.
-
Method Details
-
doesNotThrow
Asserts thatExecutor.execute()
method call doesn't produce anyException
otherwise test will fail by throwingAssertionError
.- Parameters:
-
executor
- the instance ofExecutor
whoseExecutor.execute()
method will be checked for exception throwing
-
doesNotThrow
Asserts thatExecutor.execute()
method call doesn't produce anyException
otherwise test will fail by throwingAssertionError
.- Parameters:
-
executor
- the instance ofExecutor
whoseExecutor.execute()
method will be checked for exception throwing -
message
- the identifying message for theAssertionError
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.
-