01: package org.shiftone.cache.test;
02:
03: import junit.framework.TestCase;
04:
05: import org.shiftone.cache.Cache;
06: import org.shiftone.cache.policy.lfu.LfuCacheFactory;
07:
08: public class SimpleTestCase extends TestCase {
09:
10: public void testSimple() {
11:
12: Cache cache = new LfuCacheFactory().newInstance("testSimple",
13: 1000, 50);
14: Object object = new Object();
15: String longString = "this is a string but it's not really that long";
16:
17: cache.addObject(longString, object);
18: assertNotNull(cache.getObject(longString));
19: }
20:
21: /*
22: public void testSimpleNull()
23: {
24:
25: Cache cache = new LfuCacheFactory().newInstance(1000, 50);
26: Object object = new Object();
27: String longString = null;
28:
29: cache.addObject(null, null);
30:
31: cache.addObject(null, object);
32: assertNotNull(cache.getObject(longString));
33: }
34: */
35: }
|