Search in sources :

Example 1 with BasicStatelessBusinessRemote

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

the class ContextLookupStatefulPojoBean method lookupStatelessBusinessRemote.

public void lookupStatelessBusinessRemote() throws TestFailureException {
    try {
        try {
            final BasicStatelessBusinessRemote object = (BasicStatelessBusinessRemote) ejbContext.lookup("stateful/beanReferences/stateless-business-remote");
            Assert.assertNotNull("The EJB BusinessRemote 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 : BasicStatelessBusinessRemote(org.apache.openejb.test.stateless.BasicStatelessBusinessRemote) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) JMSException(javax.jms.JMSException) TestFailureException(org.apache.openejb.test.TestFailureException)

Example 2 with BasicStatelessBusinessRemote

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

the class EncStatefulBean method lookupStatelessBusinessRemote.

public void lookupStatelessBusinessRemote() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);
            final BasicStatelessBusinessRemote object = (BasicStatelessBusinessRemote) ctx.lookup("java:comp/env/stateful/beanReferences/stateless-business-remote");
            Assert.assertNotNull("The EJB BusinessRemote 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 : BasicStatelessBusinessRemote(org.apache.openejb.test.stateless.BasicStatelessBusinessRemote) 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 3 with BasicStatelessBusinessRemote

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

the class ContextLookupStatefulBean method lookupStatelessBusinessRemote.

public void lookupStatelessBusinessRemote() throws TestFailureException {
    try {
        try {
            final BasicStatelessBusinessRemote object = (BasicStatelessBusinessRemote) ejbContext.lookup("stateful/beanReferences/stateless-business-remote");
            Assert.assertNotNull("The EJB BusinessRemote 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 : BasicStatelessBusinessRemote(org.apache.openejb.test.stateless.BasicStatelessBusinessRemote) 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)

Example 4 with BasicStatelessBusinessRemote

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

the class EncCmpBean method lookupStatelessBusinessRemote.

public void lookupStatelessBusinessRemote() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);
            final BasicStatelessBusinessRemote object = (BasicStatelessBusinessRemote) ctx.lookup("java:comp/env/entity/cmp/beanReferences/stateless-business-remote");
            Assert.assertNotNull("The EJB BusinessRemote 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 : BasicStatelessBusinessRemote(org.apache.openejb.test.stateless.BasicStatelessBusinessRemote) 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 5 with BasicStatelessBusinessRemote

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

the class ContextLookupMdbBean method lookupStatelessBusinessRemote.

@Override
public void lookupStatelessBusinessRemote() throws TestFailureException {
    try {
        try {
            final BasicStatelessBusinessRemote object = (BasicStatelessBusinessRemote) mdbContext.lookup("stateless/beanReferences/stateless-business-remote");
            Assert.assertNotNull("The EJB BusinessRemote 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 : BasicStatelessBusinessRemote(org.apache.openejb.test.stateless.BasicStatelessBusinessRemote) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) JMSException(javax.jms.JMSException) 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 BasicStatelessBusinessRemote (org.apache.openejb.test.stateless.BasicStatelessBusinessRemote)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