Fix ImmutableNaturalIdTest

This commit is contained in:
Andrea Boriero 2016-04-27 11:38:24 +01:00 committed by Steve Ebersole
parent dc0033aa9d
commit 49514b92e3
2 changed files with 7 additions and 3 deletions

View File

@ -85,10 +85,11 @@ public class ImmutableNaturalIdTest extends AbstractJPATest {
fail(); fail();
} }
catch ( PersistenceException p ) { catch ( PersistenceException p ) {
//expected
t.rollback();
} }
u.setUserName( "steve" ); u.setUserName( "steve" );
s.delete( u ); s.delete( u );
t.commit();
s.close(); s.close();
} }

View File

@ -6,6 +6,8 @@
*/ */
package org.hibernate.test.naturalid.immutable; package org.hibernate.test.naturalid.immutable;
import javax.persistence.PersistenceException;
import org.junit.Test; import org.junit.Test;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
@ -76,11 +78,12 @@ public class ImmutableNaturalIdTest extends BaseCoreFunctionalTestCase {
s.flush(); s.flush();
fail(); fail();
} }
catch ( HibernateException he ) { catch ( PersistenceException e ) {
//expected
t.rollback();
} }
u.setUserName( "steve" ); u.setUserName( "steve" );
s.delete( u ); s.delete( u );
t.commit();
s.close(); s.close();
} }