AssertThrows
Helper class to simplify negative testing. Usage:
new AssertThrows() { public void test() {
Integer.parseInt("not a number");
}};
| Methods |
|
AssertThrows(Class expectedExceptionClass)
Create a new assertion object, and call the test method to verify the
expected exception is thrown.
|
|
AssertThrows(Class expectedExceptionClass)
Create a new assertion object, and call the test method to verify the
expected exception is thrown.
Parameters:
expectedExceptionClass - the expected exception class
|
|
AssertThrows()
Create a new assertion object, and call the test method to verify the
expected exception is thrown.
|
|
AssertThrows()
Create a new assertion object, and call the test method to verify the
expected exception is thrown.
|
|
AssertThrows(int expectedErrorCode)
Create a new assertion object, and call the test method to verify the
expected exception is thrown.
|
|
AssertThrows(int expectedErrorCode)
Create a new assertion object, and call the test method to verify the
expected exception is thrown.
Parameters:
expectedErrorCode - the error code of the exception
|
| void |
test()
The test method that is called.
|
| void |
test() throws Exception
The test method that is called.
Throws:
Exception - the exception
|
|