HHH-8514 - EntityManager#createQuery(CriteriaQuery) should throw IAE rather than ISE

This commit is contained in:
Steve Ebersole 2013-09-18 09:52:14 -05:00
parent 31f50f3280
commit a4d4152204
1 changed files with 5 additions and 3 deletions

View File

@ -23,6 +23,7 @@
*/
package org.hibernate.jpa.test.criteria;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import javax.persistence.EntityManager;
@ -106,12 +107,13 @@ public class ManipulationCriteriaTest extends AbstractMetamodelSpecificTest {
em.createQuery( updateCriteria ).executeUpdate();
fail( "Expecting failure due to no assignments" );
}
catch (IllegalStateException ise) {
catch (IllegalArgumentException iae) {
// expected
}
em.getTransaction().rollback(); // HHH-8442 changed to rollback since thrown ISE causes
// transaction to be marked for rollback only.
// changed to rollback since HHH-8442 causes transaction to be marked for rollback only
assertTrue( em.getTransaction().getRollbackOnly() );
em.getTransaction().rollback();
em.close();
}