Annotation Type Managed
Annotation for a
Workspace
field in a test class. This will ensure it gets initialised
and closed correctly between tests.
Use static-fields to keep a workspace object alive for the duration of all the tests
(providing the same semantics as initialising and closing resources using the
BeforeAll
and AfterAll
annotations).
You must extend your test class with the JctExtension
extension for this annotation
to be detected and handled.
Example usage:
@ExtendWith(JctExtension.class)
class MyTest {
@Managed
Workspace workspace;
@JavacCompilerTest
void myTest(JctCompiler compiler) {
...
var compilation = compiler.compile(workspace);
...
}
}
- Since:
- 0.4.0
- Author:
- Ashley Scopes
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionGet the path strategy to use for the workspace.
-
Element Details
-
pathStrategy
Get the path strategy to use for the workspace.- Returns:
- the path strategy to use.
- Default:
RAM_DIRECTORIES
-