freemarker.testcase
Class TestCacheExpiry

java.lang.Object
  |
  +--freemarker.testcase.TestCacheExpiry
All Implemented Interfaces:
CacheListener, java.util.EventListener

public class TestCacheExpiry
extends java.lang.Object
implements CacheListener

Tests expiry of items from the cache. This happens n update cycles after an item is added to the cache. We should be able to see this in the System.out stream.

Version:
$Id: TestCacheExpiry.java,v 1.1 2003/11/09 03:18:25 run2000 Exp $

Constructor Summary
TestCacheExpiry()
          Creates new TestCacheExpiry
 
Method Summary
 void cacheUnavailable(CacheEvent e)
          Called when a cache cannot be updated.
 void elementRemoved(CacheEvent e)
          Called when an element is removed from the cache.
 void elementUpdated(CacheEvent e)
          Called when a cache element updates successfully.
 void elementUpdateFailed(CacheEvent e)
          Called when a cache element fails to update.
protected  java.lang.String getTestcasePath()
          Retrieve the root path of the FM-Classic distribution from a properties file.
static void main(java.lang.String[] args)
          Main code for running the test.
 void test()
          Performs the test.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestCacheExpiry

public TestCacheExpiry()
Creates new TestCacheExpiry
Method Detail

test

public void test()
          throws java.lang.Exception
Performs the test. The test results are sent to System.out.

elementRemoved

public void elementRemoved(CacheEvent e)
Called when an element is removed from the cache.
Specified by:
elementRemoved in interface CacheListener
Parameters:
e - the CacheEvent fired.

elementUpdateFailed

public void elementUpdateFailed(CacheEvent e)
Called when a cache element fails to update. The event fired contains the Exception object.
Specified by:
elementUpdateFailed in interface CacheListener
Parameters:
e - the CacheEvent fired.

cacheUnavailable

public void cacheUnavailable(CacheEvent e)
Called when a cache cannot be updated. The event fired contains the Exception object.
Specified by:
cacheUnavailable in interface CacheListener
Parameters:
e - the CacheEvent fired.

elementUpdated

public void elementUpdated(CacheEvent e)
Called when a cache element updates successfully.
Specified by:
elementUpdated in interface CacheListener
Parameters:
e - the CacheEvent fired.

getTestcasePath

protected java.lang.String getTestcasePath()
                                    throws java.io.IOException
Retrieve the root path of the FM-Classic distribution from a properties file. This is used to set the root of the FM-Classic cache, which in turn is used to find the example source code.
Returns:
the path to the root of the FM-Classic distribution.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Main code for running the test.