Package org.apache.jcs.engine

Examples of org.apache.jcs.engine.CompositeCacheAttributes


    public void testSimpleShrink()
        throws Exception
    {
        MemoryCacheMockImpl memory = new MemoryCacheMockImpl();

        CompositeCacheAttributes cacheAttr = new CompositeCacheAttributes();
        cacheAttr.setMaxMemoryIdleTimeSeconds( 1 );
        cacheAttr.setMaxSpoolPerRun( 10 );

        memory.setCacheAttributes( cacheAttr );

        String key = "key";
        String value = "value";
View Full Code Here


    public void testSimpleShrinkMutiple()
        throws Exception
    {
        MemoryCacheMockImpl memory = new MemoryCacheMockImpl();

        CompositeCacheAttributes cacheAttr = new CompositeCacheAttributes();
        cacheAttr.setMaxMemoryIdleTimeSeconds( 1 );
        cacheAttr.setMaxSpoolPerRun( 3 );

        memory.setCacheAttributes( cacheAttr );

        for ( int i = 0; i < 10; i++ )
        {
View Full Code Here

    public void testSimpleShrinkMutipleWithEventHandler()
    throws Exception
{
    MemoryCacheMockImpl memory = new MemoryCacheMockImpl();

    CompositeCacheAttributes cacheAttr = new CompositeCacheAttributes();
    cacheAttr.setMaxMemoryIdleTimeSeconds( 1 );
    cacheAttr.setMaxSpoolPerRun( 3 );

    memory.setCacheAttributes( cacheAttr );

    ElementEventHandlerMockImpl handler = new ElementEventHandlerMockImpl();
View Full Code Here

     *
     */
    public void testRegionDefinitonWithAttributes()
        throws Exception
    {
        ICompositeCacheAttributes ca = new CompositeCacheAttributes();

        long maxIdleTime = 8765;
        ca.setMaxMemoryIdleTimeSeconds( maxIdleTime );

        CacheAccess access = CacheAccess.defineRegion( "testRegionDefinitonWithAttributes", ca );
        assertNotNull( "We should have an access class", access );

        ICompositeCacheAttributes ca2 = access.getCacheAttributes();
        assertEquals( "Wrong idle time setting.", ca.getMaxMemoryIdleTimeSeconds(), ca2.getMaxMemoryIdleTimeSeconds() );
    }
View Full Code Here

     *
     */
    public void testRegionDefinitonWithBothAttributes()
        throws Exception
    {
        ICompositeCacheAttributes ca = new CompositeCacheAttributes();

        long maxIdleTime = 8765;
        ca.setMaxMemoryIdleTimeSeconds( maxIdleTime );

        long maxLife = 9876;
        IElementAttributes attr = new ElementAttributes();
        attr.setMaxLifeSeconds( maxLife );

        CacheAccess access = CacheAccess.defineRegion( "testRegionDefinitonWithAttributes", ca, attr );
        assertNotNull( "We should have an access class", access );

        ICompositeCacheAttributes ca2 = access.getCacheAttributes();
        assertEquals( "Wrong idle time setting.", ca.getMaxMemoryIdleTimeSeconds(), ca2.getMaxMemoryIdleTimeSeconds() );
    }
View Full Code Here

TOP

Related Classes of org.apache.jcs.engine.CompositeCacheAttributes

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.