|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectj2meunit.framework.Assert
public class Assert
A set of assert methods.
| Constructor Summary | |
|---|---|
Assert()
Creates a new Assert object. |
|
| Method Summary | |
|---|---|
void |
assertEquals(long expected,
long actual)
Asserts that two longs are equal. |
void |
assertEquals(java.lang.Object expected,
java.lang.Object actual)
Asserts that two objects are equal. |
void |
assertEquals(java.lang.String message,
long expected,
long actual)
Asserts that two longs are equal. |
void |
assertEquals(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
Asserts that two objects are equal. |
void |
assertNotNull(java.lang.Object object)
Asserts that an object isn't null. |
void |
assertNotNull(java.lang.String message,
java.lang.Object object)
Asserts that an object isn't null. |
void |
assertNull(java.lang.Object object)
Asserts that an object is null. |
void |
assertNull(java.lang.String message,
java.lang.Object object)
Asserts that an object is null. |
void |
assertSame(java.lang.Object expected,
java.lang.Object actual)
Asserts that two objects refer to the same object. |
void |
assertSame(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
Asserts that two objects refer to the same object. |
void |
assertTrue(boolean condition)
Asserts that a condition is true. |
void |
assertTrue(java.lang.String message,
boolean condition)
Asserts that a condition is true. |
void |
fail()
Fails a test with no message. |
void |
fail(java.lang.String message)
Fails a test with the given error message. |
protected void |
failNotEquals(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
Fails an "assertEquals" test with the given error message. |
protected void |
failNotSame(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
Fails an "assertSame" test with the given error message. |
protected void |
onAssertion()
This method is called every time an assertion is made (this does not include direct fails). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Assert()
| Method Detail |
|---|
public void assertEquals(long expected,
long actual)
expected - the expected value of an objectactual - the actual value of an object
public void assertEquals(java.lang.Object expected,
java.lang.Object actual)
expected - the expected value of an objectactual - the actual value of an object
public void assertEquals(java.lang.String message,
long expected,
long actual)
message - the detail message for this assertionexpected - the expected value of an objectactual - the actual value of an object
public void assertEquals(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
message - The detail message for this assertionexpected - The expected value of an objectactual - The actual value of an objectpublic void assertNotNull(java.lang.Object object)
object - The object to test
public void assertNotNull(java.lang.String message,
java.lang.Object object)
message - The detail message for this assertionobject - The object to testpublic void assertNull(java.lang.Object object)
object - The object to test
public void assertNull(java.lang.String message,
java.lang.Object object)
message - The detail message for this assertionobject - The object to test
public void assertSame(java.lang.Object expected,
java.lang.Object actual)
expected - The expected value of an objectactual - The actual value of an object
public void assertSame(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
message - The detail message for this assertionexpected - The expected value of an objectactual - The actual value of an object
public void assertTrue(java.lang.String message,
boolean condition)
message - The detail message for this assertioncondition - The boolean value to testpublic void assertTrue(boolean condition)
condition - The boolean value to testpublic void fail()
public void fail(java.lang.String message)
message - The message to display
AssertionFailedError - Containing the error message
protected void failNotEquals(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
message - The message to displayexpected - The expected valueactual - The actual value
protected void failNotSame(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
message - The message to displayexpected - The expected valueactual - The actual valueprotected void onAssertion()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||