|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.test.AssertUtils
public class AssertUtils
| Constructor Summary | |
|---|---|
AssertUtils()
|
|
| Method Summary | ||
|---|---|---|
static
|
assertCollectionEqualsNoOrder(Collection<T> expected,
Collection<T> actual,
String msg)
Verifies that two collections are equal, according to the definition of equals() of the contained
elements. |
|
static
|
assertCollectionMatchesNoOrder(Collection<T> expected,
Collection<T> actual,
String msg)
Verifies that the two collections contain the same number of matching elements as is done in assertPropertiesMatch(String, Object, Object, String...). |
|
static
|
assertCollectionMatchesNoOrder(String msg,
Collection<T> expected,
Collection<T> actual,
String... ignoredProperties)
|
|
static
|
assertPropertiesMatch(String msg,
T expected,
T actual,
List<String> ignoredProperties)
Verifies that all public, accessible properties of the two objects are equal, excluding those specified in the ignoredProperties argument. |
|
static
|
assertPropertiesMatch(String msg,
T expected,
T actual,
String... ignoredProperties)
|
|
static
|
assertPropertiesMatch(T expected,
T actual,
String msg)
Verifies that all public, accessible properties of the two objects are equal. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AssertUtils()
| Method Detail |
|---|
public static <T> void assertPropertiesMatch(T expected,
T actual,
String msg)
equals() methods or when they do not implement
equals().
T - The type of the objects to be comparedexpected - The expected object to compare against. Should be non-null.actual - The actual object to be compared. Should be non-null.msg - An error message
public static <T> void assertPropertiesMatch(String msg,
T expected,
T actual,
String... ignoredProperties)
T - The type of the objects to be compared.msg - An error messageexpected - The expected object to compare against. Should be non-null.actual - The actual object to be compared. Should be non-null.ignoredProperties - A list of property names to exclude from comparison.
public static <T> void assertPropertiesMatch(String msg,
T expected,
T actual,
List<String> ignoredProperties)
ignoredProperties argument. This method might be used when you want to compare two objects without
using their equals() methods or when they do not implement equals.
T - The type of the objects to be compared.msg - An error messageexpected - The expected object to compare against. Should be non-null.actual - The actual object to be compared. Should be non-null.ignoredProperties - A list of property names to exclude from comparison.
public static <T> void assertCollectionEqualsNoOrder(Collection<T> expected,
Collection<T> actual,
String msg)
equals() of the contained
elements. Order is ignored as well as the runtime type of the collections.
T - The type of the elements in the collectionsexpected - The expected collection to compare againstactual - The actual collection to compare againstmsg - An error message
public static <T> void assertCollectionMatchesNoOrder(Collection<T> expected,
Collection<T> actual,
String msg)
assertPropertiesMatch(String, Object, Object, String...). If the
collections differ in size, an assertion error will be thrown; otherwise, elements
are compared, ignoring order. Note that all element properties are are compared in
this method.
T - The type of the elements in the collectionsexpected - The expected collection to compare againstactual - The actual collection under testmsg - An error message
public static <T> void assertCollectionMatchesNoOrder(String msg,
Collection<T> expected,
Collection<T> actual,
String... ignoredProperties)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||