sessionControl.verify();
}
public void testOpenSessionInViewFilter() throws Exception {
MockControl sfControl = MockControl.createControl(SessionFactory.class);
final SessionFactory sf = (SessionFactory) sfControl.getMock();
MockControl sessionControl = MockControl.createControl(Session.class);
final Session session = (Session) sessionControl.getMock();
// set up the session factory
sfControl.expectAndReturn(sf.getSession(), session);
final SessionHolder holder = new SessionHolder(session);
sfControl.expectAndReturn(sf.getSessionHolder(session), holder);
session.logout();
sessionControl.setVoidCallable(1);
sfControl.replay();
sessionControl.replay();
// set up the second session factory
MockControl sf2Control = MockControl.createControl(SessionFactory.class);
final SessionFactory sf2 = (SessionFactory) sf2Control.getMock();
MockControl session2Control = MockControl.createControl(Session.class);
final Session session2 = (Session) session2Control.getMock();
sf2Control.expectAndReturn(sf2.getSession(), session2);
final SessionHolder holder2 = new SessionHolder(session2);
sf2Control.expectAndReturn(sf2.getSessionHolder(session2), holder2);
session2.logout();
session2Control.setVoidCallable(1);
//session2Control.expectAndReturn(session2.getRepository(), repo);
sf2Control.replay();