_@BeforeClass
Description
- A method annotated with
@BeforeClass
will be executed once, before all the test methods are executed. If there are four test methods in a test class, and a user runs thetest
CLI command for the whole test class, the following will happen:- The method annotated with
@BeforeClass
will run one time. - Each of the four test methods will run.
- The method annotated with
Attributes
Attribute Name | Required? | Possible Values | Info |
---|---|---|---|
NONE | Â | Â | No attributes. |
Location in the test class file
Before a method declaration.
Examples
Â
Panel Title
class variableTest
{
@BeforeClass
setUp()
{
set(variable: 'hi', value: 'test');
}
Â
@Test
run()
{
assert(variable: 'hi', value: 'test');
}
Â
@Test
Runny()
{
assert(variable: 'hi', value: 'test');
}
Â
@Test
runWithSubs()
{
assert(variable: 'hi', value: 'test');
}
}
Â