Search in sources :

Example 6 with BasicBmpObject

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

the class EncSingletonBean method lookupEntityBean.

//=============================
// Home interface methods
//
//
// 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/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) InitialContext(javax.naming.InitialContext) 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 7 with BasicBmpObject

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

the class ContextLookupMdbBean method lookupEntityBean.

@Override
public void lookupEntityBean() throws TestFailureException {
    try {
        try {
            final BasicBmpHome home = (BasicBmpHome) mdbContext.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) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException) BasicBmpObject(org.apache.openejb.test.entity.bmp.BasicBmpObject)

Example 8 with BasicBmpObject

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

the class EncStatelessBean method lookupEntityBean.

//=============================
// Home interface methods
//
//
// 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/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) InitialContext(javax.naming.InitialContext) 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 9 with BasicBmpObject

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

the class ContextLookupMdbPojoBean method lookupEntityBean.

public void lookupEntityBean() throws TestFailureException {
    try {
        try {
            final BasicBmpHome home = (BasicBmpHome) getMessageDrivenContext().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) NamingException(javax.naming.NamingException) JMSException(javax.jms.JMSException) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException) BasicBmpObject(org.apache.openejb.test.entity.bmp.BasicBmpObject)

Example 10 with BasicBmpObject

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

the class EncMdbBean method lookupEntityBean.

@Override
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/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) InitialContext(javax.naming.InitialContext) JMSException(javax.jms.JMSException) 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