use of org.apache.openejb.test.TestFailureException in project tomee by apache.
the class EncBmpBean 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/entity/bmp/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 EncBmpBean method lookupStatelessBusinessRemote.
public void lookupStatelessBusinessRemote() throws TestFailureException {
try {
try {
final InitialContext ctx = new InitialContext();
Assert.assertNotNull("The InitialContext is null", ctx);
final BasicStatelessBusinessRemote object = (BasicStatelessBusinessRemote) ctx.lookup("java:comp/env/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 EncBmpBean method lookupStringEntry.
public void lookupStringEntry() throws TestFailureException {
try {
try {
final InitialContext ctx = new InitialContext();
Assert.assertNotNull("The InitialContext is null", ctx);
final String expected = new String("1");
final String actual = (String) ctx.lookup("java:comp/env/entity/bmp/references/String");
Assert.assertNotNull("The String 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 EncBmpBean method lookupShortEntry.
public void lookupShortEntry() throws TestFailureException {
try {
try {
final InitialContext ctx = new InitialContext();
Assert.assertNotNull("The InitialContext is null", ctx);
final Short expected = new Short((short) 1);
final Short actual = (Short) ctx.lookup("java:comp/env/entity/bmp/references/Short");
Assert.assertNotNull("The Short 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 lookupShortEntry.
public void lookupShortEntry() throws TestFailureException {
try {
try {
final Short expected = new Short((short) 1);
final Short actual = (Short) ejbContext.lookup("entity/cmp/references/Short");
Assert.assertNotNull("The Short 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);
}
}
Aggregations