Annotation Type Isolation


@Retention(RUNTIME) @Target(TYPE) public @interface Isolation
Defines the isolation level for a test case.

Per default, each test method is executed in a separate Weld instance, which guarantees total isolation; however, this also means that multiple instances exist for application-scoped beans (one per test method), which can be a problem in some cases.

When a test class is annotated with @Isolation(IsolationLevel.PER_CLASS), all test methods are executed in the same Weld instance. Each test method will still run in a separate instance of the test class itself, but any injected application-scoped beans will be shared among the test methods.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description