use of org.apache.openejb.test.object.ObjectGraph in project tomee by apache.
the class RmiIiopSingletonBean method returnNestedHandle.
public ObjectGraph returnNestedHandle() throws javax.ejb.EJBException {
ObjectGraph data = null;
try {
final InitialContext ctx = new InitialContext();
final EncSingletonHome home = (EncSingletonHome) ctx.lookup("java:comp/env/singleton/rmi-iiop/home");
final EncSingletonObject object = home.create();
data = new ObjectGraph(object.getHandle());
} catch (final Exception e) {
throw new javax.ejb.EJBException(e);
}
return data;
}
use of org.apache.openejb.test.object.ObjectGraph in project tomee by apache.
the class RmiIiopSingletonBean method returnNestedEJBObject.
public ObjectGraph returnNestedEJBObject() throws javax.ejb.EJBException {
ObjectGraph data = null;
try {
final InitialContext ctx = new InitialContext();
final EncSingletonHome home = (EncSingletonHome) ctx.lookup("java:comp/env/singleton/rmi-iiop/home");
final EncSingletonObject object = home.create();
data = new ObjectGraph(object);
} catch (final Exception e) {
throw new javax.ejb.EJBException(e);
}
return data;
}
use of org.apache.openejb.test.object.ObjectGraph in project tomee by apache.
the class RmiIiopSingletonBean method returnNestedEJBHome.
public ObjectGraph returnNestedEJBHome() throws javax.ejb.EJBException {
ObjectGraph data = null;
try {
final InitialContext ctx = new InitialContext();
final Object object = ctx.lookup("java:comp/env/singleton/rmi-iiop/home");
data = new ObjectGraph(object);
} catch (final Exception e) {
throw new javax.ejb.EJBException(e);
}
return data;
}
use of org.apache.openejb.test.object.ObjectGraph in project tomee by apache.
the class RmiIiopStatelessBean method returnNestedEJBMetaData.
public ObjectGraph returnNestedEJBMetaData() throws javax.ejb.EJBException {
ObjectGraph data = null;
try {
final InitialContext ctx = new InitialContext();
final EncStatelessHome home = (EncStatelessHome) ctx.lookup("java:comp/env/stateless/rmi-iiop/home");
final EJBMetaData object = home.getEJBMetaData();
data = new ObjectGraph(object);
} catch (final Exception e) {
throw new javax.ejb.EJBException(e);
}
return data;
}
use of org.apache.openejb.test.object.ObjectGraph in project tomee by apache.
the class BmpRmiIiopTests method test47_returnNestedEJBMetaData.
public void test47_returnNestedEJBMetaData() {
try {
final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
final EncBmpHome home = (EncBmpHome) obj;
assertNotNull("The EJBHome returned from JNDI is null", home);
final EJBMetaData expected = home.getEJBMetaData();
assertNotNull("The EJBMetaData returned is null", expected);
final ObjectGraph graph = ejbObject.returnObjectGraph(new ObjectGraph(expected));
assertNotNull("The ObjectGraph is null", graph);
final EJBMetaData actual = (EJBMetaData) graph.getObject();
assertNotNull("The EJBMetaData returned is null", actual);
assertEquals(expected.getHomeInterfaceClass(), actual.getHomeInterfaceClass());
assertEquals(expected.getRemoteInterfaceClass(), actual.getRemoteInterfaceClass());
} catch (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
Aggregations