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

Bartosz Majsak (JIRA) jira-events at lists.jboss.org
Wed Jun 5 04:14:56 EDT 2013


    [ https://issues.jboss.org/browse/ARQ-1389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779403#comment-12779403 ] 

Bartosz Majsak edited comment on ARQ-1389 at 6/5/13 4:14 AM:
-------------------------------------------------------------

There is something already in place, but more focused on CDI/JSF world - https://community.jboss.org/thread/200461
                
      was (Author: bmajsak):
    There is something already in place, but more focused on CDI/JSF integration - https://community.jboss.org/thread/200461
                  
> 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