Search in sources :

Example 71 with ObjectGraph

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

the class StatefulRmiIiopTests method test37_returnNestedEJBHome.

public void test37_returnNestedEJBHome() {
    try {
        final Object obj = initialContext.lookup("client/tests/stateful/EncBean");
        final EncStatefulHome expected = (EncStatefulHome) 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 EncStatefulHome actual = (EncStatefulHome) 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 72 with ObjectGraph

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

the class StatelessRmiIiopTests method test43_returnNestedEJBObject2.

public void test43_returnNestedEJBObject2() {
    try {
        final ObjectGraph graph = ejbObject.returnNestedEJBObject();
        assertNotNull("The ObjectGraph is null", graph);
        final EncStatelessObject actual = (EncStatelessObject) 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) RemoteException(java.rmi.RemoteException)

Example 73 with ObjectGraph

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

the class StatelessRmiIiopTests method test63_returnNestedColor2.

public void test63_returnNestedColor2() {
    try {
        final Color expected = Color.GREEN;
        final ObjectGraph graph = ejbObject.returnNestedColor();
        assertNotNull("The ObjectGraph is null", graph);
        final Color actual = (Color) graph.getObject();
        assertNotNull("The Color returned is null", actual);
        assertEquals(expected, actual);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : Color(org.apache.openejb.test.object.Color) ObjectGraph(org.apache.openejb.test.object.ObjectGraph) RemoteException(java.rmi.RemoteException)

Example 74 with ObjectGraph

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

the class StatefulRmiIiopTests method test42_returnNestedEJBObject.

public void test42_returnNestedEJBObject() {
    try {
        final Object obj = initialContext.lookup("client/tests/stateful/EncBean");
        final EncStatefulHome home = (EncStatefulHome) obj;
        assertNotNull("The EJBHome returned from JNDI is null", home);
        final EncStatefulObject expected = home.create("test_42 StatefulBean");
        assertNotNull("The EJBObject created is null", expected);
        final ObjectGraph graph = ejbObject.returnObjectGraph(new ObjectGraph(expected));
        assertNotNull("The ObjectGraph is null", graph);
        final EncStatefulObject actual = (EncStatefulObject) 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) EJBObject(javax.ejb.EJBObject) RemoteException(java.rmi.RemoteException)

Example 75 with ObjectGraph

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

the class StatefulRmiIiopTests method test43_returnNestedEJBObject2.

public void test43_returnNestedEJBObject2() {
    try {
        final ObjectGraph graph = ejbObject.returnNestedEJBObject();
        assertNotNull("The ObjectGraph is null", graph);
        final EncStatefulObject actual = (EncStatefulObject) 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) RemoteException(java.rmi.RemoteException)

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