Search in sources :

Example 61 with EjbJar$JAXB

use of org.apache.openejb.jee.EjbJar$JAXB in project tomee by apache.

the class CheckAnnotationTest method testWebServiceWithMessageDriven.

@Keys({ @Key(value = "annotation.invalid.messagedriven.webservice", type = KeyType.WARNING) })
public AppModule testWebServiceWithMessageDriven() {
    final EjbJar ejbJar = new EjbJar();
    ejbJar.addEnterpriseBean(new MessageDrivenBean(Yellow.class));
    final EjbModule ejbModule = new EjbModule(ejbJar);
    ejbModule.setFinder(new AnnotationFinder(new ClassesArchive(Yellow.class)).link());
    final AppModule appModule = new AppModule(ejbModule);
    return appModule;
}
Also used : AppModule(org.apache.openejb.config.AppModule) Yellow(org.apache.openejb.test.annotated.Yellow) MessageDrivenBean(org.apache.openejb.jee.MessageDrivenBean) EjbModule(org.apache.openejb.config.EjbModule) ClassesArchive(org.apache.xbean.finder.archive.ClassesArchive) AnnotationFinder(org.apache.xbean.finder.AnnotationFinder) EjbJar(org.apache.openejb.jee.EjbJar)

Example 62 with EjbJar$JAXB

use of org.apache.openejb.jee.EjbJar$JAXB in project tomee by apache.

the class CheckAnnotationTest method testWebServiceWithManagedBean.

@Keys({ @Key(value = "annotation.invalid.managedbean.webservice", type = KeyType.WARNING) })
public AppModule testWebServiceWithManagedBean() {
    final EjbJar ejbJar = new EjbJar();
    ejbJar.addEnterpriseBean(new ManagedBean(Red.class));
    final EjbModule ejbModule = new EjbModule(ejbJar);
    ejbModule.setFinder(new AnnotationFinder(new ClassesArchive(Red.class)).link());
    final AppModule appModule = new AppModule(ejbModule);
    return appModule;
}
Also used : Red(org.apache.openejb.test.annotated.Red) AppModule(org.apache.openejb.config.AppModule) EjbModule(org.apache.openejb.config.EjbModule) ClassesArchive(org.apache.xbean.finder.archive.ClassesArchive) ManagedBean(org.apache.openejb.jee.ManagedBean) AnnotationFinder(org.apache.xbean.finder.AnnotationFinder) EjbJar(org.apache.openejb.jee.EjbJar)

Example 63 with EjbJar$JAXB

use of org.apache.openejb.jee.EjbJar$JAXB in project tomee by apache.

the class CheckAnnotationTest method shouldWarnForLocalAnnotationOnBeanWithNoInterface.

@Keys({ @Key(value = "ann.local.forLocalBean", type = KeyType.WARNING) })
public EjbModule shouldWarnForLocalAnnotationOnBeanWithNoInterface() {
    final EjbJar ejbJar = new EjbJar();
    ejbJar.addEnterpriseBean(new StatelessBean(EjbWithoutInterface.class));
    final EjbModule ejbModule = new EjbModule(ejbJar);
    ejbModule.setFinder(new AnnotationFinder(new ClassesArchive(EjbWithoutInterface.class)).link());
    return ejbModule;
}
Also used : StatelessBean(org.apache.openejb.jee.StatelessBean) EjbModule(org.apache.openejb.config.EjbModule) ClassesArchive(org.apache.xbean.finder.archive.ClassesArchive) AnnotationFinder(org.apache.xbean.finder.AnnotationFinder) EjbJar(org.apache.openejb.jee.EjbJar)

Example 64 with EjbJar$JAXB

use of org.apache.openejb.jee.EjbJar$JAXB in project tomee by apache.

the class CheckDependsOnTest method dependsOn.

@Keys({ @Key(value = "dependsOn.circuit", count = 2), @Key(value = "dependsOn.noSuchEjb", count = 2) })
public EjbJar dependsOn() throws OpenEJBException {
    final EjbJar ejbJar = new EjbJar();
    final SingletonBean one = new SingletonBean(One.class);
    final SingletonBean two = new SingletonBean(Two.class);
    final SingletonBean three = new SingletonBean(Three.class);
    final SingletonBean four = new SingletonBean(Four.class);
    final SingletonBean five = new SingletonBean(Five.class);
    final SingletonBean six = new SingletonBean(Six.class);
    ejbJar.addEnterpriseBean(one);
    ejbJar.addEnterpriseBean(two);
    ejbJar.addEnterpriseBean(three);
    ejbJar.addEnterpriseBean(four);
    ejbJar.addEnterpriseBean(five);
    ejbJar.addEnterpriseBean(six);
    return ejbJar;
}
Also used : SingletonBean(org.apache.openejb.jee.SingletonBean) EjbJar(org.apache.openejb.jee.EjbJar)

Example 65 with EjbJar$JAXB

use of org.apache.openejb.jee.EjbJar$JAXB in project tomee by apache.

the class Green method testSystemPropertyNames.

@Keys({ @Key(value = "incorrect.property.name", type = KeyType.WARNING) })
public AppModule testSystemPropertyNames() {
    // SystemInstance.get().setProperty("java.persistence.provider", "test");
    SystemInstance.get().setProperty("javax.naming.referral", "test");
    final EjbJar ejbJar = new EjbJar();
    ejbJar.addEnterpriseBean(new StatefulBean(Green.class));
    return new AppModule(new EjbModule(ejbJar));
}
Also used : AppModule(org.apache.openejb.config.AppModule) StatefulBean(org.apache.openejb.jee.StatefulBean) EjbModule(org.apache.openejb.config.EjbModule) EjbJar(org.apache.openejb.jee.EjbJar)

Aggregations

EjbJar (org.apache.openejb.jee.EjbJar)242 StatelessBean (org.apache.openejb.jee.StatelessBean)117 Assembler (org.apache.openejb.assembler.classic.Assembler)88 EjbModule (org.apache.openejb.config.EjbModule)81 ConfigurationFactory (org.apache.openejb.config.ConfigurationFactory)76 SecurityServiceInfo (org.apache.openejb.assembler.classic.SecurityServiceInfo)60 TransactionServiceInfo (org.apache.openejb.assembler.classic.TransactionServiceInfo)60 OpenejbJar (org.apache.openejb.jee.oejb3.OpenejbJar)50 Properties (java.util.Properties)49 InitialContext (javax.naming.InitialContext)43 SingletonBean (org.apache.openejb.jee.SingletonBean)42 AppModule (org.apache.openejb.config.AppModule)40 StatefulBean (org.apache.openejb.jee.StatefulBean)33 ProxyFactoryInfo (org.apache.openejb.assembler.classic.ProxyFactoryInfo)31 Module (org.apache.openejb.testing.Module)30 EjbDeployment (org.apache.openejb.jee.oejb3.EjbDeployment)27 Test (org.junit.Test)26 LocalInitialContextFactory (org.apache.openejb.core.LocalInitialContextFactory)25 InitContextFactory (org.apache.openejb.core.ivm.naming.InitContextFactory)24 EjbJarInfo (org.apache.openejb.assembler.classic.EjbJarInfo)21