patterntesting.runtime.junit
Class MapTester

Package class diagram package MapTester
java.lang.Object
  extended by patterntesting.runtime.junit.MapTester

public class MapTester
extends Object

This class asserts (among other things) that two maps are equals.

Since:
1.4 (18.12.2013)
Author:
oliver

Method Summary
static void assertEqualKeys(Map<?,?> m1, Map<?,?> m2)
          Checks if each key in map m1 is equals to that of map m2.
static void assertEquals(Map<?,?> m1, Map<?,?> m2)
          Checks if each key-value pair in map m1 is equals to that of map m2.
static void assertEqualValues(Map<?,?> m1, Map<?,?> m2)
          Checks if each value in map m1 is equals to that of map m2.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

assertEquals

public static void assertEquals(Map<?,?> m1,
                                Map<?,?> m2)
Checks if each key-value pair in map m1 is equals to that of map m2. If not this method will tell you which pair is different. If the maps have different size this method will tell you which pair is missing.

Parameters:
m1 - the m1
m2 - the m2

assertEqualKeys

public static void assertEqualKeys(Map<?,?> m1,
                                   Map<?,?> m2)
Checks if each key in map m1 is equals to that of map m2. If not this method will tell you which key is different. If the maps have different size this method will tell you which key is missing.

Parameters:
m1 - the m1
m2 - the m2

assertEqualValues

public static void assertEqualValues(Map<?,?> m1,
                                     Map<?,?> m2)
Checks if each value in map m1 is equals to that of map m2. If not this method will tell you which map is different. If the maps have different size this method will tell you which value is missing.

Parameters:
m1 - the m1
m2 - the m2


Copyright © 2002–2014 PatternTesting Team. All rights reserved.