use of javax.ejb.EJBObject in project tomee by apache.
the class CmpRmiIiopTests method test44_returnEJBObjectArray.
public void test44_returnEJBObjectArray() {
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 = new EncCmpObject[3];
for (int i = 0; i < expected.length; i++) {
expected[i] = home.create("test_44 CmpBean");
assertNotNull("The EJBObject created is null", expected[i]);
}
final EJBObject[] actual = ejbObject.returnEJBObjectArray(expected);
assertNotNull("The EJBObject array returned is null", actual);
assertEquals(expected.length, actual.length);
for (int i = 0; i < actual.length; i++) {
assertTrue("The EJBObejcts are not identical", expected[i].isIdentical(actual[i]));
}
} catch (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
use of javax.ejb.EJBObject in project tomee by apache.
the class CmpRmiIiopTests 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 ComplexHandleTests method test01_getEJBObject.
// =================================
// Test handle methods
//
public void test01_getEJBObject() {
try {
final EJBObject object = ejbHandle.getEJBObject();
assertNotNull("The EJBObject is null", object);
// Wait until isIdentical is working.
// assertTrue("EJBObjects are not identical", object.isIdentical(ejbObject));
} catch (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
use of javax.ejb.EJBObject in project tomee by apache.
the class UnknownHandleTests method setUp.
protected void setUp() throws Exception {
super.setUp();
final Object obj = initialContext.lookup("client/tests/entity/cmp/UnknownCmpHome");
ejbHome = (UnknownCmpHome) obj;
ejbObject = ejbHome.createObject("Fifth Bean");
ejbHandle = ejbObject.getHandle();
}
use of javax.ejb.EJBObject in project tomee by apache.
the class Cmp2HandleTests method Xtest02_copyHandleByMarshalledObject.
public void Xtest02_copyHandleByMarshalledObject() {
try {
final MarshalledObject obj = new MarshalledObject(ejbHandle);
final Handle copy = (Handle) obj.get();
final EJBObject object = copy.getEJBObject();
assertNotNull("The EJBObject is null", object);
assertTrue("EJBObjects are not identical", object.isIdentical(ejbObject));
} catch (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
Aggregations