Search in sources :

Example 6 with BasicStatelessBusinessLocal

use of org.apache.openejb.test.stateless.BasicStatelessBusinessLocal in project tomee by apache.

the class EncStatefulBean method lookupStatelessBusinessLocal.

public void lookupStatelessBusinessLocal() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);
            final Object o = ctx.lookup("java:comp/env/stateful/beanReferences/stateless-business-local");
            final BasicStatelessBusinessLocal object = (BasicStatelessBusinessLocal) o;
            Assert.assertNotNull("The EJB BusinessLocal is null", object);
        } catch (final Exception e) {
            e.printStackTrace();
            Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
        }
    } catch (final AssertionFailedError afe) {
        throw new TestFailureException(afe);
    }
}
Also used : BasicStatelessBusinessLocal(org.apache.openejb.test.stateless.BasicStatelessBusinessLocal) BasicStatelessObject(org.apache.openejb.test.stateless.BasicStatelessObject) BasicBmpObject(org.apache.openejb.test.entity.bmp.BasicBmpObject) 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) CreateException(javax.ejb.CreateException)

Example 7 with BasicStatelessBusinessLocal

use of org.apache.openejb.test.stateless.BasicStatelessBusinessLocal in project tomee by apache.

the class ContextLookupBmpBean method lookupStatelessBusinessLocal.

public void lookupStatelessBusinessLocal() throws TestFailureException {
    try {
        try {
            final BasicStatelessBusinessLocal object = (BasicStatelessBusinessLocal) ejbContext.lookup("entity/bmp/beanReferences/stateless-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 : BasicStatelessBusinessLocal(org.apache.openejb.test.stateless.BasicStatelessBusinessLocal) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) RemoveException(javax.ejb.RemoveException) JMSException(javax.jms.JMSException) RemoteException(java.rmi.RemoteException) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException)

Example 8 with BasicStatelessBusinessLocal

use of org.apache.openejb.test.stateless.BasicStatelessBusinessLocal in project tomee by apache.

the class EncBmpBean method lookupStatelessBusinessLocal.

public void lookupStatelessBusinessLocal() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);
            final Object o = ctx.lookup("java:comp/env/entity/bmp/beanReferences/stateless-business-local");
            final BasicStatelessBusinessLocal object = (BasicStatelessBusinessLocal) o;
            Assert.assertNotNull("The EJB BusinessLocal is null", object);
        } catch (final Exception e) {
            e.printStackTrace();
            Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
        }
    } catch (final AssertionFailedError afe) {
        throw new TestFailureException(afe);
    }
}
Also used : BasicStatelessBusinessLocal(org.apache.openejb.test.stateless.BasicStatelessBusinessLocal) BasicStatelessObject(org.apache.openejb.test.stateless.BasicStatelessObject) BasicStatefulObject(org.apache.openejb.test.stateful.BasicStatefulObject) 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)

Example 9 with BasicStatelessBusinessLocal

use of org.apache.openejb.test.stateless.BasicStatelessBusinessLocal in project tomee by apache.

the class ContextLookupCmpBean method lookupStatelessBusinessLocal.

public void lookupStatelessBusinessLocal() throws TestFailureException {
    try {
        try {
            final BasicStatelessBusinessLocal object = (BasicStatelessBusinessLocal) ejbContext.lookup("entity/cmp/beanReferences/stateless-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 : BasicStatelessBusinessLocal(org.apache.openejb.test.stateless.BasicStatelessBusinessLocal) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) RemoveException(javax.ejb.RemoveException) JMSException(javax.jms.JMSException) RemoteException(java.rmi.RemoteException) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException)

Example 10 with BasicStatelessBusinessLocal

use of org.apache.openejb.test.stateless.BasicStatelessBusinessLocal in project tomee by apache.

the class EncCmp2Bean method lookupStatelessBusinessLocal.

public void lookupStatelessBusinessLocal() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);
            final Object o = ctx.lookup("java:comp/env/entity/cmp/beanReferences/stateless-business-local");
            final BasicStatelessBusinessLocal object = (BasicStatelessBusinessLocal) o;
            Assert.assertNotNull("The EJB BusinessLocal is null", object);
        } catch (final Exception e) {
            e.printStackTrace();
            Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
        }
    } catch (final AssertionFailedError afe) {
        throw new TestFailureException(afe);
    }
}
Also used : BasicStatelessBusinessLocal(org.apache.openejb.test.stateless.BasicStatelessBusinessLocal) BasicStatelessObject(org.apache.openejb.test.stateless.BasicStatelessObject) BasicStatefulObject(org.apache.openejb.test.stateful.BasicStatefulObject) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) InitialContext(javax.naming.InitialContext) JMSException(javax.jms.JMSException) TestFailureException(org.apache.openejb.test.TestFailureException) CreateException(javax.ejb.CreateException)

Aggregations

JMSException (javax.jms.JMSException)11 AssertionFailedError (junit.framework.AssertionFailedError)11 TestFailureException (org.apache.openejb.test.TestFailureException)11 BasicStatelessBusinessLocal (org.apache.openejb.test.stateless.BasicStatelessBusinessLocal)11 EJBException (javax.ejb.EJBException)9 RemoteException (java.rmi.RemoteException)6 InitialContext (javax.naming.InitialContext)5 BasicStatelessObject (org.apache.openejb.test.stateless.BasicStatelessObject)5 RemoveException (javax.ejb.RemoveException)4 BasicStatefulObject (org.apache.openejb.test.stateful.BasicStatefulObject)4 CreateException (javax.ejb.CreateException)3 BasicBmpObject (org.apache.openejb.test.entity.bmp.BasicBmpObject)2 NamingException (javax.naming.NamingException)1