Search in sources :

Example 1 with BasicStatefulBusinessRemote

use of org.apache.openejb.test.stateful.BasicStatefulBusinessRemote in project tomee by apache.

the class ContextLookupStatelessBean method lookupStatefulBusinessRemote.

public void lookupStatefulBusinessRemote() throws TestFailureException {
    try {
        try {
            final BasicStatefulBusinessRemote object = (BasicStatefulBusinessRemote) ejbContext.lookup("stateless/beanReferences/stateful-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 : BasicStatefulBusinessRemote(org.apache.openejb.test.stateful.BasicStatefulBusinessRemote) 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)

Example 2 with BasicStatefulBusinessRemote

use of org.apache.openejb.test.stateful.BasicStatefulBusinessRemote in project tomee by apache.

the class EncSingletonBean method lookupStatefulBusinessRemote.

public void lookupStatefulBusinessRemote() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);
            final BasicStatefulBusinessRemote object = (BasicStatefulBusinessRemote) ctx.lookup("java:comp/env/singleton/beanReferences/stateful-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 : BasicStatefulBusinessRemote(org.apache.openejb.test.stateful.BasicStatefulBusinessRemote) 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)

Example 3 with BasicStatefulBusinessRemote

use of org.apache.openejb.test.stateful.BasicStatefulBusinessRemote in project tomee by apache.

the class ContextLookupMdbBean method lookupStatefulBusinessRemote.

@Override
public void lookupStatefulBusinessRemote() throws TestFailureException {
    try {
        try {
            final BasicStatefulBusinessRemote object = (BasicStatefulBusinessRemote) mdbContext.lookup("stateless/beanReferences/stateful-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 : BasicStatefulBusinessRemote(org.apache.openejb.test.stateful.BasicStatefulBusinessRemote) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) JMSException(javax.jms.JMSException) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException)

Example 4 with BasicStatefulBusinessRemote

use of org.apache.openejb.test.stateful.BasicStatefulBusinessRemote in project tomee by apache.

the class EncCmp2Bean method lookupStatefulBusinessRemote.

public void lookupStatefulBusinessRemote() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);
            final BasicStatefulBusinessRemote object = (BasicStatefulBusinessRemote) ctx.lookup("java:comp/env/entity/cmp/beanReferences/stateful-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 : BasicStatefulBusinessRemote(org.apache.openejb.test.stateful.BasicStatefulBusinessRemote) 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)

Example 5 with BasicStatefulBusinessRemote

use of org.apache.openejb.test.stateful.BasicStatefulBusinessRemote in project tomee by apache.

the class ContextLookupMdbPojoBean method lookupStatefulBusinessRemote.

public void lookupStatefulBusinessRemote() throws TestFailureException {
    try {
        try {
            final BasicStatefulBusinessRemote object = (BasicStatefulBusinessRemote) getMessageDrivenContext().lookup("stateless/beanReferences/stateful-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 : BasicStatefulBusinessRemote(org.apache.openejb.test.stateful.BasicStatefulBusinessRemote) 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)

Aggregations

AssertionFailedError (junit.framework.AssertionFailedError)12 TestFailureException (org.apache.openejb.test.TestFailureException)12 BasicStatefulBusinessRemote (org.apache.openejb.test.stateful.BasicStatefulBusinessRemote)12 EJBException (javax.ejb.EJBException)11 JMSException (javax.jms.JMSException)11 RemoteException (java.rmi.RemoteException)8 InitialContext (javax.naming.InitialContext)6 RemoveException (javax.ejb.RemoveException)4 NamingException (javax.naming.NamingException)2 CreateException (javax.ejb.CreateException)1