diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/NonRegistryManagedBeanConsumingIntegrator.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/HibernateSearchSimulatedIntegrator.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/NonRegistryManagedBeanConsumingIntegrator.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/HibernateSearchSimulatedIntegrator.java index 1454f2cd09..593a2eace2 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/NonRegistryManagedBeanConsumingIntegrator.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/HibernateSearchSimulatedIntegrator.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; import org.hibernate.boot.Metadata; import org.hibernate.engine.spi.SessionFactoryImplementor; @@ -21,12 +21,13 @@ import org.hamcrest.CoreMatchers; import static org.hamcrest.MatcherAssert.assertThat; /** - * Simulates a Hibernate ORM integrator consuming beans whose lifecycle is not managed by the registry, + * Simulates Hibernate Search's implementation of {@link Integrator}, + * consuming beans whose lifecycle is not managed by the registry, * but by the CDI engine only. * * @author Yoann Rodiere */ -public class NonRegistryManagedBeanConsumingIntegrator implements Integrator, BeanContainer.LifecycleOptions { +public class HibernateSearchSimulatedIntegrator implements Integrator, BeanContainer.LifecycleOptions { private final BeanInstanceProducer fallbackBeanInstanceProducer; @@ -43,7 +44,7 @@ public class NonRegistryManagedBeanConsumingIntegrator implements Integrator, Be private ContainedBeanImplementor namedReflectionInstantiatedBean1; private ContainedBeanImplementor namedReflectionInstantiatedBean2; - public NonRegistryManagedBeanConsumingIntegrator(BeanInstanceProducer fallbackBeanInstanceProducer) { + public HibernateSearchSimulatedIntegrator(BeanInstanceProducer fallbackBeanInstanceProducer) { this.fallbackBeanInstanceProducer = fallbackBeanInstanceProducer; } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/Monitor.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/Monitor.java similarity index 98% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/Monitor.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/Monitor.java index 95d7679ead..5cef3bce42 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/Monitor.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/Monitor.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; import java.util.concurrent.atomic.AtomicInteger; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheAlternativeNamedApplicationScopedBeanImpl.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheAlternativeNamedApplicationScopedBeanImpl.java similarity index 95% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheAlternativeNamedApplicationScopedBeanImpl.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheAlternativeNamedApplicationScopedBeanImpl.java index 5bfaceccbc..7fb24fccbd 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheAlternativeNamedApplicationScopedBeanImpl.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheAlternativeNamedApplicationScopedBeanImpl.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheAlternativeNamedDependentBeanImpl.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheAlternativeNamedDependentBeanImpl.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheAlternativeNamedDependentBeanImpl.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheAlternativeNamedDependentBeanImpl.java index 21cb63f8d2..4189809d73 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheAlternativeNamedDependentBeanImpl.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheAlternativeNamedDependentBeanImpl.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheApplicationScopedBean.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheApplicationScopedBean.java similarity index 93% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheApplicationScopedBean.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheApplicationScopedBean.java index 94d5d637ba..73cd44e42e 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheApplicationScopedBean.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheApplicationScopedBean.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheDependentBean.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheDependentBean.java similarity index 93% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheDependentBean.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheDependentBean.java index 9a9f0d130f..4383df01d3 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheDependentBean.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheDependentBean.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheEntity.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheEntity.java similarity index 92% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheEntity.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheEntity.java index dde81a4697..648a75a147 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheEntity.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheEntity.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; import jakarta.persistence.Entity; import jakarta.persistence.Id; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheFallbackBeanInstanceProducer.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheFallbackBeanInstanceProducer.java similarity index 96% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheFallbackBeanInstanceProducer.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheFallbackBeanInstanceProducer.java index 6f65cf5aa1..cac5610dd8 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheFallbackBeanInstanceProducer.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheFallbackBeanInstanceProducer.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or . */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; import java.util.concurrent.atomic.AtomicInteger; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheMainNamedApplicationScopedBeanImpl.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheMainNamedApplicationScopedBeanImpl.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheMainNamedApplicationScopedBeanImpl.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheMainNamedApplicationScopedBeanImpl.java index 0ae94c120d..b4521f046d 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheMainNamedApplicationScopedBeanImpl.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheMainNamedApplicationScopedBeanImpl.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheMainNamedDependentBeanImpl.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheMainNamedDependentBeanImpl.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheMainNamedDependentBeanImpl.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheMainNamedDependentBeanImpl.java index 60e3f793fa..a2aa10ffb8 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheMainNamedDependentBeanImpl.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheMainNamedDependentBeanImpl.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheNamedApplicationScopedBean.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheNamedApplicationScopedBean.java similarity index 84% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheNamedApplicationScopedBean.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheNamedApplicationScopedBean.java index b55ed8f91e..6d19c2b26f 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheNamedApplicationScopedBean.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheNamedApplicationScopedBean.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; /** * @author Yoann Rodiere diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheNamedDependentBean.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheNamedDependentBean.java similarity index 84% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheNamedDependentBean.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheNamedDependentBean.java index 431eeed602..3f5028b5d7 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheNamedDependentBean.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheNamedDependentBean.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; /** * @author Yoann Rodiere diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheNestedDependentBean.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheNestedDependentBean.java similarity index 87% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheNestedDependentBean.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheNestedDependentBean.java index 730160989c..9b4660a800 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheNestedDependentBean.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheNestedDependentBean.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; @@ -12,7 +12,8 @@ import jakarta.enterprise.context.Dependent; /** * A dependent bean required by other beans, but never requested directly - * to the {@link org.hibernate.resource.beans.spi.ManagedBeanRegistry}. + * to the {@link org.hibernate.resource.beans.spi.ManagedBeanRegistry} + * or {@link org.hibernate.resource.beans.container.spi.BeanContainer}. * * @author Yoann Rodiere */ diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheNonHibernateBeanConsumer.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheNonHibernateBeanConsumer.java similarity index 93% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheNonHibernateBeanConsumer.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheNonHibernateBeanConsumer.java index 2f5389be35..9d767112e5 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheNonHibernateBeanConsumer.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheNonHibernateBeanConsumer.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; import jakarta.annotation.PostConstruct; import jakarta.inject.Singleton; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheReflectionInstantiatedBean.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheReflectionInstantiatedBean.java similarity index 87% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheReflectionInstantiatedBean.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheReflectionInstantiatedBean.java index a61337df76..9123593527 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheReflectionInstantiatedBean.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheReflectionInstantiatedBean.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or . */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; import jakarta.enterprise.inject.Vetoed; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheSharedApplicationScopedBean.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheSharedApplicationScopedBean.java similarity index 93% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheSharedApplicationScopedBean.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheSharedApplicationScopedBean.java index a32fbea78f..514821bb5a 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/TheSharedApplicationScopedBean.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/TheSharedApplicationScopedBean.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged; +package org.hibernate.orm.test.cdi.general.hibernatesearch; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/delayed/NonRegistryManagedDelayedCdiSupportTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/delayed/HibernateSearchDelayedCdiSupportTest.java similarity index 77% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/delayed/NonRegistryManagedDelayedCdiSupportTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/delayed/HibernateSearchDelayedCdiSupportTest.java index 04c5cdb8e9..160728437a 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/delayed/NonRegistryManagedDelayedCdiSupportTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/delayed/HibernateSearchDelayedCdiSupportTest.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged.delayed; +package org.hibernate.orm.test.cdi.general.hibernatesearch.delayed; import jakarta.enterprise.inject.Instance; import jakarta.enterprise.inject.se.SeContainer; @@ -17,47 +17,55 @@ import org.hibernate.boot.registry.StandardServiceRegistry; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.AvailableSettings; import org.hibernate.engine.spi.SessionFactoryImplementor; -import org.hibernate.resource.beans.spi.ManagedBeanRegistry; import org.hibernate.tool.schema.Action; import org.hibernate.testing.junit4.BaseUnitTestCase; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.Monitor; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.NonRegistryManagedBeanConsumingIntegrator; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheAlternativeNamedApplicationScopedBeanImpl; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheAlternativeNamedDependentBeanImpl; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheApplicationScopedBean; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheDependentBean; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheEntity; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheFallbackBeanInstanceProducer; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheMainNamedApplicationScopedBeanImpl; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheMainNamedDependentBeanImpl; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheNamedApplicationScopedBean; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheNamedDependentBean; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheNestedDependentBean; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheNonHibernateBeanConsumer; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheSharedApplicationScopedBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.Monitor; +import org.hibernate.orm.test.cdi.general.hibernatesearch.HibernateSearchSimulatedIntegrator; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheAlternativeNamedApplicationScopedBeanImpl; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheAlternativeNamedDependentBeanImpl; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheApplicationScopedBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheDependentBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheEntity; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheFallbackBeanInstanceProducer; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheMainNamedApplicationScopedBeanImpl; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheMainNamedDependentBeanImpl; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheNamedApplicationScopedBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheNamedDependentBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheNestedDependentBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheNonHibernateBeanConsumer; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheSharedApplicationScopedBean; import org.junit.Test; import static org.junit.Assert.assertEquals; /** - * Tests support for requesting CDI beans from the {@link ManagedBeanRegistry} - * when the CDI BeanManager access is delayed (not available during bootstrap), - * and when the registry should not manage the lifecycle of beans, but leave it up to CDI. + * Tests support for requesting CDI beans in Hibernate Search + * when the CDI BeanManager access is delayed (not available during bootstrap) + * + * In Hibernate Search, + * beans are retrieved directly from the {@link org.hibernate.resource.beans.container.spi.BeanContainer} + * because Hibernate Search is not bound by the JPA spec + * and wants to leave the lifecycle of beans up to CDI instead + * of controlling it in {@link org.hibernate.resource.beans.spi.ManagedBeanRegistry}. + * This involves using {@code canUseCachedReferences = false} and {@code useJpaCompliantCreation = false} + * in {@link org.hibernate.resource.beans.container.spi.BeanContainer.LifecycleOptions}). * * @author Steve Ebersole * @author Yoann Rodiere + * + * @see HibernateSearchSimulatedIntegrator */ -public class NonRegistryManagedDelayedCdiSupportTest extends BaseUnitTestCase { +public class HibernateSearchDelayedCdiSupportTest extends BaseUnitTestCase { @Test public void testIt() { Monitor.reset(); final TheFallbackBeanInstanceProducer fallbackBeanInstanceProducer = new TheFallbackBeanInstanceProducer(); - final NonRegistryManagedBeanConsumingIntegrator beanConsumingIntegrator = - new NonRegistryManagedBeanConsumingIntegrator( fallbackBeanInstanceProducer ); + final HibernateSearchSimulatedIntegrator beanConsumingIntegrator = + new HibernateSearchSimulatedIntegrator( fallbackBeanInstanceProducer ); final SeContainerInitializer cdiInitializer = SeContainerInitializer.newInstance() .disableDiscovery() @@ -91,8 +99,8 @@ public class NonRegistryManagedDelayedCdiSupportTest extends BaseUnitTestCase { assertEquals( 1, Monitor.theNestedDependentBean().currentInstantiationCount() ); try (SessionFactoryImplementor sessionFactory = buildSessionFactory( cdiContainer, beanConsumingIntegrator )) { - // Here, the NonRegistryManagedBeanConsumingIntegrator has just been integrated and has requested beans - // See NonRegistryManagedBeanConsumingIntegrator for a detailed list of requested beans + // Here, the HibernateSearchSimulatedIntegrator has just been integrated and has requested beans + // See HibernateSearchSimulatedIntegrator for a detailed list of requested beans beanConsumingIntegrator.ensureInstancesInitialized(); @@ -167,7 +175,7 @@ public class NonRegistryManagedDelayedCdiSupportTest extends BaseUnitTestCase { } private SessionFactoryImplementor buildSessionFactory(SeContainer cdiContainer, - NonRegistryManagedBeanConsumingIntegrator beanConsumingIntegrator) { + HibernateSearchSimulatedIntegrator beanConsumingIntegrator) { BootstrapServiceRegistry bsr = new BootstrapServiceRegistryBuilder() .applyIntegrator( beanConsumingIntegrator ) .build(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/extended/NonRegistryManagedExtendedCdiSupportTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/extended/HibernateSearchExtendedCdiSupportTest.java similarity index 76% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/extended/NonRegistryManagedExtendedCdiSupportTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/extended/HibernateSearchExtendedCdiSupportTest.java index 7aa5a0e9bd..d71f5b0606 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/extended/NonRegistryManagedExtendedCdiSupportTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/extended/HibernateSearchExtendedCdiSupportTest.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged.extended; +package org.hibernate.orm.test.cdi.general.hibernatesearch.extended; import jakarta.enterprise.inject.Instance; import jakarta.enterprise.inject.se.SeContainer; @@ -17,39 +17,47 @@ import org.hibernate.boot.registry.StandardServiceRegistry; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.AvailableSettings; import org.hibernate.engine.spi.SessionFactoryImplementor; -import org.hibernate.resource.beans.spi.ManagedBeanRegistry; import org.hibernate.tool.schema.Action; import org.hibernate.testing.junit4.BaseUnitTestCase; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.Monitor; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.NonRegistryManagedBeanConsumingIntegrator; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheAlternativeNamedApplicationScopedBeanImpl; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheAlternativeNamedDependentBeanImpl; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheApplicationScopedBean; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheDependentBean; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheEntity; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheFallbackBeanInstanceProducer; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheMainNamedApplicationScopedBeanImpl; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheMainNamedDependentBeanImpl; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheNamedApplicationScopedBean; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheNamedDependentBean; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheNestedDependentBean; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheNonHibernateBeanConsumer; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheSharedApplicationScopedBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.Monitor; +import org.hibernate.orm.test.cdi.general.hibernatesearch.HibernateSearchSimulatedIntegrator; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheAlternativeNamedApplicationScopedBeanImpl; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheAlternativeNamedDependentBeanImpl; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheApplicationScopedBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheDependentBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheEntity; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheFallbackBeanInstanceProducer; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheMainNamedApplicationScopedBeanImpl; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheMainNamedDependentBeanImpl; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheNamedApplicationScopedBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheNamedDependentBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheNestedDependentBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheNonHibernateBeanConsumer; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheSharedApplicationScopedBean; import org.hibernate.orm.test.cdi.testsupport.TestingExtendedBeanManager; import org.junit.Test; import static org.junit.Assert.assertEquals; /** - * Tests support for requesting CDI beans from the {@link ManagedBeanRegistry} - * when the CDI BeanManager access is "lazy" (beans are instantiated when instances are first requested), - * and when the registry should not manage the lifecycle of beans, but leave it up to CDI. + * Tests support for requesting CDI beans in Hibernate Search + * when the CDI BeanManager access is lazy (beans are instantiated when instances are first requested). + * + * In Hibernate Search, + * beans are retrieved directly from the {@link org.hibernate.resource.beans.container.spi.BeanContainer} + * because Hibernate Search is not bound by the JPA spec + * and wants to leave the lifecycle of beans up to CDI instead + * of controlling it in {@link org.hibernate.resource.beans.spi.ManagedBeanRegistry}. + * This involves using {@code canUseCachedReferences = false} and {@code useJpaCompliantCreation = false} + * in {@link org.hibernate.resource.beans.container.spi.BeanContainer.LifecycleOptions}). * * @author Steve Ebersole * @author Yoann Rodiere + * + * @see HibernateSearchSimulatedIntegrator */ -public class NonRegistryManagedExtendedCdiSupportTest extends BaseUnitTestCase { +public class HibernateSearchExtendedCdiSupportTest extends BaseUnitTestCase { @Test public void test() { doTest( TestingExtendedBeanManager.create() ); @@ -60,8 +68,8 @@ public class NonRegistryManagedExtendedCdiSupportTest extends BaseUnitTestCase { final TheFallbackBeanInstanceProducer fallbackBeanInstanceProducer = new TheFallbackBeanInstanceProducer(); - final NonRegistryManagedBeanConsumingIntegrator beanConsumingIntegrator = - new NonRegistryManagedBeanConsumingIntegrator( fallbackBeanInstanceProducer ); + final HibernateSearchSimulatedIntegrator beanConsumingIntegrator = + new HibernateSearchSimulatedIntegrator( fallbackBeanInstanceProducer ); try (SessionFactoryImplementor sessionFactory = buildSessionFactory( beanManager, beanConsumingIntegrator )) { final SeContainerInitializer cdiInitializer = SeContainerInitializer.newInstance() @@ -81,7 +89,7 @@ public class NonRegistryManagedExtendedCdiSupportTest extends BaseUnitTestCase { cdiContainer.getBeanManager().createInstance().select( TheNonHibernateBeanConsumer.class ); nonHibernateBeanConsumerInstance.get(); - // Here, the NonRegistryManagedBeanConsumingIntegrator has just been integrated and has requested beans + // Here, the HibernateSearchSimulatedIntegrator has just been integrated and has requested beans // BUT it has not fetched instances of beans yet, so non-shared beans should not have been instantiated yet. assertEquals( 0, Monitor.theApplicationScopedBean().currentInstantiationCount() ); assertEquals( 0, Monitor.theMainNamedApplicationScopedBean().currentInstantiationCount() ); @@ -99,9 +107,9 @@ public class NonRegistryManagedExtendedCdiSupportTest extends BaseUnitTestCase { beanConsumingIntegrator.ensureInstancesInitialized(); - // Here the NonRegistryManagedBeanConsumingIntegrator *did* fetch an instance of each bean, + // Here the HibernateSearchSimulatedIntegrator *did* fetch an instance of each bean, // so all beans should have been instantiated. - // See NonRegistryManagedBeanConsumingIntegrator for a detailed list of requested beans + // See HibernateSearchSimulatedIntegrator for a detailed list of requested beans // Application scope: maximum 1 instance as soon as at least one was requested assertEquals( 1, Monitor.theApplicationScopedBean().currentInstantiationCount() ); @@ -154,7 +162,7 @@ public class NonRegistryManagedExtendedCdiSupportTest extends BaseUnitTestCase { assertEquals( 3, Monitor.theNestedDependentBean().currentPreDestroyCount() ); } - // Here, the NonRegistryManagedBeanConsumingIntegrator has just been disintegrated and has released beans + // Here, the HibernateSearchSimulatedIntegrator has just been disintegrated and has released beans // The dependent beans should now have been released as well. assertEquals( 1, Monitor.theApplicationScopedBean().currentPreDestroyCount() ); assertEquals( 1, Monitor.theMainNamedApplicationScopedBean().currentPreDestroyCount() ); @@ -167,7 +175,7 @@ public class NonRegistryManagedExtendedCdiSupportTest extends BaseUnitTestCase { } private SessionFactoryImplementor buildSessionFactory(TestingExtendedBeanManager beanManager, - NonRegistryManagedBeanConsumingIntegrator beanConsumingIntegrator) { + HibernateSearchSimulatedIntegrator beanConsumingIntegrator) { BootstrapServiceRegistry bsr = new BootstrapServiceRegistryBuilder() .applyIntegrator( beanConsumingIntegrator ) .build(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/package-info.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/package-info.java new file mode 100644 index 0000000000..34d78d566a --- /dev/null +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/package-info.java @@ -0,0 +1,25 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * License: GNU Lesser General Public License (LGPL), version 2.1 or later + * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html + */ + +/** + * Package for testing requests of CDI beans in Hibernate Search. + * + * In Hibernate Search, + * beans are retrieved directly from the {@link org.hibernate.resource.beans.container.spi.BeanContainer} + * because Hibernate Search is not bound by the JPA spec + * and wants to leave the lifecycle of beans up to CDI instead + * of controlling it in {@link org.hibernate.resource.beans.spi.ManagedBeanRegistry}. + * This involves using {@code canUseCachedReferences = false} and {@code useJpaCompliantCreation = false} + * in {@link org.hibernate.resource.beans.container.spi.BeanContainer.LifecycleOptions}). + * + * Mainly these are regression tests against Hibernate Search's pattern of usage of ORM's + * {@link org.hibernate.resource.beans.container.spi.BeanContainer} as accessed + * via {@link org.hibernate.resource.beans.spi.ManagedBeanRegistry#getBeanContainer()}. + * + * @see org.hibernate.orm.test.cdi.general.hibernatesearch.HibernateSearchSimulatedIntegrator + */ +package org.hibernate.orm.test.cdi.general.hibernatesearch; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/standard/NonRegistryManagedStandardCdiSupportTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/standard/HibernateSearchStandardCdiSupportTest.java similarity index 74% rename from hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/standard/NonRegistryManagedStandardCdiSupportTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/standard/HibernateSearchStandardCdiSupportTest.java index 8cb2d3510d..49917fd326 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/standard/NonRegistryManagedStandardCdiSupportTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/hibernatesearch/standard/HibernateSearchStandardCdiSupportTest.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged.standard; +package org.hibernate.orm.test.cdi.general.hibernatesearch.standard; import jakarta.enterprise.inject.Instance; import jakarta.enterprise.inject.se.SeContainer; @@ -17,46 +17,58 @@ import org.hibernate.boot.registry.StandardServiceRegistry; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.AvailableSettings; import org.hibernate.engine.spi.SessionFactoryImplementor; -import org.hibernate.resource.beans.spi.ManagedBeanRegistry; +import org.hibernate.orm.test.cdi.general.hibernatesearch.delayed.HibernateSearchDelayedCdiSupportTest; +import org.hibernate.orm.test.cdi.general.hibernatesearch.extended.HibernateSearchExtendedCdiSupportTest; import org.hibernate.tool.schema.Action; import org.hibernate.testing.junit4.BaseUnitTestCase; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.Monitor; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.NonRegistryManagedBeanConsumingIntegrator; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheAlternativeNamedApplicationScopedBeanImpl; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheAlternativeNamedDependentBeanImpl; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheApplicationScopedBean; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheDependentBean; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheEntity; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheFallbackBeanInstanceProducer; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheMainNamedApplicationScopedBeanImpl; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheMainNamedDependentBeanImpl; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheNamedApplicationScopedBean; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheNamedDependentBean; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheNestedDependentBean; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheNonHibernateBeanConsumer; -import org.hibernate.orm.test.cdi.general.nonregistrymanaged.TheSharedApplicationScopedBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.Monitor; +import org.hibernate.orm.test.cdi.general.hibernatesearch.HibernateSearchSimulatedIntegrator; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheAlternativeNamedApplicationScopedBeanImpl; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheAlternativeNamedDependentBeanImpl; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheApplicationScopedBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheDependentBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheEntity; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheFallbackBeanInstanceProducer; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheMainNamedApplicationScopedBeanImpl; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheMainNamedDependentBeanImpl; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheNamedApplicationScopedBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheNamedDependentBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheNestedDependentBean; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheNonHibernateBeanConsumer; +import org.hibernate.orm.test.cdi.general.hibernatesearch.TheSharedApplicationScopedBean; import org.junit.Test; import static org.junit.Assert.assertEquals; /** - * Tests support for requesting CDI beans from the {@link ManagedBeanRegistry} - * when the CDI BeanManager is available right away during bootstrap, - * and when the registry should not manage the lifecycle of beans, but leave it up to CDI. + * Tests support for requesting CDI beans in Hibernate Search + * when the CDI BeanManager access is available right away during bootstrap + * (not {@link HibernateSearchDelayedCdiSupportTest delayed} + * nor {@link HibernateSearchExtendedCdiSupportTest lazy}). + * + * In Hibernate Search, + * beans are retrieved directly from the {@link org.hibernate.resource.beans.container.spi.BeanContainer} + * because Hibernate Search is not bound by the JPA spec + * and wants to leave the lifecycle of beans up to CDI instead + * of controlling it in {@link org.hibernate.resource.beans.spi.ManagedBeanRegistry}. + * This involves using {@code canUseCachedReferences = false} and {@code useJpaCompliantCreation = false} + * in {@link org.hibernate.resource.beans.container.spi.BeanContainer.LifecycleOptions}). * * @author Steve Ebersole * @author Yoann Rodiere + * + * @see HibernateSearchSimulatedIntegrator */ -public class NonRegistryManagedStandardCdiSupportTest extends BaseUnitTestCase { +public class HibernateSearchStandardCdiSupportTest extends BaseUnitTestCase { @Test public void testIt() { Monitor.reset(); final TheFallbackBeanInstanceProducer fallbackBeanInstanceProducer = new TheFallbackBeanInstanceProducer(); - final NonRegistryManagedBeanConsumingIntegrator beanConsumingIntegrator = - new NonRegistryManagedBeanConsumingIntegrator( fallbackBeanInstanceProducer ); + final HibernateSearchSimulatedIntegrator beanConsumingIntegrator = + new HibernateSearchSimulatedIntegrator( fallbackBeanInstanceProducer ); final SeContainerInitializer cdiInitializer = SeContainerInitializer.newInstance() .disableDiscovery() @@ -90,8 +102,8 @@ public class NonRegistryManagedStandardCdiSupportTest extends BaseUnitTestCase { assertEquals( 1, Monitor.theNestedDependentBean().currentInstantiationCount() ); try (SessionFactoryImplementor sessionFactory = buildSessionFactory( cdiContainer, beanConsumingIntegrator )) { - // Here, the NonRegistryManagedBeanConsumingIntegrator has just been integrated and has requested beans - // See NonRegistryManagedBeanConsumingIntegrator for a detailed list of requested beans + // Here, the HibernateSearchSimulatedIntegrator has just been integrated and has requested beans + // See HibernateSearchSimulatedIntegrator for a detailed list of requested beans beanConsumingIntegrator.ensureInstancesInitialized(); @@ -134,7 +146,7 @@ public class NonRegistryManagedStandardCdiSupportTest extends BaseUnitTestCase { assertEquals( 0, Monitor.theNestedDependentBean().currentPreDestroyCount() ); } - // Here, the NonRegistryManagedBeanConsumingIntegrator has just been disintegrated and has released beans + // Here, the HibernateSearchSimulatedIntegrator has just been disintegrated and has released beans // release() should have an effect on exclusively used application-scoped beans assertEquals( 1, Monitor.theApplicationScopedBean().currentPreDestroyCount() ); @@ -166,7 +178,7 @@ public class NonRegistryManagedStandardCdiSupportTest extends BaseUnitTestCase { } private SessionFactoryImplementor buildSessionFactory(SeContainer cdiContainer, - NonRegistryManagedBeanConsumingIntegrator beanConsumingIntegrator) { + HibernateSearchSimulatedIntegrator beanConsumingIntegrator) { BootstrapServiceRegistry bsr = new BootstrapServiceRegistryBuilder() .applyIntegrator( beanConsumingIntegrator ) .build(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/package-info.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/package-info.java deleted file mode 100644 index 476a71415a..0000000000 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cdi/general/nonregistrymanaged/package-info.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * License: GNU Lesser General Public License (LGPL), version 2.1 or later - * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html - */ - -/** - * Package for testing Hibernate's support for integrating - * with CDI for beans whose lifecycle is not managed by the - * {@link org.hibernate.resource.beans.spi.ManagedBeanRegistry} - * (i.e. beans retrieved with shouldRegistryManageLifecycle = false). - * - * Mainly these are regression tests against Search's pattern of usage of ORM's - * {@link org.hibernate.resource.beans.container.spi.BeanContainer} as accessed - * via {@link org.hibernate.resource.beans.spi.ManagedBeanRegistry#getBeanContainer()} - */ -package org.hibernate.orm.test.cdi.general.nonregistrymanaged;