Search in sources :

Example 6 with TransactionRolledbackLocalException

use of javax.ejb.TransactionRolledbackLocalException in project tomee by apache.

the class ManyToManyTests method testSetCmrNull.

public void testSetCmrNull() throws Exception {
    resetDB();
    beginTransaction();
    try {
        final PlatformLocal platform = findPlatform(new Integer(1));
        try {
            platform.setGames(null);
            fail("expected platform.setGames(null) to throw an IllegalArgumentException");
        } catch (final TransactionRolledbackLocalException e) {
            final Throwable cause = e.getCause();
            assertNotNull("cause is null", cause);
            assertTrue("cause is not a instance of IllegalArgumentException", cause instanceof IllegalArgumentException);
        }
    } finally {
        completeTransaction();
    }
}
Also used : TransactionRolledbackLocalException(javax.ejb.TransactionRolledbackLocalException) PlatformLocal(org.apache.openejb.test.entity.cmr.manytomany.PlatformLocal)

Aggregations

TransactionRolledbackLocalException (javax.ejb.TransactionRolledbackLocalException)6 AssertionFailedError (junit.framework.AssertionFailedError)4 TestFailureException (org.apache.openejb.test.TestFailureException)4 OneInverseSideLocal (org.apache.openejb.test.entity.cmr.cmrmapping.OneInverseSideLocal)4 ManyOwningSideLocal (org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideLocal)2 OneOwningSideLocal (org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideLocal)2 PlatformLocal (org.apache.openejb.test.entity.cmr.manytomany.PlatformLocal)2