From f29cec8464c65fd7a4231d019cb296f9280a5d2a Mon Sep 17 00:00:00 2001 From: Fabio Massimo Ercoli Date: Thu, 20 Jan 2022 14:27:36 +0100 Subject: [PATCH] HSEARCH-4417 Force classloader precedence to EnhancingClassLoader --- ...ToOneOwnedByContainingLazyOnContainedSideIT.java | 13 +++++++++++-- ...oOneOwnedByContainingLazyOnContainingSideIT.java | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/association/bytype/onetoone/ownedbycontaining/AutomaticIndexingOneToOneOwnedByContainingLazyOnContainedSideIT.java b/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/association/bytype/onetoone/ownedbycontaining/AutomaticIndexingOneToOneOwnedByContainingLazyOnContainedSideIT.java index a0e38a81836..8909f269e66 100644 --- a/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/association/bytype/onetoone/ownedbycontaining/AutomaticIndexingOneToOneOwnedByContainingLazyOnContainedSideIT.java +++ b/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/association/bytype/onetoone/ownedbycontaining/AutomaticIndexingOneToOneOwnedByContainingLazyOnContainedSideIT.java @@ -33,10 +33,11 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.ObjectPath; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.PropertyValue; +import org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmSetupHelper; +import org.hibernate.search.util.impl.integrationtest.mapper.orm.ReusableOrmSetupHolder; import org.hibernate.testing.bytecode.enhancement.BytecodeEnhancerRunner; import org.hibernate.testing.bytecode.enhancement.EnhancementOptions; -import org.junit.Ignore; import org.junit.runner.RunWith; /** @@ -47,7 +48,6 @@ */ @RunWith(BytecodeEnhancerRunner.class) // So that we can have lazy *ToOne associations @EnhancementOptions(lazyLoading = true) -@Ignore("HSEARCH-4417 likely ORM bugs") public class AutomaticIndexingOneToOneOwnedByContainingLazyOnContainedSideIT extends AbstractAutomaticIndexingAssociationBaseIT< AutomaticIndexingOneToOneOwnedByContainingLazyOnContainedSideIT.IndexedEntity, @@ -59,6 +59,15 @@ public AutomaticIndexingOneToOneOwnedByContainingLazyOnContainedSideIT() { super( new ModelPrimitivesImpl() ); } + @Override + public void setup(OrmSetupHelper.SetupContext setupContext, + ReusableOrmSetupHolder.DataClearConfig dataClearConfig) { + super.setup( setupContext, dataClearConfig ); + + // Necessary for BytecodeEnhancerRunner, see BytecodeEnhancementIT.setup + setupContext.withTcclLookupPrecedenceBefore(); + } + private static class ModelPrimitivesImpl implements ModelPrimitives { diff --git a/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/association/bytype/onetoone/ownedbycontaining/AutomaticIndexingOneToOneOwnedByContainingLazyOnContainingSideIT.java b/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/association/bytype/onetoone/ownedbycontaining/AutomaticIndexingOneToOneOwnedByContainingLazyOnContainingSideIT.java index 521ac75a628..27dbdf9fd8b 100644 --- a/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/association/bytype/onetoone/ownedbycontaining/AutomaticIndexingOneToOneOwnedByContainingLazyOnContainingSideIT.java +++ b/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/association/bytype/onetoone/ownedbycontaining/AutomaticIndexingOneToOneOwnedByContainingLazyOnContainingSideIT.java @@ -33,10 +33,11 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.ObjectPath; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.PropertyValue; +import org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmSetupHelper; +import org.hibernate.search.util.impl.integrationtest.mapper.orm.ReusableOrmSetupHolder; import org.hibernate.testing.bytecode.enhancement.BytecodeEnhancerRunner; import org.hibernate.testing.bytecode.enhancement.EnhancementOptions; -import org.junit.Ignore; import org.junit.runner.RunWith; /** @@ -47,7 +48,6 @@ */ @RunWith(BytecodeEnhancerRunner.class) // So that we can have lazy *ToOne associations @EnhancementOptions(lazyLoading = true) -@Ignore("HSEARCH-4417 likely ORM bugs") public class AutomaticIndexingOneToOneOwnedByContainingLazyOnContainingSideIT extends AbstractAutomaticIndexingAssociationBaseIT< AutomaticIndexingOneToOneOwnedByContainingLazyOnContainingSideIT.IndexedEntity, @@ -59,6 +59,15 @@ public AutomaticIndexingOneToOneOwnedByContainingLazyOnContainingSideIT() { super( new ModelPrimitivesImpl() ); } + @Override + public void setup(OrmSetupHelper.SetupContext setupContext, + ReusableOrmSetupHolder.DataClearConfig dataClearConfig) { + super.setup( setupContext, dataClearConfig ); + + // Necessary for BytecodeEnhancerRunner, see BytecodeEnhancementIT.setup + setupContext.withTcclLookupPrecedenceBefore(); + } + private static class ModelPrimitivesImpl implements ModelPrimitives {