|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
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 java.util.Map<java.lang.Class<?>,ColumnType> |
deregisteredColumnTypesByClass
ColumnTypesから登録除去されたカラムの型をクラスをキーにして管理するマップ |
protected java.util.Map<java.lang.Integer,ColumnType> |
deregisteredColumnTypesBySqlType
ColumnTypesから登録除去されたカラムの型をSQL型をキーにして管理するマップ |
protected boolean |
ejb3Enabled
EJB3を使用するかどうかを表すフラグ。 |
protected TigerAnnotationHandler |
handler
Tigerのアノテーションハンドラー |
protected boolean |
jtaEnabled
JTAを使用するかどうかを表すフラグ。 |
protected java.util.List<MockInterceptor> |
mockInterceptors
モックインターセプターのリスト |
protected NamingConvention |
namingConvention
命名規約 |
protected PreparationType |
preparationType
テストデータの準備方法 |
protected java.lang.Class<?> |
testClass
テストクラス |
protected java.lang.reflect.Method |
testMethod
テストメソッド |
protected boolean |
trimString
テストデータの文字列に含まれる空白を取り除くかどうかを表すフラグ。 |
| コンストラクタの概要 | |
|---|---|
SimpleInternalTestContext()
|
|
| メソッドの概要 | ||
|---|---|---|
void |
addAspecDef(java.lang.Object componentKey,
AspectDef aspectDef)
コンテナから componentKeyをキーにして取得できるコンポーネント定義にaspectDefで表されるアスペクト定義を追加します。 |
|
void |
addMockInterceptor(MockInterceptor mockInterceptor)
モックインターセプターを登録します。 |
|
void |
destroy()
このコンポーネントを破棄します。 |
|
void |
destroyContainer()
S2コンテナを破棄します。 |
|
|
getComponent(java.lang.Class<? extends T> componentKey)
指定されたキーに対応するコンポーネントを返します。 |
|
java.lang.Object |
getComponent(java.lang.Object componentKey)
指定されたキーに対応するコンポーネントを返します。 |
|
ComponentDef |
getComponentDef(int index)
番号で指定された位置のコンポーネント定義を返します。 |
|
ComponentDef |
getComponentDef(java.lang.Object componentKey)
指定されたキーに対応するコンポーネント定義を返します。 |
|
S2Container |
getContainer()
テストのコンテキストで利用するコンテナを返します。 |
|
DataSet |
getExpected()
テストの期待値を返します。 |
|
MockInterceptor |
getMockInterceptor(int index)
番号で指定された位置のモックインターセプタを返します。 |
|
int |
getMockInterceptorSize()
登録されたモックインターセプタの数を返します。 |
|
PreparationType |
getPreparationType()
PreparationTypeを返します。 |
|
java.lang.String |
getTestClassPackagePath()
テストクラスのパッケージをパスに変換して返します。 |
|
java.lang.String |
getTestClassShortName()
テストクラスの単純名を返します。 |
|
java.lang.String |
getTestMethodName()
テストメソッドの名称を返します。 |
|
boolean |
hasComponentDef(java.lang.Object componentKey)
指定されたキーに対応するコンポーネント定義が存在する場合 trueを返します。 |
|
void |
include()
設定ファイルをインクルードします。 |
|
void |
include(java.lang.String path)
指定された設定ファイルのパスからS2コンテナを生成し、子コンテナとしてルートのS2コンテナにインクルードします。 |
|
void |
init()
このコンポーネントを初期化します。 |
|
void |
initContainer()
S2コンテナを初期化します。 |
|
boolean |
isEjb3Enabled()
EJB3が使用可能の場合 trueを返します。 |
|
boolean |
isJtaEnabled()
JTAが使用可能の場合 trueを返します。 |
|
boolean |
isTrimString()
テストデータの文字列に含まれる空白を取り除く場合は trueを返します。 |
|
void |
prepareTestData()
テスト用のデータを準備します。 |
|
void |
register(java.lang.Class<?> componentClass)
クラスをコンポーネント定義として登録します。 |
|
void |
register(java.lang.Class<?> componentClass,
java.lang.String componentName)
指定された名前でクラスをコンポーネント定義として登録します。 |
|
void |
register(ComponentDef componentDef)
コンポーネント定義を登録します。 |
|
void |
register(java.lang.Object component)
コンポーネントを登録します。 |
|
void |
register(java.lang.Object component,
java.lang.String componentName)
指定された名前でコンポーネントを登録します。 |
|
protected void |
registerColumnType(java.lang.Class<?> clazz,
ColumnType columnType)
カラムの型を登録します。 |
|
protected void |
registerColumnType(int sqlType,
ColumnType columnType)
カラムの型を登録します。 |
|
void |
registerColumnTypes()
カラムの型をColumnTypesに登録します。 |
|
void |
revertColumnTypes()
InternalTestContext.registerColumnTypes()で登録したカラムの型を元に戻します。 |
|
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 |
setNamingConvention(NamingConvention namingConvention)
命名規約を設定します。 |
|
void |
setPreparationType(PreparationType preparationType)
PreparationTypeを設定します。 |
|
void |
setTestClass(java.lang.Class<?> testClass)
テストクラスを設定します。 |
|
void |
setTestMethod(java.lang.reflect.Method testMethod)
テストメソッドを設定します。 |
|
void |
setTrimString(boolean trimString)
テストデータの文字列に含まれる空白を取り除く場合は trueを設定します。 |
|
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
|---|
protected final TigerAnnotationHandler handler
protected final java.util.List<MockInterceptor> mockInterceptors
protected S2Container container
protected NamingConvention namingConvention
protected java.lang.Class<?> testClass
protected java.lang.reflect.Method testMethod
protected boolean autoIncluding
true
protected boolean autoPreparing
true
protected PreparationType preparationType
protected boolean trimString
true
protected boolean ejb3Enabled
false
protected boolean jtaEnabled
false
protected boolean containerInitialized
protected java.util.Map<java.lang.Class<?>,ColumnType> deregisteredColumnTypesByClass
ColumnTypesから登録除去されたカラムの型をクラスをキーにして管理するマップ
protected java.util.Map<java.lang.Integer,ColumnType> deregisteredColumnTypesBySqlType
ColumnTypesから登録除去されたカラムの型をSQL型をキーにして管理するマップ
| コンストラクタの詳細 |
|---|
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.setPreparationType(PreparationType)を使用してください。
TestContext 内の setAutoPreparingautoPreparing - 自動でテストデータを準備する場合truepublic PreparationType getPreparationType()
TestContext の記述: PreparationTypeを返します。
TestContext 内の getPreparationTypePreparationTypepublic void setPreparationType(PreparationType preparationType)
TestContext の記述: PreparationTypeを設定します。
TestContext 内の setPreparationTypepreparationType - PreparationTypepublic void setTrimString(boolean trimString)
TestContext の記述: trueを設定します。
TestContext 内の setTrimStringtrimString - テストデータの文字列に含まれる空白を取り除く場合はtruepublic boolean isTrimString()
TestContext の記述: trueを返します。
TestContext 内の isTrimStringtrue、そうでない場合は
falsepublic void setTestClass(java.lang.Class<?> testClass)
InternalTestContext の記述:
InternalTestContext 内の setTestClasstestClass - テストクラスpublic void setTestMethod(java.lang.reflect.Method testMethod)
InternalTestContext の記述:
InternalTestContext 内の setTestMethodtestMethod - テストメソッドpublic void setNamingConvention(NamingConvention namingConvention)
InternalTestContext の記述:
InternalTestContext 内の setNamingConventionnamingConvention - 命名規約
public void init()
throws java.lang.Throwable
java.lang.Throwablepublic void destroy()
public void initContainer()
InternalTestContext の記述:
InternalTestContext 内の initContainerpublic void destroyContainer()
InternalTestContext の記述:
InternalTestContext 内の destroyContainerpublic void include()
InternalTestContext の記述:
InternalTestContext 内の includepublic void include(java.lang.String path)
TestContext の記述:
TestContext 内の includepath - 設定ファイルのパス
public void register(java.lang.Class<?> componentClass,
java.lang.String componentName)
TestContext の記述:
TestContext 内の registercomponentClass - コンポーネントのクラスcomponentName - コンポーネント名public void register(java.lang.Class<?> componentClass)
TestContext の記述:
TestContext 内の registercomponentClass - コンポーネントのクラスpublic void register(ComponentDef componentDef)
TestContext の記述:
TestContext 内の registercomponentDef - コンポーネント定義
public void register(java.lang.Object component,
java.lang.String componentName)
TestContext の記述:
TestContext 内の registercomponent - コンポーネントcomponentName - コンポーネント名public void register(java.lang.Object component)
TestContext の記述:
TestContext 内の registercomponent - コンポーネントpublic java.lang.String getTestClassPackagePath()
TestContext の記述:
TestContext 内の getTestClassPackagePathpublic java.lang.String getTestClassShortName()
TestContext の記述:
TestContext 内の getTestClassShortNamepublic java.lang.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(java.lang.Class<? extends T> componentKey)
TestContext の記述:
TestContext 内の getComponentT - コンポーネントの型componentKey - コンポーネントを取得するためのキー
public java.lang.Object getComponent(java.lang.Object componentKey)
TestContext の記述:
TestContext 内の getComponentcomponentKey - コンポーネントを取得するためのキー
public boolean hasComponentDef(java.lang.Object componentKey)
TestContext の記述: trueを返します。
TestContext 内の hasComponentDefcomponentKey - コンポーネントを取得するためのキー
true、そうでない場合は
falsepublic ComponentDef getComponentDef(int index)
TestContext の記述:
TestContext 内の getComponentDefindex - 番号
public ComponentDef getComponentDef(java.lang.Object componentKey)
TestContext の記述:
TestContext 内の getComponentDefcomponentKey - コンポーネントを取得するためのキー
public void addMockInterceptor(MockInterceptor mockInterceptor)
InternalTestContext の記述:
InternalTestContext 内の addMockInterceptormockInterceptor - モックインターセプターpublic int getMockInterceptorSize()
TestContext の記述:
モックインターセプタはMockにより登録されます。
TestContext 内の getMockInterceptorSize
public void addAspecDef(java.lang.Object componentKey,
AspectDef aspectDef)
InternalTestContext の記述: componentKeyをキーにして取得できるコンポーネント定義にaspectDefで表されるアスペクト定義を追加します。
InternalTestContext 内の addAspecDefcomponentKey - コンポーネントのキーaspectDef - アスペクト定義public boolean isEjb3Enabled()
InternalTestContext の記述: trueを返します。
InternalTestContext 内の isEjb3Enabledtrue、そうでない場合falsepublic boolean isJtaEnabled()
InternalTestContext の記述: trueを返します。
InternalTestContext 内の isJtaEnabledtrue、そうでない場合falsepublic void registerColumnTypes()
InternalTestContext の記述: カラムの型をColumnTypesに登録します。
InternalTestContext 内の registerColumnTypes
protected void registerColumnType(java.lang.Class<?> clazz,
ColumnType columnType)
clazz - クラスcolumnType - カラムの型
protected void registerColumnType(int sqlType,
ColumnType columnType)
sqlType - SQL型columnType - カラムの型public void revertColumnTypes()
InternalTestContext の記述: InternalTestContext.registerColumnTypes()で登録したカラムの型を元に戻します。
InternalTestContext 内の revertColumnTypes
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||