freemarker.testcase
Class TestInclude2

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--freemarker.testcase.AbstractTestCase
                    |
                    +--freemarker.testcase.TestInclude2
All Implemented Interfaces:
CacheListener, java.util.EventListener, junit.framework.Test

public final class TestInclude2
extends AbstractTestCase
implements CacheListener

A second test class for testing FM-Classic's <include> tag. In particular, test whether we can escape from a cache directory's sandbox.

Version:
$Id: TestInclude2.java,v 1.13 2003/11/28 01:17:06 run2000 Exp $
See Also:
TestInclude

Fields inherited from class freemarker.testcase.AbstractTestCase
m_aFilename, m_aReferenceText, m_aTemplateText
 
Constructor Summary
TestInclude2(java.lang.String aTestname)
          Constructor that passes the name of the test up to the JUnit constructor.
 
Method Summary
 void cacheUnavailable(CacheEvent event)
          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.
static void main(java.lang.String[] argc)
          Bootstrap for the self-test code.
 void runTest()
          Performs the test.
 void setUp()
          Set up the test case prior to running.
 
Methods inherited from class freemarker.testcase.AbstractTestCase
getReferenceText, getTemplateText, getTestcasePath, getTextFromFile, isTextIdentical, setUpFiles, showTestResults, writeText
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestInclude2

public TestInclude2(java.lang.String aTestname)
Constructor that passes the name of the test up to the JUnit constructor.
Parameters:
aTestname - the name of the test
Method Detail

setUp

public void setUp()
Set up the test case prior to running.
Overrides:
setUp in class junit.framework.TestCase

runTest

public void runTest()
             throws java.io.IOException
Performs the test. A fail result will generate information about the failure and pass it up to JUnit.
Overrides:
runTest in class junit.framework.TestCase

cacheUnavailable

public void cacheUnavailable(CacheEvent event)
Called when a cache cannot be updated. The event fired contains the Exception object.
Specified by:
cacheUnavailable in interface CacheListener
Parameters:
event - 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.

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.

main

public static void main(java.lang.String[] argc)
                 throws java.lang.Exception
Bootstrap for the self-test code.