Search in sources :

Example 1 with TestFailureException

use of org.apache.openejb.test.TestFailureException in project tomee by apache.

the class AnnotatedFieldInjectionStatelessBean method lookupShortEntry.

public void lookupShortEntry() throws TestFailureException {
    try {
        final Short expected = new Short((short) 1);
        Assert.assertNotNull("The Short looked up is null", shoort);
        Assert.assertEquals(expected, shoort);
    } catch (final AssertionFailedError afe) {
        throw new TestFailureException(afe);
    }
}
Also used : TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError)

Example 2 with TestFailureException

use of org.apache.openejb.test.TestFailureException in project tomee by apache.

the class AnnotatedFieldInjectionStatelessBean method lookupIntegerEntry.

public void lookupIntegerEntry() throws TestFailureException {
    try {
        final Integer expected = new Integer(1);
        Assert.assertNotNull("The Integer looked up is null", inteeger);
        Assert.assertEquals(expected, inteeger);
    } catch (final AssertionFailedError afe) {
        throw new TestFailureException(afe);
    }
}
Also used : TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError)

Example 3 with TestFailureException

use of org.apache.openejb.test.TestFailureException 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 4 with TestFailureException

use of org.apache.openejb.test.TestFailureException in project tomee by apache.

the class ContextLookupStatelessBean method lookupStatefulBusinessLocalBean.

public void lookupStatefulBusinessLocalBean() throws TestFailureException {
    try {
        try {
            final BasicStatelessPojoBean object = (BasicStatelessPojoBean) ejbContext.lookup("stateless/beanReferences/stateful-business-localbean");
            Assert.assertNotNull("The EJB BusinessLocalBean 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 : 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 5 with TestFailureException

use of org.apache.openejb.test.TestFailureException in project tomee by apache.

the class FieldInjectionStatefulBean method lookupCharacterEntry.

public void lookupCharacterEntry() throws TestFailureException {
    try {
        final Character expected = new Character('D');
        Assert.assertNotNull("The Character looked up is null", chaaracter);
        Assert.assertEquals(expected, chaaracter);
    } catch (final AssertionFailedError afe) {
        throw new TestFailureException(afe);
    }
}
Also used : TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError)

Aggregations

AssertionFailedError (junit.framework.AssertionFailedError)503 TestFailureException (org.apache.openejb.test.TestFailureException)503 JMSException (javax.jms.JMSException)336 EJBException (javax.ejb.EJBException)334 RemoteException (java.rmi.RemoteException)268 InitialContext (javax.naming.InitialContext)168 RemoveException (javax.ejb.RemoveException)80 CreateException (javax.ejb.CreateException)77 NamingException (javax.naming.NamingException)65 BasicStatefulObject (org.apache.openejb.test.stateful.BasicStatefulObject)42 BasicBmpObject (org.apache.openejb.test.entity.bmp.BasicBmpObject)41 BasicStatelessObject (org.apache.openejb.test.stateless.BasicStatelessObject)38 EntityManager (javax.persistence.EntityManager)21 EntityManagerFactory (javax.persistence.EntityManagerFactory)17 DataSource (javax.sql.DataSource)16 ConnectionFactory (javax.jms.ConnectionFactory)15 QueueConnectionFactory (javax.jms.QueueConnectionFactory)15 TopicConnectionFactory (javax.jms.TopicConnectionFactory)15 EJBContext (javax.ejb.EJBContext)12 BasicBmpHome (org.apache.openejb.test.entity.bmp.BasicBmpHome)12