Search in sources :

Example 1 with Session30RemoteBusiness

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

the class ReferenceAnnotationDescriptorTestCase method testSessionHome30.

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

Example 2 with Session30RemoteBusiness

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

the class ReferenceAnnotationDescriptorTestCase method testLocalHome.

@Test
public void testLocalHome() throws Exception {
    InitialContext jndiContext = new InitialContext();
    StatefulSession30RemoteBusiness statefulSession = (StatefulSession30RemoteBusiness) jndiContext.lookup("java:module/StatefulSession30!" + StatefulSession30RemoteBusiness.class.getName());
    Assert.assertNotNull(statefulSession);
    String access = statefulSession.accessLocalStateless();
    Assert.assertEquals("Session30", access);
    Session30RemoteBusiness session = (Session30RemoteBusiness) jndiContext.lookup("java:module/Session30!" + Session30RemoteBusiness.class.getName());
    Assert.assertNotNull(session);
    access = session.accessLocalStateful();
    Assert.assertEquals("default", access);
    access = session.accessLocalStateful("testing");
    Assert.assertEquals("testing", access);
    access = session.accessLocalStateful("testing", new Integer(123));
    Assert.assertEquals("testing123", access);
}
Also used : Session30RemoteBusiness(org.jboss.as.test.integration.ejb.ejb2.reference.global.Session30RemoteBusiness) InitialContext(javax.naming.InitialContext) Test(org.junit.Test)

Aggregations

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