Search in sources :

Example 1 with ObjectGraph

use of org.apache.openejb.test.object.ObjectGraph in project tomee by apache.

the class CmpRmiIiopTests method test53_returnNestedHandle2.

public void test53_returnNestedHandle2() {
    try {
        final ObjectGraph graph = ejbObject.returnNestedHandle();
        assertNotNull("The ObjectGraph is null", graph);
        final Handle actual = (Handle) graph.getObject();
        assertNotNull("The EJBObject Handle returned is null", actual);
        assertNotNull("The EJBObject in the Handle is null", actual.getEJBObject());
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : ObjectGraph(org.apache.openejb.test.object.ObjectGraph) RemoteException(java.rmi.RemoteException) Handle(javax.ejb.Handle)

Example 2 with ObjectGraph

use of org.apache.openejb.test.object.ObjectGraph in project tomee by apache.

the class BmpRmiIiopTests method test48_returnNestedEJBMetaData2.

public void test48_returnNestedEJBMetaData2() {
    try {
        final ObjectGraph graph = ejbObject.returnNestedEJBMetaData();
        assertNotNull("The ObjectGraph is null", graph);
        final EJBMetaData actual = (EJBMetaData) graph.getObject();
        assertNotNull("The EJBMetaData returned is null", actual);
        assertNotNull("The home interface class of the EJBMetaData is null", actual.getHomeInterfaceClass());
        assertNotNull("The remote interface class of the EJBMetaData is null", actual.getRemoteInterfaceClass());
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBMetaData(javax.ejb.EJBMetaData) ObjectGraph(org.apache.openejb.test.object.ObjectGraph) RemoteException(java.rmi.RemoteException)

Example 3 with ObjectGraph

use of org.apache.openejb.test.object.ObjectGraph in project tomee by apache.

the class CmpRmiIiopTests method test37_returnNestedEJBHome.

public void test37_returnNestedEJBHome() {
    try {
        final Object obj = initialContext.lookup("client/tests/entity/cmp/EncBean");
        final EncCmpHome expected = (EncCmpHome) obj;
        assertNotNull("The EJBHome returned from JNDI is null", expected);
        final ObjectGraph graph = ejbObject.returnObjectGraph(new ObjectGraph(expected));
        assertNotNull("The ObjectGraph is null", graph);
        final EncCmpHome actual = (EncCmpHome) graph.getObject();
        assertNotNull("The EJBHome returned is null", actual);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : ObjectGraph(org.apache.openejb.test.object.ObjectGraph) EJBObject(javax.ejb.EJBObject) RemoteException(java.rmi.RemoteException)

Example 4 with ObjectGraph

use of org.apache.openejb.test.object.ObjectGraph in project tomee by apache.

the class RmiIiopBmpBean method returnNestedEJBObject.

public ObjectGraph returnNestedEJBObject() throws javax.ejb.EJBException {
    ObjectGraph data = null;
    try {
        final InitialContext ctx = new InitialContext();
        final EncBmpHome home = (EncBmpHome) ctx.lookup("java:comp/env/bmp/rmi-iiop/home");
        final EncBmpObject object = home.create("Test02 BmpBean");
        data = new ObjectGraph(object);
    } catch (final Exception e) {
        throw new javax.ejb.EJBException(e);
    }
    return data;
}
Also used : EJBException(javax.ejb.EJBException) ObjectGraph(org.apache.openejb.test.object.ObjectGraph) InitialContext(javax.naming.InitialContext) EJBException(javax.ejb.EJBException) RemoveException(javax.ejb.RemoveException) RemoteException(java.rmi.RemoteException)

Example 5 with ObjectGraph

use of org.apache.openejb.test.object.ObjectGraph in project tomee by apache.

the class RmiIiopCmp2Bean method returnNestedEJBMetaData.

public ObjectGraph returnNestedEJBMetaData() {
    ObjectGraph data = null;
    try {
        final InitialContext ctx = new InitialContext();
        final EncCmpHome home = (EncCmpHome) ctx.lookup("java:comp/env/cmp/rmi-iiop/home");
        final EJBMetaData object = home.getEJBMetaData();
        data = new ObjectGraph(object);
    } catch (final Exception e) {
        throw new EJBException(e);
    }
    return data;
}
Also used : EJBMetaData(javax.ejb.EJBMetaData) ObjectGraph(org.apache.openejb.test.object.ObjectGraph) EJBException(javax.ejb.EJBException) InitialContext(javax.naming.InitialContext) EJBException(javax.ejb.EJBException) CreateException(javax.ejb.CreateException)

Aggregations

ObjectGraph (org.apache.openejb.test.object.ObjectGraph)80 RemoteException (java.rmi.RemoteException)76 EJBObject (javax.ejb.EJBObject)30 EJBException (javax.ejb.EJBException)24 InitialContext (javax.naming.InitialContext)24 EJBMetaData (javax.ejb.EJBMetaData)18 Handle (javax.ejb.Handle)12 RemoveException (javax.ejb.RemoveException)8 EncCmpHome (org.apache.openejb.test.entity.cmp.EncCmpHome)5 EncCmpObject (org.apache.openejb.test.entity.cmp.EncCmpObject)5 CreateException (javax.ejb.CreateException)4 RmiIiopCmpObject (org.apache.openejb.test.entity.cmp.RmiIiopCmpObject)4 Color (org.apache.openejb.test.object.Color)2