Search in sources :

Example 1 with Session21

use of org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21 in project wildfly by wildfly.

the class ReferenceAnnotationDescriptorTestCase method testSession21.

@Test
public void testSession21() throws Exception {
    InitialContext jndiContext = new InitialContext();
    Session21Home home = (Session21Home) jndiContext.lookup("java:module/Session21!" + Session21Home.class.getName());
    Session21 session = home.create();
    String access = session.access();
    Assert.assertEquals("Session21", access);
    access = session.access30();
    Assert.assertEquals("Session30", access);
}
Also used : Session21Home(org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21Home) Session21(org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21) InitialContext(javax.naming.InitialContext) Test(org.junit.Test)

Example 2 with Session21

use of org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21 in project wildfly by wildfly.

the class Session30Bean method access21.

public String access21() {
    try {
        InitialContext jndiContext = new InitialContext();
        Session21Home sessionHome = (Session21Home) jndiContext.lookup("java:comp/env/injected");
        Session21 session = sessionHome.create();
        return session.access();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : Session21Home(org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21Home) Session21(org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21) InitialContext(javax.naming.InitialContext)

Example 3 with Session21

use of org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21 in project wildfly by wildfly.

the class Session30Bean method globalAccess21.

public String globalAccess21() {
    try {
        InitialContext jndiContext = new InitialContext();
        Session21Home home = (Session21Home) jndiContext.lookup("java:module/Session21!" + Session21Home.class.getName());
        Session21 session = home.create();
        return session.access();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : Session21Home(org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21Home) Session21(org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21) InitialContext(javax.naming.InitialContext)

Example 4 with Session21

use of org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21 in project wildfly by wildfly.

the class ReferenceAnnotationDescriptorTestCase method testSession30.

@Test
public void testSession30() throws Exception {
    InitialContext jndiContext = new InitialContext();
    Session30Home sessionHome = (Session30Home) jndiContext.lookup("java:module/Session30!" + Session30Home.class.getName());
    Session30 session = sessionHome.create();
    String access = session.access();
    Assert.assertEquals("Session30", access);
    access = session.access21();
    Assert.assertEquals("Session21", access);
}
Also used : InitialContext(javax.naming.InitialContext) Session30(org.jboss.as.test.integration.ejb.ejb2.reference.global.Session30) Test(org.junit.Test)

Aggregations

InitialContext (javax.naming.InitialContext)4 Session21 (org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21)3 Session21Home (org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21Home)3 Test (org.junit.Test)2 Session30 (org.jboss.as.test.integration.ejb.ejb2.reference.global.Session30)1