use of org.apache.openejb.test.object.ObjectGraph 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());
}
}
use of org.apache.openejb.test.object.ObjectGraph 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());
}
}
use of org.apache.openejb.test.object.ObjectGraph 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());
}
}
use of org.apache.openejb.test.object.ObjectGraph in project tomee by apache.
the class Cmp2RmiIiopTests method test43_returnNestedEJBObject2.
public void test43_returnNestedEJBObject2() {
try {
final ObjectGraph graph = ejbObject.returnNestedEJBObject();
assertNotNull("The ObjectGraph is null", graph);
final EncCmpObject actual = (EncCmpObject) graph.getObject();
assertNotNull("The EJBHome returned is null", actual);
} catch (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
use of org.apache.openejb.test.object.ObjectGraph in project tomee by apache.
the class RmiIiopStatelessBean method returnNestedEJBHome.
public ObjectGraph returnNestedEJBHome() throws javax.ejb.EJBException {
ObjectGraph data = null;
try {
final InitialContext ctx = new InitialContext();
final Object object = ctx.lookup("java:comp/env/stateless/rmi-iiop/home");
data = new ObjectGraph(object);
} catch (final Exception e) {
throw new javax.ejb.EJBException(e);
}
return data;
}
Aggregations