|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectorg.seasar.framework.unit.impl.SimpleInternalTestContext
public class SimpleInternalTestContext
Servlet、JTA、EJB3のAPIに依存せずにS2JUnit4を実行可能にするシンプルなテストコンテキストです。
| フィールドの概要 | |
|---|---|
protected boolean |
autoIncluding
自動インクルードをするかどうかを表すフラグ。 |
protected boolean |
autoPreparing
テストデータを自動準備するかどうかを表すフラグ。 |
protected S2Container |
container
ルートのS2コンテナ |
protected boolean |
containerInitialized
S2コンテナが初期化されたかどうかを表すフラグ |
protected boolean |
ejb3Enabled
EJB3を使用するかどうかを表すフラグ。 |
protected TigerAnnotationHandler |
handler
Tigerのアノテーションハンドラー |
protected boolean |
jtaEnabled
JTAを使用するかどうかを表すフラグ。 |
protected List<MockInterceptor> |
mockInterceptors
モックインターセプターのリスト |
protected NamingConvention |
namingConvention
命名規約 |
protected Class<?> |
testClass
テストクラス |
protected Method |
testMethod
テストメソッド |
| コンストラクタの概要 | |
|---|---|
SimpleInternalTestContext()
|
|
| メソッドの概要 | ||
|---|---|---|
void |
addAspecDef(Object componentKey,
AspectDef aspectDef)
コンテナから componentKeyをキーにして取得できるコンポーネント定義にaspectDefで表されるアスペクト定義を追加します。 |
|
void |
addMockInterceptor(MockInterceptor mockInterceptor)
モックインターセプターを登録します。 |
|
void |
destroy()
このコンポーネントを破棄します。 |
|
void |
destroyContainer()
S2コンテナを破棄します。 |
|
|
getComponent(Class<? extends T> componentKey)
指定されたキーに対応するコンポーネントを返します。 |
|
Object |
getComponent(Object componentKey)
指定されたキーに対応するコンポーネントを返します。 |
|
ComponentDef |
getComponentDef(int index)
番号で指定された位置のコンポーネント定義を返します。 |
|
ComponentDef |
getComponentDef(Object componentKey)
指定されたキーに対応するコンポーネント定義を返します。 |
|
S2Container |
getContainer()
テストのコンテキストで利用するコンテナを返します。 |
|
DataSet |
getExpected()
テストの期待値を返します。 |
|
MockInterceptor |
getMockInterceptor(int index)
番号で指定された位置のモックインターセプタを返します。 |
|
int |
getMockInterceptorSize()
登録されたモックインターセプタの数を返します。 |
|
String |
getTestClassPackagePath()
テストクラスのパッケージをパスに変換して返します。 |
|
String |
getTestClassShortName()
テストクラスの単純名を返します。 |
|
String |
getTestMethodName()
テストメソッドの名称を返します。 |
|
boolean |
hasComponentDef(Object componentKey)
指定されたキーに対応するコンポーネント定義が存在する場合 trueを返します。 |
|
void |
include()
設定ファイルをインクルードします。 |
|
void |
include(String path)
指定された設定ファイルのパスからS2コンテナを生成し、子コンテナとしてルートのS2コンテナにインクルードします。 |
|
void |
init()
このコンポーネントを初期化します。 |
|
void |
initContainer()
S2コンテナを初期化します。 |
|
boolean |
isEjb3Enabled()
EJB3が使用可能の場合 trueを返します。 |
|
boolean |
isJtaEnabled()
JTAが使用可能の場合 trueを返します。 |
|
void |
prepareTestData()
テスト用のデータを準備します。 |
|
void |
register(Class<?> componentClass)
クラスをコンポーネント定義として登録します。 |
|
void |
register(Class<?> componentClass,
String componentName)
指定された名前でクラスをコンポーネント定義として登録します。 |
|
void |
register(ComponentDef componentDef)
コンポーネント定義を登録します。 |
|
void |
register(Object component)
コンポーネントを登録します。 |
|
void |
register(Object component,
String componentName)
指定された名前でコンポーネントを登録します。 |
|
void |
setAutoIncluding(boolean autoIncluding)
このコンテキストの初期化時に特定のS2コンテナを子コンテナとしてインクルードする場合は trueを指定します。 |
|
void |
setAutoPreparing(boolean autoPreparing)
テストの実行前にテストデータを事前に準備する場合は trueを指定します。 |
|
void |
setContainer(S2Container container)
S2コンテナを設定します。 |
|
void |
setEjb3Enabled(boolean ejb3Enabled)
EJB3を使用する場合 trueを設定します。 |
|
void |
setJtaEnabled(boolean jtaEnabled)
JTAを使用する場合 trueを設定します。 |
|
void |
setTestClass(Class<?> testClass)
テストクラスを設定します。 |
|
void |
setTestMethod(Method testMethod)
テストメソッドを設定します。 |
|
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
|---|
protected final TigerAnnotationHandler handler
protected final List<MockInterceptor> mockInterceptors
protected S2Container container
protected NamingConvention namingConvention
protected Class<?> testClass
protected Method testMethod
protected boolean autoIncluding
true
protected boolean autoPreparing
true
protected boolean ejb3Enabled
false
protected boolean jtaEnabled
false
protected boolean containerInitialized
| コンストラクタの詳細 |
|---|
public SimpleInternalTestContext()
| メソッドの詳細 |
|---|
public void setContainer(S2Container container)
container - S2コンテナpublic void setEjb3Enabled(boolean ejb3Enabled)
trueを設定します。
ejb3Enabled - EJB3を使用する場合true、使用しない場合falsepublic void setJtaEnabled(boolean jtaEnabled)
trueを設定します。
jtaEnabled - JTAを使用する場合true、使用しない場合falsepublic void setAutoIncluding(boolean autoIncluding)
TestContext の記述: trueを指定します。
TestContext 内の setAutoIncludingautoIncluding - 自動インクルードをする場合truepublic void setAutoPreparing(boolean autoPreparing)
TestContext の記述: trueを指定します。
TestContext 内の setAutoPreparingautoPreparing - 自動でテストデータを準備する場合truepublic void setTestClass(Class<?> testClass)
InternalTestContext の記述:
InternalTestContext 内の setTestClasstestClass - テストクラスpublic void setTestMethod(Method testMethod)
InternalTestContext の記述:
InternalTestContext 内の setTestMethodtestMethod - テストメソッド
public void init()
throws Throwable
Throwablepublic void destroy()
public void initContainer()
InternalTestContext の記述:
InternalTestContext 内の initContainerpublic void destroyContainer()
InternalTestContext の記述:
InternalTestContext 内の destroyContainerpublic void include()
InternalTestContext の記述:
InternalTestContext 内の includepublic void include(String path)
TestContext の記述:
TestContext 内の includepath - 設定ファイルのパス
public void register(Class<?> componentClass,
String componentName)
TestContext の記述:
TestContext 内の registercomponentClass - コンポーネントのクラスcomponentName - コンポーネント名public void register(Class<?> componentClass)
TestContext の記述:
TestContext 内の registercomponentClass - コンポーネントのクラスpublic void register(ComponentDef componentDef)
TestContext の記述:
TestContext 内の registercomponentDef - コンポーネント定義
public void register(Object component,
String componentName)
TestContext の記述:
TestContext 内の registercomponent - コンポーネントcomponentName - コンポーネント名public void register(Object component)
TestContext の記述:
TestContext 内の registercomponent - コンポーネントpublic String getTestClassPackagePath()
TestContext の記述:
TestContext 内の getTestClassPackagePathpublic String getTestClassShortName()
TestContext の記述:
TestContext 内の getTestClassShortNamepublic String getTestMethodName()
TestContext の記述:
TestContext 内の getTestMethodNamepublic void prepareTestData()
InternalTestContext の記述:
InternalTestContext 内の prepareTestDatapublic DataSet getExpected()
TestContext の記述:
TestContext 内の getExpectednullpublic MockInterceptor getMockInterceptor(int index)
TestContext の記述:
モックインターセプタはMockにより登録されます。
番号は0から始まります。
TestContext 内の getMockInterceptorindex - 番号
public S2Container getContainer()
InternalTestContext の記述:
InternalTestContext 内の getContainerpublic <T> T getComponent(Class<? extends T> componentKey)
TestContext の記述:
TestContext 内の getComponentT - コンポーネントの型componentKey - コンポーネントを取得するためのキー
public Object getComponent(Object componentKey)
TestContext の記述:
TestContext 内の getComponentcomponentKey - コンポーネントを取得するためのキー
public boolean hasComponentDef(Object componentKey)
TestContext の記述: trueを返します。
TestContext 内の hasComponentDefcomponentKey - コンポーネントを取得するためのキー
true、そうでない場合はfalsepublic ComponentDef getComponentDef(int index)
TestContext の記述:
TestContext 内の getComponentDefindex - 番号
public ComponentDef getComponentDef(Object componentKey)
TestContext の記述:
TestContext 内の getComponentDefcomponentKey - コンポーネントを取得するためのキー
public void addMockInterceptor(MockInterceptor mockInterceptor)
InternalTestContext の記述:
InternalTestContext 内の addMockInterceptormockInterceptor - モックインターセプターpublic int getMockInterceptorSize()
TestContext の記述:
モックインターセプタはMockにより登録されます。
TestContext 内の getMockInterceptorSize
public void addAspecDef(Object componentKey,
AspectDef aspectDef)
InternalTestContext の記述: componentKeyをキーにして取得できるコンポーネント定義にaspectDefで表されるアスペクト定義を追加します。
InternalTestContext 内の addAspecDefcomponentKey - コンポーネントのキーaspectDef - アスペクト定義public boolean isEjb3Enabled()
InternalTestContext の記述: trueを返します。
InternalTestContext 内の isEjb3Enabledtrue、そうでない場合falsepublic boolean isJtaEnabled()
InternalTestContext の記述: trueを返します。
InternalTestContext 内の isJtaEnabledtrue、そうでない場合false
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||