use of org.apache.openejb.test.object.ObjectGraph in project tomee by apache.
the class BmpRmiIiopTests method test42_returnNestedEJBObject.
public void test42_returnNestedEJBObject() {
try {
final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
final EncBmpHome home = (EncBmpHome) obj;
assertNotNull("The EJBHome returned from JNDI is null", home);
final EncBmpObject expected = home.create("test_42 BmpBean");
assertNotNull("The EJBObject created is null", expected);
final ObjectGraph graph = ejbObject.returnObjectGraph(new ObjectGraph(expected));
assertNotNull("The ObjectGraph is null", graph);
final EncBmpObject actual = (EncBmpObject) (EncBmpObject) 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 BmpRmiIiopTests method test52_returnNestedHandle.
public void test52_returnNestedHandle() {
try {
final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
final EncBmpHome home = (EncBmpHome) obj;
assertNotNull("The EJBHome returned from JNDI is null", home);
final EncBmpObject object = home.create("test_52 BmpBean");
assertNotNull("The EJBObject created is null", object);
final Handle expected = object.getHandle();
assertNotNull("The EJBObject Handle returned is null", expected);
assertNotNull("The EJBObject in the Handle is null", expected.getEJBObject());
final ObjectGraph graph = ejbObject.returnObjectGraph(new ObjectGraph(expected));
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());
final EJBObject exp = expected.getEJBObject();
final EJBObject act = actual.getEJBObject();
assertTrue("The EJBObjects in the Handles are not identical", exp.isIdentical(act));
} 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 BmpRmiIiopTests method test38_returnNestedEJBHome2.
public void test38_returnNestedEJBHome2() {
try {
final ObjectGraph graph = ejbObject.returnNestedEJBHome();
assertNotNull("The ObjectGraph is null", graph);
final EncBmpHome actual = (EncBmpHome) 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 CmpRmiIiopTests method test48_returnNestedEJBMetaData2.
public void test48_returnNestedEJBMetaData2() {
try {
final ObjectGraph graph = ejbObject.returnNestedEJBMetaData();
assertNotNull("The ObjectGraph is null", graph);
final EJBMetaData actual = (EJBMetaData) graph.getObject();
assertNotNull("The EJBMetaData returned is null", actual);
assertNotNull("The home interface class of the EJBMetaData is null", actual.getHomeInterfaceClass());
assertNotNull("The remote interface class of the EJBMetaData is null", actual.getRemoteInterfaceClass());
} 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 CmpRmiIiopTests 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());
}
}
Aggregations