use of org.apache.openejb.test.TestFailureException in project tomee by apache.
the class ContextLookupMdbPojoBean method lookupMessageDrivenContext.
public void lookupMessageDrivenContext() throws TestFailureException {
try {
try {
final InitialContext ctx = new InitialContext();
Assert.assertNotNull("The InitialContext is null", ctx);
// lookup in enc
final MessageDrivenContext sctx = (MessageDrivenContext) ctx.lookup("java:comp/env/mdbcontext");
Assert.assertNotNull("The MessageDrivenContext got from java:comp/env/mdbcontext is null", sctx);
// lookup using global name
final EJBContext ejbCtx = (EJBContext) ctx.lookup("java:comp/EJBContext");
Assert.assertNotNull("The MessageDrivenContext got from java:comp/EJBContext is null ", ejbCtx);
} 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 EncMdbBean method lookupFloatEntry.
@Override
public void lookupFloatEntry() throws TestFailureException {
try {
try {
final InitialContext ctx = new InitialContext();
Assert.assertNotNull("The InitialContext is null", ctx);
final Float expected = 1.0F;
final Float actual = (Float) ctx.lookup("java:comp/env/stateless/references/Float");
Assert.assertNotNull("The Float 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 EncMdbBean method lookupStatelessBusinessRemote.
@Override
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/stateless/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 EncMdbBean method lookupShortEntry.
@Override
public void lookupShortEntry() throws TestFailureException {
try {
try {
final InitialContext ctx = new InitialContext();
Assert.assertNotNull("The InitialContext is null", ctx);
final Short expected = (short) 1;
final Short actual = (Short) ctx.lookup("java:comp/env/stateless/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 EncMdbBean method lookupByteEntry.
@Override
public void lookupByteEntry() throws TestFailureException {
try {
try {
final InitialContext ctx = new InitialContext();
Assert.assertNotNull("The InitialContext is null", ctx);
final Byte expected = (byte) 1;
final Byte actual = (Byte) ctx.lookup("java:comp/env/stateless/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);
}
}
Aggregations