Search in sources :

Example 1 with BasicStatefulPojoBean

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

the class EncSingletonBean method lookupStatefulBusinessLocalBean.

public void lookupStatefulBusinessLocalBean() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);
            final BasicStatefulPojoBean object = (BasicStatefulPojoBean) ctx.lookup("java:comp/env/singleton/beanReferences/stateful-business-localbean");
            Assert.assertNotNull("The EJB BusinessLocalBean 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 : BasicStatefulPojoBean(org.apache.openejb.test.stateful.BasicStatefulPojoBean) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) InitialContext(javax.naming.InitialContext) JMSException(javax.jms.JMSException) RemoteException(java.rmi.RemoteException) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException)

Example 2 with BasicStatefulPojoBean

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

the class EncStatelessBean method lookupStatefulBusinessLocalBean.

public void lookupStatefulBusinessLocalBean() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);
            final BasicStatefulPojoBean object = (BasicStatefulPojoBean) ctx.lookup("java:comp/env/stateless/beanReferences/stateful-business-localbean");
            Assert.assertNotNull("The EJB BusinessLocalBean 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 : BasicStatefulPojoBean(org.apache.openejb.test.stateful.BasicStatefulPojoBean) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) InitialContext(javax.naming.InitialContext) JMSException(javax.jms.JMSException) RemoteException(java.rmi.RemoteException) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException)

Aggregations

RemoteException (java.rmi.RemoteException)2 EJBException (javax.ejb.EJBException)2 JMSException (javax.jms.JMSException)2 InitialContext (javax.naming.InitialContext)2 AssertionFailedError (junit.framework.AssertionFailedError)2 TestFailureException (org.apache.openejb.test.TestFailureException)2 BasicStatefulPojoBean (org.apache.openejb.test.stateful.BasicStatefulPojoBean)2