org.rhq.test
Class AssertUtils
java.lang.Object
org.rhq.test.AssertUtils
public class AssertUtils
- extends Object
|
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
|
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 |
AssertUtils
public AssertUtils()
assertPropertiesMatch
public static <T> void assertPropertiesMatch(T expected,
T actual,
String msg)
- Verifies that all public, accessible properties of the two objects are equal. This method might be used when you
want to compare two objects without using their
equals() methods or when they do not implement
equals().
- Type Parameters:
T - The type of the objects to be compared- Parameters:
expected - 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
assertPropertiesMatch
public static <T> void assertPropertiesMatch(String msg,
T expected,
T actual,
String... ignoredProperties)
- Type Parameters:
T - The type of the objects to be compared.- Parameters:
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.
assertPropertiesMatch
public static <T> void 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. This method might be used when you want to compare two objects without
using their equals() methods or when they do not implement equals.
- Type Parameters:
T - The type of the objects to be compared.- Parameters:
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.
assertCollectionEqualsNoOrder
public static <T> void 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. Order is ignored as well as the runtime type of the collections.
- Type Parameters:
T - The type of the elements in the collections- Parameters:
expected - The expected collection to compare againstactual - The actual collection to compare againstmsg - An error message
Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.