Search in sources :

Example 26 with EnterpriseBeanInfo

use of org.apache.openejb.assembler.classic.EnterpriseBeanInfo in project tomee by apache.

the class BusinessInterfacesTest method testLemonStrict.

public void testLemonStrict() throws Exception {
    setUp();
    strict(true);
    final Map<String, EnterpriseBeanInfo> beans = deploy(LemonOneBean.class, LemonTwoBean.class, LemonThreeBean.class, LemonFourBean.class, LemonFiveBean.class, LemonSixBean.class);
    EnterpriseBeanInfo beanInfo;
    beanInfo = beans.get("LemonOneBean");
    assertEquals(list(), sort(beanInfo.businessLocal));
    assertEquals(list(), sort(beanInfo.businessRemote));
    assertTrue(beanInfo.localbean);
    beanInfo = beans.get("LemonTwoBean");
    assertEquals(list(), sort(beanInfo.businessLocal));
    assertEquals(list(), sort(beanInfo.businessRemote));
    assertTrue(beanInfo.localbean);
    beanInfo = beans.get("LemonThreeBean");
    assertEquals(list(), sort(beanInfo.businessLocal));
    assertEquals(list(), sort(beanInfo.businessRemote));
    assertTrue(beanInfo.localbean);
    beanInfo = beans.get("LemonFourBean");
    assertEquals(list(), sort(beanInfo.businessLocal));
    assertEquals(list(), sort(beanInfo.businessRemote));
    assertTrue(beanInfo.localbean);
    beanInfo = beans.get("LemonFiveBean");
    assertEquals(list(), sort(beanInfo.businessLocal));
    assertEquals(list(), sort(beanInfo.businessRemote));
    assertTrue(beanInfo.localbean);
    beanInfo = beans.get("LemonSixBean");
    assertEquals(list(), sort(beanInfo.businessLocal));
    assertEquals(list(), sort(beanInfo.businessRemote));
    assertTrue(beanInfo.localbean);
}
Also used : EnterpriseBeanInfo(org.apache.openejb.assembler.classic.EnterpriseBeanInfo)

Example 27 with EnterpriseBeanInfo

use of org.apache.openejb.assembler.classic.EnterpriseBeanInfo in project tomee by apache.

the class BusinessInterfacesTest method testOrangeNotStrict.

public void testOrangeNotStrict() throws Exception {
    strict(false);
    final Map<String, EnterpriseBeanInfo> beans = deploy(OrangeOneBean.class, OrangeTwoBean.class);
    EnterpriseBeanInfo beanInfo = beans.get("OrangeOneBean");
    assertEquals(list(OrangeOneLocal.class, OrangeOneBoth.class), sort(beanInfo.businessLocal));
    assertEquals(list(OrangeOneRemote.class, OrangeOneBoth.class), sort(beanInfo.businessRemote));
    beanInfo = beans.get("OrangeTwoBean");
    assertEquals(list(OrangeTwoLocal.class, OrangeTwoBoth.class), sort(beanInfo.businessLocal));
    assertEquals(list(OrangeTwoRemote.class, OrangeTwoBoth.class), sort(beanInfo.businessRemote));
}
Also used : EnterpriseBeanInfo(org.apache.openejb.assembler.classic.EnterpriseBeanInfo)

Example 28 with EnterpriseBeanInfo

use of org.apache.openejb.assembler.classic.EnterpriseBeanInfo in project tomee by apache.

the class BusinessInterfacesTest method testGreen.

public void testGreen() throws Exception {
    // Results should be the same with strict on or off
    for (final boolean strict : Arrays.asList(false, true)) {
        setUp();
        strict(strict);
        final Map<String, EnterpriseBeanInfo> beans = deploy(GreenOneBean.class, GreenTwoBean.class);
        EnterpriseBeanInfo beanInfo;
        beanInfo = beans.get("GreenOneBean");
        assertEquals(list(GreenOneLocal.class), sort(beanInfo.businessLocal));
        assertEquals(list(GreenOneRemote.class), sort(beanInfo.businessRemote));
        beanInfo = beans.get("GreenTwoBean");
        assertEquals(list(GreenTwoLocal.class), sort(beanInfo.businessLocal));
        assertEquals(list(GreenTwoRemote.class), sort(beanInfo.businessRemote));
    }
}
Also used : EnterpriseBeanInfo(org.apache.openejb.assembler.classic.EnterpriseBeanInfo)

Example 29 with EnterpriseBeanInfo

use of org.apache.openejb.assembler.classic.EnterpriseBeanInfo in project tomee by apache.

