Package org.apache.turbine.services.cache

Examples of org.apache.turbine.services.cache.GlobalCacheService.removeObject()


        retrievedObject = globalCache.getObject(cacheKey);
        assertNotNull( "Did not retrieved a cached object 1", retrievedObject);
        assertTrue( "Did not retrieved a correct, expected cached object 1", retrievedObject == cacheObject1);

        // Remove object from cache
        globalCache.removeObject(cacheKey);

        // Verify object removed from cache
        retrievedObject = null;
        cacheObject1 = null;
        try
View Full Code Here


        {
            throw e;
        }

        // Remove object from cache that does NOT exist in the cache
        globalCache.removeObject(cacheKey);
    }

    /**
     * Simple test that adds, retrieves, and deletes 2 object.
     *
 
View Full Code Here

        retrievedObject = globalCache.getObject(cacheKey_2);
        assertNotNull( "Did not retrieved a cached object 2. Attempt #2", retrievedObject);
        assertEquals( "Did not retrieved correct cached object 2 Attempt #2", cacheObject2, retrievedObject);

        // Remove objects
        globalCache.removeObject(cacheKey);
        globalCache.removeObject(cacheKey_2);
    }

    /**
     * Verify that an object will throw the ObjectExpiredException
View Full Code Here

        assertNotNull( "Did not retrieved a cached object 2. Attempt #2", retrievedObject);
        assertEquals( "Did not retrieved correct cached object 2 Attempt #2", cacheObject2, retrievedObject);

        // Remove objects
        globalCache.removeObject(cacheKey);
        globalCache.removeObject(cacheKey_2);
    }

    /**
     * Verify that an object will throw the ObjectExpiredException
     * when it now longer exists in cache.
View Full Code Here

        {
            throw e;
        }

        // Remove objects
        globalCache.removeObject(cacheKey);
    }

    /**
     * Verify the all object will be flushed from the cache.
     *
 
View Full Code Here

        // Wait 15 seconds, 3 Refresh
        Thread.sleep((TURBINE_CACHE_REFRESH * 2) + 1);
        assertEquals("After refresh", 0, globalCache.getNumberOfObjects());

        // Remove objects
        globalCache.removeObject(cacheKey);
    }

    /**
     * Verify the Cache count is correct.
     * @throws Exception
View Full Code Here

            {
                throw e;
            }
        }
        // Remove objects
        globalCache.removeObject(cacheKey);
    }

    /**
     * Verify a cached object will be delete after it has been
     * untouched beyond it's TimeToLive.
View Full Code Here

        retrievedObject = globalCache.getObject(cacheKey);
        assertNotNull( "Did not retrieved a cached object 1", retrievedObject);
        assertTrue( "Did not retrieved a correct, expected cached object 1", retrievedObject == cacheObject1);

        // Remove object from cache
        globalCache.removeObject(cacheKey);

        // Verify object removed from cache
        retrievedObject = null;
        cacheObject1 = null;
        try
View Full Code Here

        {
            throw e;
        }

        // Remove object from cache that does NOT exist in the cache
        globalCache.removeObject(cacheKey);
    }

    /**
     * Simple test that adds, retrieves, and deletes 2 object.
     *
 
View Full Code Here

        retrievedObject = globalCache.getObject(cacheKey_2);
        assertNotNull( "Did not retrieved a cached object 2. Attempt #2", retrievedObject);
        assertEquals( "Did not retrieved correct cached object 2 Attempt #2", cacheObject2, retrievedObject);

        // Remove objects
        globalCache.removeObject(cacheKey);
        globalCache.removeObject(cacheKey_2);
    }

    /**
     * Verify that an object will throw the ObjectExpiredException
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.