JUnit 4
Annotations
Annotation |
Description |
---|---|
|
Annotation |
|
Will perform the method() before each test. This method can prepare the test environment, e.g. read input data, initialize the class) |
|
Test method must start with test |
|
Will perform the method before the start of all tests. This can be used to perform time intensive activities for example be used to connect to a database |
|
Will perform the method after all tests have finished.. This can be used to perform clean-up activities for example be used to disconnect to a database |
|
Will ignore the test method, e.g. useful if the underlying code has been changed and the test has not yet been adapted. |
|
Tests if the method throws the named exception |
|
Fails if the method takes longer then 100 milliseconds |