Class Assertions


  • public class Assertions
    extends java.lang.Object
    • Constructor Detail

      • Assertions

        public Assertions()
    • Method Detail

      • addAssertionHandler

        public static void addAssertionHandler​(AssertionHandler assertionHandler)
        Add AssertionHandler to handlers set, with DEFAULT_PRIORITY = 0
      • addAssertionHandler

        public static void addAssertionHandler​(AssertionHandler assertionHandler,
                                               int priority)
        Add AssertionHandler to handler list, with provided priority. Handlers with greater priority will be invoked earlier.
      • removeAssertionHandler

        public static void removeAssertionHandler​(AssertionHandler assertionHandler)
        Remove AssertionHandler from handlers list.
      • internalRaiseAssertion

        protected static void internalRaiseAssertion​(ThrowableFactory throwableFactory,
                                                     java.lang.String message,
                                                     boolean silent)
      • log

        public static void log​(java.lang.String message)
      • fail

        public static void fail​(java.lang.Throwable throwable)
        Assertion failed with throwable.
      • failSilently

        public static void failSilently​(java.lang.Throwable throwable)
        Assertion failed with throwable. This assertion marked as silent.
      • fail

        public static void fail​(ThrowableFactory throwableFactory)
        Assertion failed with throwable factory.
      • assertTrue

        public static void assertTrue​(boolean shouldBeTrue,
                                      ThrowableFactory throwableFactory)
        Checks that shouldBeTrue condition is true, else raises exception provided by ThrowableFactory.
      • assertFalse

        public static void assertFalse​(boolean shouldBeFalse,
                                       ThrowableFactory throwableFactory)
        Checks that shouldBeFalse condition is false, else raises exception provided by ThrowableFactory.
      • assertNull

        public static void assertNull​(java.lang.Object shouldBeNull,
                                      ThrowableFactory throwableFactory)
      • assertNotNull

        public static void assertNotNull​(java.lang.Object shouldNotBeNull,
                                         ThrowableFactory throwableFactory)
      • assertEmpty

        public static void assertEmpty​(java.util.Collection shouldBeEmpty,
                                       ThrowableFactory throwableFactory)
      • assertNotEmpty

        public static void assertNotEmpty​(java.util.Collection shouldNotBeEmpty,
                                          ThrowableFactory throwableFactory)