ts.tester.coverage
クラス LineCoverage

java.lang.Object
  上位を拡張 ts.tester.coverage.Coverage
      上位を拡張 ts.tester.coverage.LineCoverage

public class LineCoverage
extends Coverage

行カバレッジの計測を実行するクラス。

バージョン:
$Revision: 1.2 $, $Date: 2007/02/16 16:12:48 $
作成者:
佐藤隆之.

入れ子のクラスの概要
 
クラス ts.tester.coverage.Coverage から継承された入れ子のクラス/インタフェース
Coverage.FilterType, Coverage.MethodKey
 
コンストラクタの概要
LineCoverage(java.lang.Class<?> execClass)
          実行クラスを引数にとるコンストラクタ。
LineCoverage(java.lang.Class<?> execClass, java.lang.String commandArgs)
          実行クラスとそのmain関数に渡されるコマンドライン引数文字列を 引数にとるコンストラクタ。
 
メソッドの概要
 java.util.Collection<java.lang.String> allClassNames()
          カバレッジの対象となる全クラスの名前のコレクションを取得する。
 java.util.Collection<java.lang.String> allSourcePaths()
          カバレッジの対象となる全ソースファイルのコレクションを取得する。
protected  void entryClass(com.sun.jdi.ReferenceType refType)
          カバレッジ計測中において、クラスの登録時に呼ばれるメソッドである。
protected  void entryLine(com.sun.jdi.Location location)
          カバレッジの準備処理において、ソースコードの各行の登録を行うために呼ばれる メソッドである。
protected  void entryMethod(com.sun.jdi.Method method)
          カバレッジ計測中において、メソッドの呼び出し時に呼ばれるメソッドである。
protected  void exitMethod(com.sun.jdi.Method method)
          カバレッジ計測中において、メソッドの終了時に呼ばれるメソッドである。
 Result<java.lang.Integer> getClassResult(java.lang.String className, Result<java.lang.Integer> parent)
          クラス名からCaseResultオブジェクトを 取得する。
 Result<java.lang.Integer> getMethodResult(Coverage.MethodKey methodKey, Result<java.lang.Integer> parent)
          指定されたメソッド・キーに対応するメソッドの CaseResultオブジェクトを取得する。
 Result<java.lang.Integer> getMethodResult(com.sun.jdi.Method method, Result<java.lang.Integer> parent)
          指定されたメソッドに対応付けられたCaseResultオブジェクトを取得する。
 PassResult<java.lang.Integer> getPassResult(java.lang.String srcPath)
          ソースファイルパスからPassResult オブジェクトを取得する。
 java.util.Collection<Coverage.MethodKey> methodKeysOf(java.lang.String className)
          カバレッジの対象となる全てのメソッドのリストを取得する。
protected  void passLine(com.sun.jdi.Location location)
          カバレッジ計測中において、ソースコードの各行を通過した際に呼ばれるメソッド である。
 
クラス ts.tester.coverage.Coverage から継承されたメソッド
addClassPath, addExclusionClassPattern, addTargetClassPattern, executeVM, handleEvent, launchVM, prepareVM, run, setClassFilterType, setErrorStream, setEventOfEntryMethodEnabled, setEventOfExitMethodEnabled, setExecClass, setObjectWriter, setOutputStream, setPrinter, setSourceBasePath, setVMOptions
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

LineCoverage

public LineCoverage(java.lang.Class<?> execClass)
実行クラスを引数にとるコンストラクタ。

パラメータ:
execClass - 実行クラス。
例外:
java.lang.AssertionError - 引数がヌルの場合(デバッグモードのみ)。

LineCoverage

public LineCoverage(java.lang.Class<?> execClass,
                    java.lang.String commandArgs)
実行クラスとそのmain関数に渡されるコマンドライン引数文字列を 引数にとるコンストラクタ。

パラメータ:
execClass - 実行クラス。
commandArgs - コマンドライン引数文字列。
例外:
java.lang.AssertionError - 引数がヌルの場合(デバッグモードのみ)。
メソッドの詳細

entryLine

