Package org.directmemory

Examples of org.directmemory.CacheStore.heapEntriesCount()


    CacheStore cache = new CacheStore(limit, 10 * 1024 * 1024, 1);
    for (int i = 1; i <= limit * 1.5; i++) {
      DummyPojo pojo = new  DummyPojo("test" + i, 1024);
      cache.put("test" + i, pojo);
      if (i <= limit) {
        assertEquals(i, cache.heapEntriesCount());
      } else {
        assertEquals(limit, cache.heapEntriesCount());
      }
    }

View Full Code Here


      DummyPojo pojo = new  DummyPojo("test" + i, 1024);
      cache.put("test" + i, pojo);
      if (i <= limit) {
        assertEquals(i, cache.heapEntriesCount());
      } else {
        assertEquals(limit, cache.heapEntriesCount());
      }
    }

    logger.debug("goOverTheLimitPutAndGet " + cache.toString());
   
View Full Code Here

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

 
  @AfterClass
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.