From 850d266c525e8e4863f4531abc4b33fb73c25545 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Thu, 29 Aug 2024 13:46:15 +0200 Subject: [PATCH] HHH-18544 add disabled tests Signed-off-by: Gavin King --- .../test/loading/multiLoad/MultiLoadTest.java | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/loading/multiLoad/MultiLoadTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/loading/multiLoad/MultiLoadTest.java index 6688888fe4..76ad1195a4 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/loading/multiLoad/MultiLoadTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/loading/multiLoad/MultiLoadTest.java @@ -24,6 +24,7 @@ import org.hibernate.stat.Statistics; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.jdbc.SQLStatementInspector; import org.hibernate.testing.orm.junit.DomainModel; +import org.hibernate.testing.orm.junit.FailureExpected; import org.hibernate.testing.orm.junit.ServiceRegistry; import org.hibernate.testing.orm.junit.SessionFactory; import org.hibernate.testing.orm.junit.SessionFactoryScope; @@ -249,7 +250,7 @@ public class MultiLoadTest { public void testBasicMultiLoadWithManagedAndNoChecking(SessionFactoryScope scope) { scope.inTransaction( session -> { - SimpleEntity first = session.byId( SimpleEntity.class ).getReference( 1 ); + SimpleEntity first = session.byId( SimpleEntity.class ).load( 1 ); List list = session.byMultipleIds( SimpleEntity.class ).multiLoad( ids( 56 ) ); assertEquals( 56, list.size() ); // this check is HIGHLY specific to implementation in the batch loader @@ -261,6 +262,36 @@ public class MultiLoadTest { @Test public void testBasicMultiLoadWithManagedAndChecking(SessionFactoryScope scope) { + scope.inTransaction( + session -> { + SimpleEntity first = session.byId( SimpleEntity.class ).load( 1 ); + List list = session.byMultipleIds( SimpleEntity.class ) + .enableSessionCheck( true ) + .multiLoad( ids( 56 ) ); + assertEquals( 56, list.size() ); + // this check is HIGHLY specific to implementation in the batch loader + // which puts existing managed entities first... + assertSame( first, list.get( 0 ) ); + } + ); + } + + @Test @FailureExpected(jiraKey = "HHH-18544") + public void testBasicMultiLoadWithManagedAndNoCheckingProxied(SessionFactoryScope scope) { + scope.inTransaction( + session -> { + SimpleEntity first = session.byId( SimpleEntity.class ).getReference( 1 ); + List list = session.byMultipleIds( SimpleEntity.class ).multiLoad( ids( 56 ) ); + assertEquals( 56, list.size() ); + // this check is HIGHLY specific to implementation in the batch loader + // which puts existing managed entities first... + assertSame( first, list.get( 0 ) ); + } + ); + } + + @Test @FailureExpected(jiraKey = "HHH-18544") + public void testBasicMultiLoadWithManagedAndCheckingProxied(SessionFactoryScope scope) { scope.inTransaction( session -> { SimpleEntity first = session.byId( SimpleEntity.class ).getReference( 1 );