use of org.apache.openejb.test.TestFailureException in project tomee by apache.
the class ContextLookupCmpBean method lookupIntegerEntry.
public void lookupIntegerEntry() throws TestFailureException {
try {
try {
final Integer expected = new Integer(1);
final Integer actual = (Integer) ejbContext.lookup("entity/cmp/references/Integer");
Assert.assertNotNull("The Integer looked up is null", actual);
Assert.assertEquals(expected, actual);
} catch (final Exception e) {
Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
} catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
use of org.apache.openejb.test.TestFailureException in project tomee by apache.
the class ContextLookupCmpBean method lookupStatefulBusinessLocal.
public void lookupStatefulBusinessLocal() throws TestFailureException {
try {
try {
final BasicStatefulBusinessLocal object = (BasicStatefulBusinessLocal) ejbContext.lookup("entity/cmp/beanReferences/stateful-business-local");
Assert.assertNotNull("The EJB BusinessLocal is null", object);
} catch (final Exception e) {
Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
} catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
use of org.apache.openejb.test.TestFailureException in project tomee by apache.
the class ContextLookupCmpBean method lookupByteEntry.
public void lookupByteEntry() throws TestFailureException {
try {
try {
final Byte expected = new Byte((byte) 1);
final Byte actual = (Byte) ejbContext.lookup("entity/cmp/references/Byte");
Assert.assertNotNull("The Byte looked up is null", actual);
Assert.assertEquals(expected, actual);
} catch (final Exception e) {
Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
} catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
use of org.apache.openejb.test.TestFailureException in project tomee by apache.
the class EncCmp2Bean method lookupPersistenceContext.
public void lookupPersistenceContext() throws TestFailureException {
try {
try {
final InitialContext ctx = new InitialContext();
Assert.assertNotNull("The InitialContext is null", ctx);
final EntityManager em = (EntityManager) ctx.lookup("java:comp/env/persistence/TestContext");
Assert.assertNotNull("The EntityManager is null", em);
// call a do nothing method to assure entity manager actually exists
em.getFlushMode();
} catch (final Exception e) {
Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
} catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
use of org.apache.openejb.test.TestFailureException in project tomee by apache.
the class EncCmp2Bean method lookupStatefulBusinessLocal.
public void lookupStatefulBusinessLocal() throws TestFailureException {
try {
try {
final InitialContext ctx = new InitialContext();
Assert.assertNotNull("The InitialContext is null", ctx);
final BasicStatefulBusinessLocal object = (BasicStatefulBusinessLocal) ctx.lookup("java:comp/env/entity/cmp/beanReferences/stateful-business-local");
Assert.assertNotNull("The EJB BusinessLocal is null", object);
} catch (final Exception e) {
Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
} catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
Aggregations