1   package com.atlassian.user.impl.hibernate;
2   
3   import net.sf.hibernate.SessionFactory;
4   
5   import com.atlassian.cache.memory.MemoryCacheManager;
6   
7   /**
8    * Tests the caching implementation of the {@link ExternalEntityDAO}.
9    */
10  public class TestCachingExternalEntityDAO extends TestExternalEntityDAO
11  {
12      private CachingExternalEntityDAO cachingExternalEntityDao;
13      private SessionFactory sessionFactory;
14  
15      public void setSessionFactory(SessionFactory sessionFactory)
16      {
17          this.sessionFactory = sessionFactory;
18      }
19  
20      protected void onSetUp() throws Exception
21      {
22          super.onSetUp();
23          cachingExternalEntityDao = new CachingExternalEntityDAO(sessionFactory, new MemoryCacheManager());
24      }
25  
26      public ExternalEntityDAO getExternalEntityDao()
27      {
28          return cachingExternalEntityDao;
29      }
30  }