Search in sources :

Example 1 with SFSBHibernateSessionFactory

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()));
}
Also used : Employee(org.jboss.as.test.integration.jpa.hibernate.Employee) SFSBHibernateSessionFactory(org.jboss.as.test.integration.jpa.hibernate.SFSBHibernateSessionFactory) Test(org.junit.Test)

Aggregations

Employee (org.jboss.as.test.integration.jpa.hibernate.Employee)1 SFSBHibernateSessionFactory (org.jboss.as.test.integration.jpa.hibernate.SFSBHibernateSessionFactory)1 Test (org.junit.Test)1