Java Examples for org.hibernate.resource.beans.container.spi.ContainedBean
The following java examples will help you to understand the usage of org.hibernate.resource.beans.container.spi.ContainedBean. These source code samples are taken from different open source projects.
Example 1
Project: spring-framework-master File: HibernateNativeEntityManagerFactorySpringBeanContainerIntegrationTests.java View source code |
@Test
public void testCanRetrieveBeanByTypeWithJpaCompliantOptions() {
BeanContainer beanContainer = getBeanContainer();
assertThat(beanContainer).isNotNull();
ContainedBean<SinglePrototypeInSpringContextTestBean> bean = beanContainer.getBean(SinglePrototypeInSpringContextTestBean.class, JpaLifecycleOptions.INSTANCE, IneffectiveBeanInstanceProducer.INSTANCE);
assertThat(bean).isNotNull();
SinglePrototypeInSpringContextTestBean instance = bean.getBeanInstance();
assertThat(instance).isNotNull();
assertThat(instance.getApplicationContext()).isSameAs(applicationContext);
}