Search in sources :

Example 1 with Session21Home

use of org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21Home 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 Session21Home

use of org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21Home 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 Session21Home

use of org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21Home 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)

Aggregations

InitialContext (javax.naming.InitialContext)3 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)1