use of org.jboss.as.test.integration.jpa.hibernate.SFSBHibernateSessionFactory in project wildfly by wildfly.
the class SessionFactoryTestCase method testInjectPUIntoHibernateSessionFactory.
// Test that a Persistence unit can be injected into a Hibernate Session factory
@Test
public void testInjectPUIntoHibernateSessionFactory() throws Exception {
SFSBHibernateSessionFactory sfsbHibernateSessionFactory = lookup("SFSBHibernateSessionFactory", SFSBHibernateSessionFactory.class);
sfsbHibernateSessionFactory.createEmployee("Sharon", "3 beach ave", 3);
Employee emp = sfsbHibernateSessionFactory.getEmployee(3);
assertTrue("name read from hibernate session is Sharon", "Sharon".equals(emp.getName()));
}
Aggregations