Skip to content

Commit 96a8f34

Browse files
committed
Fix ConfigurationTest
1 parent 4236f7d commit 96a8f34

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

hibernate-core/src/test/java/org/hibernate/test/annotations/ConfigurationTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,20 @@
88
//$Id$
99
package org.hibernate.test.annotations;
1010

11+
import javax.persistence.PersistenceException;
12+
1113
import org.hibernate.HibernateException;
1214
import org.hibernate.Query;
1315
import org.hibernate.Session;
1416
import org.hibernate.SessionFactory;
1517
import org.hibernate.Transaction;
1618
import org.hibernate.cfg.Configuration;
1719
import org.hibernate.cfg.Environment;
20+
import org.hibernate.hql.internal.ast.QuerySyntaxException;
1821

1922
import org.junit.Test;
2023

24+
import static org.hibernate.testing.junit4.ExtraAssertions.assertTyping;
2125
import static org.junit.Assert.assertEquals;
2226
import static org.junit.Assert.assertNotNull;
2327
import static org.junit.Assert.assertTrue;
@@ -59,7 +63,8 @@ public void testIgnoringHbm() throws Exception {
5963
s.createQuery( "from Boat" ).list();
6064
fail( "Boat should not be mapped" );
6165
}
62-
catch (HibernateException e) {
66+
catch (IllegalArgumentException e) {
67+
assertTyping( QuerySyntaxException.class, e.getCause());
6368
//all good
6469
}
6570
q = s.createQuery( "from Plane" );

0 commit comments

Comments
 (0)