org.apache.velocity.test
Class EventHandlingTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.velocity.test.EventHandlingTestCase
All Implemented Interfaces:
junit.framework.Test, org.apache.velocity.runtime.log.LogChute

public class EventHandlingTestCase
extends junit.framework.TestCase
implements org.apache.velocity.runtime.log.LogChute

Tests event handling for all event handlers except IncludeEventHandler. This is tested separately due to its complexity.

Version:
$Id: EventHandlingTestCase.java 463298 2006-10-12 16:10:32Z henning $
Author:
Geir Magnusson Jr.

Nested Class Summary
static class EventHandlingTestCase.TestEventCartridge
           
 
Field Summary
 
Fields inherited from interface org.apache.velocity.runtime.log.LogChute
DEBUG_ID, DEBUG_PREFIX, ERROR_ID, ERROR_PREFIX, INFO_ID, INFO_PREFIX, TRACE_ID, TRACE_PREFIX, WARN_ID, WARN_PREFIX
 
Constructor Summary
EventHandlingTestCase(String name)
          Default constructor.
 
Method Summary
static void clearLogString()
           
static String getLogString()
           
 void init(org.apache.velocity.runtime.RuntimeServices rs)
          Required by LogChute
 boolean isLevelEnabled(int level)
           
 void log(int level, String message)
          handler for LogChute interface
 void log(int level, String message, Throwable t)
           
static void setLogString(String message)
           
static junit.framework.Test suite()
           
 void testConfigurationEventHandlers()
          Test assigning the event handlers via properties
 void testManualEventHandlers()
           
 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, getName, run, run, runBare, runTest, setName, setUp, 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

EventHandlingTestCase

public EventHandlingTestCase(String name)
Default constructor.

Method Detail

suite

public static junit.framework.Test suite()

testManualEventHandlers

public void testManualEventHandlers()
                             throws Exception
Throws:
Exception

testConfigurationEventHandlers

public void testConfigurationEventHandlers()
                                    throws Exception
Test assigning the event handlers via properties

Throws:
Exception

throwException

public void throwException()
                    throws Exception
silly method to throw an exception to test the method invocation exception event handling

Throws:
Exception

init

public void init(org.apache.velocity.runtime.RuntimeServices rs)
Required by LogChute

Specified by:
init in interface org.apache.velocity.runtime.log.LogChute

log

public void log(int level,
                String message)
handler for LogChute interface

Specified by:
log in interface org.apache.velocity.runtime.log.LogChute

log

public void log(int level,
                String message,
                Throwable t)
Specified by:
log in interface org.apache.velocity.runtime.log.LogChute

isLevelEnabled

public boolean isLevelEnabled(int level)
Specified by:
isLevelEnabled in interface org.apache.velocity.runtime.log.LogChute

clearLogString

public static void clearLogString()

setLogString

public static void setLogString(String message)

getLogString

public static String getLogString()


Copyright © 2000-2010 The Apache Software Foundation. All Rights Reserved.