use of org.apache.openejb.test.TestFailureException in project tomee by apache.
the class EncSingletonBean method lookupStatefulBean.
public void lookupStatefulBean() throws TestFailureException {
try {
try {
final InitialContext ctx = new InitialContext();
Assert.assertNotNull("The InitialContext is null", ctx);
final BasicStatefulHome home = (BasicStatefulHome) ctx.lookup("java:comp/env/singleton/beanReferences/stateful");
Assert.assertNotNull("The EJBHome looked up is null", home);
final BasicStatefulObject object = home.createObject("Enc Bean");
Assert.assertNotNull("The EJBObject 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 ContextLookupBmpBean method lookupDoubleEntry.
public void lookupDoubleEntry() throws TestFailureException {
try {
try {
final Double expected = new Double(1.0D);
final Double actual = (Double) ejbContext.lookup("entity/bmp/references/Double");
Assert.assertNotNull("The Double 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 ContextLookupBmpBean method lookupStatefulBusinessRemote.
public void lookupStatefulBusinessRemote() throws TestFailureException {
try {
try {
final BasicStatefulBusinessRemote object = (BasicStatefulBusinessRemote) ejbContext.lookup("entity/bmp/beanReferences/stateful-business-remote");
Assert.assertNotNull("The EJB BusinessRemote 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 ContextLookupBmpBean method lookupStatelessBusinessRemote.
public void lookupStatelessBusinessRemote() throws TestFailureException {
try {
try {
final BasicStatelessBusinessRemote object = (BasicStatelessBusinessRemote) ejbContext.lookup("entity/bmp/beanReferences/stateless-business-remote");
Assert.assertNotNull("The EJB BusinessRemote 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 ContextLookupBmpBean method lookupPersistenceUnit.
public void lookupPersistenceUnit() throws TestFailureException {
try {
try {
final EntityManagerFactory emf = (EntityManagerFactory) ejbContext.lookup("persistence/TestUnit");
Assert.assertNotNull("The EntityManagerFactory is null", emf);
} catch (final Exception e) {
Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
} catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
Aggregations