Examples of DozerCacheManager


Examples of org.dozer.cache.DozerCacheManager

  private DozerCacheManager cacheMgr;

  @Override
  @Before
  public void setUp() throws Exception {
    cacheMgr = new DozerCacheManager();
  }
View Full Code Here

Examples of org.dozer.cache.DozerCacheManager

    cacheMgr = new DozerCacheManager();
  }

  @Test
  public void testCreateNew() throws Exception {
    DozerCacheManager cacheMgr2 = new DozerCacheManager();

    assertFalse("cache mgrs should not be equal", cacheMgr.equals(cacheMgr2));
    assertNotSame("cache mgrs should not be same instance", cacheMgr, cacheMgr2);
  }
View Full Code Here

Examples of org.dozer.cache.DozerCacheManager

  @Test
  public void testAddDuplicateCachesNonSingleton() throws Exception {
    // You should be able to add caches with the same name to non singleton instances
    // of the cache manager because they each have their own copies of caches to manage.
    // The caches are uniquely identified by the cache managers by using the instance id.
    DozerCacheManager cacheMgr2 = new DozerCacheManager();

    // add cache to each cache mgr instance
    String cacheName = getRandomString();
    cacheMgr.addCache(cacheName, 1);
    cacheMgr2.addCache(cacheName, 1);

    assertTrue("cache should exist in cache mgr1", cacheMgr.cacheExists(cacheName));
    assertTrue("cache should also exist in cache mgr2", cacheMgr2.cacheExists(cacheName));

    Cache cache1 = cacheMgr.getCache(cacheName);
    Cache cache2 = cacheMgr2.getCache(cacheName);

    assertFalse("caches should not be the same instance", cache1 == cache2);
    assertEquals("invalid cache name", cacheName, cache1.getName());
    assertEquals("invalid cache name for cache2", cacheName, cache2.getName());
  }
View Full Code Here

Examples of org.dozer.cache.DozerCacheManager

  private DozerCacheManager cacheMgr;

  @Override
  @Before
  public void setUp() throws Exception {
    cacheMgr = new DozerCacheManager();
  }
View Full Code Here

Examples of org.dozer.cache.DozerCacheManager

    cacheMgr = new DozerCacheManager();
  }

  @Test
  public void testCreateNew() throws Exception {
    DozerCacheManager cacheMgr2 = new DozerCacheManager();

    assertFalse("cache mgrs should not be equal", cacheMgr.equals(cacheMgr2));
    assertNotSame("cache mgrs should not be same instance", cacheMgr, cacheMgr2);
  }
View Full Code Here

Examples of org.dozer.cache.DozerCacheManager

  @Test
  public void testAddDuplicateCachesNonSingleton() throws Exception {
    // You should be able to add caches with the same name to non singleton instances
    // of the cache manager because they each have their own copies of caches to manage.
    // The caches are uniquely identified by the cache managers by using the instance id.
    DozerCacheManager cacheMgr2 = new DozerCacheManager();

    // add cache to each cache mgr instance
    String cacheName = getRandomString();
    cacheMgr.addCache(cacheName, 1);
    cacheMgr2.addCache(cacheName, 1);

    assertTrue("cache should exist in cache mgr1", cacheMgr.cacheExists(cacheName));
    assertTrue("cache should also exist in cache mgr2", cacheMgr2.cacheExists(cacheName));

    Cache cache1 = cacheMgr.getCache(cacheName);
    Cache cache2 = cacheMgr2.getCache(cacheName);

    assertFalse("caches should not be the same instance", cache1 == cache2);
    assertEquals("invalid cache name", cacheName, cache1.getName());
    assertEquals("invalid cache name for cache2", cacheName, cache2.getName());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.