Examples of EhCacheDataCache


Examples of org.pentaho.reporting.engine.classic.core.cache.EhCacheDataCache

public class CacheKillingTest extends TestCase
{
  public void testKillCacheAndSurvive()
  {
    EhCacheDataCache dataCache = new EhCacheDataCache();
    DataCacheKey key = new DataCacheKey();
    key.addAttribute("Test", "test");
    dataCache.put(key, new DefaultTableModel());

    final CacheManager cacheManager = CacheManager.getInstance();
    // Note: EHCacheProvider will dynamically create these
    // caches if they don't exist.
    cacheManager.clearAll();
    cacheManager.removalAll();

    assertFalse(cacheManager.cacheExists("libloader-bundles"));
    assertFalse(cacheManager.cacheExists("libloader-data"));
    assertFalse(cacheManager.cacheExists("libloader-factory"));
    assertFalse(cacheManager.cacheExists("report-dataset-cache"));

    cacheManager.shutdown();

    assertNull(dataCache.get(key));
    dataCache.put(key, new DefaultTableModel());
    assertNotNull(dataCache.get(key));

  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.cache.EhCacheDataCache

  }

  public void testKillCacheWithoutShutdownAndSurvive()
  {
    EhCacheDataCache dataCache = new EhCacheDataCache();
    DataCacheKey key = new DataCacheKey();
    key.addAttribute("Test", "test");
    dataCache.put(key, new DefaultTableModel());

    final CacheManager cacheManager = CacheManager.getInstance();
    // Note: EHCacheProvider will dynamically create these
    // caches if they don't exist.
    cacheManager.clearAll();
    cacheManager.removalAll();

    assertFalse(cacheManager.cacheExists("libloader-bundles"));
    assertFalse(cacheManager.cacheExists("libloader-data"));
    assertFalse(cacheManager.cacheExists("libloader-factory"));
    assertFalse(cacheManager.cacheExists("report-dataset-cache"));

    assertNull(dataCache.get(key));
    dataCache.put(key, new DefaultTableModel());
    assertNotNull(dataCache.get(key));

  }
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.