Package org.castor.cache

Examples of org.castor.cache.Cache.initialize()


        assertEquals(30, ((CountLimited) cache).getCapacity());
        assertEquals(Cache.DEFAULT_NAME, cache.getName());
       
        Properties params = new Properties();
        params.put(Cache.PARAM_NAME, "dummy1");
        cache.initialize(params);
        assertEquals(30, ((CountLimited) cache).getCapacity());
        assertEquals("dummy1", cache.getName());
       
        params.clear();
        params.put(Cache.PARAM_NAME, "dummy2");
View Full Code Here


        assertEquals("dummy1", cache.getName());
       
        params.clear();
        params.put(Cache.PARAM_NAME, "dummy2");
        params.put(CountLimited.PARAM_CAPACITY, "-10");
        cache.initialize(params);
        assertEquals(30, ((CountLimited) cache).getCapacity());
        assertEquals("dummy2", cache.getName());
       
        params.clear();
        params.put(Cache.PARAM_NAME, "dummy3");
View Full Code Here

        assertEquals("dummy2", cache.getName());
       
        params.clear();
        params.put(Cache.PARAM_NAME, "dummy3");
        params.put(CountLimited.PARAM_CAPACITY, "0");
        cache.initialize(params);
        assertEquals(30, ((CountLimited) cache).getCapacity());
        assertEquals("dummy3", cache.getName());
       
        params.clear();
        params.put(Cache.PARAM_NAME, "dummy4");
View Full Code Here

        assertEquals("dummy3", cache.getName());
       
        params.clear();
        params.put(Cache.PARAM_NAME, "dummy4");
        params.put(CountLimited.PARAM_CAPACITY, "10");
        cache.initialize(params);
        assertEquals(10, ((CountLimited) cache).getCapacity());
        assertEquals("dummy4", cache.getName());
       
        assertFalse(cache.containsKey("first key"));
        assertFalse(cache.containsKey("second key"));
View Full Code Here

        try {
            Properties params = new Properties();
            params.put(Cache.PARAM_NAME, "dummy");
            params.put(CountLimited.PARAM_CAPACITY, new Integer(10));
            cache.initialize(params);
        } catch (CacheAcquireException ex) {
            fail("Unexpected CacheAcquireException at initialization.");
        }
       
        assertNull(cache.put("first key", "first value"));
View Full Code Here

        try {
            Properties params = new Properties();
            params.put(Cache.PARAM_NAME, "dummy");
            params.put(CountLimited.PARAM_CAPACITY, "3");
            cache.initialize(params);
        } catch (CacheAcquireException ex) {
            fail("Unexpected CacheAcquireException at initialization.");
        }
       
        assertEquals(0, cache.size());
View Full Code Here

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.