|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectorg.seasar.framework.unit.S2TestMethodRunner
public class S2TestMethodRunner
テストメソッドを扱うランナーです。
| フィールドの概要 | |
|---|---|
protected static String |
DEFAULT_S2JUNIT4_PATH
S2JUnit4のデフォルトの設定ファイルのパス |
protected Description |
description
テストのディスクリプション |
protected EasyMockSupport |
easyMockSupport
EasyMockとの対話をサポートするオブジェクト |
protected static String |
ENV_PATH
このランナーで使用する環境名設定ファイルのパス |
protected static String |
ENV_VALUE
環境名設定ファイルのパスにファイルが存在しない場合の環境名 |
protected S2TestIntrospector |
introspector
テストクラスのイントロスペクター |
protected Method |
method
テストメソッド |
protected RunNotifier |
notifier
ノティファイアー |
protected ClassLoader |
originalClassLoader
テストで使用するクラスローダーで置き換えられる前のオリジナルのクラスローダー |
protected static String |
s2junit4Path
S2JUnit4の設定ファイルのパス |
protected Object |
test
テストオブジェクト |
protected Class<?> |
testClass
テストクラス |
protected InternalTestContext |
testContext
S2JUnit4の内部的なテストコンテキスト |
protected UnitClassLoader |
unitClassLoader
テストで使用するクラスローダー |
| コンストラクタの概要 | |
|---|---|
S2TestMethodRunner(Object test,
Method method,
RunNotifier notifier,
Description description,
S2TestIntrospector introspector)
インスタンスを構築します。 |
|
| メソッドの概要 | |
|---|---|
protected void |
addFailure(Throwable e)
テストの失敗を登録します。 |
protected void |
bindField(Field field)
指定されたフィールドにコンポーネントをバインディングします。 |
protected void |
bindField(Field field,
Object object)
指定されたフィールドに指定された値をバインディングします。 |
protected void |
bindFields()
フィールドにコンポーネントをバインディングします。 |
protected S2Container |
createRootContainer()
ルートのコンテナを返します。 |
protected void |
executeMethod()
テストメソッドを実行します。 |
protected void |
executeMethodBody()
テストメソッド本体を実行します。 |
protected Class<? extends Throwable> |
expectedException()
発生すると期待されているエラーもしくは例外のクラスを返します。 |
protected boolean |
expectsException()
テストの実行で例外が発生することが期待されている場合 trueを返します。 |
protected ClassLoader |
getOriginalClassLoader()
オリジナルのクラスローダーを返します。 |
protected void |
initContainer()
コンテナを初期化します。 |
protected void |
invokeMethod(Method method)
指定されたメソッドを実行します。 |
protected boolean |
isAutoBindable(Field field)
自動フィールドバインディングが可能な場合 trueを返します。 |
protected boolean |
isFulfilled()
事前条件が満たされる場合 trueを返します。 |
protected boolean |
isIgnored()
無視の対象の場合 trueを返します。 |
protected boolean |
isUnexpected(Throwable exception)
期待していない例外もしくはエラーの場合 trueを返します。 |
protected boolean |
needsWarmDeploy()
WARM deployが必要とされる場合 trueを返します。 |
protected String |
normalizeName(String name)
コンポーネント名を正規化します。 |
protected String |
resolveComponentName(Field filed)
フィールドからコンポーネントの名前を解決します。 |
void |
run()
このランナーを起動します。 |
protected void |
runAfters()
すべてのテストケース共通の解放処理を実行します。 |
protected void |
runBefores()
すべてのテストケース共通の初期化処理を実行します。 |
protected void |
runEachAfter()
テストケース個別の解放メソッドを実行します。 |
protected void |
runEachBefore()
テストケース個別の初期化メソッドを実行します。 |
protected boolean |
runEachRecord()
テストケース個別の登録メソッド存在する場合、登録メソッドを実行し trueを返します。 |
protected void |
runMethod()
テストケースを実行します。 |
protected void |
runTest()
テストを実行します。 |
protected void |
runWithTimeout(long timeout)
タイムアウトのミリ秒を指定してテストを実行します。 |
protected void |
setUpTestContext()
テストコンテキストをセットアップします。 |
protected void |
tearDownTestContext()
テストコンテキストを解放します。 |
protected void |
unbindFields()
フィールドとコンポーネントのバインディングを解除します。 |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
|---|
protected static final String DEFAULT_S2JUNIT4_PATH
protected static final String ENV_PATH
protected static final String ENV_VALUE
protected static String s2junit4Path
protected final Object test
protected final Class<?> testClass
protected final Method method
protected final RunNotifier notifier
protected final Description description
protected final S2TestIntrospector introspector
protected ClassLoader originalClassLoader
テストで使用するクラスローダーで置き換えられる前のオリジナルのクラスローダー
protected UnitClassLoader unitClassLoader
protected InternalTestContext testContext
protected EasyMockSupport easyMockSupport
| コンストラクタの詳細 |
|---|
public S2TestMethodRunner(Object test,
Method method,
RunNotifier notifier,
Description description,
S2TestIntrospector introspector)
test - テストクラスのインスタンスmethod - テストメソッドnotifier - ノティファイアーdescription - テストのディスクリプションintrospector - テストクラスのイントロスペクター| メソッドの詳細 |
|---|
protected void addFailure(Throwable e)
e - 失敗を表すスロー可能オブジェクトpublic void run()
protected boolean isIgnored()
trueを返します。
true、そうでない場合falseprotected boolean isFulfilled()
trueを返します。
true、そうでない場合falseprotected void runWithTimeout(long timeout)
timeout - タイムアウトのミリ秒protected void runMethod()
テストの実行に必要な事前処理と事後処理を行います。
protected void setUpTestContext()
throws Throwable
Throwable - 何らかの例外またはエラーが起きた場合protected ClassLoader getOriginalClassLoader()
protected S2Container createRootContainer()
protected void tearDownTestContext()
throws Throwable
Throwable - 何らかの例外またはエラーが起きた場合
protected void runBefores()
throws org.seasar.framework.unit.S2TestMethodRunner.FailedBefore
FailedBefore - 何らかの例外またはエラーが発生した場合
org.seasar.framework.unit.S2TestMethodRunner.FailedBeforeprotected void runAfters()
protected void runEachBefore()
throws org.seasar.framework.unit.S2TestMethodRunner.FailedBefore
FailedBefore - 何らかの例外またはエラーが発生した場合
org.seasar.framework.unit.S2TestMethodRunner.FailedBeforeprotected void runEachAfter()
protected void initContainer()
protected void bindFields()
throws Throwable
Throwable - 何らかの例外またはエラーが発生した場合protected void bindField(Field field)
field - フィールド
protected void bindField(Field field,
Object object)
field - フィールドobject - 値protected boolean isAutoBindable(Field field)
trueを返します。
field - フィールド
true、そうでない場合falseprotected String resolveComponentName(Field filed)
filed - フィールド
protected String normalizeName(String name)
name - コンポーネント名
protected boolean runEachRecord()
throws Throwable
trueを返します。
true、存在しない場合false
Throwable - 何らかの例外またはエラーが発生した場合
protected void runTest()
throws Throwable
JTAが利用可能な場合、トランザクションの制御とテストデータの準備を行います。
Throwable - 何らかの例外またはエラーが発生した場合
protected void executeMethod()
throws Throwable
期待される例外またはエラーが存在するか、存在する場合その例外またはエラーがスローされたかを確認します。
Throwable - 何らかの例外またはエラーが発生した場合
protected void executeMethodBody()
throws Throwable
Throwable - 何らかの例外またはエラーが発生した場合protected boolean expectsException()
trueを返します。
true、そうでない場合falseprotected boolean isUnexpected(Throwable exception)
trueを返します。
exception - 例外もしくはエラー
true、そうでない場合falseprotected Class<? extends Throwable> expectedException()
null
protected void invokeMethod(Method method)
throws Throwable
method - メソッド
Throwable - 何らかの例外またはエラーが発生した場合protected void unbindFields()
protected boolean needsWarmDeploy()
trueを返します。
true、そうでない場合false
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||