From 34b439223eb8914c047a502e34a2b97c24b16a50 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Fri, 22 Apr 2016 21:06:56 +0100 Subject: [PATCH] Fix ConfigurationTest --- .../org/hibernate/test/annotations/ConfigurationTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/ConfigurationTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/ConfigurationTest.java index c0a29b9c8b..9a8d67a60d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/ConfigurationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/ConfigurationTest.java @@ -8,6 +8,8 @@ //$Id$ package org.hibernate.test.annotations; +import javax.persistence.PersistenceException; + import org.hibernate.HibernateException; import org.hibernate.Query; import org.hibernate.Session; @@ -15,9 +17,11 @@ import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.hql.internal.ast.QuerySyntaxException; import org.junit.Test; +import static org.hibernate.testing.junit4.ExtraAssertions.assertTyping; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -59,7 +63,8 @@ public class ConfigurationTest { s.createQuery( "from Boat" ).list(); fail( "Boat should not be mapped" ); } - catch (HibernateException e) { + catch (IllegalArgumentException e) { + assertTyping( QuerySyntaxException.class, e.getCause()); //all good } q = s.createQuery( "from Plane" );