final HibernateException flushEx = new HibernateException("flush failure");
MockControl sfControl = MockControl.createControl(SessionFactoryImplementor.class);
final SessionFactoryImplementor sf = (SessionFactoryImplementor) sfControl.getMock();
final MockControl sessionControl = MockControl.createControl(Session.class);
final Session session = (Session) sessionControl.getMock();
sf.openSession();
sfControl.setReturnValue(session, 1);
sf.getTransactionManager();
sfControl.setReturnValue(tm, 6);
session.isOpen();
sessionControl.setReturnValue(true, 4);