try {
Object obj = initialContext.lookup("client/tests/stateless/EncBean");
EncStatelessHome home = (EncStatelessHome) obj;
assertNotNull("The EJBHome returned from JNDI is null", home);
EncStatelessObject expected = home.create();
assertNotNull("The EJBObject created is null", expected);
ObjectGraph graph = ejbObject.returnObjectGraph(new ObjectGraph(expected));
assertNotNull("The ObjectGraph is null", graph);
EncStatelessObject actual = (EncStatelessObject) graph.getObject();
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());