Package org.testng

Class Assert


  • public class Assert
    extends java.lang.Object
    Assertion tool class. Presents assertion methods with a more natural parameter order. The order is always actualValue, expectedValue [, message].

    Important: Assertion methods comparing two values for equality, such as assertEquals, are only intended to test equality for an actual and an (un-)expected result value. They are not designed for testing whether a class correctly implements equals(Object). For example assertEquals might return fast when provided with the same object as actual and expected value without calling equals(Object) at all. Such tests trying to verify the equals(Object) implementation should instead be written explicitly and assertTrue or assertFalse should be used to verify the result, e.g.: assertTrue(var.equals(var)), assertFalse(var.equals(null)).

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Assert()
      Protect constructor since it is a static only class
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void assertEquals​(boolean[] actual, boolean[] expected)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(boolean[] actual, boolean[] expected, java.lang.String message)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(boolean actual, boolean expected)
      Asserts that two booleans are equal.
      static void assertEquals​(boolean actual, boolean expected, java.lang.String message)
      Asserts that two booleans are equal.
      static void assertEquals​(boolean actual, java.lang.Boolean expected)
      Asserts that two booleans are equal.
      static void assertEquals​(boolean actual, java.lang.Boolean expected, java.lang.String message)
      Asserts that two booleans are equal.
      static void assertEquals​(byte[] actual, byte[] expected)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(byte[] actual, byte[] expected, java.lang.String message)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(byte actual, byte expected)
      Asserts that two bytes are equal.
      static void assertEquals​(byte actual, byte expected, java.lang.String message)
      Asserts that two bytes are equal.
      static void assertEquals​(byte actual, java.lang.Byte expected)
      Asserts that two bytes are equal.
      static void assertEquals​(byte actual, java.lang.Byte expected, java.lang.String message)
      Asserts that two bytes are equal.
      static void assertEquals​(char[] actual, char[] expected)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(char[] actual, char[] expected, java.lang.String message)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(char actual, char expected)
      Asserts that two chars are equal.
      static void assertEquals​(char actual, char expected, java.lang.String message)
      Asserts that two chars are equal.
      static void assertEquals​(char actual, java.lang.Character expected)
      Asserts that two chars are equal.
      static void assertEquals​(char actual, java.lang.Character expected, java.lang.String message)
      Asserts that two chars are equal.
      static void assertEquals​(double[] actual, double[] expected)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(double[] actual, double[] expected, double delta)
      Asserts that two arrays contain the equal elements concerning a delta in the same order.
      static void assertEquals​(double[] actual, double[] expected, double delta, java.lang.String message)
      Asserts that two arrays contain the equal elements concerning a delta in the same order.
      static void assertEquals​(double[] actual, double[] expected, java.lang.String message)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(double actual, double expected)
      Asserts that two doubles are equal.
      static void assertEquals​(double actual, double expected, double delta)
      Asserts that two doubles are equal concerning a delta.
      static void assertEquals​(double actual, double expected, double delta, java.lang.String message)
      Asserts that two doubles are equal concerning a delta.
      static void assertEquals​(double actual, double expected, java.lang.String message)
      Asserts that two doubles are equal.
      static void assertEquals​(double actual, java.lang.Double expected)
      Asserts that two doubles are equal.
      static void assertEquals​(double actual, java.lang.Double expected, java.lang.String message)
      Asserts that two doubles are equal.
      static void assertEquals​(float[] actual, float[] expected)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(float[] actual, float[] expected, float delta)
      Asserts that two arrays contain the equal elements concerning a delta in the same order.
      static void assertEquals​(float[] actual, float[] expected, float delta, java.lang.String message)
      Asserts that two arrays contain the equal elements concerning a delta in the same order.
      static void assertEquals​(float[] actual, float[] expected, java.lang.String message)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(float actual, float expected)
      Asserts that two floats are equal.
      static void assertEquals​(float actual, float expected, float delta)
      Asserts that two floats are equal concerning a delta.
      static void assertEquals​(float actual, float expected, float delta, java.lang.String message)
      Asserts that two floats are equal concerning a delta.
      static void assertEquals​(float actual, float expected, java.lang.String message)
      Asserts that two floats are equal.
      static void assertEquals​(float actual, java.lang.Float expected)
      Asserts that two floats are equal.
      static void assertEquals​(float actual, java.lang.Float expected, java.lang.String message)
      Asserts that two floats are equal.
      static void assertEquals​(int[] actual, int[] expected)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(int[] actual, int[] expected, java.lang.String message)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(int actual, int expected)
      Asserts that two ints are equal.
      static void assertEquals​(int actual, int expected, java.lang.String message)
      Asserts that two ints are equal.
      static void assertEquals​(int actual, java.lang.Integer expected)
      Asserts that two ints are equal.
      static void assertEquals​(int actual, java.lang.Integer expected, java.lang.String message)
      Asserts that two ints are equal.
      static void assertEquals​(long[] actual, long[] expected)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(long[] actual, long[] expected, java.lang.String message)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(long actual, long expected)
      Asserts that two longs are equal.
      static void assertEquals​(long actual, long expected, java.lang.String message)
      Asserts that two longs are equal.
      static void assertEquals​(long actual, java.lang.Long expected)
      Asserts that two longs are equal.
      static void assertEquals​(long actual, java.lang.Long expected, java.lang.String message)
      Asserts that two longs are equal.
      static void assertEquals​(short[] actual, short[] expected)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(short[] actual, short[] expected, java.lang.String message)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(short actual, short expected)
      Asserts that two shorts are equal.
      static void assertEquals​(short actual, short expected, java.lang.String message)
      Asserts that two shorts are equal.
      static void assertEquals​(short actual, java.lang.Short expected)
      Asserts that two shorts are equal.
      static void assertEquals​(short actual, java.lang.Short expected, java.lang.String message)
      Asserts that two shorts are equal.
      static void assertEquals​(java.lang.Boolean actual, boolean expected)
      Asserts that two booleans are equal.
      static void assertEquals​(java.lang.Boolean actual, boolean expected, java.lang.String message)
      Asserts that two booleans are equal.
      static void assertEquals​(java.lang.Byte actual, byte expected)
      Asserts that two bytes are equal.
      static void assertEquals​(java.lang.Byte actual, byte expected, java.lang.String message)
      Asserts that two bytes are equal.
      static void assertEquals​(java.lang.Character actual, char expected)
      Asserts that two chars are equal.
      static void assertEquals​(java.lang.Character actual, char expected, java.lang.String message)
      Asserts that two chars are equal.
      static void assertEquals​(java.lang.Double actual, double expected)
      Asserts that two doubles are equal.
      static void assertEquals​(java.lang.Double actual, double expected, java.lang.String message)
      Asserts that two doubles are equal.
      static void assertEquals​(java.lang.Float actual, float expected)
      Asserts that two floats are equal.
      static void assertEquals​(java.lang.Float actual, float expected, java.lang.String message)
      Asserts that two floats are equal.
      static void assertEquals​(java.lang.Integer actual, int expected)
      Asserts that two ints are equal.
      static void assertEquals​(java.lang.Integer actual, int expected, java.lang.String message)
      Asserts that two ints are equal.
      static void assertEquals​(java.lang.Iterable<?> actual, java.lang.Iterable<?> expected)
      Asserts that two iterables return iterators with the same elements in the same order.
      static void assertEquals​(java.lang.Iterable<?> actual, java.lang.Iterable<?> expected, java.lang.String message)
      Asserts that two iterables return iterators with the same elements in the same order.
      static void assertEquals​(java.lang.Long actual, long expected)
      Asserts that two longs are equal.
      static void assertEquals​(java.lang.Long actual, long expected, java.lang.String message)
      Asserts that two longs are equal.
      static void assertEquals​(java.lang.Object[] actual, java.lang.Object[] expected)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(java.lang.Object[] actual, java.lang.Object[] expected, java.lang.String message)
      Asserts that two arrays contain the same elements in the same order.
      static void assertEquals​(java.lang.Object actual, java.lang.Object expected)
      Asserts that two objects are equal.
      static void assertEquals​(java.lang.Object actual, java.lang.Object expected, java.lang.String message)
      Asserts that two objects are equal.
      static void assertEquals​(java.lang.Short actual, short expected)
      Asserts that two shorts are equal.
      static void assertEquals​(java.lang.Short actual, short expected, java.lang.String message)
      Asserts that two shorts are equal.
      static void assertEquals​(java.lang.String actual, java.lang.String expected)
      Asserts that two Strings are equal.
      static void assertEquals​(java.lang.String actual, java.lang.String expected, java.lang.String message)
      Asserts that two Strings are equal.
      static void assertEquals​(java.util.Collection<?> actual, java.util.Collection<?> expected)
      Asserts that two collections contain the same elements in the same order.
      static void assertEquals​(java.util.Collection<?> actual, java.util.Collection<?> expected, java.lang.String message)
      Asserts that two collections contain the same elements in the same order.
      static void assertEquals​(java.util.Iterator<?> actual, java.util.Iterator<?> expected)
      Asserts that two iterators return the same elements in the same order.
      static void assertEquals​(java.util.Iterator<?> actual, java.util.Iterator<?> expected, java.lang.String message)
      Asserts that two iterators return the same elements in the same order.
      static void assertEquals​(java.util.Map<?,​?> actual, java.util.Map<?,​?> expected)  
      static void assertEquals​(java.util.Map<?,​?> actual, java.util.Map<?,​?> expected, java.lang.String message)
      Asserts that two maps are equal.
      static void assertEquals​(java.util.Set<?> actual, java.util.Set<?> expected)
      Asserts that two sets are equal.
      static void assertEquals​(java.util.Set<?> actual, java.util.Set<?> expected, java.lang.String message)
      Assert set equals
      static void assertEqualsDeep​(java.util.Map<?,​?> actual, java.util.Map<?,​?> expected)  
      static void assertEqualsDeep​(java.util.Map<?,​?> actual, java.util.Map<?,​?> expected, java.lang.String message)  
      static void assertEqualsDeep​(java.util.Set<?> actual, java.util.Set<?> expected, java.lang.String message)  
      static void assertEqualsNoOrder​(java.lang.Object[] actual, java.lang.Object[] expected)
      Asserts that two arrays contain the same elements in no particular order.
      static void assertEqualsNoOrder​(java.lang.Object[] actual, java.lang.Object[] expected, java.lang.String message)
      Asserts that two arrays contain the same elements in no particular order.
      static void assertEqualsNoOrder​(java.util.Collection<?> actual, java.util.Collection<?> expected)
      Asserts that two collection contain the same elements in no particular order.
      static void assertEqualsNoOrder​(java.util.Collection<?> actual, java.util.Collection<?> expected, java.lang.String message)
      Asserts that two collection contain the same elements in no particular order.
      static void assertEqualsNoOrder​(java.util.Iterator<?> actual, java.util.Iterator<?> expected)
      Asserts that two iterators contain the same elements in no particular order.
      static void assertEqualsNoOrder​(java.util.Iterator<?> actual, java.util.Iterator<?> expected, java.lang.String message)
      Asserts that two iterators contain the same elements in no particular order.
      static void assertFalse​(boolean condition)
      Asserts that a condition is false.
      static void assertFalse​(boolean condition, java.lang.String message)
      Asserts that a condition is false.
      static void assertNotEquals​(double actual, double expected, double delta)  
      static void assertNotEquals​(double actual, double expected, double delta, java.lang.String message)  
      static void assertNotEquals​(float actual, float expected, float delta)  
      static void assertNotEquals​(float actual, float expected, float delta, java.lang.String message)  
      static void assertNotEquals​(java.lang.Object[] actual, java.lang.Object[] expected, java.lang.String message)  
      static void assertNotEquals​(java.lang.Object actual, java.lang.Object expected)  
      static void assertNotEquals​(java.lang.Object actual, java.lang.Object expected, java.lang.String message)  
      static void assertNotEquals​(java.util.Collection<?> actual, java.util.Collection<?> expected)  
      static void assertNotEquals​(java.util.Collection<?> actual, java.util.Collection<?> expected, java.lang.String message)  
      static void assertNotEquals​(java.util.Iterator<?> actual, java.util.Iterator<?> expected)  
      static void assertNotEquals​(java.util.Iterator<?> actual, java.util.Iterator<?> expected, java.lang.String message)  
      static void assertNotEquals​(java.util.Map<?,​?> actual, java.util.Map<?,​?> expected)  
      static void assertNotEquals​(java.util.Map<?,​?> actual, java.util.Map<?,​?> expected, java.lang.String message)  
      static void assertNotEquals​(java.util.Set<?> actual, java.util.Set<?> expected)  
      static void assertNotEquals​(java.util.Set<?> actual, java.util.Set<?> expected, java.lang.String message)  
      static void assertNotEqualsDeep​(java.util.Map<?,​?> actual, java.util.Map<?,​?> expected)  
      static void assertNotEqualsDeep​(java.util.Map<?,​?> actual, java.util.Map<?,​?> expected, java.lang.String message)  
      static void assertNotEqualsDeep​(java.util.Set<?> actual, java.util.Set<?> expected)  
      static void assertNotEqualsDeep​(java.util.Set<?> actual, java.util.Set<?> expected, java.lang.String message)  
      static void assertNotNull​(java.lang.Object object)
      Asserts that an object isn't null.
      static void assertNotNull​(java.lang.Object object, java.lang.String message)
      Asserts that an object isn't null.
      static void assertNotSame​(java.lang.Object actual, java.lang.Object expected)
      Asserts that two objects do not refer to the same object.
      static void assertNotSame​(java.lang.Object actual, java.lang.Object expected, java.lang.String message)
      Asserts that two objects do not refer to the same objects.
      static void assertNull​(java.lang.Object object)
      Asserts that an object is null.
      static void assertNull​(java.lang.Object object, java.lang.String message)
      Asserts that an object is null.
      static void assertSame​(java.lang.Object actual, java.lang.Object expected)
      Asserts that two objects refer to the same object.
      static void assertSame​(java.lang.Object actual, java.lang.Object expected, java.lang.String message)
      Asserts that two objects refer to the same object.
      static <T extends java.lang.Throwable>
      void
      assertThrows​(java.lang.Class<T> throwableClass, Assert.ThrowingRunnable runnable)
      Asserts that runnable throws an exception of type throwableClass when executed.
      static void assertThrows​(Assert.ThrowingRunnable runnable)
      Asserts that runnable throws an exception when invoked.
      static void assertTrue​(boolean condition)
      Asserts that a condition is true.
      static void assertTrue​(boolean condition, java.lang.String message)
      Asserts that a condition is true.
      static <T extends java.lang.Throwable>
      T
      expectThrows​(java.lang.Class<T> throwableClass, Assert.ThrowingRunnable runnable)
      Asserts that runnable throws an exception of type throwableClass when executed and returns the exception.
      static void fail()
      Fails a test with no message.
      static void fail​(java.lang.String message)
      Fails a test with the given message.
      static void fail​(java.lang.String message, java.lang.Throwable realCause)
      Fails a test with the given message and wrapping the original exception.
      • Methods inherited from class java.lang.Object

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

      • ARRAY_MISMATCH_TEMPLATE

        public static final java.lang.String ARRAY_MISMATCH_TEMPLATE
        See Also:
        Constant Field Values
    • Constructor Detail

      • Assert

        protected Assert()
        Protect constructor since it is a static only class
    • Method Detail

      • assertTrue

        public static void assertTrue​(boolean condition,
                                      java.lang.String message)
        Asserts that a condition is true. If it isn't, an AssertionError, with the given message, is thrown.
        Parameters:
        condition - the condition to evaluate
        message - the assertion error message
      • assertTrue

        public static void assertTrue​(boolean condition)
        Asserts that a condition is true. If it isn't, an AssertionError is thrown.
        Parameters:
        condition - the condition to evaluate
      • assertFalse

        public static void assertFalse​(boolean condition,
                                       java.lang.String message)
        Asserts that a condition is false. If it isn't, an AssertionError, with the given message, is thrown.
        Parameters:
        condition - the condition to evaluate
        message - the assertion error message
      • assertFalse

        public static void assertFalse​(boolean condition)
        Asserts that a condition is false. If it isn't, an AssertionError is thrown.
        Parameters:
        condition - the condition to evaluate
      • fail

        public static void fail​(java.lang.String message,
                                java.lang.Throwable realCause)
        Fails a test with the given message and wrapping the original exception.
        Parameters:
        message - the assertion error message
        realCause - the original exception
      • fail

        public static void fail​(java.lang.String message)
        Fails a test with the given message.
        Parameters:
        message - the assertion error message
      • fail

        public static void fail()
        Fails a test with no message.
      • assertEquals

        public static void assertEquals​(java.lang.Object actual,
                                        java.lang.Object expected,
                                        java.lang.String message)
        Asserts that two objects are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(byte[] actual,
                                        byte[] expected)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(byte[] actual,
                                        byte[] expected,
                                        java.lang.String message)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(short[] actual,
                                        short[] expected)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(short[] actual,
                                        short[] expected,
                                        java.lang.String message)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(int[] actual,
                                        int[] expected)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(int[] actual,
                                        int[] expected,
                                        java.lang.String message)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(boolean[] actual,
                                        boolean[] expected)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(boolean[] actual,
                                        boolean[] expected,
                                        java.lang.String message)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(char[] actual,
                                        char[] expected)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(char[] actual,
                                        char[] expected,
                                        java.lang.String message)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(float[] actual,
                                        float[] expected)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(float[] actual,
                                        float[] expected,
                                        java.lang.String message)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(float[] actual,
                                        float[] expected,
                                        float delta)
        Asserts that two arrays contain the equal elements concerning a delta in the same order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        delta - the absolute tolerable difference between the actual and expected values
      • assertEquals

        public static void assertEquals​(float[] actual,
                                        float[] expected,
                                        float delta,
                                        java.lang.String message)
        Asserts that two arrays contain the equal elements concerning a delta in the same order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        delta - the absolute tolerable difference between the actual and expected values
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(double[] actual,
                                        double[] expected)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(double[] actual,
                                        double[] expected,
                                        java.lang.String message)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(double[] actual,
                                        double[] expected,
                                        double delta)
        Asserts that two arrays contain the equal elements concerning a delta in the same order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        delta - the absolute tolerable difference between the actual and expected values
      • assertEquals

        public static void assertEquals​(double[] actual,
                                        double[] expected,
                                        double delta,
                                        java.lang.String message)
        Asserts that two arrays contain the equal elements concerning a delta in the same order. If they do not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        delta - the absolute tolerable difference between the actual and expected values
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(long[] actual,
                                        long[] expected)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(long[] actual,
                                        long[] expected,
                                        java.lang.String message)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(java.lang.Object actual,
                                        java.lang.Object expected)
        Asserts that two objects are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(java.lang.String actual,
                                        java.lang.String expected,
                                        java.lang.String message)
        Asserts that two Strings are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(java.lang.String actual,
                                        java.lang.String expected)
        Asserts that two Strings are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(double actual,
                                        double expected,
                                        double delta,
                                        java.lang.String message)
        Asserts that two doubles are equal concerning a delta. If they are not, an AssertionError, with the given message, is thrown. If the expected value is infinity then the delta value is ignored.
        Parameters:
        actual - the actual value
        expected - the expected value
        delta - the absolute tolerable difference between the actual and expected values
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(double actual,
                                        double expected,
                                        double delta)
        Asserts that two doubles are equal concerning a delta. If they are not, an AssertionError is thrown. If the expected value is infinity then the delta value is ignored.
        Parameters:
        actual - the actual value
        expected - the expected value
        delta - the absolute tolerable difference between the actual and expected values
      • assertEquals

        public static void assertEquals​(double actual,
                                        double expected,
                                        java.lang.String message)
        Asserts that two doubles are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(java.lang.Double actual,
                                        double expected,
                                        java.lang.String message)
        Asserts that two doubles are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(double actual,
                                        java.lang.Double expected,
                                        java.lang.String message)
        Asserts that two doubles are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(double actual,
                                        double expected)
        Asserts that two doubles are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(java.lang.Double actual,
                                        double expected)
        Asserts that two doubles are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(double actual,
                                        java.lang.Double expected)
        Asserts that two doubles are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(float actual,
                                        float expected,
                                        float delta,
                                        java.lang.String message)
        Asserts that two floats are equal concerning a delta. If they are not, an AssertionError, with the given message, is thrown. If the expected value is infinity then the delta value is ignored.
        Parameters:
        actual - the actual value
        expected - the expected value
        delta - the absolute tolerable difference between the actual and expected values
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(float actual,
                                        float expected,
                                        float delta)
        Asserts that two floats are equal concerning a delta. If they are not, an AssertionError is thrown. If the expected value is infinity then the delta value is ignored.
        Parameters:
        actual - the actual value
        expected - the expected value
        delta - the absolute tolerable difference between the actual and expected values
      • assertEquals

        public static void assertEquals​(float actual,
                                        float expected,
                                        java.lang.String message)
        Asserts that two floats are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(java.lang.Float actual,
                                        float expected,
                                        java.lang.String message)
        Asserts that two floats are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(float actual,
                                        java.lang.Float expected,
                                        java.lang.String message)
        Asserts that two floats are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(float actual,
                                        float expected)
        Asserts that two floats are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(java.lang.Float actual,
                                        float expected)
        Asserts that two floats are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(float actual,
                                        java.lang.Float expected)
        Asserts that two floats are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(long actual,
                                        long expected,
                                        java.lang.String message)
        Asserts that two longs are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(java.lang.Long actual,
                                        long expected,
                                        java.lang.String message)
        Asserts that two longs are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(long actual,
                                        java.lang.Long expected,
                                        java.lang.String message)
        Asserts that two longs are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(long actual,
                                        long expected)
        Asserts that two longs are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(java.lang.Long actual,
                                        long expected)
        Asserts that two longs are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(long actual,
                                        java.lang.Long expected)
        Asserts that two longs are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(boolean actual,
                                        boolean expected,
                                        java.lang.String message)
        Asserts that two booleans are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(java.lang.Boolean actual,
                                        boolean expected,
                                        java.lang.String message)
        Asserts that two booleans are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(boolean actual,
                                        java.lang.Boolean expected,
                                        java.lang.String message)
        Asserts that two booleans are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(boolean actual,
                                        boolean expected)
        Asserts that two booleans are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(java.lang.Boolean actual,
                                        boolean expected)
        Asserts that two booleans are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(boolean actual,
                                        java.lang.Boolean expected)
        Asserts that two booleans are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(byte actual,
                                        byte expected,
                                        java.lang.String message)
        Asserts that two bytes are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(java.lang.Byte actual,
                                        byte expected,
                                        java.lang.String message)
        Asserts that two bytes are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(byte actual,
                                        java.lang.Byte expected,
                                        java.lang.String message)
        Asserts that two bytes are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(byte actual,
                                        byte expected)
        Asserts that two bytes are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(java.lang.Byte actual,
                                        byte expected)
        Asserts that two bytes are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(byte actual,
                                        java.lang.Byte expected)
        Asserts that two bytes are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(char actual,
                                        char expected,
                                        java.lang.String message)
        Asserts that two chars are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(java.lang.Character actual,
                                        char expected,
                                        java.lang.String message)
        Asserts that two chars are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(char actual,
                                        java.lang.Character expected,
                                        java.lang.String message)
        Asserts that two chars are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(char actual,
                                        char expected)
        Asserts that two chars are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(java.lang.Character actual,
                                        char expected)
        Asserts that two chars are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(char actual,
                                        java.lang.Character expected)
        Asserts that two chars are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(short actual,
                                        short expected,
                                        java.lang.String message)
        Asserts that two shorts are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(java.lang.Short actual,
                                        short expected,
                                        java.lang.String message)
        Asserts that two shorts are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(short actual,
                                        java.lang.Short expected,
                                        java.lang.String message)
        Asserts that two shorts are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(short actual,
                                        short expected)
        Asserts that two shorts are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(java.lang.Short actual,
                                        short expected)
        Asserts that two shorts are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(short actual,
                                        java.lang.Short expected)
        Asserts that two shorts are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(int actual,
                                        int expected,
                                        java.lang.String message)
        Asserts that two ints are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(java.lang.Integer actual,
                                        int expected,
                                        java.lang.String message)
        Asserts that two ints are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(int actual,
                                        java.lang.Integer expected,
                                        java.lang.String message)
        Asserts that two ints are equal. If they are not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(int actual,
                                        int expected)
        Asserts that two ints are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(java.lang.Integer actual,
                                        int expected)
        Asserts that two ints are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(int actual,
                                        java.lang.Integer expected)
        Asserts that two ints are equal. If they are not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertNotNull

        public static void assertNotNull​(java.lang.Object object)
        Asserts that an object isn't null. If it is, an AssertionError is thrown.
        Parameters:
        object - the assertion object
      • assertNotNull

        public static void assertNotNull​(java.lang.Object object,
                                         java.lang.String message)
        Asserts that an object isn't null. If it is, an AssertionError, with the given message, is thrown.
        Parameters:
        object - the assertion object
        message - the assertion error message
      • assertNull

        public static void assertNull​(java.lang.Object object)
        Asserts that an object is null. If it is not, an AssertionError, with the given message, is thrown.
        Parameters:
        object - the assertion object
      • assertNull

        public static void assertNull​(java.lang.Object object,
                                      java.lang.String message)
        Asserts that an object is null. If it is not, an AssertionError, with the given message, is thrown.
        Parameters:
        object - the assertion object
        message - the assertion error message
      • assertSame

        public static void assertSame​(java.lang.Object actual,
                                      java.lang.Object expected,
                                      java.lang.String message)
        Asserts that two objects refer to the same object. If they do not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertSame

        public static void assertSame​(java.lang.Object actual,
                                      java.lang.Object expected)
        Asserts that two objects refer to the same object. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertNotSame

        public static void assertNotSame​(java.lang.Object actual,
                                         java.lang.Object expected,
                                         java.lang.String message)
        Asserts that two objects do not refer to the same objects. If they do, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertNotSame

        public static void assertNotSame​(java.lang.Object actual,
                                         java.lang.Object expected)
        Asserts that two objects do not refer to the same object. If they do, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(java.util.Collection<?> actual,
                                        java.util.Collection<?> expected)
        Asserts that two collections contain the same elements in the same order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(java.util.Collection<?> actual,
                                        java.util.Collection<?> expected,
                                        java.lang.String message)
        Asserts that two collections contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(java.util.Iterator<?> actual,
                                        java.util.Iterator<?> expected)
        Asserts that two iterators return the same elements in the same order. If they do not, an AssertionError is thrown. Please note that this assert iterates over the elements and modifies the state of the iterators.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(java.util.Iterator<?> actual,
                                        java.util.Iterator<?> expected,
                                        java.lang.String message)
        Asserts that two iterators return the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown. Please note that this assert iterates over the elements and modifies the state of the iterators.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(java.lang.Iterable<?> actual,
                                        java.lang.Iterable<?> expected)
        Asserts that two iterables return iterators with the same elements in the same order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(java.lang.Iterable<?> actual,
                                        java.lang.Iterable<?> expected,
                                        java.lang.String message)
        Asserts that two iterables return iterators with the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(java.lang.Object[] actual,
                                        java.lang.Object[] expected,
                                        java.lang.String message)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEqualsNoOrder

        public static void assertEqualsNoOrder​(java.lang.Object[] actual,
                                               java.lang.Object[] expected,
                                               java.lang.String message)
        Asserts that two arrays contain the same elements in no particular order. If they do not, an AssertionError, with the given message, is thrown. The arrays are not compared 'deeply', that means, if the elements are arrays as well their equals method is used which only checks for reference equality.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEqualsNoOrder

        public static void assertEqualsNoOrder​(java.util.Collection<?> actual,
                                               java.util.Collection<?> expected,
                                               java.lang.String message)
        Asserts that two collection contain the same elements in no particular order. If they do not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEqualsNoOrder

        public static void assertEqualsNoOrder​(java.util.Iterator<?> actual,
                                               java.util.Iterator<?> expected,
                                               java.lang.String message)
        Asserts that two iterators contain the same elements in no particular order. If they do not, an AssertionError, with the given message, is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
        message - the assertion error message
      • assertEquals

        public static void assertEquals​(java.lang.Object[] actual,
                                        java.lang.Object[] expected)
        Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEqualsNoOrder

        public static void assertEqualsNoOrder​(java.lang.Object[] actual,
                                               java.lang.Object[] expected)
        Asserts that two arrays contain the same elements in no particular order. If they do not, an AssertionError is thrown. The arrays are not compared 'deeply', that means, if the elements are arrays as well their equals method is used which only checks for reference equality.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEqualsNoOrder

        public static void assertEqualsNoOrder​(java.util.Collection<?> actual,
                                               java.util.Collection<?> expected)
        Asserts that two collection contain the same elements in no particular order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEqualsNoOrder

        public static void assertEqualsNoOrder​(java.util.Iterator<?> actual,
                                               java.util.Iterator<?> expected)
        Asserts that two iterators contain the same elements in no particular order. If they do not, an AssertionError is thrown.
        Parameters:
        actual - the actual value
        expected - the expected value
      • assertEquals

        public static void assertEquals​(java.util.Set<?> actual,
                                        java.util.Set<?> expected)
        Asserts that two sets are equal.
        Parameters:
        actual - The actual value
        expected - The expected value
      • assertEquals

        public static void assertEquals​(java.util.Set<?> actual,
                                        java.util.Set<?> expected,
                                        java.lang.String message)
        Assert set equals
        Parameters:
        actual - The actual value
        expected - The expected value
        message - The message
      • assertEqualsDeep

        public static void assertEqualsDeep​(java.util.Set<?> actual,
                                            java.util.Set<?> expected,
                                            java.lang.String message)
      • assertEquals

        public static void assertEquals​(java.util.Map<?,​?> actual,
                                        java.util.Map<?,​?> expected)
      • assertEquals

        public static void assertEquals​(java.util.Map<?,​?> actual,
                                        java.util.Map<?,​?> expected,
                                        java.lang.String message)
        Asserts that two maps are equal.
        Parameters:
        actual - The actual value
        expected - The expected value
        message - The message
      • assertEqualsDeep

        public static void assertEqualsDeep​(java.util.Map<?,​?> actual,
                                            java.util.Map<?,​?> expected)
      • assertEqualsDeep

        public static void assertEqualsDeep​(java.util.Map<?,​?> actual,
                                            java.util.Map<?,​?> expected,
                                            java.lang.String message)
      • assertNotEquals

        public static void assertNotEquals​(java.lang.Object actual,
                                           java.lang.Object expected,
                                           java.lang.String message)
      • assertNotEquals

        public static void assertNotEquals​(java.lang.Object[] actual,
                                           java.lang.Object[] expected,
                                           java.lang.String message)
      • assertNotEquals

        public static void assertNotEquals​(java.util.Iterator<?> actual,
                                           java.util.Iterator<?> expected,
                                           java.lang.String message)
      • assertNotEquals

        public static void assertNotEquals​(java.util.Collection<?> actual,
                                           java.util.Collection<?> expected,
                                           java.lang.String message)
      • assertNotEquals

        public static void assertNotEquals​(java.lang.Object actual,
                                           java.lang.Object expected)
      • assertNotEquals

        public static void assertNotEquals​(java.util.Collection<?> actual,
                                           java.util.Collection<?> expected)
      • assertNotEquals

        public static void assertNotEquals​(java.util.Iterator<?> actual,
                                           java.util.Iterator<?> expected)
      • assertNotEquals

        public static void assertNotEquals​(float actual,
                                           float expected,
                                           float delta,
                                           java.lang.String message)
      • assertNotEquals

        public static void assertNotEquals​(float actual,
                                           float expected,
                                           float delta)
      • assertNotEquals

        public static void assertNotEquals​(double actual,
                                           double expected,
                                           double delta,
                                           java.lang.String message)
      • assertNotEquals

        public static void assertNotEquals​(java.util.Set<?> actual,
                                           java.util.Set<?> expected)
      • assertNotEquals

        public static void assertNotEquals​(java.util.Set<?> actual,
                                           java.util.Set<?> expected,
                                           java.lang.String message)
      • assertNotEqualsDeep

        public static void assertNotEqualsDeep​(java.util.Set<?> actual,
                                               java.util.Set<?> expected)
      • assertNotEqualsDeep

        public static void assertNotEqualsDeep​(java.util.Set<?> actual,
                                               java.util.Set<?> expected,
                                               java.lang.String message)
      • assertNotEquals

        public static void assertNotEquals​(java.util.Map<?,​?> actual,
                                           java.util.Map<?,​?> expected)
      • assertNotEquals

        public static void assertNotEquals​(java.util.Map<?,​?> actual,
                                           java.util.Map<?,​?> expected,
                                           java.lang.String message)
      • assertNotEqualsDeep

        public static void assertNotEqualsDeep​(java.util.Map<?,​?> actual,
                                               java.util.Map<?,​?> expected)
      • assertNotEqualsDeep

        public static void assertNotEqualsDeep​(java.util.Map<?,​?> actual,
                                               java.util.Map<?,​?> expected,
                                               java.lang.String message)
      • assertNotEquals

        public static void assertNotEquals​(double actual,
                                           double expected,
                                           double delta)
      • assertThrows

        public static void assertThrows​(Assert.ThrowingRunnable runnable)
        Asserts that runnable throws an exception when invoked. If it does not, an AssertionError is thrown.
        Parameters:
        runnable - A function that is expected to throw an exception when invoked
        Since:
        6.9.5
      • assertThrows

        public static <T extends java.lang.Throwable> void assertThrows​(java.lang.Class<T> throwableClass,
                                                                        Assert.ThrowingRunnable runnable)
        Asserts that runnable throws an exception of type throwableClass when executed. If it does not throw an exception, an AssertionError is thrown. If it throws the wrong type of exception, an AssertionError is thrown describing the mismatch; the exception that was actually thrown can be obtained by calling Throwable.getCause().
        Type Parameters:
        T - the expected type of the exception
        Parameters:
        throwableClass - the expected type of the exception
        runnable - A function that is expected to throw an exception when invoked
        Since:
        6.9.5
      • expectThrows

        public static <T extends java.lang.Throwable> T expectThrows​(java.lang.Class<T> throwableClass,
                                                                     Assert.ThrowingRunnable runnable)
        Asserts that runnable throws an exception of type throwableClass when executed and returns the exception. If runnable does not throw an exception, an AssertionError is thrown. If it throws the wrong type of exception, an AssertionError is thrown describing the mismatch; the exception that was actually thrown can be obtained by calling Throwable.getCause().
        Type Parameters:
        T - the expected type of the exception
        Parameters:
        throwableClass - the expected type of the exception
        runnable - A function that is expected to throw an exception when invoked
        Returns:
        The exception thrown by runnable
        Since:
        6.9.5