Search in sources :

Example 46 with TestFailureException

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

the class FieldInjectionMdbBean method lookupByteEntry.

@Override
public void lookupByteEntry() throws TestFailureException {
    try {
        final Byte expected = (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 47 with TestFailureException

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

the class FieldInjectionMdbBean method lookupJMSConnectionFactory.

@Override
public void lookupJMSConnectionFactory() throws TestFailureException {
    try {
        try {
            testJmsConnection(coonnectionFactory.createConnection());
            testJmsConnection(queueCoonnectionFactory.createConnection());
            testJmsConnection(topicCoonnectionFactory.createConnection());
        } catch (final Exception e) {
            e.printStackTrace();
            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) EJBException(javax.ejb.EJBException) TestFailureException(org.apache.openejb.test.TestFailureException) CreateException(javax.ejb.CreateException)

Example 48 with TestFailureException

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

the class SetterInjectionMdbBean method lookupDoubleEntry.

@Override
public void lookupDoubleEntry() throws TestFailureException {
    try {
        final Double expected = 1.0D;
        Assert.assertNotNull("The Double looked up is null", dooubleField);
        Assert.assertEquals(expected, dooubleField);
    } catch (final AssertionFailedError afe) {
        throw new TestFailureException(afe);
    }
}
Also used : TestFailureException(org.apache.openejb.test.TestFailureException) AssertionFailedError(junit.framework.AssertionFailedError)

Example 49 with TestFailureException

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

the class SetterInjectionMdbBean method lookupCharacterEntry.

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

Example 50 with TestFailureException

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

the class SetterInjectionMdbBean method lookupFloatEntry.

@Override
public void lookupFloatEntry() throws TestFailureException {
    try {
        final Float expected = 1.0F;
        Assert.assertNotNull("The Float looked up is null", flooatField);
        Assert.assertEquals(expected, flooatField);
    } 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