[weld-issues] [JBoss JIRA] Commented: (WELD-220) Make it possible to get manager from TestContainer before beans are deployed

Kabir Khan (JIRA) jira-events at lists.jboss.org
Wed Oct 21 11:55:05 EDT 2009


    [ https://jira.jboss.org/jira/browse/WELD-220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12490747#action_12490747 ] 

Kabir Khan commented on WELD-220:
---------------------------------

In case Pete wonders why, I'll probably have forgotten before he comes back from holidays :-)

To deploy an Weld aware MC bean we need to have access to a BeanManager so that we can create the InjectionTarget.
To make MC beans available to Weld we need deploy the MC beans before Weld is deployed and push the MC beans into Weld using the Weld lifecycle events.
The existing implementation of TestContainer created the BeanManager during deployment of the Weld beans.

For MC-beans-injected-into-Weld-beans and Weld-beans-injected-into-MC-beans, I had worked around this in my test framework by creating a temporary TestContainer/BeanManager that I could use on the MC side before deploying the Weld classes.

However, when I created a test with the following classes, where Middle is deployed in Weld and Last+First in MC, it all failed since the beans created from Last and First, belong to the "real" bean manager where Middle also resides, while the First.middle injection point was created against the "temporary" bean manager which thus cannot find the Middle bean.

@Default
public class Last
{

}

@Default
public class Middle
{
   @Inject Last last;

   public Last getLast()
   {
      return last;
   }
}


@Default
public class First
{
   @Inject Middle middle;

   public Middle getMiddle()
   {
      return middle;
   }
}


> Make it possible to get manager from TestContainer before beans are deployed
> ----------------------------------------------------------------------------
>
>                 Key: WELD-220
>                 URL: https://jira.jboss.org/jira/browse/WELD-220
>             Project: Weld
>          Issue Type: Feature Request
>          Components: Testing Infrastructure (Mocks and Harness Integration)
>            Reporter: Kabir Khan
>             Fix For: 1.0.0.CR2
>
>
> This is needed for the work I am doing on MC. Although the use-case in MC is more complicated than showed here, PreinstantiateBeanManager shows the essentials of what I need.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list