/** * Asserts that two arrays contain the same elements in the same order. If they do not, * an AssertionError, with the given message, is thrown. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(byte[] actual, byte[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { if (expected[i] != actual[i]) { fail(String.format(ARRAY_MISMATCH_TEMPLATE, i, Byte.toString(expected[i]), Byte.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(long[] actual, long[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { if (expected[i] != actual[i]) { fail(String.format(ARRAY_MISMATCH_TEMPLATE, i, Long.toString(expected[i]), Long.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(int[] actual, int[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { if (expected[i] != actual[i]) { fail(String.format(ARRAY_MISMATCH_TEMPLATE, i, Integer.toString(expected[i]), Integer.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(short[] actual, short[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { if (expected[i] != actual[i]) { fail(String.format(ARRAY_MISMATCH_TEMPLATE, i, Short.toString(expected[i]), Short.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(float[] actual, float[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { if (expected[i] != actual[i]) { fail(String.format(ARRAY_MISMATCH_TEMPLATE, i, Float.toString(expected[i]), Float.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(double[] actual, double[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { if (expected[i] != actual[i]) { fail(String.format(ARRAY_MISMATCH_TEMPLATE, i, Double.toString(expected[i]), Double.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(boolean[] actual, boolean[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { if (expected[i] != actual[i]) { fail(String.format(ARRAY_MISMATCH_TEMPLATE, i, Boolean.toString(expected[i]), Boolean.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(char[] actual, char[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { if (expected[i] != actual[i]) { fail(String.format(ARRAY_MISMATCH_TEMPLATE, i, Character.toString(expected[i]), Character.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(int[] actual, int[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { if (expected[i] != actual[i]) { fail( String.format( ARRAY_MISMATCH_TEMPLATE, i, Integer.toString(expected[i]), Integer.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(boolean[] actual, boolean[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { if (expected[i] != actual[i]) { fail( String.format( ARRAY_MISMATCH_TEMPLATE, i, Boolean.toString(expected[i]), Boolean.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(float[] actual, float[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { assertEquals(actual[i], expected[i], String.format( ARRAY_MISMATCH_TEMPLATE, i, Float.toString(expected[i]), Float.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(double[] actual, double[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { assertEquals(actual[i], expected[i], String.format( ARRAY_MISMATCH_TEMPLATE, i, Double.toString(expected[i]), Double.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(byte[] actual, byte[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { if (expected[i] != actual[i]) { fail( String.format( ARRAY_MISMATCH_TEMPLATE, i, Byte.toString(expected[i]), Byte.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(char[] actual, char[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { if (expected[i] != actual[i]) { fail( String.format( ARRAY_MISMATCH_TEMPLATE, i, Character.toString(expected[i]), Character.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param delta the absolute tolerable difference between the actual and expected values * @param message the assertion error message */ public static void assertEquals(double[] actual, double[] expected, double delta, String message) { if (checkRefEqualityAndLength(actual, expected, message)) { return; } for (int i = 0; i < expected.length; i++) { assertEquals(actual[i], expected[i], delta, String.format( ARRAY_MISMATCH_TEMPLATE, i, Double.toString(expected[i]), Double.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(short[] actual, short[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { if (expected[i] != actual[i]) { fail( String.format( ARRAY_MISMATCH_TEMPLATE, i, Short.toString(expected[i]), Short.toString(actual[i]), 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. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(long[] actual, long[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { if (expected[i] != actual[i]) { fail( String.format( ARRAY_MISMATCH_TEMPLATE, i, Long.toString(expected[i]), Long.toString(actual[i]), message)); } } }
/** * Asserts that two arrays contain the equal elements concerning a delta in the same order. If * they do not, an * AssertionError is thrown. * * @param actual the actual value * @param expected the expected value * @param delta the absolute tolerable difference between the actual and expected values * @param message the assertion error message */ public static void assertEquals(float[] actual, float[] expected, float delta, String message) { if (checkRefEqualityAndLength(actual, expected, message)) { return; } for (int i = 0; i < expected.length; i++) { assertEquals(actual[i], expected[i], delta, String.format( ARRAY_MISMATCH_TEMPLATE, i, Float.toString(expected[i]), Float.toString(actual[i]), message)); } }