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)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.0.0-beta-2
    • 4.5.0
    • tests

    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

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

            Dates

              Created:
              Updated:
              Resolved: