[jbosstools-issues] [JBoss JIRA] (JBIDE-12645) Weld extensions: built in contexts
Rastislav Wagner (JIRA)
issues at jboss.org
Thu Apr 3 05:07:13 EDT 2014
[ https://issues.jboss.org/browse/JBIDE-12645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rastislav Wagner closed JBIDE-12645.
------------------------------------
verified in JBDS 8.0.0 Beta1-v20140330-1929-B79
> Weld extensions: built in contexts
> ----------------------------------
>
> Key: JBIDE-12645
> URL: https://issues.jboss.org/browse/JBIDE-12645
> Project: Tools (JBoss Tools)
> Issue Type: Sub-task
> Components: cdi-extensions
> Reporter: Alexey Kazakov
> Assignee: Viacheslav Kabanovich
> Labels: new_and_noteworthy
> Fix For: 4.2.0.Alpha1
>
>
> See http://docs.jboss.org/weld/reference/1.1.5.Final/en-US/html/contexts.html#contexts.available
> Steps:
> 1. Import into Eclipse test project /jbosstools-javaee/cdi/tests/org.jboss.tools.cdi.core.test/projects/weld1.1
> 2. Open Java source src/test/Test.java
> {code}
> package test;
> import javax.enterprise.inject.Default;
> import javax.inject.Inject;
> import org.jboss.weld.context.ApplicationContext;
> import org.jboss.weld.context.ConversationContext;
> import org.jboss.weld.context.DependentContext;
> import org.jboss.weld.context.RequestContext;
> import org.jboss.weld.context.SessionContext;
> import org.jboss.weld.context.SingletonContext;
> import org.jboss.weld.context.bound.Bound;
> import org.jboss.weld.context.bound.BoundConversationContext;
> import org.jboss.weld.context.bound.BoundRequestContext;
> import org.jboss.weld.context.bound.BoundSessionContext;
> import org.jboss.weld.context.ejb.Ejb;
> import org.jboss.weld.context.ejb.EjbRequestContext;
> import org.jboss.weld.context.http.Http;
> import org.jboss.weld.context.http.HttpConversationContext;
> import org.jboss.weld.context.http.HttpRequestContext;
> import org.jboss.weld.context.http.HttpSessionContext;
> import org.jboss.weld.context.unbound.Unbound;
> public class Test {
> //Bean @Default DependentContext is injected
> @Inject DependentContext dependentContext;
> //Bean @Default ApplicationContext is injected
> @Inject ApplicationContext applicationContext;
> //Bean @Default SingletonContext is injected
> @Inject SingletonContext singletonContext;
> //Bean @Unbound RequestContext is injected
> @Inject @Unbound RequestContext unboundRequestContext;
> //Bean @Bound @Default BoundRequestContext is injected
> @Inject @Bound RequestContext boundRequestContext;
> @Inject @Default BoundRequestContext boundRequestContext2;
> //Bean @Http @Default HttpRequestContext is injected
> @Inject @Http RequestContext httpRequestContext;
> @Inject @Default HttpRequestContext httpRequestContext2;
>
> //Bean @Ejb @Default EjbRequestContext is injected
> @Inject @Ejb RequestContext ejbRequestContext;
> @Inject @Default EjbRequestContext ejbRequestContext2;
> //Bean BoundConversationContext is injected
> @Inject @Bound ConversationContext boundConversationContext;
> @Inject @Default BoundConversationContext boundConversationContext2;
>
> //Bean HttpConversationContext is injected
> @Inject @Http ConversationContext httpConversationContext;
> @Inject @Default HttpConversationContext httpConversationContext2;
> //Bean @Bound @Default BoundSessionContext is injected
> @Inject @Bound SessionContext boundSessionContext;
> @Inject @Default BoundSessionContext boundSessionContext2;
> //Bean @Http @Default HttpSessionContext is injected
> @Inject @Http SessionContext httpSessionContext;
> @Inject @Default HttpSessionContext httpSessionContext2;
> //Invalid: 3 beans are available for injection.
> @Inject RequestContext invalidRequestContext;
> //Invalid: 2 beans are available for injection.
> @Inject ConversationContext invalidConversationContext;
> //Invalid: 2 beans are available for injection.
> @Inject SessionContext invalidSessionContext;
> }
> {code}
> ASSERT: All injection points are satisfied, for three last injection points multiple beans are available.
> Open-on opens interfaces for correspondent beans.
--
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 jbosstools-issues
mailing list