org.apache.velocity.test
Class EventHandlingTestCase
TestCaseorg.apache.velocity.test.EventHandlingTestCase
- EventHandler, LogSystem, MethodExceptionEventHandler, NullSetEventHandler, ReferenceInsertionEventHandler
public class EventHandlingTestCase
extends TestCase
Tests event handling
Version:
- Geir Magnusson Jr.
void | init(RuntimeServices rs)- init()
|
void | logVelocityMessage(int level, String message)- handler for LogSystem interface
|
Object | methodException(Class claz, String method, Exception e)- Handles exceptions thrown during in-template method access
|
Object | referenceInsert(String reference, Object value)- Event handler for when a reference is inserted into the output stream.
|
void | runTest()- Runs the test.
|
boolean | shouldLogOnNullSet(String lhs, 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
|
NO_REFERENCE_VALUE
private static String NO_REFERENCE_VALUE
REFERENCE_VALUE
private static String REFERENCE_VALUE
exceptionSwitch
private boolean exceptionSwitch
logString
private String logString
EventHandlingTestCase
public EventHandlingTestCase()
Default constructor.
logVelocityMessage
public void logVelocityMessage(int level,
String message) handler for LogSystem interface
- logVelocityMessage in interface LogSystem
methodException
public Object methodException(Class claz,
String method,
Exception e)
throws Exception Handles exceptions thrown during in-template method access
- methodException in interface MethodExceptionEventHandler
runTest
public void runTest()
Runs the test.
shouldLogOnNullSet
public boolean shouldLogOnNullSet(String lhs,
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
- shouldLogOnNullSet in interface NullSetEventHandler
suite
public static junit.framework.Test suite()
throwException
public void throwException()
throws Exception silly method to throw an exception to test
the method invocation exception event handling
Copyright © 2003 Apache Software Foundation. All Rights Reserved.