Search in sources :

Example 1 with BasicStatelessHome

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

the class ContextLookupStatefulPojoBean method lookupStatelessBean.

public void lookupStatelessBean() throws TestFailureException {
    try {
        try {
            final BasicStatelessHome home = (BasicStatelessHome) ejbContext.lookup("stateful/beanReferences/stateless");
            Assert.assertNotNull("The EJBHome looked up is null", home);
            final BasicStatelessObject object = home.createObject();
            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 : BasicStatelessObject(org.apache.openejb.test.stateless.BasicStatelessObject) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) BasicStatelessHome(org.apache.openejb.test.stateless.BasicStatelessHome) JMSException(javax.jms.JMSException) TestFailureException(org.apache.openejb.test.TestFailureException)

Example 2 with BasicStatelessHome

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

the class EncStatefulBean method lookupStatelessBean.

public void lookupStatelessBean() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);
            final BasicStatelessHome home = (BasicStatelessHome) ctx.lookup("java:comp/env/stateful/beanReferences/stateless");
            Assert.assertNotNull("The EJBHome looked up is null", home);
            final BasicStatelessObject object = home.createObject();
            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 : BasicStatelessObject(org.apache.openejb.test.stateless.BasicStatelessObject) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) InitialContext(javax.naming.InitialContext) BasicStatelessHome(org.apache.openejb.test.stateless.BasicStatelessHome) JMSException(javax.jms.JMSException) RemoteException(java.rmi.RemoteException) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException) CreateException(javax.ejb.CreateException)

Example 3 with BasicStatelessHome

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

the class ContextLookupStatefulBean method lookupStatelessBean.

public void lookupStatelessBean() throws TestFailureException {
    try {
        try {
            final BasicStatelessHome home = (BasicStatelessHome) ejbContext.lookup("stateful/beanReferences/stateless");
            Assert.assertNotNull("The EJBHome looked up is null", home);
            final BasicStatelessObject object = home.createObject();
            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 : BasicStatelessObject(org.apache.openejb.test.stateless.BasicStatelessObject) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) BasicStatelessHome(org.apache.openejb.test.stateless.BasicStatelessHome) JMSException(javax.jms.JMSException) RemoteException(java.rmi.RemoteException) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException) CreateException(javax.ejb.CreateException)

Example 4 with BasicStatelessHome

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

the class EncCmp2Bean method lookupStatelessBean.

public void lookupStatelessBean() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);
            final BasicStatelessHome home = (BasicStatelessHome) ctx.lookup("java:comp/env/entity/cmp/beanReferences/stateless");
            Assert.assertNotNull("The EJBHome looked up is null", home);
            final BasicStatelessObject object = home.createObject();
            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 : BasicStatelessObject(org.apache.openejb.test.stateless.BasicStatelessObject) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) InitialContext(javax.naming.InitialContext) BasicStatelessHome(org.apache.openejb.test.stateless.BasicStatelessHome) JMSException(javax.jms.JMSException) TestFailureException(org.apache.openejb.test.TestFailureException) CreateException(javax.ejb.CreateException)

Example 5 with BasicStatelessHome

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

the class ContextLookupBmpBean method lookupStatelessBean.

public void lookupStatelessBean() throws TestFailureException {
    try {
        try {
            final BasicStatelessHome home = (BasicStatelessHome) ejbContext.lookup("entity/bmp/beanReferences/stateless");
            Assert.assertNotNull("The EJBHome looked up is null", home);
            final BasicStatelessObject object = home.createObject();
            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 : BasicStatelessObject(org.apache.openejb.test.stateless.BasicStatelessObject) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) BasicStatelessHome(org.apache.openejb.test.stateless.BasicStatelessHome) RemoveException(javax.ejb.RemoveException) JMSException(javax.jms.JMSException) RemoteException(java.rmi.RemoteException) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException)

Aggregations

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