public class EventHandlingTestCase extends junit.framework.TestCase implements ReferenceInsertionEventHandler, NullSetEventHandler, MethodExceptionEventHandler, LogSystem
| Modifier and Type | Field and Description |
|---|---|
private boolean |
exceptionSwitch |
private java.lang.String |
logString |
private static java.lang.String |
NO_REFERENCE_VALUE |
private static java.lang.String |
REFERENCE_VALUE |
| Constructor and Description |
|---|
EventHandlingTestCase()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
init(RuntimeServices rs)
init()
|
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
|
countTestCases, createResult, getName, run, run, runBare, setName, setUp, tearDown, toStringassertEquals, 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, failNotEquals, failNotSame, failSameprivate java.lang.String logString
private boolean exceptionSwitch
private static java.lang.String NO_REFERENCE_VALUE
private static java.lang.String REFERENCE_VALUE
public void init(RuntimeServices rs)
LogSystempublic static junit.framework.Test suite()
public void runTest()
runTest in class junit.framework.TestCasepublic void throwException()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.Object referenceInsert(java.lang.String reference,
java.lang.Object value)
referenceInsert in interface ReferenceInsertionEventHandlerreference - Reference from template about to be inserted.value - Value about to be inserted (after its
toString() method is called).toString() should be
called for output.public boolean shouldLogOnNullSet(java.lang.String lhs,
java.lang.String rhs)
shouldLogOnNullSet in interface NullSetEventHandlerlhs - reference literal of left-hand-side of set statementrhs - reference literal of right-hand-side of set statementpublic java.lang.Object methodException(java.lang.Class claz,
java.lang.String method,
java.lang.Exception e)
throws java.lang.Exception
methodException in interface MethodExceptionEventHandlerjava.lang.Exceptionpublic void logVelocityMessage(int level,
java.lang.String message)
logVelocityMessage in interface LogSystemCopyright ? 2002 Apache Software Foundation. All Rights Reserved.