Search in sources :

Example 16 with TestFailureException

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

the class AnnotatedFieldInjectionStatelessBean method lookupLongEntry.

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

Example 17 with TestFailureException

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

the class AnnotatedFieldInjectionStatelessBean method lookupBooleanEntry.

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

Example 18 with TestFailureException

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

the class AnnotatedFieldInjectionStatelessBean method lookupByteEntry.

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

Example 19 with TestFailureException

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

the class AnnotatedFieldInjectionStatelessBean method lookupFloatEntry.

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

Example 20 with TestFailureException

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

the class ContextLookupStatefulPojoBean method lookupPersistenceUnit.

public void lookupPersistenceUnit() throws TestFailureException {
    try {
        try {
            final EntityManagerFactory emf = (EntityManagerFactory) ejbContext.lookup("persistence/TestUnit");
            Assert.assertNotNull("The EntityManagerFactory is null", emf);
        } catch (final Exception e) {
            Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
        }
    } catch (final AssertionFailedError afe) {
        throw new TestFailureException(afe);
    }
}
Also used : EntityManagerFactory(javax.persistence.EntityManagerFactory) TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError) JMSException(javax.jms.JMSException) TestFailureException(org.apache.openejb.test.TestFailureException)

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