use of org.jboss.as.test.integration.ejb.ejb2.reference.global.Session30 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);
}
use of org.jboss.as.test.integration.ejb.ejb2.reference.global.Session30 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.Session30 in project wildfly by wildfly.
the class ReferenceAnnotationDescriptorTestCase method testStateless21Interfaces.
@Test
public void testStateless21Interfaces() throws Exception {
InitialContext jndiContext = new InitialContext();
Session30Home home = (Session30Home) jndiContext.lookup("java:module/Session30!" + Session30Home.class.getName());
Assert.assertNotNull(home);
EJBMetaData metadata = home.getEJBMetaData();
Assert.assertNotNull(metadata);
Assert.assertEquals(Session30.class.getName(), metadata.getRemoteInterfaceClass().getName());
HomeHandle homeHandle = home.getHomeHandle();
Assert.assertNotNull(homeHandle);
EJBHome ejbHome = homeHandle.getEJBHome();
Assert.assertNotNull(ejbHome);
metadata = ejbHome.getEJBMetaData();
Assert.assertNotNull(metadata);
Assert.assertEquals(Session30.class.getName(), metadata.getRemoteInterfaceClass().getName());
Session30 session = home.create();
Assert.assertNotNull(session);
ejbHome = session.getEJBHome();
Assert.assertNotNull(ejbHome);
Handle handle = session.getHandle();
Assert.assertNotNull(handle);
EJBObject ejbObject = handle.getEJBObject();
Assert.assertNotNull(ejbObject);
ejbHome = ejbObject.getEJBHome();
Assert.assertNotNull(ejbHome);
Handle handle1 = ejbObject.getHandle();
Assert.assertNotNull(handle1);
Session30 session1 = home.create();
Assert.assertTrue(session.isIdentical(session1));
}
use of org.jboss.as.test.integration.ejb.ejb2.reference.global.Session30 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);
}
use of org.jboss.as.test.integration.ejb.ejb2.reference.global.Session30 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);
}
Aggregations