protected void entryLine(com.sun.jdi.Location location)
カバレッジの準備処理において、ソースコードの各行の登録を行うために呼ばれる メソッドである。

定義:
クラス Coverage 内の entryLine
パラメータ:
location - ソースコードの行を示すオブジェクト。

getMethodResult

public Result<java.lang.Integer> getMethodResult(Coverage.MethodKey methodKey,
                                                 Result<java.lang.Integer> parent)
指定されたメソッド・キーに対応するメソッドの CaseResultオブジェクトを取得する。
対応するCaseResultオブジェクトが 登録されていない場合は、新たに登録して返す。

パラメータ:
methodKey - メソッド・キー。
parent - 親となるカバレッジ結果オブジェクト。
戻り値:
CaseResultオブジェクト。

getMethodResult

public Result<java.lang.Integer> getMethodResult(com.sun.jdi.Method method,
                                                 Result<java.lang.Integer> parent)
指定されたメソッドに対応付けられたCaseResultオブジェクトを取得する。
対応するCaseResultオブジェクトが 登録されていない場合は、新たに登録して返す。

パラメータ:
method - メソッド。
parent - 親となるカバレッジ結果オブジェクト。
戻り値:
CaseResultオブジェクト。

getClassResult

public Result<java.lang.Integer> getClassResult(java.lang.String className,
                                                Result<java.lang.Integer> parent)
クラス名からCaseResultオブジェクトを 取得する。
指定されたクラス名に対応付けられたCaseResultオブジェクトが登録されていない場合は、新たに登録して返す。

パラメータ:
className - クラス名。
parent - 親となるカバレッジ結果オブジェクト。
戻り値:
CaseResultオブジェクト。

getPassResult

public PassResult<java.lang.Integer> getPassResult(java.lang.String srcPath)
ソースファイルパスからPassResult オブジェクトを取得する。
指定されたソースファイルパスに対応付けられた PassResult オブジェクトが登録されていない場合は、新たに登録して返す。

パラメータ:
srcPath - ソースファイルパス。
戻り値:
PassResultオブジェクト。

passLine

protected void passLine(com.sun.jdi.Location location)
カバレッジ計測中において、ソースコードの各行を通過した際に呼ばれるメソッド である。

定義:
クラス Coverage 内の passLine
パラメータ:
location - ソースコードの行を示すオブジェクト。

entryClass

protected void entryClass(com.sun.jdi.ReferenceType refType)
カバレッジ計測中において、クラスの登録時に呼ばれるメソッドである。

定義:
クラス Coverage 内の entryClass
パラメータ:
refType - 登録されたクラス又はインターフェイスを示すオブジェクト。

entryMethod

protected void entryMethod(com.sun.jdi.Method method)
カバレッジ計測中において、メソッドの呼び出し時に呼ばれるメソッドである。

定義:
クラス Coverage 内の entryMethod
パラメータ:
method - メソッド。

exitMethod

protected void exitMethod(com.sun.jdi.Method method)
カバレッジ計測中において、メソッドの終了時に呼ばれるメソッドである。

定義:
クラス Coverage 内の exitMethod
パラメータ:
method - メソッド。

allSourcePaths

public java.util.Collection<java.lang.String> allSourcePaths()
カバレッジの対象となる全ソースファイルのコレクションを取得する。

定義:
クラス Coverage 内の allSourcePaths
戻り値:
ソースファイルを格納したコレクション。

allClassNames

public java.util.Collection<java.lang.String> allClassNames()
カバレッジの対象となる全クラスの名前のコレクションを取得する。

定義:
クラス Coverage 内の allClassNames
戻り値:
クラス名を格納したコレクション。

methodKeysOf

public java.util.Collection<Coverage.MethodKey> methodKeysOf(java.lang.String className)
カバレッジの対象となる全てのメソッドのリストを取得する。

定義:
クラス Coverage 内の methodKeysOf
パラメータ:
className - クラス名。
戻り値:
メソッドオブジェクトを格納するリスト。


Copyright (C) SATOH Takayuki All Rights Reserved.