Package org.apache.openejb.config

Examples of org.apache.openejb.config.AppModule


   * @return Whether or not the parsing was successful
   * @throws ConversionException
   */
  @SuppressWarnings("unchecked") //$NON-NLS-1$
  public boolean convert(InputSource ejbJarSrc, InputSource openEjbJarSrc) throws ConversionException {
    AppModule appModule = getAppModule(ejbJarSrc, openEjbJarSrc);

    if (appModule.getCmpMappings() == null) {
      appModule.setCmpMappings(new EntityMappings());
    }
   
    for (Converter converter : converters) {
      converter.convert(appModule);
    }
View Full Code Here


    return true;
  }

  private AppModule getAppModule(InputSource ejbJarSrc, InputSource openEjbJarSrc) throws ConversionException {
    AppModule appModule = new AppModule(classLoader, "ModuleToConvert"); //$NON-NLS-1$
   
    try {
      EjbJar ejbJar = (EjbJar) JaxbJavaee.unmarshal(EjbJar.class, ejbJarSrc.getByteStream());
          EjbModule ejbModule = new EjbModule(ejbJar, new OpenejbJar());
          ejbModule.setClassLoader(classLoader);
          appModule.getEjbModules().add(ejbModule);

      if (openEjbJarSrc != null) {
            InitEjbDeployments initEjbDeployments = new InitEjbDeployments();
            initEjbDeployments.deploy(ejbModule);
View Full Code Here

                one(facade).changeInvocationsTo("org.superbiz.ProductHome", "findAll", new String[0], "javax.persistence.EntityManager entityManager = entityManagerFactory.createEntityManager();\r\njavax.persistence.Query query = entityManager.createQuery(\"SELECT p from Product p\");\r\nquery.getResultList();\r\n");
            }
        });

        AppModule module = new TestFixture().getAppModule("simple-session-and-entity-ejb-jar.xml", null);
        new EntityBeanUsageConverter(facade).convert(module);

        context.assertIsSatisfied();
    }
View Full Code Here

                one(facade).removeInterface("org.superbiz.Store", "javax.ejb.EJBObject");
                one(facade).addInterface("org.superbiz.StoreBean", "org.superbiz.Store");
            }
        });

        AppModule module = new TestFixture().getAppModule("single-session-bean.xml", null);
        new SessionBeanInterfaceModifier(facade).convert(module);

        context.assertIsSatisfied();
    }
View Full Code Here

                one(facade).removeInterface("org.superbiz.Store", "javax.ejb.EJBLocalObject");
                one(facade).addInterface("org.superbiz.StoreBean", "org.superbiz.Store");
            }
        });

        AppModule module = new TestFixture().getAppModule("single-session-bean-local.xml", null);
        new SessionBeanInterfaceModifier(facade).convert(module);

        context.assertIsSatisfied();
    }
View Full Code Here

            {
                one(facade).removeInterface("org.superbiz.StoreBean", "javax.ejb.SessionBean");
            }
        });

        AppModule module = new TestFixture().getAppModule("badsession-ejb-jar.xml", null);
        new SessionBeanInterfaceModifier(facade).convert(module);

        context.assertIsSatisfied();
    }
View Full Code Here

    public void testShouldNotThrowExceptionOnNullEjbClassName() throws Exception {
        Mockery context = new Mockery();

        final IJDTFacade facade = context.mock(IJDTFacade.class);

        AppModule module = new TestFixture().getAppModule("emptysession-ejb-jar.xml", null);
        new SessionBeanInterfaceModifier(facade).convert(module);

        context.assertIsSatisfied();
    }
View Full Code Here

   
    IJDTFacade jdtFacade = context.mock(IJDTFacade.class);
    InputStream is = getClass().getResourceAsStream("empty-ejb-jar.xml");
    InputSource ejbJarSrc = new InputSource(is);

        AppModule appModule = new TestFixture().getAppModule(ejbJarSrc, null);
    new EntityBeanConverter(jdtFacade).convert(appModule);
  }
View Full Code Here

   
    IJDTFacade jdtFacade = context.mock(IJDTFacade.class);
    InputStream is = getClass().getResourceAsStream("nobeans-ejb-jar.xml");
    InputSource ejbJarSrc = new InputSource(is);

        AppModule appModule = new TestFixture().getAppModule(ejbJarSrc, null);
    new EntityBeanConverter(jdtFacade).convert(appModule);
  }
View Full Code Here

   
    IJDTFacade jdtFacade = context.mock(IJDTFacade.class);
    InputStream is = getClass().getResourceAsStream("emptyrelationship-ejb-jar.xml");
    InputSource ejbJarSrc = new InputSource(is);

        AppModule appModule = new TestFixture().getAppModule(ejbJarSrc, null);
    new EntityBeanConverter(jdtFacade).addRelationshipAnnotations(appModule);
  }
View Full Code Here

TOP

Related Classes of org.apache.openejb.config.AppModule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.