Package org.apache.openjpa.datacache

Examples of org.apache.openjpa.datacache.ConcurrentQueryCache



    }

    public void testName() {
        ConcurrentQueryCache qCache =
            (ConcurrentQueryCache) emf.getConfiguration().getDataCacheManagerInstance().getSystemQueryCache();
        assertNotNull(qCache);
        assertEquals(CACHE_NAME, qCache.getName());
    }
View Full Code Here


     * Returns the current size of the EntityManagerFactory's
     * query cache.
     *
     */
    protected int queryCacheGet() {
        ConcurrentQueryCache dcache = getQueryCache();
        CacheMap map = dcache.getCacheMap();
        return map.size();
    }
View Full Code Here

    /**
     * Verify that the persistent unit property configuration is enabling
     * the TIMESTAMP Eviction Policy.
     */
    public void testTimestampEvictionEnablement() {
        ConcurrentQueryCache qc = getQueryCache();
        EvictPolicy ep = qc.getEvictPolicy();
        assertTrue(ep == EvictPolicy.TIMESTAMP);
    }
View Full Code Here

    /**
     * Verify that the persistent unit property configuration is enabling
     * the TIMESTAMP Eviction Policy.
     */
    public void testTimestampEvictionEnablement() {
        ConcurrentQueryCache qc = getQueryCache();
        EvictPolicy ep = qc.getEvictPolicy();
        assertTrue(ep == EvictPolicy.TIMESTAMP);
    }
View Full Code Here


    }

    public void testName() {
        ConcurrentQueryCache qCache =
            (ConcurrentQueryCache) emf.getConfiguration().getDataCacheManagerInstance().getSystemQueryCache();
        assertNotNull(qCache);
        assertEquals(CACHE_NAME, qCache.getName());
    }
View Full Code Here

        );
    }

    public void testQueryCacheOverFlow() {
        OpenJPAEntityManagerSPI em = emf.createEntityManager();
        ConcurrentQueryCache cache =
            (ConcurrentQueryCache) emf.getConfiguration().getDataCacheManagerInstance().getSystemQueryCache();

        // populate entities.
        em.getTransaction().begin();
        for (int i = 0; i < cacheSize + 1; i++) {
            CachedPerson person = new CachedPerson();
            person.setId(i);
            em.persist(person);
        }
        em.getTransaction().commit();
        // Clean up persistence context.
        em.clear();

        // Populate query cache
        for (int i = 0; i < cacheSize + 1; i++) {
            em.createQuery(QUERY + i, CachedPerson.class).getSingleResult();
        }

        Set<?> keys = cache.getCacheMap().keySet();
        assertEquals(cacheSize, keys.size());
        List<String> strKeys = new ArrayList<String>();
        for (Object key : keys) {
            strKeys.add(key.toString());
        }
View Full Code Here

     * Returns the current size of the EntityManagerFactory's
     * query cache.
     *
     */
    protected int queryCacheGet() {
        ConcurrentQueryCache dcache = getQueryCache();
        CacheMap map = dcache.getCacheMap();
        return map.size();
    }
View Full Code Here

    /**
     * Verify that the persistent unit property configuration is enabling
     * the TIMESTAMP Eviction Policy.
     */
    public void testTimestampEvictionEnablement() {
        ConcurrentQueryCache qc = getQueryCache();
        EvictPolicy ep = qc.getEvictPolicy();
        assertTrue(ep == EvictPolicy.TIMESTAMP);
    }
View Full Code Here

    /**
     * Verify that the persistent unit property configuration is enabling
     * the DEFAULT Eviction Policy.
     */
    public void testTimestampEvictionEnablement() {
        ConcurrentQueryCache qc = getQueryCache();
        EvictPolicy ep = qc.getEvictPolicy();
        assertTrue(ep == EvictPolicy.DEFAULT);
    }
View Full Code Here

    /**
     * Verify that the persistent unit property configuration is enabling
     * the DEFAULT Eviction Policy.
     */
    public void testTimestampEvictionEnablement() {
        ConcurrentQueryCache qc = getQueryCache();
        EvictPolicy ep = qc.getEvictPolicy();
        assertTrue(ep == EvictPolicy.DEFAULT);
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.datacache.ConcurrentQueryCache

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.