[arquillian-issues] [JBoss JIRA] (ARQ-1389) Create an extension that allows users to specify CDI context active for a test.

John Ament (JIRA) jira-events at lists.jboss.org
Wed May 22 07:51:06 EDT 2013


John Ament created ARQ-1389:
-------------------------------

             Summary: Create an extension that allows users to specify CDI context active for a test.
                 Key: ARQ-1389
                 URL: https://issues.jboss.org/browse/ARQ-1389
             Project: Arquillian
          Issue Type: Feature Request
      Security Level: Public (Everyone can see)
            Reporter: John Ament


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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the arquillian-issues mailing list