Package org.shiftone.cache.test

Source Code of org.shiftone.cache.test.SimpleTestCase

package org.shiftone.cache.test;



import junit.framework.TestCase;

import org.shiftone.cache.Cache;
import org.shiftone.cache.policy.lfu.LfuCacheFactory;


public class SimpleTestCase extends TestCase
{

    public void testSimple()
    {

        Cache  cache      = new LfuCacheFactory().newInstance("testSimple", 1000, 50);
        Object object     = new Object();
        String longString = "this is a string but it's not really that long";

        cache.addObject(longString, object);
        assertNotNull(cache.getObject(longString));
    }

    /*
        public void testSimpleNull()
        {

            Cache  cache      = new LfuCacheFactory().newInstance(1000, 50);
            Object object     = new Object();
            String longString = null;

            cache.addObject(null, null);

            cache.addObject(null, object);
            assertNotNull(cache.getObject(longString));
        }
        */
}
 
TOP

Related Classes of org.shiftone.cache.test.SimpleTestCase

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.