Package org.castor.cache

Examples of org.castor.cache.Cache


        cache.clear();
        assertEquals(0, cache.size());
    }

    public void testIsEmpty() {
        Cache cache = initialize();

        assertFalse(cache.isEmpty());
        cache.clear();
        assertTrue(cache.isEmpty());
    }
View Full Code Here


        cache.clear();
        assertTrue(cache.isEmpty());
    }

    public void testGet() {
        Cache cache = initialize();

        assertEquals("first value", cache.get("first key"));
        assertEquals("second value", cache.get("second key"));
        assertEquals("third value", cache.get("third key"));
        assertNull(cache.get("fourth key"));
        assertNull(cache.get("fifth key"));
    }
View Full Code Here

                LOG.error(msg, ie);
                throw new CacheAcquireException(msg, ie);
            }
        }
       
        Cache cache = null;
        try {
            Class < ? > cls = loader.loadClass(getCacheClassName());
            Constructor < ? > cst = cls.getConstructor(new Class[] {Object.class});
            cache = (Cache) cst.newInstance(new Object[] {_cache});
        } catch (ClassNotFoundException cnfe) {
View Full Code Here

                    ClassMolder molder = (ClassMolder) itor.next();
                    ClassMolder extend = molder.getExtends();

                    if (extend == null) {
                        // create new Cache instance for the base type
                        Cache cache = null;
                        try {
                            cache = _cacheFactoryRegistry.getCache(
                                    molder.getCacheParams(),
                                    cdResolver.getMappingLoader().getClassLoader());
                        } catch (CacheAcquireException e) {
View Full Code Here

        assertEquals("jcache", JCache.TYPE);
        assertEquals("javax.util.jcache.CacheAccessFactory", JCache.IMPLEMENTATION);
    }

    public void testConstructor() {
        Cache c = new JCache();
        assertTrue(c instanceof JCache);
    }
View Full Code Here

        Cache c = new JCache();
        assertTrue(c instanceof JCache);
    }

    public void testGetType() {
        Cache c = new JCache();
        assertEquals("jcache", c.getType());
    }
View Full Code Here

            fail("Failed to initialize JCache instance");
        }
    }

    public void testClose() {
        Cache c = new JCache();
        int counter = DistributedCacheMock.getCounter();
       
        c.close();
        assertEquals(counter, DistributedCacheMock.getCounter());
    }
View Full Code Here

        assertEquals("fkcache", FKCache.TYPE);
        assertEquals("javax.util.jcache.CacheAccessFactory", FKCache.IMPLEMENTATION);
    }

    public void testConstructor() {
        Cache c = new FKCache();
        assertTrue(c instanceof FKCache);
    }
View Full Code Here

        Cache c = new FKCache();
        assertTrue(c instanceof FKCache);
    }

    public void testGetType() {
        Cache c = new FKCache();
        assertEquals("fkcache", c.getType());
    }
View Full Code Here

            fail("Failed to initialize FKCache instance");
        }
    }

    public void testClose() {
        Cache c = new FKCache();
        int counter = DistributedCacheMock.getCounter();
       
        c.close();
        assertEquals(counter, DistributedCacheMock.getCounter());
    }
View Full Code Here

TOP

Related Classes of org.castor.cache.Cache

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.