use of javax.ejb.EJBObject in project tomee by apache.
the class StatelessRmiIiopTests method test42_returnNestedEJBObject.
public void test42_returnNestedEJBObject() {
try {
final Object obj = initialContext.lookup("client/tests/stateless/EncBean");
final EncStatelessHome home = (EncStatelessHome) obj;
assertNotNull("The EJBHome returned from JNDI is null", home);
final EncStatelessObject expected = home.create();
assertNotNull("The EJBObject created is null", expected);
final ObjectGraph graph = ejbObject.returnObjectGraph(new ObjectGraph(expected));
assertNotNull("The ObjectGraph is null", graph);
final EncStatelessObject actual = (EncStatelessObject) 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 javax.ejb.EJBObject in project tomee by apache.
the class StatelessRmiIiopTests method test54_returnHandleArray.
public void test54_returnHandleArray() {
try {
final Object obj = initialContext.lookup("client/tests/stateless/EncBean");
final EncStatelessHome home = (EncStatelessHome) obj;
assertNotNull("The EJBHome returned from JNDI is null", home);
final EncStatelessObject object = home.create();
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());
}
}
use of javax.ejb.EJBObject in project tomee by apache.
the class StatelessRmiIiopTests method setUp.
protected void setUp() throws Exception {
super.setUp();
final Object obj = initialContext.lookup("client/tests/stateless/RMI-over-IIOP/EJBHome");
ejbHome = (RmiIiopStatelessHome) obj;
ejbObject = ejbHome.create();
}
use of javax.ejb.EJBObject in project tomee by apache.
the class StatelessAllowedOperationsTests method setUp.
protected void setUp() throws Exception {
super.setUp();
final Object obj = initialContext.lookup("client/tests/stateless/BasicStatelessHome");
ejbHome = (BasicStatelessHome) obj;
ejbObject = ejbHome.createObject();
ejbHandle = ejbObject.getHandle();
timerSync = (TimerSync) initialContext.lookup("TimerSyncBeanBusinessRemote");
// setUp_ejbActivate_Passivate();
/* These tests will only work if the specified
* method has already been called by the container.
*
* TO DO:
* Implement a little application senario to ensure
* that all methods tested for below have been called
* by the container.
*/
ejbObject.businessMethod("activate me please");
}
use of javax.ejb.EJBObject in project tomee by apache.
the class StatelessHandleTests 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());
}
}
Aggregations