the class BusinessInterfacesTest method testRedNotStrict.

/**
 * Definition in the bean class wins over the
 *
 * @throws Exception
 */
public void testRedNotStrict() throws Exception {
    strict(false);
    final Map<String, EnterpriseBeanInfo> beans = deploy(RedOneBean.class, RedTwoBean.class);
    EnterpriseBeanInfo beanInfo = beans.get("RedOneBean");
    assertEquals(list(RedOneLocal.class), sort(beanInfo.businessLocal));
    assertEquals(list(RedOneRemote.class, RedOneOverridden.class), sort(beanInfo.businessRemote));
    beanInfo = beans.get("RedTwoBean");
    assertEquals(list(RedTwoLocal.class, RedTwoOverridden.class), sort(beanInfo.businessLocal));
    assertEquals(list(RedTwoRemote.class), sort(beanInfo.businessRemote));
}
Also used : EnterpriseBeanInfo(org.apache.openejb.assembler.classic.EnterpriseBeanInfo)

Example 30 with EnterpriseBeanInfo

use of org.apache.openejb.assembler.classic.EnterpriseBeanInfo in project tomee by apache.

the class BusinessInterfacesTest method testMagenta.

public void testMagenta() throws Exception {
    // Results should be the same with strict on or off
    for (final boolean strict : Arrays.asList(false, true)) {
        setUp();
        strict(strict);
        final Map<String, EnterpriseBeanInfo> beans = deploy(MagentaOneBean.class, MagentaTwoBean.class, MagentaThreeBean.class, MagentaFourBean.class, MagentaFiveBean.class);
        EnterpriseBeanInfo beanInfo;
        beanInfo = beans.get("MagentaOneBean");
        assertEquals(list(MagentaOneLocal.class), sort(beanInfo.businessLocal));
        assertEquals(list(), sort(beanInfo.businessRemote));
        assertTrue(beanInfo.localbean);
        beanInfo = beans.get("MagentaTwoBean");
        assertEquals(list(), sort(beanInfo.businessLocal));
        assertEquals(list(MagentaTwoRemote.class), sort(beanInfo.businessRemote));
        assertTrue(beanInfo.localbean);
        beanInfo = beans.get("MagentaThreeBean");
        assertEquals(list(), sort(beanInfo.businessLocal));
        assertEquals(list(), sort(beanInfo.businessRemote));
        assertTrue(beanInfo.localbean);
        beanInfo = beans.get("MagentaFourBean");
        assertEquals(list(MagentaFourLocal.class), sort(beanInfo.businessLocal));
        assertEquals(list(), sort(beanInfo.businessRemote));
        assertTrue(beanInfo.localbean);
        beanInfo = beans.get("MagentaFiveBean");
        assertEquals(list(), sort(beanInfo.businessLocal));
        assertEquals(list(MagentaFiveRemote.class), sort(beanInfo.businessRemote));
        assertTrue(beanInfo.localbean);
    }
}
Also used : EnterpriseBeanInfo(org.apache.openejb.assembler.classic.EnterpriseBeanInfo)

Aggregations

EnterpriseBeanInfo (org.apache.openejb.assembler.classic.EnterpriseBeanInfo)31 EjbJarInfo (org.apache.openejb.assembler.classic.EjbJarInfo)17 BeanContext (org.apache.openejb.BeanContext)8 HashMap (java.util.HashMap)7 AppInfo (org.apache.openejb.assembler.classic.AppInfo)7 WebAppInfo (org.apache.openejb.assembler.classic.WebAppInfo)7 Assembler (org.apache.openejb.assembler.classic.Assembler)6 EjbJar (org.apache.openejb.jee.EjbJar)6 ArrayList (java.util.ArrayList)5 OpenEJBException (org.apache.openejb.OpenEJBException)5 StatelessBean (org.apache.openejb.jee.StatelessBean)5 SecurityServiceInfo (org.apache.openejb.assembler.classic.SecurityServiceInfo)4 SingletonBeanInfo (org.apache.openejb.assembler.classic.SingletonBeanInfo)4 TransactionServiceInfo (org.apache.openejb.assembler.classic.TransactionServiceInfo)4 EjbDeployment (org.apache.openejb.jee.oejb3.EjbDeployment)4 URL (java.net.URL)3 Map (java.util.Map)3 InitialContext (javax.naming.InitialContext)3 StatelessBeanInfo (org.apache.openejb.assembler.classic.StatelessBeanInfo)3 File (java.io.File)2