public class UnitTest
extends java.lang.Object
Constructor and Description |
---|
UnitTest() |
Modifier and Type | Method and Description |
---|---|
static void |
assertEquals(java.lang.Object exp1,
java.lang.Object exp2)
Tests that two values are equal.
|
static void |
assertEquals(java.lang.String msg,
java.lang.Object exp1,
java.lang.Object exp2)
Tests that two values are equal.
|
static void |
assertFalse(boolean exp)
Checks that the boolean condition is false.
|
static void |
assertFalse(java.lang.String msg,
boolean exp)
Checks that the boolean condition is false.
|
static void |
assertNotEquals(java.lang.Object exp1,
java.lang.Object exp2)
Tests that two values are not equal.
|
static void |
assertNotEquals(java.lang.String msg,
java.lang.Object exp1,
java.lang.Object exp2)
Tests that two values are not equal.
|
static void |
assertNotNull(java.lang.Object exp)
Checks that the expression is not null.
|
static void |
assertNotNull(java.lang.String msg,
java.lang.Object exp)
Checks that the expression is not null.
|
static void |
assertNotSame(java.lang.Object exp1,
java.lang.Object exp2)
Checks that the two expressions are different.
|
static void |
assertNotSame(java.lang.String msg,
java.lang.Object exp1,
java.lang.Object exp2)
Checks that the two expressions are different.
|
static void |
assertNull(java.lang.Object exp)
Checks that the expression is null.
|
static void |
assertNull(java.lang.String msg,
java.lang.Object exp)
Checks that the expression is null.
|
static void |
assertSame(java.lang.Object exp1,
java.lang.Object exp2)
Checks that the two expressions are the same.
|
static void |
assertSame(java.lang.String msg,
java.lang.Object exp1,
java.lang.Object exp2)
Checks that the two expressions are the same.
|
static void |
assertTrue(boolean exp)
Checks that the boolean condition is true.
|
static void |
assertTrue(java.lang.String msg,
boolean exp)
Checks that the boolean condition is true.
|
static int |
getErrorCount()
Returns the current error count.
|
static void |
resetErrorCount()
Resets the current error count to zero.
|
static void |
setConsole(java.lang.Object console)
Redirects output to the specified console.
|
public static void assertTrue(java.lang.String msg, boolean exp)
msg
- The message to display if the assertion failsexp
- The expression being testedpublic static void assertTrue(boolean exp)
exp
- The expression being testedpublic static void assertFalse(java.lang.String msg, boolean exp)
msg
- The message to display if the assertion failsexp
- The expression being testedpublic static void assertFalse(boolean exp)
exp
- The expression being testedpublic static void assertEquals(java.lang.String msg, java.lang.Object exp1, java.lang.Object exp2)
msg
- The message to display if the assertion failsexp1
- The expression being testedexp2
- The expected valuepublic static void assertEquals(java.lang.Object exp1, java.lang.Object exp2)
exp1
- The expression being testedexp2
- The expected valuepublic static void assertNotEquals(java.lang.String msg, java.lang.Object exp1, java.lang.Object exp2)
msg
- The message to display if the assertion failsexp1
- The expression being testedexp2
- The value that should be excludedpublic static void assertNotEquals(java.lang.Object exp1, java.lang.Object exp2)
exp1
- The expression being testedexp2
- The value that should be excludedpublic static void assertNull(java.lang.String msg, java.lang.Object exp)
msg
- The message to display if the assertion failsexp
- The expression being testedpublic static void assertNull(java.lang.Object exp)
exp
- The expression being testedpublic static void assertNotNull(java.lang.String msg, java.lang.Object exp)
msg
- The message to display if the assertion failsexp
- The expression being testedpublic static void assertNotNull(java.lang.Object exp)
exp
- The expression being testedpublic static void assertSame(java.lang.String msg, java.lang.Object exp1, java.lang.Object exp2)
msg
- The message to display if the assertion failsexp1
- The expression being testedexp2
- The expected valuepublic static void assertSame(java.lang.Object exp1, java.lang.Object exp2)
exp1
- The expression being testedexp2
- The expected valuepublic static void assertNotSame(java.lang.String msg, java.lang.Object exp1, java.lang.Object exp2)
msg
- The message to display if the assertion failsexp1
- The expression being testedexp2
- The value that should be excludedpublic static void assertNotSame(java.lang.Object exp1, java.lang.Object exp2)
exp1
- The expression being testedexp2
- The value that should be excludedpublic static void resetErrorCount()
public static int getErrorCount()
public static void setConsole(java.lang.Object console)
console
- The new error-reporting console