org.apache.velocity.test
クラス EventHandlingTestCase

java.lang.Object
  拡張TestCase
      拡張org.apache.velocity.test.EventHandlingTestCase
すべての実装インタフェース:
EventHandler, LogSystem, MethodExceptionEventHandler, NullSetEventHandler, ReferenceInsertionEventHandler

public class EventHandlingTestCase
extends TestCase
implements ReferenceInsertionEventHandler, NullSetEventHandler, MethodExceptionEventHandler, LogSystem

Tests event handling

バージョン:
$Id: EventHandlingTestCase.java,v 1.5 2001/08/07 22:20:28 geirm Exp $
作成者:
Geir Magnusson Jr.
関連項目:
直列化された形式

フィールドの概要
private  boolean exceptionSwitch
           
private  java.lang.String logString
           
private static java.lang.String NO_REFERENCE_VALUE
           
private static java.lang.String REFERENCE_VALUE
           
 
インタフェース org.apache.velocity.runtime.log.LogSystem から継承したフィールド
DEBUG_ID, DEBUG_ON, ERROR_ID, INFO_ID, WARN_ID
 
コンストラクタの概要
EventHandlingTestCase()
          Default constructor.
 
メソッドの概要
 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
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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.

メソッドの詳細

init

public void init(RuntimeServices rs)
インタフェース LogSystem の記述:
init()

定義:
インタフェース LogSystem 内の init

suite

public static junit.framework.Test suite()

runTest

public void runTest()
Runs the test.


throwException

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

例外:
java.lang.Exception

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.

定義:
インタフェース ReferenceInsertionEventHandler 内の referenceInsert
パラメータ:
reference - Reference from template about to be inserted.
value - Value about to be inserted (after its toString() method is called).
戻り値:
Object on which toString() should be called for output.

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

定義:
インタフェース NullSetEventHandler 内の shouldLogOnNullSet
パラメータ:
lhs - reference literal of left-hand-side of set statement
rhs - reference literal of right-hand-side of set statement
戻り値:
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

定義:
インタフェース MethodExceptionEventHandler 内の methodException
例外:
java.lang.Exception

logVelocityMessage

public void logVelocityMessage(int level,
                               java.lang.String message)
handler for LogSystem interface

定義:
インタフェース LogSystem 内の logVelocityMessage


Copyright © 2003 Apache Software Foundation. All Rights Reserved.