Class JUnitAgnosticAssert


  • public class JUnitAgnosticAssert
    extends java.lang.Object
    Provides JUnit agnostic assertions.
    Author:
    Daniel Sagenschneider
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void assertEquals​(java.lang.Object expected, java.lang.Object actual, java.lang.String message)
      Asserts equals.
      static void assertFalse​(boolean actual, java.lang.String message)
      Asserts false.
      static void assertNotNull​(java.lang.Object actual, java.lang.String message)
      Assert not null.
      static void assertNull​(java.lang.Object actual, java.lang.String message)
      Assert null.
      static void assertSame​(java.lang.Object expected, java.lang.Object actual, java.lang.String message)
      Asserts same.
      static void assertTrue​(boolean actual, java.lang.String message)
      Asserts true.
      static <R> R fail​(java.lang.String message)
      Fails.
      static <R> R fail​(java.lang.Throwable failure)
      Propagates the failure.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JUnitAgnosticAssert

        public JUnitAgnosticAssert()
    • Method Detail

      • assertNotNull

        public static void assertNotNull​(java.lang.Object actual,
                                         java.lang.String message)
        Assert not null.
        Parameters:
        actual - Actual.
        message - Message.
      • assertNull

        public static void assertNull​(java.lang.Object actual,
                                      java.lang.String message)
        Assert null.
        Parameters:
        actual - Actual.
        message - Message.
      • assertEquals

        public static void assertEquals​(java.lang.Object expected,
                                        java.lang.Object actual,
                                        java.lang.String message)
        Asserts equals.
        Parameters:
        expected - Expected.
        actual - Actual.
        message - Message.
      • assertSame

        public static void assertSame​(java.lang.Object expected,
                                      java.lang.Object actual,
                                      java.lang.String message)
        Asserts same.
        Parameters:
        expected - Expected.
        actual - Actual.
        message - Message.
      • assertTrue

        public static void assertTrue​(boolean actual,
                                      java.lang.String message)
        Asserts true.
        Parameters:
        actual - Actual.
        message - Message.
      • assertFalse

        public static void assertFalse​(boolean actual,
                                       java.lang.String message)
        Asserts false.
        Parameters:
        actual - Actual.
        message - Message.
      • fail

        public static <R> R fail​(java.lang.Throwable failure)
        Propagates the failure.
        Type Parameters:
        R - Any result.
        Parameters:
        failure - Failure.
        Returns:
        Never returns, however allows for return statements.
      • fail

        public static <R> R fail​(java.lang.String message)
        Fails.
        Type Parameters:
        R - Any result.
        Parameters:
        message - Failure message.
        Returns:
        Never returns, however allows for return statements.