public final class BeanAssert extends Object
This class fulfils a similar role to other assertion libraries in testing code. It should generally be statically imported.
| Modifier and Type | Method and Description |
|---|---|
static void |
assertBeanEquals(Bean expected,
Bean actual)
Asserts that two beans are equal, providing a better error message.
|
static void |
assertBeanEquals(Bean expected,
Bean actual,
double tolerance)
Asserts that two beans are equal, providing a better error message.
|
static void |
assertBeanEquals(String baseMsg,
Bean expected,
Bean actual)
Asserts that two beans are equal, providing a better error message.
|
static void |
assertBeanEquals(String baseMsg,
Bean expected,
Bean actual,
double tolerance)
Asserts that two beans are equal, providing a better error message.
|
static void |
assertBeanEqualsFullDetail(Bean expected,
Bean actual)
Asserts that two beans are equal, providing a better error message.
|
static void |
assertBeanEqualsFullDetail(Bean expected,
Bean actual,
double tolerance)
Asserts that two beans are equal, providing a better error message.
|
static void |
assertBeanEqualsFullDetail(String baseMsg,
Bean expected,
Bean actual)
Asserts that two beans are equal, providing a better error message, with
an unlimited number of errors reported.
|
static void |
assertBeanEqualsFullDetail(String baseMsg,
Bean expected,
Bean actual,
double tolerance)
Asserts that two beans are equal, providing a better error message, with
an unlimited number of errors reported.
|
public static void assertBeanEquals(Bean expected, Bean actual)
expected - the expected value, not nullactual - the actual value, not nullpublic static void assertBeanEquals(Bean expected, Bean actual, double tolerance)
Note that specifying a tolerance can mean that two beans compare as not
equal using Object.equals(Object) but equal using this method,
because the standard equals method has no tolerance.
expected - the expected value, not nullactual - the actual value, not nulltolerance - the tolerance to use for double and floatpublic static void assertBeanEquals(String baseMsg, Bean expected, Bean actual)
baseMsg - the message to use in any error, null uses default messageexpected - the expected value, not nullactual - the actual value, not nullpublic static void assertBeanEquals(String baseMsg, Bean expected, Bean actual, double tolerance)
Note that specifying a tolerance can mean that two beans compare as not
equal using Object.equals(Object) but equal using this method,
because the standard equals method has no tolerance.
baseMsg - the message to use in any error, null uses default messageexpected - the expected value, not nullactual - the actual value, not nulltolerance - the tolerance to use for double and floatpublic static void assertBeanEqualsFullDetail(Bean expected, Bean actual)
expected - the expected value, not nullactual - the actual value, not nullpublic static void assertBeanEqualsFullDetail(Bean expected, Bean actual, double tolerance)
Note that specifying a tolerance can mean that two beans compare as not
equal using Object.equals(Object) but equal using this method,
because the standard equals method has no tolerance.
expected - the expected value, not nullactual - the actual value, not nulltolerance - the tolerance to use for double and floatpublic static void assertBeanEqualsFullDetail(String baseMsg, Bean expected, Bean actual)
baseMsg - the message to use in any error, null uses default messageexpected - the expected value, not nullactual - the actual value, not nullpublic static void assertBeanEqualsFullDetail(String baseMsg, Bean expected, Bean actual, double tolerance)
Note that specifying a tolerance can mean that two beans compare as not
equal using Object.equals(Object) but equal using this method,
because the standard equals method has no tolerance.
baseMsg - the message to use in any error, null uses default messageexpected - the expected value, not nullactual - the actual value, not nulltolerance - the tolerance to use for double and floatCopyright © 2007–2017 Joda.org. All rights reserved.