Search in sources :

Example 36 with ObjectGraph

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

the class SingletonRmiIiopTests method test37_returnNestedEJBHome.

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

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

the class SingletonRmiIiopTests method test38_returnNestedEJBHome2.

public void test38_returnNestedEJBHome2() {
    try {
        final ObjectGraph graph = ejbObject.returnNestedEJBHome();
        assertNotNull("The ObjectGraph is null", graph);
        final EncSingletonHome actual = (EncSingletonHome) 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 38 with ObjectGraph

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

the class SingletonRmiIiopTests method test43_returnNestedEJBObject2.

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

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

the class SingletonRmiIiopTests 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 40 with ObjectGraph

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

the class SingletonRmiIiopTests method test59_returnClassObjectGraph.

public void test59_returnClassObjectGraph() {
    try {
        final Class[] primitives = { boolean.class, byte.class, char.class, short.class, int.class, long.class, float.class, double.class };
        final ObjectGraph expectedGraph = new ObjectGraph(primitives);
        final ObjectGraph actualGraph = ejbObject.returnObjectGraph(expectedGraph);
        final Class[] expected = (Class[]) expectedGraph.getObject();
        final Class[] actual = (Class[]) actualGraph.getObject();
        assertEquals(expected.length, actual.length);
        for (int i = 0; i < expected.length; i++) {
            assertEquals(expected[i], actual[i]);
        }
    } catch (final RemoteException 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