From 452d69b61f42f55a58b2c9dd4c00c56184737812 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Wed, 16 Aug 2023 20:02:01 +0200 Subject: [PATCH] Fix tests for Oracle 11 --- .../orm/test/locking/jpa/FollowOnLockingTest.java | 3 +++ .../entity/JoinedInheritanceImplicitJoinTest.java | 12 ++++++------ .../query/criteria/CriteriaTypeValidationTests.java | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/locking/jpa/FollowOnLockingTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/locking/jpa/FollowOnLockingTest.java index b4c0912a10..66b3cc14cc 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/locking/jpa/FollowOnLockingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/locking/jpa/FollowOnLockingTest.java @@ -20,6 +20,7 @@ import org.hibernate.testing.orm.junit.SessionFactoryScope; import org.hibernate.testing.orm.junit.SkipForDialect; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import jakarta.persistence.LockModeType; import jakarta.persistence.LockTimeoutException; @@ -40,10 +41,12 @@ import static org.hibernate.jpa.SpecHints.HINT_SPEC_QUERY_TIMEOUT; public class FollowOnLockingTest { @Test + @Timeout( 10 ) public void testQueryLockingWithoutFollowOn(SessionFactoryScope scope) { testQueryLocking( scope, false ); } @Test + @Timeout( 10 ) public void testQueryLockingWithFollowOn(SessionFactoryScope scope) { testQueryLocking( scope, true ); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/persister/entity/JoinedInheritanceImplicitJoinTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/persister/entity/JoinedInheritanceImplicitJoinTest.java index 5efadb712e..909d04ce0d 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/persister/entity/JoinedInheritanceImplicitJoinTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/persister/entity/JoinedInheritanceImplicitJoinTest.java @@ -100,9 +100,9 @@ public class JoinedInheritanceImplicitJoinTest { }); } - @Entity + @Entity(name = "MasterEntity") @Inheritance(strategy = InheritanceType.JOINED) - public class MasterEntity { + public static class MasterEntity { @Id @GeneratedValue public Long id; @@ -123,8 +123,8 @@ public class JoinedInheritanceImplicitJoinTest { } } - @Entity - public class ChildEntity extends MasterEntity { + @Entity(name = "ChildEntity") + public static class ChildEntity extends MasterEntity { private String childField; @OneToMany(mappedBy = "childEntity") @@ -147,8 +147,8 @@ public class JoinedInheritanceImplicitJoinTest { } } - @Entity - public class RelatedEntity { + @Entity(name = "RelatedEntity") + public static class RelatedEntity { @Id @GeneratedValue public Long id; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/CriteriaTypeValidationTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/CriteriaTypeValidationTests.java index 5fce4336cf..ddecce8a8b 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/CriteriaTypeValidationTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/CriteriaTypeValidationTests.java @@ -56,7 +56,7 @@ public class CriteriaTypeValidationTests { } - @Entity + @Entity(name = "Parent") public static class Parent { @Id private Long id; @@ -67,7 +67,7 @@ public class CriteriaTypeValidationTests { private Set children = new HashSet<>(); } - @Entity + @Entity(name = "Child") public static class Child { @Id private Long id;