public abstract class AssertThrows
extends java.lang.Object
new AssertThrows() { public void test() {
Integer.parseInt("not a number");
}};
| Constructor and Description |
|---|
AssertThrows()
Create a new assertion object, and call the test method to verify the
expected exception is thrown.
|
AssertThrows(java.lang.Class<? extends java.lang.Exception> expectedExceptionClass)
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.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
test()
The test method that is called.
|
public AssertThrows(java.lang.Class<? extends java.lang.Exception> expectedExceptionClass)
expectedExceptionClass - the expected exception classpublic AssertThrows()
public AssertThrows(int expectedErrorCode)
expectedErrorCode - the error code of the exception