use of org.apache.openejb.test.TestFailureException in project tomee by apache.
the class ContextLookupSingletonBean method lookupIntegerEntry.
public void lookupIntegerEntry() throws TestFailureException {
try {
try {
final Integer expected = new Integer(1);
final Integer actual = (Integer) ejbContext.lookup("singleton/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 ContextLookupSingletonBean method lookupStringEntry.
public void lookupStringEntry() throws TestFailureException {
try {
try {
final String expected = new String("1");
final String actual = (String) ejbContext.lookup("singleton/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 ContextLookupSingletonBean method lookupSingletonBusinessLocal.
public void lookupSingletonBusinessLocal() throws TestFailureException {
try {
try {
final BasicSingletonBusinessLocal object = (BasicSingletonBusinessLocal) ejbContext.lookup("singleton/beanReferences/singleton-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 ContextLookupSingletonBean method lookupStatefulBusinessLocal.
public void lookupStatefulBusinessLocal() throws TestFailureException {
try {
try {
final BasicStatefulBusinessLocal object = (BasicStatefulBusinessLocal) ejbContext.lookup("singleton/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 ContextLookupSingletonBean method lookupStatefulBean.
public void lookupStatefulBean() throws TestFailureException {
try {
try {
final BasicStatefulHome home = (BasicStatefulHome) ejbContext.lookup("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);
}
}
Aggregations