org.apache.velocity.test
Class EventHandlingTestCase
java.lang.Object
|
+--junit.framework.Assert
|
+--junit.framework.TestCase
|
+--org.apache.velocity.test.EventHandlingTestCase
- All Implemented Interfaces:
- EventHandler, LogSystem, MethodExceptionEventHandler, NullSetEventHandler, ReferenceInsertionEventHandler, junit.framework.Test
- public class EventHandlingTestCase
- extends junit.framework.TestCase
- implements ReferenceInsertionEventHandler, NullSetEventHandler, MethodExceptionEventHandler, LogSystem
Tests event handling
- Version:
- $Id: EventHandlingTestCase.java,v 1.3.2.1 2001/06/02 14:34:18 geirm Exp $
- Author:
- Geir Magnusson Jr.
Fields inherited from class junit.framework.TestCase |
fName |
Method Summary |
void |
logVelocityMessage(int level,
java.lang.String message)
handler for LogSystem interface |
java.lang.Object |
methodException(java.lang.Class claz,
java.lang.String method,
java.lang.Exception e)
Handles exceptions thrown during in-template method access |
java.lang.Object |
referenceInsert(java.lang.String reference,
java.lang.Object value)
Event handler for when a reference is inserted into the output stream. |
void |
runTest()
Runs the test. |
boolean |
shouldLogOnNullSet(java.lang.String lhs,
java.lang.String rhs)
Event handler for when the right hand side of
a #set() directive is null, which results in
a log message. |
static junit.framework.Test |
suite()
|
void |
throwException()
silly method to throw an exception to test
the method invocation exception event handling |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, name, run, run, runBare, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, fail, fail, failNotEquals, failNotSame |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
logString
private java.lang.String logString
exceptionSwitch
private boolean exceptionSwitch
NO_REFERENCE_VALUE
private static java.lang.String NO_REFERENCE_VALUE
REFERENCE_VALUE
private static java.lang.String REFERENCE_VALUE
EventHandlingTestCase
public EventHandlingTestCase()
- Default constructor.
suite
public static junit.framework.Test suite()
runTest
public void runTest()
- Runs the test.
- Overrides:
runTest
in class junit.framework.TestCase
throwException
public void throwException()
throws java.lang.Exception
- silly method to throw an exception to test
the method invocation exception event handling
referenceInsert
public java.lang.Object referenceInsert(java.lang.String reference,
java.lang.Object value)
- Event handler for when a reference is inserted into the output stream.
- Specified by:
referenceInsert
in interface ReferenceInsertionEventHandler
shouldLogOnNullSet
public boolean shouldLogOnNullSet(java.lang.String lhs,
java.lang.String rhs)
- Event handler for when the right hand side of
a #set() directive is null, which results in
a log message. This method gives the application
a chance to 'vote' on msg generation
- Specified by:
shouldLogOnNullSet
in interface NullSetEventHandler
- Following copied from interface:
org.apache.velocity.app.event.NullSetEventHandler
- Parameters:
lhs
- reference literal of left-hand-side of set statementrhs
- reference literal of right-hand-side of set statement- Returns:
- true if log message should be written, false otherwise
methodException
public java.lang.Object methodException(java.lang.Class claz,
java.lang.String method,
java.lang.Exception e)
throws java.lang.Exception
- Handles exceptions thrown during in-template method access
- Specified by:
methodException
in interface MethodExceptionEventHandler
logVelocityMessage
public void logVelocityMessage(int level,
java.lang.String message)
- handler for LogSystem interface
- Specified by:
logVelocityMessage
in interface LogSystem
Copyright © 2001 Apache Software Foundation. All Rights Reserved.