|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.testng.Assert
public class Assert
Assertion tool class. Presents assertion methods with a more natural parameter order. The order is always actualValue, expectedValue [, message].
Constructor Summary | |
---|---|
protected |
Assert()
Protect constructor since it is a static only class |
Method Summary | |
---|---|
static void |
assertEquals(boolean actual,
boolean expected)
Asserts that two booleans are equal. |
static void |
assertEquals(boolean actual,
boolean expected,
String message)
Asserts that two booleans are equal. |
static void |
assertEquals(byte[] actual,
byte[] expected)
Asserts that two arrays contain the same elements in the same order. |
static void |
assertEquals(byte[] actual,
byte[] expected,
String message)
Asserts that two arrays contain the same elements in the same order. |
static void |
assertEquals(byte actual,
byte expected)
Asserts that two bytes are equal. |
static void |
assertEquals(byte actual,
byte expected,
String message)
Asserts that two bytes are equal. |
static void |
assertEquals(char actual,
char expected)
Asserts that two chars are equal. |
static void |
assertEquals(char actual,
char expected,
String message)
Asserts that two chars are equal. |
static void |
assertEquals(Collection actual,
Collection expected)
Asserts that two collections contain the same elements in the same order. |
static void |
assertEquals(Collection actual,
Collection expected,
String message)
Asserts that two collections contain the same elements in the same order. |
static void |
assertEquals(double actual,
double expected,
double delta)
Asserts that two doubles are equal concerning a delta. |
static void |
assertEquals(double actual,
double expected,
double delta,
String message)
Asserts that two doubles are equal concerning a delta. |
static void |
assertEquals(float actual,
float expected,
float delta)
Asserts that two floats are equal concerning a delta. |
static void |
assertEquals(float actual,
float expected,
float delta,
String message)
Asserts that two floats are equal concerning a delta. |
static void |
assertEquals(int actual,
int expected)
Asserts that two ints are equal. |
static void |
assertEquals(int actual,
int expected,
String message)
Asserts that two ints are equal. |
static void |
assertEquals(long actual,
long expected)
Asserts that two longs are equal. |
static void |
assertEquals(long actual,
long expected,
String message)
Asserts that two longs are equal. |
static void |
assertEquals(Map<?,?> actual,
Map<?,?> expected)
Asserts that two maps are equal. |
static void |
assertEquals(Object[] actual,
Object[] expected)
Asserts that two arrays contain the same elements in the same order. |
static void |
assertEquals(Object[] actual,
Object[] expected,
String message)
Asserts that two arrays contain the same elements in the same order. |
static void |
assertEquals(Object actual,
Object expected)
Asserts that two objects are equal. |
static void |
assertEquals(Object actual,
Object expected,
String message)
Asserts that two objects are equal. |
static void |
assertEquals(Set<?> actual,
Set<?> expected,
String message)
Assert set equals |
static void |
assertEquals(Set actual,
Set expected)
Asserts that two sets are equal. |
static void |
assertEquals(short actual,
short expected)
Asserts that two shorts are equal. |
static void |
assertEquals(short actual,
short expected,
String message)
Asserts that two shorts are equal. |
static void |
assertEquals(String actual,
String expected)
Asserts that two Strings are equal. |
static void |
assertEquals(String actual,
String expected,
String message)
Asserts that two Strings are equal. |
static void |
assertEqualsNoOrder(Object[] actual,
Object[] expected)
Asserts that two arrays contain the same elements in no particular order. |
static void |
assertEqualsNoOrder(Object[] actual,
Object[] expected,
String message)
Asserts that two arrays contain the same elements in no particular order. |
static void |
assertFalse(boolean condition)
Asserts that a condition is false. |
static void |
assertFalse(boolean condition,
String message)
Asserts that a condition is false. |
static void |
assertNotEquals(double actual1,
double actual2,
double delta)
|
static void |
assertNotEquals(double actual1,
double actual2,
double delta,
String message)
|
static void |
assertNotEquals(float actual1,
float actual2,
float delta)
|
static void |
assertNotEquals(float actual1,
float actual2,
float delta,
String message)
|
static void |
assertNotEquals(Object actual1,
Object actual2)
|
static void |
assertNotEquals(Object actual1,
Object actual2,
String message)
|
static void |
assertNotNull(Object object)
Asserts that an object isn't null. |
static void |
assertNotNull(Object object,
String message)
Asserts that an object isn't null. |
static void |
assertNotSame(Object actual,
Object expected)
Asserts that two objects do not refer to the same object. |
static void |
assertNotSame(Object actual,
Object expected,
String message)
Asserts that two objects do not refer to the same objects. |
static void |
assertNull(Object object)
Asserts that an object is null. |
static void |
assertNull(Object object,
String message)
Asserts that an object is null. |
static void |
assertSame(Object actual,
Object expected)
Asserts that two objects refer to the same object. |
static void |
assertSame(Object actual,
Object expected,
String message)
Asserts that two objects refer to the same object. |
static void |
assertTrue(boolean condition)
Asserts that a condition is true. |
static void |
assertTrue(boolean condition,
String message)
Asserts that a condition is true. |
static void |
fail()
Fails a test with no message. |
static void |
fail(String message)
Fails a test with the given message. |
static void |
fail(String message,
Throwable realCause)
Fails a test with the given message and wrapping the original exception. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Assert()
Method Detail |
---|
public static void assertTrue(boolean condition, String message)
condition
- the condition to evaluatemessage
- the assertion error messagepublic static void assertTrue(boolean condition)
condition
- the condition to evaluatepublic static void assertFalse(boolean condition, String message)
condition
- the condition to evaluatemessage
- the assertion error messagepublic static void assertFalse(boolean condition)
condition
- the condition to evaluatepublic static void fail(String message, Throwable realCause)
message
- the assertion error messagerealCause
- the original exceptionpublic static void fail(String message)
message
- the assertion error messagepublic static void fail()
public static void assertEquals(Object actual, Object expected, String message)
actual
- the actual valueexpected
- the expected valuemessage
- the assertion error messagepublic static void assertEquals(Object actual, Object expected)
actual
- the actual valueexpected
- the expected valuepublic static void assertEquals(String actual, String expected, String message)
actual
- the actual valueexpected
- the expected valuemessage
- the assertion error messagepublic static void assertEquals(String actual, String expected)
actual
- the actual valueexpected
- the expected valuepublic static void assertEquals(double actual, double expected, double delta, String message)
actual
- the actual valueexpected
- the expected valuedelta
- the absolute tolerate value value between the actual and expected valuemessage
- the assertion error messagepublic static void assertEquals(double actual, double expected, double delta)
actual
- the actual valueexpected
- the expected valuedelta
- the absolute tolerate value value between the actual and expected valuepublic static void assertEquals(float actual, float expected, float delta, String message)
actual
- the actual valueexpected
- the expected valuedelta
- the absolute tolerate value value between the actual and expected valuemessage
- the assertion error messagepublic static void assertEquals(float actual, float expected, float delta)
actual
- the actual valueexpected
- the expected valuedelta
- the absolute tolerate value value between the actual and expected valuepublic static void assertEquals(long actual, long expected, String message)
actual
- the actual valueexpected
- the expected valuemessage
- the assertion error messagepublic static void assertEquals(long actual, long expected)
actual
- the actual valueexpected
- the expected valuepublic static void assertEquals(boolean actual, boolean expected, String message)
actual
- the actual valueexpected
- the expected valuemessage
- the assertion error messagepublic static void assertEquals(boolean actual, boolean expected)
actual
- the actual valueexpected
- the expected valuepublic static void assertEquals(byte actual, byte expected, String message)
actual
- the actual valueexpected
- the expected valuemessage
- the assertion error messagepublic static void assertEquals(byte actual, byte expected)
actual
- the actual valueexpected
- the expected valuepublic static void assertEquals(char actual, char expected, String message)
actual
- the actual valueexpected
- the expected valuemessage
- the assertion error messagepublic static void assertEquals(char actual, char expected)
actual
- the actual valueexpected
- the expected valuepublic static void assertEquals(short actual, short expected, String message)
actual
- the actual valueexpected
- the expected valuemessage
- the assertion error messagepublic static void assertEquals(short actual, short expected)
actual
- the actual valueexpected
- the expected valuepublic static void assertEquals(int actual, int expected, String message)
actual
- the actual valueexpected
- the expected valuemessage
- the assertion error messagepublic static void assertEquals(int actual, int expected)
actual
- the actual valueexpected
- the expected valuepublic static void assertNotNull(Object object)
object
- the assertion objectpublic static void assertNotNull(Object object, String message)
object
- the assertion objectmessage
- the assertion error messagepublic static void assertNull(Object object)
object
- the assertion objectpublic static void assertNull(Object object, String message)
object
- the assertion objectmessage
- the assertion error messagepublic static void assertSame(Object actual, Object expected, String message)
actual
- the actual valueexpected
- the expected valuemessage
- the assertion error messagepublic static void assertSame(Object actual, Object expected)
actual
- the actual valueexpected
- the expected valuepublic static void assertNotSame(Object actual, Object expected, String message)
actual
- the actual valueexpected
- the expected valuemessage
- the assertion error messagepublic static void assertNotSame(Object actual, Object expected)
actual
- the actual valueexpected
- the expected valuepublic static void assertEquals(Collection actual, Collection expected)
actual
- the actual valueexpected
- the expected valuepublic static void assertEquals(Collection actual, Collection expected, String message)
actual
- the actual valueexpected
- the expected valuemessage
- the assertion error messagepublic static void assertEquals(Object[] actual, Object[] expected, String message)
actual
- the actual valueexpected
- the expected valuemessage
- the assertion error messagepublic static void assertEqualsNoOrder(Object[] actual, Object[] expected, String message)
actual
- the actual valueexpected
- the expected valuemessage
- the assertion error messagepublic static void assertEquals(Object[] actual, Object[] expected)
actual
- the actual valueexpected
- the expected valuepublic static void assertEqualsNoOrder(Object[] actual, Object[] expected)
actual
- the actual valueexpected
- the expected valuepublic static void assertEquals(byte[] actual, byte[] expected)
actual
- the actual valueexpected
- the expected valuepublic static void assertEquals(byte[] actual, byte[] expected, String message)
actual
- the actual valueexpected
- the expected valuemessage
- the assertion error messagepublic static void assertEquals(Set actual, Set expected)
public static void assertEquals(Set<?> actual, Set<?> expected, String message)
public static void assertEquals(Map<?,?> actual, Map<?,?> expected)
public static void assertNotEquals(Object actual1, Object actual2, String message)
public static void assertNotEquals(Object actual1, Object actual2)
public static void assertNotEquals(float actual1, float actual2, float delta, String message)
public static void assertNotEquals(float actual1, float actual2, float delta)
public static void assertNotEquals(double actual1, double actual2, double delta, String message)
public static void assertNotEquals(double actual1, double actual2, double delta)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |