try {
Object obj = initialContext.lookup("client/tests/entity/cmp/EncBean");
EncCmpHome home = (EncCmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncCmpHome.class);
assertNotNull("The EJBHome returned from JNDI is null", home);
EncCmpObject expected = home.create("test_42 CmpBean");
assertNotNull("The EJBObject created is null", expected);
ObjectGraph graph = ejbObject.returnObjectGraph(new ObjectGraph(expected));
assertNotNull("The ObjectGraph is null", graph);
EncCmpObject actual = (EncCmpObject) javax.rmi.PortableRemoteObject.narrow(graph.getObject(), EncCmpObject.class);
assertNotNull("The EJBObject returned is null", actual);
assertTrue("The EJBObejcts are not identical", expected.isIdentical(actual));
} catch (Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());