use of com.navercorp.pinpoint.profiler.metadata.SimpleCache in project pinpoint by naver.
the class SimpleCacheTest method startKey1.
@Test
public void startKey1() {
SimpleCache<String> cache = new SimpleCache<String>(1);
Result test = cache.put("test");
Assert.assertEquals(-1, test.getId());
}
use of com.navercorp.pinpoint.profiler.metadata.SimpleCache in project pinpoint by naver.
the class SimpleCacheTest method startKey0.
@Test
public void startKey0() {
SimpleCache<String> cache = new SimpleCache<String>(1024, 0);
Result test = cache.put("test");
Assert.assertEquals(0, test.getId());
}
use of com.navercorp.pinpoint.profiler.metadata.SimpleCache in project pinpoint by naver.
the class SimpleCacheTest method put.
@Test
public void put() {
SimpleCache<String> cache = new SimpleCache<String>();
Result test = cache.put("test");
Assert.assertEquals(-1, test.getId());
Assert.assertTrue(test.isNewValue());
Result recheck = cache.put("test");
Assert.assertEquals(test.getId(), recheck.getId());
Assert.assertFalse(recheck.isNewValue());
Result newValue = cache.put("new");
Assert.assertEquals(1, newValue.getId());
Assert.assertTrue(newValue.isNewValue());
}
Aggregations