-
Feature Request
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
None
I've seen the need for this to pop up in several places - at work, in SO questions, in email threads, and I think it would be ideal to handle as a new Arquillian Extension. Right now, Arquillian is dependent on the app server to manage context and typically the context activated is whatever the app server finds as appropriate. This works OK for servlet based containers since a RequestScope will be active, but for local, embedded (non servlet) or even JMX protocol based containers this doesn't work.
Ideally, a developer would be able to annotate a test method:
@ActiveContext(ValidScope.class)
Where ValidScope.class is a CDI scope (RequestScoped, SessionScoped.. etc) that can be activated. The extension would then activate this scope for the duration of the test, allowing injection of appropriately scoped objects to be injected correctly.
Perhaps this annotation can also be class level, applying to everything in that class.
- relates to
-
ARQ-337 Create a Context/Scope activation/deactivation abstraction for CDI
- Open