Package org.directmemory

Examples of org.directmemory.CacheStore.reset()


    assertNotNull(pojo2);
    assertEquals("test2", pojo2.name);
    assertNotNull(pojo3);
    assertEquals("test3", pojo3.name);
    logger.debug("addAndRetrieve " + cache.toString());
    cache.reset();
  }
 
   
  @AfterClass
  public static void checkPerformance() {
View Full Code Here


    assertNotNull(pojo2);
    assertEquals("test2", pojo2.name);
    assertNotNull(pojo3);
    assertEquals("test3", pojo3.name);
    logger.debug("addAndRetrieve " + cache.toString());
    cache.reset();
  }
 
 
  @Test public void goOverTheOffheapLimitPutAndGet() {
    int limit = 1000;
View Full Code Here

      DummyPojo newPojo = (DummyPojo)cache.get(key);
      assertNotNull(newPojo);
      assertEquals("test"+i, newPojo.name);
    }
    logger.debug("finally " + cache.toString());
    cache.reset();
 
 

 
  @Test
View Full Code Here

    cache.get("test2");
    // accessing an element should put it back at the beginning of the list
    last = cache.removeLast();
    // so the last should be now test3
    assertEquals("test3", last.key);
    cache.reset();
  }
 
  @Test
  public void remove() {
    CacheStore cache = new CacheStore(-1, 1 * 1024 * 1024, 1);
View Full Code Here

    cache.put("test1", new DummyPojo("test1", 1024));
    CacheEntry entry = cache.remove("test1");
    assertEquals("test1", entry.key);
    entry = cache.getEntry("test1");
    assertNull(entry);
    cache.reset();
  }
 
  @Test public void reachLimit() {
    int limit = 10;
    CacheStore cache = new CacheStore(limit, 1 * 1024 * 1024, 1);
View Full Code Here

      if (i < limit) {
        assert(limit >= cache.heapEntriesCount());
      }
      logger.debug("reachLimit " + cache);
    }
    cache.reset();
  }
 
  @Test public void goOverTheLimit() {
    int limit = 10;
    CacheStore cache = new CacheStore(limit, 1 * 1024 * 1024, 1);
View Full Code Here

      } else {
        assertEquals(limit, cache.heapEntriesCount());
      }
      logger.debug("goOverTheLimit " + cache);
    }
    cache.reset();   
  }
 
 
  @Test public void goOverTheLimitPutAndGet() {
    int limit = 1000;
View Full Code Here

      DummyPojo newPojo = (DummyPojo)cache.get("test" + i);
      assertNotNull(newPojo);
      assertEquals("test"+i, newPojo.name);
  }
    assertEquals(limit, cache.heapEntriesCount());
    cache.reset();
 

 
  @AfterClass
  public static void checkPerformance() {
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.