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);
}
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);
}
Aggregations