|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.common.testing.GuavaAsserts
@Beta @GwtCompatible public final class GuavaAsserts
Contains additional assertion methods not found in JUnit.
Nested Class Summary | |
---|---|
static class |
GuavaAsserts.TestAssertionFailure
An error thrown when test assertions are shown to be invalid. |
Method Summary | |
---|---|
static void |
assertEquals(Object expected,
Object actual)
Assert the equality of two objects |
static void |
assertEquals(String message,
Object o1,
Object o2)
Assert the equality of two objects |
static void |
assertTrue(boolean condition)
Test the condition and throw a failure exception if false with a stock message. |
static void |
assertTrue(String message,
boolean condition)
Test the condition and throw a failure exception if false with a stock message. |
static void |
checkEqualsAndHashCodeMethods(String message,
Object lhs,
Object rhs,
boolean expectedResult)
Utility for testing equals() and hashCode() results at once. |
static void |
fail()
Fail with an RuntimeException. |
static void |
fail(String message)
Fail with an RuntimeException and a message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void checkEqualsAndHashCodeMethods(String message, Object lhs, Object rhs, boolean expectedResult)
lhs
- An Object for which equals() and hashCode() are to be tested.rhs
- As lhs.expectedResult
- True if the objects should compare equal,
false if not.public static void fail()
RuntimeException
- alwayspublic static void fail(String message)
RuntimeException
- alwayspublic static void assertTrue(boolean condition)
public static void assertTrue(String message, boolean condition)
public static void assertEquals(Object expected, Object actual)
public static void assertEquals(String message, Object o1, Object o2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |