Search in sources :

Example 1 with BasicBmpObject

use of org.apache.openejb.test.entity.bmp.BasicBmpObject in project tomee by apache.

the class ContextLookupStatelessBean method lookupEntityBean.

//=============================
// Home interface methods
//
//
// Home interface methods
//=============================
//=============================
// Remote interface methods
//
public void lookupEntityBean() throws TestFailureException {
    try {
        try {
            final BasicBmpHome home = (BasicBmpHome) ejbContext.lookup("stateless/beanReferences/bmp_entity");
            Assert.assertNotNull("The EJBHome looked up is null", home);
            final BasicBmpObject 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);
    }
}
Also used : BasicBmpHome(org.apache.openejb.test.entity.bmp.BasicBmpHome) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) JMSException(javax.jms.JMSException) RemoteException(java.rmi.RemoteException) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException) BasicBmpObject(org.apache.openejb.test.entity.bmp.BasicBmpObject)

Example 2 with BasicBmpObject

use of org.apache.openejb.test.entity.bmp.BasicBmpObject in project tomee by apache.

the class ContextLookupStatefulPojoBean method lookupEntityBean.

public void lookupEntityBean() throws TestFailureException {
    try {
        try {
            final BasicBmpHome home = (BasicBmpHome) ejbContext.lookup("stateful/beanReferences/bmp_entity");
            Assert.assertNotNull("The EJBHome looked up is null", home);
            final BasicBmpObject 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);
    }
}
Also used : BasicBmpHome(org.apache.openejb.test.entity.bmp.BasicBmpHome) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) JMSException(javax.jms.JMSException) TestFailureException(org.apache.openejb.test.TestFailureException) BasicBmpObject(org.apache.openejb.test.entity.bmp.BasicBmpObject)

Example 3 with BasicBmpObject

use of org.apache.openejb.test.entity.bmp.BasicBmpObject in project tomee by apache.

the class EncStatefulBean method lookupEntityBean.

//
// Home interface methods
//=============================
//=============================
// Remote interface methods
//
public void lookupEntityBean() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);
            final BasicBmpHome home = (BasicBmpHome) ctx.lookup("java:comp/env/stateful/beanReferences/bmp_entity");
            Assert.assertNotNull("The EJBHome looked up is null", home);
            final BasicBmpObject 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);
    }
}
Also used : BasicBmpHome(org.apache.openejb.test.entity.bmp.BasicBmpHome) 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) BasicBmpObject(org.apache.openejb.test.entity.bmp.BasicBmpObject)

Example 4 with BasicBmpObject

use of org.apache.openejb.test.entity.bmp.BasicBmpObject in project tomee by apache.

the class ContextLookupStatefulBean method lookupEntityBean.

//
// Home interface methods
//=============================
//=============================
// Remote interface methods
//
public void lookupEntityBean() throws TestFailureException {
    try {
        try {
            final BasicBmpHome home = (BasicBmpHome) ejbContext.lookup("stateful/beanReferences/bmp_entity");
            Assert.assertNotNull("The EJBHome looked up is null", home);
            final BasicBmpObject 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);
    }
}
Also used : BasicBmpHome(org.apache.openejb.test.entity.bmp.BasicBmpHome) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) JMSException(javax.jms.JMSException) RemoteException(java.rmi.RemoteException) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException) CreateException(javax.ejb.CreateException) BasicBmpObject(org.apache.openejb.test.entity.bmp.BasicBmpObject)

Example 5 with BasicBmpObject

use of org.apache.openejb.test.entity.bmp.BasicBmpObject in project tomee by apache.

the class ContextLookupSingletonBean method lookupEntityBean.

//=============================
// Home interface methods
//
//
// Home interface methods
//=============================
//=============================
// Remote interface methods
//
public void lookupEntityBean() throws TestFailureException {
    try {
        try {
            final BasicBmpHome home = (BasicBmpHome) ejbContext.lookup("singleton/beanReferences/bmp_entity");
            Assert.assertNotNull("The EJBHome looked up is null", home);
            final BasicBmpObject 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);
    }
}
Also used : BasicBmpHome(org.apache.openejb.test.entity.bmp.BasicBmpHome) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) JMSException(javax.jms.JMSException) RemoteException(java.rmi.RemoteException) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException) BasicBmpObject(org.apache.openejb.test.entity.bmp.BasicBmpObject)

Aggregations

AssertionFailedError (junit.framework.AssertionFailedError)12 TestFailureException (org.apache.openejb.test.TestFailureException)12 BasicBmpHome (org.apache.openejb.test.entity.bmp.BasicBmpHome)12 BasicBmpObject (org.apache.openejb.test.entity.bmp.BasicBmpObject)12 EJBException (javax.ejb.EJBException)11 JMSException (javax.jms.JMSException)10 RemoteException (java.rmi.RemoteException)8 InitialContext (javax.naming.InitialContext)4 NamingException (javax.naming.NamingException)3 CreateException (javax.ejb.CreateException)2