Package org.castor.cache.hashbelt.container

Examples of org.castor.cache.hashbelt.container.MapContainer


    public void test() {
        RefreshingReaperMock.getExpiredObjects().clear();
       
        Cache cache = new Unlimited();
       
        Container container = new MapContainer();
        for (int i = 0; i < 10; i++) {
            container.put(new Integer(i), Integer.toString(i));
        }
       
        AbstractReaper reaper = new RefreshingReaperMock();
        reaper.setCache(cache);
        reaper.handleExpiredContainer(container);
        assertEquals(10, container.size());
       
        assertEquals(10, cache.size());
        for (int i = 0; i < 10; i++) {
            Object key = new Integer(i);
            assertTrue(cache.containsKey(key));
View Full Code Here


    public void test() {
        ReinsertingReaperMock.getExpiredObjects().clear();
       
        Cache cache = new Unlimited();
       
        Container container = new MapContainer();
        for (int i = 0; i < 10; i++) {
            container.put(new Integer(i), Integer.toString(i));
        }
       
        AbstractReaper reaper = new ReinsertingReaperMock();
        reaper.setCache(cache);
        reaper.handleExpiredContainer(container);
        assertEquals(10, container.size());
       
        assertEquals(10, cache.size());
        for (int i = 0; i < 10; i++) {
            Object key = new Integer(i);
            assertTrue(cache.containsKey(key));
View Full Code Here

    public TestNotifyingReaper(final String name) { super(name); }
   
    public void test() {
        NotifyingReaperMock.getExpiredObjects().clear();
       
        Container container = new MapContainer();
        for (int i = 0; i < 10; i++) {
            container.put(new Integer(i), Integer.toString(i));
        }
       
        AbstractReaper reaper = new NotifyingReaperMock();
        reaper.handleExpiredContainer(container);
        assertEquals(10, container.size());
       
        List expired = NotifyingReaperMock.getExpiredObjects();
        assertEquals(10, expired.size());
        for (int i = 0; i < 10; i++) {
            assertTrue(expired.contains(Integer.toString(i)));
View Full Code Here

    }

    public TestNullReaper(final String name) { super(name); }
   
    public void test() {
        Container container = new MapContainer();
        for (int i = 0; i < 10; i++) {
            container.put(new Integer(i), Integer.toString(i));
        }

        AbstractReaper reaper = new NullReaper();
        reaper.handleExpiredContainer(container);
        assertEquals(10, container.size());
    }
View Full Code Here

TOP

Related Classes of org.castor.cache.hashbelt.container.MapContainer

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.