|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectpatterntesting.runtime.junit.CollectionTester
public final class CollectionTester
If you want to assert that the content of two collections are equals use this tester here.
| Method Summary | |
|---|---|
static void |
assertEquals(Collection<?> c1,
Collection<?> c2)
Checks if each object in collection c1 is equals to that of Collection c2. |
protected static void |
assertEquals(Collection<?> c1,
Collection<?> c2,
String msg)
Assert equals. |
static void |
assertEquals(List<?> l1,
List<?> l2)
Checks if each object in list l1 is equals to that of list l2. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void assertEquals(Collection<?> c1,
Collection<?> c2)
The order of the elements is not relevant. I.e. two collections with different ordering of its elements are equals if they have both the same elements (independent from the internal ordering).
Note: Use Lists ordering is important.
c1 - the c1c2 - the c2
protected static void assertEquals(Collection<?> c1,
Collection<?> c2,
String msg)
c1 - the c1c2 - the c2msg - the msg
public static void assertEquals(List<?> l1,
List<?> l2)
Because two lists are compared the order of the element is important. I.e. two lists with the same elements but different order are not equals.
l1 - the list 1l2 - the list 2
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||