[ 
https://issues.apache.org/jira/browse/OPENEJB-1763?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jean-Louis MONTEIRO closed OPENEJB-1763.
----------------------------------------

    Resolution: Fixed
    
> Allow EjbModule to be returned as a part of in-class configuration in 
> ApplicationComposer (@Module)
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENEJB-1763
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1763
>             Project: OpenEJB
>          Issue Type: Improvement
>          Components: tests
>    Affects Versions: 4.0.0-beta-2
>            Reporter: Jakub Marchwicki
>            Priority: Minor
>              Labels: patch, test
>             Fix For: 4.5.0
>
>         Attachments: ApplicationComposer.patch, ApplicationComposer.patch
>
>
> The ApplicationComposer JUnit runner, allows certain types to be returned by 
> the @Module annotated methods. EjbModule is not allowed and it would be 
> helpful if a specific JNDI mapping needs to be defined for tests (that was 
> our case). That way instead of 
>    @Module
>    public EjbJar beans() {
>       EjbJar ejbJar = new EjbJar("application");
>       ejbJar.addEnterpriseBean(new StatelessBean(SomeClass.class));
>       return ejbJar;
>    }
> a whole module can be created in-class
>    @Module
>    public EjbModule module() {
>       EjbJar ejbJar = new EjbJar("application");
>       ejbJar.addEnterpriseBean(new StatelessBean(SomeClass.class));
>       EjbModule ejbModule = new EjbModule(ejbJar, new OpenejbJar());
>       EjbDeployment deployment = new EjbDeployment(new 
> StatefulBean(SomeClass.class));
>       deployment.getJndi().add(new Jndi("custombindings/myClass", "Local"));
>       ejbModule.getOpenejbJar().addEjbDeployment(deployment);
>       return ejbModule;
>    }

--
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

Reply via email to