use of org.apache.openejb.test.TestFailureException in project tomee by apache.
the class EncMdbBean method lookupPersistenceUnit.
@Override
public void lookupPersistenceUnit() throws TestFailureException {
try {
try {
final InitialContext ctx = new InitialContext();
Assert.assertNotNull("The InitialContext is null", ctx);
final EntityManagerFactory emf = (EntityManagerFactory) ctx.lookup("java:comp/env/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);
}
}
use of org.apache.openejb.test.TestFailureException in project tomee by apache.
the class EncMdbBean method lookupBooleanEntry.
@Override
public void lookupBooleanEntry() throws TestFailureException {
try {
try {
final InitialContext ctx = new InitialContext();
Assert.assertNotNull("The InitialContext is null", ctx);
final Boolean expected = true;
final Boolean actual = (Boolean) ctx.lookup("java:comp/env/stateless/references/Boolean");
Assert.assertNotNull("The Boolean 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 lookupCharacterEntry.
@Override
public void lookupCharacterEntry() throws TestFailureException {
try {
try {
final InitialContext ctx = new InitialContext();
Assert.assertNotNull("The InitialContext is null", ctx);
final Character expected = 'D';
final Character actual = (Character) ctx.lookup("java:comp/env/stateless/references/Character");
Assert.assertNotNull("The Character 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 FieldInjectionMdbBean method lookupDoubleEntry.
@Override
public void lookupDoubleEntry() throws TestFailureException {
try {
final Double expected = 1.0D;
Assert.assertNotNull("The Double looked up is null", doouble);
Assert.assertEquals(expected, doouble);
} catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
use of org.apache.openejb.test.TestFailureException in project tomee by apache.
the class FieldInjectionMdbBean method lookupStringEntry.
@Override
public void lookupStringEntry() throws TestFailureException {
try {
final String expected = "1";
Assert.assertNotNull("The String looked up is null", striing);
Assert.assertEquals(expected, striing);
} catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
Aggregations