use of org.apache.openejb.test.entity.cmp.EncCmpHome in project tomee by apache.
the class Cmp2RmiIiopTests method test47_returnNestedEJBMetaData.
public void test47_returnNestedEJBMetaData() {
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 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());
}
}
use of org.apache.openejb.test.entity.cmp.EncCmpHome in project tomee by apache.
the class Cmp2RmiIiopTests method test36_returnEJBHome2.
public void test36_returnEJBHome2() {
try {
final EncCmpHome actual = (EncCmpHome) ejbObject.returnEJBHome();
assertNotNull("The EJBHome returned is null", actual);
} catch (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
use of org.apache.openejb.test.entity.cmp.EncCmpHome in project tomee by apache.
the class Cmp2RmiIiopTests method test45_returnEJBMetaData.
/*-------------------------------------------------*/
/* EJBMetaData */
/*-------------------------------------------------*/
public void test45_returnEJBMetaData() {
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 EJBMetaData expected = home.getEJBMetaData();
assertNotNull("The EJBMetaData returned is null", expected);
final EJBMetaData actual = ejbObject.returnEJBMetaData(expected);
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());
}
}
use of org.apache.openejb.test.entity.cmp.EncCmpHome in project tomee by apache.
the class Cmp2RmiIiopTests method test54_returnHandleArray.
public void test54_returnHandleArray() {
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 object = home.create("test_54 CmpBean");
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 = 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 org.apache.openejb.test.entity.cmp.EncCmpHome in project tomee by apache.
the class Cmp2RmiIiopTests method Xtest39_returnEJBHomeArray.
public void Xtest39_returnEJBHomeArray() {
try {
final EncCmpHome[] expected = new EncCmpHome[3];
for (int i = 0; i < expected.length; i++) {
final Object obj = initialContext.lookup("client/tests/entity/cmp/EncBean");
expected[i] = (EncCmpHome) obj;
assertNotNull("The EJBHome returned from JNDI is null", expected[i]);
}
final EJBHome[] actual = ejbObject.returnEJBHomeArray(expected);
assertNotNull("The EJBHome array returned is null", actual);
assertEquals(expected.length, actual.length);
} catch (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
Aggregations