Search in sources :

Example 51 with TestFailureException

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

the class SetterInjectionMdbBean method lookupByteEntry.

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

Example 52 with TestFailureException

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

the class SetterInjectionMdbBean 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 53 with TestFailureException

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

the class SetterInjectionMdbBean method lookupBooleanEntry.

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

Example 54 with TestFailureException

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

the class AnnotatedFieldInjectionSingletonBean 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 55 with TestFailureException

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

the class AnnotatedFieldInjectionSingletonBean method lookupStringEntry.

public void lookupStringEntry() throws TestFailureException {
    try {
        final String expected = new String("1");
        Assert.assertNotNull("The String looked up is null", striing);
        Assert.assertEquals(expected, striing);
    } 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