public abstract class UnitTestBase
extends java.lang.Object
Constructor and Description |
---|
UnitTestBase() |
Modifier and Type | Method and Description |
---|---|
void |
assertArrayEquals(byte[] expecteds,
byte[] actuals)
Asserts that two byte arrays are equal.
|
void |
assertArrayEquals(char[] expecteds,
char[] actuals)
Asserts that two char arrays are equal.
|
void |
assertArrayEquals(int[] expecteds,
int[] actuals)
Asserts that two int arrays are equal.
|
void |
assertArrayEquals(long[] expecteds,
long[] actuals)
Asserts that two long arrays are equal.
|
void |
assertArrayEquals(java.lang.Object[] expecteds,
java.lang.Object[] actuals)
Asserts that two object arrays are equal.
|
void |
assertArrayEquals(short[] expecteds,
short[] actuals)
Asserts that two short arrays are equal.
|
abstract void |
assertArrayEquals(java.lang.String message,
byte[] expecteds,
byte[] actuals)
Asserts that two byte arrays are equal.
|
abstract void |
assertArrayEquals(java.lang.String message,
char[] expecteds,
char[] actuals)
Asserts that two char arrays are equal.
|
abstract void |
assertArrayEquals(java.lang.String message,
int[] expecteds,
int[] actuals)
Asserts that two int arrays are equal.
|
abstract void |
assertArrayEquals(java.lang.String message,
long[] expecteds,
long[] actuals)
Asserts that two long arrays are equal.
|
abstract void |
assertArrayEquals(java.lang.String message,
java.lang.Object[] expecteds,
java.lang.Object[] actuals)
Asserts that two object arrays are equal.
|
abstract void |
assertArrayEquals(java.lang.String message,
short[] expecteds,
short[] actuals)
Asserts that two short arrays are equal.
|
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.
|
abstract void |
assertEquals(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
Asserts that two objects are equal.
|
void |
assertFalse(boolean condition)
Asserts that a condition is false.
|
void |
assertFalse(java.lang.String message,
boolean condition)
Asserts that a condition is false.
|
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.
|
abstract 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.
|
abstract void |
fail(java.lang.String message)
Fails a test with the given message.
|
abstract java.lang.String |
getJavaProjectDirectory()
Get the Java project directory, with the Java source etc.
|
public abstract java.lang.String getJavaProjectDirectory()
public void assertEquals(@Nullable java.lang.Object expected, @Nullable java.lang.Object actual)
expected
and actual
are null
, they are considered equal.expected
- expected valueactual
- the value to check against expected
public abstract void assertEquals(@Nullable java.lang.String message, @Nullable java.lang.Object expected, @Nullable java.lang.Object actual)
expected
and actual
are null
, they are considered equal.message
- the identifying message for the assertion error (null
okay)expected
- expected valueactual
- actual valuepublic void assertEquals(long expected, long actual)
expected
- expected long value.actual
- actual long valuepublic void assertEquals(@Nullable java.lang.String message, long expected, long actual)
message
- the identifying message for the test framework assertion error (null
okay)expected
- long expected value.actual
- long actual valuepublic abstract void assertArrayEquals(@Nullable java.lang.String message, java.lang.Object[] expecteds, java.lang.Object[] actuals)
expecteds
and actuals
are null
, they are considered
equal.message
- the identifying message for the test framework assertion error (null
okay)expecteds
- Object array or array of arrays (multi-dimensional array) with expected values.actuals
- Object array or array of arrays (multi-dimensional array) with actual valuespublic void assertArrayEquals(java.lang.Object[] expecteds, java.lang.Object[] actuals)
expected
and actual
are null
, they are considered equal.expecteds
- Object array or array of arrays (multi-dimensional array) with expected valuesactuals
- Object array or array of arrays (multi-dimensional array) with actual valuespublic abstract void assertArrayEquals(@Nullable java.lang.String message, byte[] expecteds, byte[] actuals)
message
- the identifying message for the test framework assertion error (null
okay)expecteds
- byte array with expected valuesactuals
- byte array with actual valuespublic void assertArrayEquals(byte[] expecteds, byte[] actuals)
expecteds
- byte array with expected values.actuals
- byte array with actual valuespublic abstract void assertArrayEquals(@Nullable java.lang.String message, char[] expecteds, char[] actuals)
message
- the identifying message for the test framework assertion error (null
okay)expecteds
- char array with expected values.actuals
- char array with actual valuespublic void assertArrayEquals(char[] expecteds, char[] actuals)
expecteds
- char array with expected values.actuals
- char array with actual valuespublic abstract void assertArrayEquals(@Nullable java.lang.String message, short[] expecteds, short[] actuals)
message
- the identifying message for the test framework assertion error (null
okay)expecteds
- short array with expected values.actuals
- short array with actual valuespublic void assertArrayEquals(short[] expecteds, short[] actuals)
expecteds
- short array with expected values.actuals
- short array with actual valuespublic abstract void assertArrayEquals(@Nullable java.lang.String message, int[] expecteds, int[] actuals)
message
- the identifying message for the test framework assertion error (null
okay)expecteds
- int array with expected values.actuals
- int array with actual valuespublic void assertArrayEquals(int[] expecteds, int[] actuals)
expecteds
- int array with expected values.actuals
- int array with actual valuespublic abstract void assertArrayEquals(@Nullable java.lang.String message, long[] expecteds, long[] actuals)
message
- the identifying message for the test framework assertion error (null
okay)expecteds
- long array with expected values.actuals
- long array with actual valuespublic void assertArrayEquals(long[] expecteds, long[] actuals)
expecteds
- long array with expected values.actuals
- long array with actual valuespublic void assertTrue(@Nullable java.lang.String message, boolean condition)
message
- the identifying message for the test framework assertion error (null
okay)condition
- condition to be checkedpublic void assertTrue(boolean condition)
condition
- condition to be checkedpublic void assertFalse(@Nullable java.lang.String message, boolean condition)
message
- the identifying message for the test framework assertion error (null
okay)condition
- condition to be checkedpublic void assertFalse(boolean condition)
condition
- condition to be checkedpublic void assertNotNull(@Nullable java.lang.String message, @Nullable java.lang.Object object)
message
- the identifying message for the test framework assertion error (null
okay)object
- Object to check or null
public void assertNotNull(@Nullable java.lang.Object object)
object
- Object to check or null
public void assertNull(@Nullable java.lang.String message, @Nullable java.lang.Object object)
message
- the identifying message for the test framework assertion error (null
okay)object
- Object to check or null
public void assertNull(@Nullable java.lang.Object object)
object
- Object to check or null
public abstract void fail(@Nullable java.lang.String message)
message
- the identifying message for the test framework assertion error (null
okay)public abstract void assertSame(java.lang.String message, @Nullable java.lang.Object expected, @Nullable java.lang.Object actual)
message
- the identifying message for the test framework assertion error (null
okay)expected
- the expected objectactual
- the object to compare to expectedpublic void fail()