// check if we can look up the Hibernate session factory that should of been bound because of
// the hibernate.session_factory_name was specified in the properties (in peristence.xml above).
SessionFactory hibernateSessionFactory = rawLookup("modelSessionFactory",SessionFactory.class);
assertNotNull("jndi lookup of hibernate.session_factory_name should return HibernateSessionFactory", hibernateSessionFactory);
Session session = hibernateSessionFactory.openSession();
Employee emp = (Employee)session.get(Employee.class,1);
assertTrue("name read from hibernate session is Sally", "Sally".equals(emp.getName()));
}
// Test that an extended Persistence context can be injected into a Hibernate Session