use of javax.ejb.EJBObject in project tomee by apache.
the class Cmp2RmiIiopTests method setUp.
protected void setUp() throws Exception {
super.setUp();
final Object obj = initialContext.lookup("client/tests/entity/cmp/RMI-over-IIOP/EJBHome");
ejbHome = (RmiIiopCmpHome) obj;
ejbObject = ejbHome.create("RMI-IIOP TestBean");
}
use of javax.ejb.EJBObject in project tomee by apache.
the class Cmp2RmiIiopTests method test54_returnHandleArray.
public void test54_returnHandleArray() {
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_54 CmpBean");
assertNotNull("The EJBObject created is null", object);
final Handle[] expected = new Handle[3];
for (int i = 0; i < expected.length; i++) {
expected[i] = object.getHandle();
assertNotNull("The EJBObject Handle returned is null", expected[i]);
}
final Handle[] actual = ejbObject.returnHandleArray(expected);
assertNotNull("The Handle array returned is null", actual);
assertEquals(expected.length, actual.length);
for (int i = 0; i < expected.length; i++) {
assertNotNull("The EJBObject Handle returned is null", actual[i]);
assertNotNull("The EJBObject in the Handle is null", actual[i].getEJBObject());
assertTrue("The EJBObjects in the Handles are not equal", expected[i].getEJBObject().isIdentical(actual[i].getEJBObject()));
}
} catch (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
use of javax.ejb.EJBObject in project tomee by apache.
the class Cmp2RmiIiopTests method test52_returnNestedHandle.
public void test52_returnNestedHandle() {
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_52 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 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 javax.ejb.EJBObject in project tomee by apache.
the class ComplexHandleTests method setUp.
protected void setUp() throws Exception {
super.setUp();
final Object obj = initialContext.lookup("client/tests/entity/cmp/ComplexCmpHome");
ejbHome = (ComplexCmpHome) obj;
ejbObject = ejbHome.createObject("Fifth Bean");
ejbHandle = ejbObject.getHandle();
}
use of javax.ejb.EJBObject in project tomee by apache.
the class Unknown2HandleTests method setUp.
protected void setUp() throws Exception {
super.setUp();
final Object obj = initialContext.lookup("client/tests/entity/cmp2/UnknownCmpHome");
ejbHome = (UnknownCmpHome) obj;
ejbObject = ejbHome.createObject("Fifth Bean");
ejbHandle = ejbObject.getHandle();
}
Aggregations