JcrDaoSupport extends DaoSupport { protected final void releaseSession(Session session) { SessionFactoryUtils.releaseSession(session, getSessionFactory()); }  final void setSessionFactory(SessionFactory sessionFactory); final SessionFactory getSessionFactory(); final void setTemplate(JcrTemplate jcrTemplate); final JcrTemplate getTemplate();  }
@Test public void testReleaseSession() { JcrDaoSupport dao = new JcrDaoSupport() { }; dao.releaseSession(null); session.logout(); replay(sessionFactory); replay(session); dao.setSessionFactory(sessionFactory); dao.afterPropertiesSet(); dao.releaseSession(session); }