nIt
is also possible to run a method once only for the
entire test class, before any of the tests are executed, and prior to any @Before method(s).
nUseful
for starting servers, opening communications, etc. that are time-consuming to close and
re-open for each
test.
nIndicate
with @BeforeClass annotation (can only be used on one method, which
must be static):
n @BeforeClass public static
void anyNameHere()
n
{
n // class setup code here
n }