use of javax.ejb.EJBObject in project tomee by apache.
the class StatefulRmiIiopTests method test52_returnNestedHandle.
public void test52_returnNestedHandle() {
try {
final Object obj = initialContext.lookup("client/tests/stateful/EncBean");
final EncStatefulHome home = (EncStatefulHome) obj;
assertNotNull("The EJBHome returned from JNDI is null", home);
final EncStatefulObject object = home.create("test_52 StatefulBean");
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 StatefulRmiIiopTests method setUp.
protected void setUp() throws Exception {
super.setUp();
final Object obj = initialContext.lookup("client/tests/stateful/RMI-over-IIOP/EJBHome");
ejbHome = (RmiIiopStatefulHome) obj;
ejbObject = ejbHome.create("RMI-IIOP TestBean");
}
use of javax.ejb.EJBObject in project tomee by apache.
the class StatefulRmiIiopTests method test44_returnEJBObjectArray.
public void test44_returnEJBObjectArray() {
try {
final Object obj = initialContext.lookup("client/tests/stateful/EncBean");
final EncStatefulHome home = (EncStatefulHome) obj;
assertNotNull("The EJBHome returned from JNDI is null", home);
final EncStatefulObject[] expected = new EncStatefulObject[3];
for (int i = 0; i < expected.length; i++) {
expected[i] = home.create("test_44 StatefulBean");
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 StatefulRmiIiopTests method test50_returnHandle.
/*-------------------------------------------------*/
/* Handle */
/*-------------------------------------------------*/
public void test50_returnHandle() {
try {
final Object obj = initialContext.lookup("client/tests/stateful/EncBean");
final EncStatefulHome home = (EncStatefulHome) obj;
assertNotNull("The EJBHome returned from JNDI is null", home);
final EncStatefulObject object = home.create("test_50 StatefulBean");
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 javax.ejb.EJBObject in project tomee by apache.
the class StatefulRmiIiopTests method test54_returnHandleArray.
public void test54_returnHandleArray() {
try {
final Object obj = initialContext.lookup("client/tests/stateful/EncBean");
final EncStatefulHome home = (EncStatefulHome) obj;
assertNotNull("The EJBHome returned from JNDI is null", home);
final EncStatefulObject object = home.create("test_54 StatefulBean");
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 = (Handle[]) 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());
}
}
Aggregations