use of org.apache.openejb.test.entity.cmp.EncCmpObject in project tomee by apache.
the class Cmp2RmiIiopTests method test50_returnHandle.
/*-------------------------------------------------*/
/* Handle */
/*-------------------------------------------------*/
public void test50_returnHandle() {
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 object = home.create("test_50 CmpBean");
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 Handle actual = ejbObject.returnHandle(expected);
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.entity.cmp.EncCmpObject 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.entity.cmp.EncCmpObject in project tomee by apache.
the class Cmp2RmiIiopTests method test40_returnEJBObject.
/*-------------------------------------------------*/
/* EJBObject */
/*-------------------------------------------------*/
public void test40_returnEJBObject() {
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_40 CmpBean");
assertNotNull("The EJBObject created is null", expected);
final EncCmpObject actual = (EncCmpObject) ejbObject.returnEJBObject(expected);
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.entity.cmp.EncCmpObject 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.entity.cmp.EncCmpObject in project tomee by apache.
the class MiscEjbTests method _test04_isIdentical_cmp.
/**
* DMB: Calling this now causes an error as the "entity" table doesn't exist yet
*/
public void _test04_isIdentical_cmp() {
try {
final String jndiName = "client/tests/entity/cmp/EncBean";
EncCmpHome ejbHome2 = null;
EncCmpObject ejbObject2 = null;
final Object obj = initialContext.lookup(jndiName);
ejbHome2 = (EncCmpHome) obj;
ejbObject2 = ejbHome2.create("isIdentical test");
// System.out.println("_______________________________________________________");
// System.out.println(" ejb1 "+ejbObject);
// System.out.println(" ejb2 "+ejbObject2);
assertTrue("The EJBObjects should not be identical", !ejbObject.isIdentical(ejbObject2));
// System.out.println("-------------------------------------------------------");
} catch (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
Aggregations