diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/InheritanceBindingTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/InheritanceBindingTest.java index c78c8e7d21..b7f2926afb 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/InheritanceBindingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/InheritanceBindingTest.java @@ -135,22 +135,22 @@ public class InheritanceBindingTest extends BaseAnnotationBindingTestCase { noInheritanceEntityBinding.getHierarchyDetails().getEntityIdentifier().getAttributeBinding(), directAttributeBindings.iterator().next() ); - assertEquals( 1, noInheritanceEntityBinding.getAttributeBindingClosureSpan() ); + assertEquals( 0, noInheritanceEntityBinding.getAttributeBindingClosureSpan() ); Iterator iterator = noInheritanceEntityBinding.attributeBindings().iterator(); assertTrue( iterator.hasNext() ); assertSame( noInheritanceEntityBinding.getHierarchyDetails().getEntityIdentifier().getAttributeBinding(), iterator.next() ); assertFalse( iterator.hasNext() ); AttributeBinding[] attributeBindings = noInheritanceEntityBinding.getAttributeBindingClosure(); - assertTrue( attributeBindings.length > 0 ); - int index =0; - assertSame( noInheritanceEntityBinding.getHierarchyDetails().getEntityIdentifier().getAttributeBinding(), attributeBindings[index++] ); - assertFalse( index < attributeBindings.length ); + assertTrue( attributeBindings.length == 0 ); +// int index =0; +// assertSame( noInheritanceEntityBinding.getHierarchyDetails().getEntityIdentifier().getAttributeBinding(), attributeBindings[index++] ); +// assertFalse( index < attributeBindings.length ); attributeBindings = noInheritanceEntityBinding.getEntitiesAttributeBindingClosure(); - index = 0; - assertTrue( attributeBindings.length > 0 ); - assertSame( noInheritanceEntityBinding.getHierarchyDetails().getEntityIdentifier().getAttributeBinding(), attributeBindings[index++] ); - assertFalse( index < attributeBindings.length ); +// int index = 0; + assertFalse( attributeBindings.length > 0 ); +// assertSame( noInheritanceEntityBinding.getHierarchyDetails().getEntityIdentifier().getAttributeBinding(), attributeBindings[index++] ); +// assertFalse( index < attributeBindings.length ); } @Test @@ -193,19 +193,19 @@ public class InheritanceBindingTest extends BaseAnnotationBindingTestCase { } assertEquals( 1, directAttributeBindings.size() ); assertTrue( directAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); - assertEquals( 1, rootEntityBinding.getAttributeBindingClosureSpan() ); + assertEquals( 0, rootEntityBinding.getAttributeBindingClosureSpan() ); Set attributeBindingClosure = new HashSet(); for ( AttributeBinding attributeBinding : rootEntityBinding.getAttributeBindingClosure() ) { assertTrue( attributeBindingClosure.add( attributeBinding ) ); } - assertEquals( 1, attributeBindingClosure.size() ); - assertTrue( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); + assertEquals( 0, attributeBindingClosure.size() ); + assertFalse( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); Set subAttributeBindings = new HashSet(); for ( AttributeBinding subAttributeBinding : rootEntityBinding.getEntitiesAttributeBindingClosure() ) { assertTrue( subAttributeBindings.add( subAttributeBinding ) ); } - assertEquals( 4, subAttributeBindings.size() ); - assertTrue( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); + assertEquals( 3, subAttributeBindings.size() ); + assertFalse( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); assertTrue( subAttributeBindings.contains( subclassEntityBinding.locateAttributeBinding( "name" ) ) ); assertTrue( subAttributeBindings.contains( subclassOfSubclassEntityBinding.locateAttributeBinding( "otherOtherName" ) ) ); assertTrue( subAttributeBindings.contains( otherSubclassEntityBinding.locateAttributeBinding( "otherName" ) ) ); @@ -310,20 +310,20 @@ public class InheritanceBindingTest extends BaseAnnotationBindingTestCase { } assertEquals( 1, directAttributeBindings.size() ); assertTrue( directAttributeBindings.contains( otherSubclassEntityBinding.locateAttributeBinding( "otherName" ) ) ); - assertEquals( 2, otherSubclassEntityBinding.getAttributeBindingClosureSpan() ); + assertEquals( 1, otherSubclassEntityBinding.getAttributeBindingClosureSpan() ); Set attributeBindingClosure = new HashSet(); for ( AttributeBinding attributeBinding : otherSubclassEntityBinding.getAttributeBindingClosure() ) { assertTrue( attributeBindingClosure.add( attributeBinding ) ); } - assertEquals(2, attributeBindingClosure.size() ); - assertTrue( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); + assertEquals(1, attributeBindingClosure.size() ); + assertFalse( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); assertTrue( attributeBindingClosure.contains( otherSubclassEntityBinding.locateAttributeBinding( "otherName" ) ) ); Set subAttributeBindings = new HashSet(); for ( AttributeBinding subAttributeBinding : otherSubclassEntityBinding.getEntitiesAttributeBindingClosure() ) { assertTrue( subAttributeBindings.add( subAttributeBinding ) ); } - assertEquals( 2, subAttributeBindings.size() ); - assertTrue( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); + assertEquals( 1, subAttributeBindings.size() ); + assertFalse( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); assertTrue( subAttributeBindings.contains( otherSubclassEntityBinding.locateAttributeBinding( "otherName" ) ) ); } @@ -364,20 +364,20 @@ public class InheritanceBindingTest extends BaseAnnotationBindingTestCase { } assertEquals( 1, directAttributeBindings.size() ); assertTrue( directAttributeBindings.contains( subclassEntityBinding.locateAttributeBinding( "name" ) ) ); - assertEquals( 2, subclassEntityBinding.getAttributeBindingClosureSpan() ); + assertEquals( 1, subclassEntityBinding.getAttributeBindingClosureSpan() ); Set attributeBindingClosure = new HashSet(); for ( AttributeBinding attributeBinding : subclassEntityBinding.getAttributeBindingClosure() ) { assertTrue( attributeBindingClosure.add( attributeBinding ) ); } - assertEquals( 2, attributeBindingClosure.size() ); - assertTrue( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); + assertEquals( 1, attributeBindingClosure.size() ); + assertFalse( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); assertTrue( attributeBindingClosure.contains( subclassEntityBinding.locateAttributeBinding( "name" ) ) ); Set subAttributeBindings = new HashSet(); for ( AttributeBinding subAttributeBinding : subclassEntityBinding.getEntitiesAttributeBindingClosure() ) { assertTrue( subAttributeBindings.add( subAttributeBinding ) ); } - assertEquals( 3, subAttributeBindings.size() ); - assertTrue( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); + assertEquals( 2, subAttributeBindings.size() ); + assertFalse( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); assertTrue( subAttributeBindings.contains( subclassEntityBinding.locateAttributeBinding( "name" ) ) ); assertTrue( subAttributeBindings.contains( subclassOfSubclassEntityBinding.locateAttributeBinding( "otherOtherName" ) ) ); } @@ -411,21 +411,21 @@ public class InheritanceBindingTest extends BaseAnnotationBindingTestCase { } assertEquals( 1, directAttributeBindings.size() ); assertTrue( directAttributeBindings.contains( subclassOfSubclassEntityBinding.locateAttributeBinding( "otherOtherName" ) ) ); - assertEquals( 3, subclassOfSubclassEntityBinding.getAttributeBindingClosureSpan() ); + assertEquals( 2, subclassOfSubclassEntityBinding.getAttributeBindingClosureSpan() ); Set attributeBindingClosure = new HashSet(); for ( AttributeBinding attributeBinding : subclassOfSubclassEntityBinding.getAttributeBindingClosure() ) { assertTrue( attributeBindingClosure.add( attributeBinding ) ); } - assertEquals( 3, attributeBindingClosure.size() ); - assertTrue( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); + assertEquals( 2, attributeBindingClosure.size() ); + assertFalse( attributeBindingClosure.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); assertTrue( attributeBindingClosure.contains( subclassEntityBinding.locateAttributeBinding( "name" ) ) ); assertTrue( attributeBindingClosure.contains( subclassOfSubclassEntityBinding.locateAttributeBinding( "otherOtherName" ) ) ); Set subAttributeBindings = new HashSet(); for ( AttributeBinding subAttributeBinding : subclassOfSubclassEntityBinding.getEntitiesAttributeBindingClosure() ) { assertTrue( subAttributeBindings.add( subAttributeBinding ) ); } - assertEquals( 3, subAttributeBindings.size() ); - assertTrue( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); + assertEquals( 2, subAttributeBindings.size() ); + assertFalse( subAttributeBindings.contains( rootEntityBinding.locateAttributeBinding( "id" ) ) ); assertTrue( subAttributeBindings.contains( subclassEntityBinding.locateAttributeBinding( "name" ) ) ); assertTrue( subAttributeBindings.contains( subclassOfSubclassEntityBinding.locateAttributeBinding( "otherOtherName" ) ) ); } diff --git a/hibernate-core/src/test/java/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java b/hibernate-core/src/test/java/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java index 747516b818..bd63f64702 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java @@ -34,7 +34,6 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.criterion.Property; import org.hibernate.criterion.Restrictions; -import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -47,7 +46,6 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ -@FailureExpectedWithNewMetamodel public class JoinedSubclassTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() {