use of javax.ejb.EJBObject in project tomee by apache.
the class SingletonRmiIiopTests method setUp.
protected void setUp() throws Exception {
super.setUp();
final Object obj = initialContext.lookup("client/tests/singleton/RMI-over-IIOP/EJBHome");
ejbHome = (RmiIiopSingletonHome) obj;
ejbObject = ejbHome.create();
}
use of javax.ejb.EJBObject in project tomee by apache.
the class SingletonRmiIiopTests method test52_returnNestedHandle.
public void test52_returnNestedHandle() {
try {
final Object obj = initialContext.lookup("client/tests/singleton/EncBean");
final EncSingletonHome home = (EncSingletonHome) obj;
assertNotNull("The EJBHome returned from JNDI is null", home);
final EncSingletonObject object = home.create();
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 SingletonHandleTests method setUp.
protected void setUp() throws Exception {
super.setUp();
final Object obj = initialContext.lookup("client/tests/singleton/BasicSingletonHome");
ejbHome = (BasicSingletonHome) obj;
ejbObject = ejbHome.createObject();
ejbHandle = ejbObject.getHandle();
}
use of javax.ejb.EJBObject in project tomee by apache.
the class SingletonHandleTests 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 StatefulRmiIiopTests method test42_returnNestedEJBObject.
public void test42_returnNestedEJBObject() {
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 = home.create("test_42 StatefulBean");
assertNotNull("The EJBObject created is null", expected);
final ObjectGraph graph = ejbObject.returnObjectGraph(new ObjectGraph(expected));
assertNotNull("The ObjectGraph is null", graph);
final EncStatefulObject actual = (EncStatefulObject) 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