* @throws Exception
*/
public void testRefreshableTimeToLive() throws Exception {
String testString = new String( "This is a test");
Object retrievedObject = null;
RefreshableCachedObject cacheObject = null;
long addTime = 0;
GlobalCacheService globalCache = (GlobalCacheService)TurbineServices
.getInstance()
.getService( GlobalCacheService.SERVICE_NAME );
// Create and add Object that expires in TEST_EXPIRETIME millis.
cacheObject = new RefreshableCachedObject(new RefreshableObject(), TEST_EXPIRETIME);
assertNotNull( "Failed to create a cachable object", cacheObject);
cacheObject.setTTL(TEST_TIMETOLIVE);
// Verify TimeToLive was set
assertEquals( "Returned TimeToLive", TEST_TIMETOLIVE, cacheObject.getTTL());
// Add object to Cache
globalCache.addObject(cacheKey, cacheObject);
addTime = System.currentTimeMillis();