From 45c786c54fec013394b098219b829155279e0951 Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Thu, 11 Sep 2014 13:12:25 -0700 Subject: [PATCH] HHH-9387 HHH-9389 HHH-9390 : Minor correct to tests to work on 4.2 --- .../collectionelement/CollectionElementTest.java | 5 ++++- .../manytomany/defaults/ManyToManyDefaultsTest.java | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/CollectionElementTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/CollectionElementTest.java index 37a388808d..3f0cd8a4b9 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/CollectionElementTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/CollectionElementTest.java @@ -381,7 +381,10 @@ public class CollectionElementTest extends BaseCoreFunctionalTestCase { ); // The default owner join column can only be computed if it has a PK with 1 column. assertEquals ( 1, ownerCollection.getOwner().getKey().getColumnSpan() ); - assertEquals( ownerForeignKeyNameExpected, ownerCollection.getKey().getColumnIterator().next().getText() ); + assertEquals( + ownerForeignKeyNameExpected, + ( (Column) ownerCollection.getKey().getColumnIterator().next() ).getText() + ); boolean hasOwnerFK = false; for ( Iterator it=ownerCollection.getCollectionTable().getForeignKeyIterator(); it.hasNext(); ) { diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/manytomany/defaults/ManyToManyDefaultsTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/manytomany/defaults/ManyToManyDefaultsTest.java index b1329c7dbc..101026cf97 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/manytomany/defaults/ManyToManyDefaultsTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/manytomany/defaults/ManyToManyDefaultsTest.java @@ -27,6 +27,7 @@ import java.util.Iterator; import org.junit.Test; +import org.hibernate.mapping.Column; import org.hibernate.mapping.ForeignKey; import org.hibernate.mapping.PersistentClass; import org.hibernate.testing.FailureExpected; @@ -215,7 +216,9 @@ public class ManyToManyDefaultsTest extends BaseCoreFunctionalTestCase { ); // The default owner and inverse join columns can only be computed if they have PK with 1 column. assertEquals ( 1, ownerCollection.getOwner().getKey().getColumnSpan() ); - assertEquals( ownerForeignKeyNameExpected, ownerCollection.getKey().getColumnIterator().next().getText() ); + assertEquals( + ownerForeignKeyNameExpected, + ( (Column) ownerCollection.getKey().getColumnIterator().next() ).getText() ); final EntityType associatedEntityType = (EntityType) ownerCollection.getElement().getType(); final PersistentClass associatedPersistentClass = @@ -227,7 +230,7 @@ public class ManyToManyDefaultsTest extends BaseCoreFunctionalTestCase { ); assertEquals( inverseForeignKeyNameExpected, - inverseCollection.getKey().getColumnIterator().next().getText() + ( (Column) inverseCollection.getKey().getColumnIterator().next() ).getText() ); } boolean hasOwnerFK = false;