Package org.shiftone.cache.adaptor

Examples of org.shiftone.cache.adaptor.MapCache


{

    public void testSimple() throws Exception
    {

        Cache cache1 = new MapCache(new Hashtable());
        Cache cache2 = new SoftCache(cache1);

        cache2.addObject("key", "value");
        assertEquals("value", cache2.getObject("key"));
    }
View Full Code Here


    public void testReference() throws Exception
    {

        Object    inObject = createBigObject();
        Object    outObject;
        MapCache  mapCache;
        SoftCache softCache;

        mapCache  = new MapCache(new Hashtable());
        softCache = new SoftCache(mapCache);

        softCache.addObject("key", inObject);

        outObject = mapCache.getObject("key");

        assertTrue("outObject instanceof Reference", outObject instanceof Reference);
        assertTrue("cache2.getObject('key') == inObject", softCache.getObject("key") == inObject);

        outObject = null;
View Full Code Here

TOP

Related Classes of org.shiftone.cache.adaptor.MapCache

Copyright © 2018 www.massapicom. 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.