Search in sources :

Example 11 with BasicStatefulBusinessLocal

use of org.apache.openejb.test.stateful.BasicStatefulBusinessLocal in project tomee by apache.

the class ContextLookupStatelessPojoBean method lookupStatefulBusinessLocal.

public void lookupStatefulBusinessLocal() throws TestFailureException {
    try {
        try {
            final BasicStatefulBusinessLocal object = (BasicStatefulBusinessLocal) getSessionContext().lookup("stateless/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);
    }
}
Also used : BasicStatefulBusinessLocal(org.apache.openejb.test.stateful.BasicStatefulBusinessLocal) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) NamingException(javax.naming.NamingException) RemoteException(java.rmi.RemoteException) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException)

Example 12 with BasicStatefulBusinessLocal

use of org.apache.openejb.test.stateful.BasicStatefulBusinessLocal in project tomee by apache.

the class EncCmpBean method lookupStatefulBusinessLocal.

public void lookupStatefulBusinessLocal() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);
            final BasicStatefulBusinessLocal object = (BasicStatefulBusinessLocal) ctx.lookup("java:comp/env/entity/cmp/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);
    }
}
Also used : BasicStatefulBusinessLocal(org.apache.openejb.test.stateful.BasicStatefulBusinessLocal) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) InitialContext(javax.naming.InitialContext) RemoveException(javax.ejb.RemoveException) JMSException(javax.jms.JMSException) RemoteException(java.rmi.RemoteException) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException)

Aggregations

AssertionFailedError (junit.framework.AssertionFailedError)12 TestFailureException (org.apache.openejb.test.TestFailureException)12 BasicStatefulBusinessLocal (org.apache.openejb.test.stateful.BasicStatefulBusinessLocal)12 EJBException (javax.ejb.EJBException)11 JMSException (javax.jms.JMSException)11 RemoteException (java.rmi.RemoteException)8 InitialContext (javax.naming.InitialContext)6 RemoveException (javax.ejb.RemoveException)4 NamingException (javax.naming.NamingException)2 CreateException (javax.ejb.CreateException)1