Search in sources :

Example 1 with EncCmpHome

use of org.apache.openejb.test.entity.cmp.EncCmpHome in project tomee by apache.

the class Cmp2RmiIiopTests method test40_returnEJBObject.

/*-------------------------------------------------*/
/*  EJBObject                                      */
/*-------------------------------------------------*/
public void test40_returnEJBObject() {
    try {
        final Object obj = initialContext.lookup("client/tests/entity/cmp/EncBean");
        final EncCmpHome home = (EncCmpHome) obj;
        assertNotNull("The EJBHome returned from JNDI is null", home);
        final EncCmpObject expected = home.create("test_40 CmpBean");
        assertNotNull("The EJBObject created is null", expected);
        final EncCmpObject actual = (EncCmpObject) ejbObject.returnEJBObject(expected);
        assertNotNull("The EJBObject returned is null", actual);
        assertTrue("The EJBObejcts are not identical", expected.isIdentical(actual));
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EncCmpObject(org.apache.openejb.test.entity.cmp.EncCmpObject) EJBObject(javax.ejb.EJBObject) RmiIiopCmpObject(org.apache.openejb.test.entity.cmp.RmiIiopCmpObject) EncCmpHome(org.apache.openejb.test.entity.cmp.EncCmpHome) EncCmpObject(org.apache.openejb.test.entity.cmp.EncCmpObject) RemoteException(java.rmi.RemoteException)

Example 2 with EncCmpHome

use of org.apache.openejb.test.entity.cmp.EncCmpHome in project tomee by apache.

the class Cmp2RmiIiopTests method test50_returnHandle.

/*-------------------------------------------------*/
/*  Handle                                         */
/*-------------------------------------------------*/
public void test50_returnHandle() {
    try {
        final Object obj = initialContext.lookup("client/tests/entity/cmp/EncBean");
        final EncCmpHome home = (EncCmpHome) obj;
        assertNotNull("The EJBHome returned from JNDI is null", home);
        final EncCmpObject object = home.create("test_50 CmpBean");
        assertNotNull("The EJBObject created is null", object);
        final Handle expected = object.getHandle();
        assertNotNull("The EJBObject Handle returned is null", expected);
        assertNotNull("The EJBObject in the Handle is null", expected.getEJBObject());
        final Handle actual = ejbObject.returnHandle(expected);
        assertNotNull("The EJBObject Handle returned is null", actual);
        assertNotNull("The EJBObject in the Handle is null", actual.getEJBObject());
        final EJBObject exp = expected.getEJBObject();
        final EJBObject act = actual.getEJBObject();
        assertTrue("The EJBObjects in the Handles are not identical", exp.isIdentical(act));
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBObject(javax.ejb.EJBObject) EncCmpObject(org.apache.openejb.test.entity.cmp.EncCmpObject) EJBObject(javax.ejb.EJBObject) RmiIiopCmpObject(org.apache.openejb.test.entity.cmp.RmiIiopCmpObject) EncCmpHome(org.apache.openejb.test.entity.cmp.EncCmpHome) EncCmpObject(org.apache.openejb.test.entity.cmp.EncCmpObject) RemoteException(java.rmi.RemoteException) Handle(javax.ejb.Handle)

Example 3 with EncCmpHome

use of org.apache.openejb.test.entity.cmp.EncCmpHome in project tomee by apache.

the class Cmp2RmiIiopTests 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) EncCmpObject(org.apache.openejb.test.entity.cmp.EncCmpObject) EJBObject(javax.ejb.EJBObject) RmiIiopCmpObject(org.apache.openejb.test.entity.cmp.RmiIiopCmpObject) EncCmpHome(org.apache.openejb.test.entity.cmp.EncCmpHome) RemoteException(java.rmi.RemoteException)

Example 4 with EncCmpHome

use of org.apache.openejb.test.entity.cmp.EncCmpHome in project tomee by apache.

the class Cmp2RmiIiopTests method test38_returnNestedEJBHome2.

public void test38_returnNestedEJBHome2() {
    try {
        final ObjectGraph graph = ejbObject.returnNestedEJBHome();
        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) EncCmpHome(org.apache.openejb.test.entity.cmp.EncCmpHome) RemoteException(java.rmi.RemoteException)

Example 5 with EncCmpHome

use of org.apache.openejb.test.entity.cmp.EncCmpHome in project tomee by apache.

the class Cmp2RmiIiopTests method test42_returnNestedEJBObject.

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

Aggregations

EncCmpHome (org.apache.openejb.test.entity.cmp.EncCmpHome)16 RemoteException (java.rmi.RemoteException)14 EncCmpObject (org.apache.openejb.test.entity.cmp.EncCmpObject)14 EJBObject (javax.ejb.EJBObject)12 RmiIiopCmpObject (org.apache.openejb.test.entity.cmp.RmiIiopCmpObject)12 ObjectGraph (org.apache.openejb.test.object.ObjectGraph)5 EJBMetaData (javax.ejb.EJBMetaData)3 Handle (javax.ejb.Handle)3 EncBmpObject (org.apache.openejb.test.entity.bmp.EncBmpObject)2 EncStatefulObject (org.apache.openejb.test.stateful.EncStatefulObject)2 EJBHome (javax.ejb.EJBHome)1