Search in sources :

Example 1 with Session30

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

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);
}
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 3 with Session30

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));
}
Also used : EJBMetaData(javax.ejb.EJBMetaData) EJBHome(javax.ejb.EJBHome) EJBObject(javax.ejb.EJBObject) HomeHandle(javax.ejb.HomeHandle) InitialContext(javax.naming.InitialContext) Session30(org.jboss.as.test.integration.ejb.ejb2.reference.global.Session30) HomeHandle(javax.ejb.HomeHandle) Handle(javax.ejb.Handle) Test(org.junit.Test)

Example 4 with Session30

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);
}
Also used : Session30RemoteBusiness(org.jboss.as.test.integration.ejb.ejb2.reference.global.Session30RemoteBusiness) InitialContext(javax.naming.InitialContext) Test(org.junit.Test)

Example 5 with Session30

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);
}
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)5 Test (org.junit.Test)5 Session30 (org.jboss.as.test.integration.ejb.ejb2.reference.global.Session30)3 Session30RemoteBusiness (org.jboss.as.test.integration.ejb.ejb2.reference.global.Session30RemoteBusiness)2 EJBHome (javax.ejb.EJBHome)1 EJBMetaData (javax.ejb.EJBMetaData)1 EJBObject (javax.ejb.EJBObject)1 Handle (javax.ejb.Handle)1 HomeHandle (javax.ejb.HomeHandle)1 Session21 (org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21)1 Session21Home (org.jboss.as.test.integration.ejb.ejb2.reference.global.Session21Home)1