public static void assertEqualsDeep(Map<?, ?> actual, Map<?, ?> expected) { assertEqualsDeep(actual, expected, null); }
public static void assertEqualsDeep(Map<?, ?> actual, Map<?, ?> expected) { assertEqualsDeep(actual, expected, null); }
public static void assertNotEqualsDeep(Set<?> actual, Set<?> expected, String message) { boolean fail; try { Assert.assertEqualsDeep(actual, expected, message); fail = true; } catch (AssertionError e) { fail = false; } if (fail) { Assert.fail(message); } }
public static void assertNotEqualsDeep(Map<?, ?> actual, Map<?, ?> expected, String message) { boolean fail; try { Assert.assertEqualsDeep(actual, expected, message); fail = true; } catch (AssertionError e) { fail = false; } if (fail) { Assert.fail(message); } }
public static void assertNotEqualsDeep(Map<?, ?> actual, Map<?, ?> expected, String message) { boolean fail; try { Assert.assertEqualsDeep(actual, expected, message); fail = true; } catch (AssertionError e) { fail = false; } if (fail) { Assert.fail(message); } }
public static void assertNotEqualsDeep(Set<?> actual, Set<?> expected, String message) { boolean fail; try { Assert.assertEqualsDeep(actual, expected, message); fail = true; } catch (AssertionError e) { fail = false; } if (fail) { Assert.fail(message); } }
@Test public void arrayInsideMapAssertEqualsDeep() { Map<String, int[]> map = new HashMap<>(); map.put("array", new int[] {42}); Map<String, int[]> mapCopy = new HashMap<>(); mapCopy.put("array", new int[] {42}); // arrays inside maps are compared by value in assertEqualsDeep(Map,Map) assertEqualsDeep(map, mapCopy); }
@Test(expectedExceptions = AssertionError.class) public void arrayDeepInSetsAssertEqualsForActualLessThanExpected() { Set<String> actual = new HashSet<>(); actual.add("42"); Set<String> expected = new HashSet<>(); expected.add("42"); expected.add("43"); assertEqualsDeep(actual, expected, "Sets not equal:"); }
@Test public void arrayInsideMapAssertEqualsDeepWithMessage() { Map<String, int[]> map = new HashMap<>(); map.put("array", new int[] {42}); Map<String, int[]> mapCopy = new HashMap<>(); mapCopy.put("array", new int[] {42}); assertEqualsDeep( map, mapCopy, "arrays inside maps are compared by value in assertEqualsDeep(Map,Map,String)"); }
@Test(expectedExceptions = AssertionError.class) public void arrayDeepInSetsAssertEqualsForExpectedLessThanActual() { Set<String> actual = new HashSet<>(); actual.add("42"); actual.add("43"); Set<String> expected = new HashSet<>(); expected.add("42"); assertEqualsDeep(actual, expected, "Sets not equal:"); }
@Test public void arrayInsideSetAssertEqualsDeep() { Set<int[]> set = new HashSet<>(); set.add(new int[] {42}); Set<int[]> setCopy = new HashSet<>(); setCopy.add(new int[] {42}); assertEqualsDeep(set, setCopy, "arrays inside sets are compared by value in assertEqualsDeep"); }