Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1763

Allow EjbModule to be returned as a part of in-class configuration in ApplicationComposer (@Module)

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0.0-beta-2
    • Fix Version/s: 4.5.0
    • Component/s: tests
    • Labels:

      Description

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

        Attachments

        1. ApplicationComposer.patch
          1 kB
          Jakub Marchwicki
        2. ApplicationComposer.patch
          1 kB
          Jakub Marchwicki

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kubamarchwicki Jakub Marchwicki
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: