org.seasar.framework.unit.impl
クラス InternalTestContextImpl

java.lang.Object
  上位を拡張 org.seasar.framework.unit.impl.InternalTestContextImpl
すべての実装されたインタフェース:
InternalTestContext, TestContext

public class InternalTestContextImpl
extends Object
implements InternalTestContext

作成者:
taedium

フィールドの概要
protected  boolean autoIncluding
           
protected  boolean autoPreparing
           
protected  S2Container container
           
protected  boolean containerInitialized
           
protected  TigerAnnotationHandler handler
           
protected  List<MockInterceptor> mockInterceptors
           
protected  NamingConvention namingConvention
           
protected  MockHttpServletRequest request
           
protected  MockHttpServletResponse response
           
protected  Servlet servlet
           
protected  MockServletConfig servletConfig
           
protected  MockServletContext servletContext
           
protected  Class<?> testClass
           
protected  Method testMethod
           
 
コンストラクタの概要
InternalTestContextImpl()
           
 
メソッドの概要
 void addAspecDef(Object componentKey, AspectDef aspectDef)
           
 void addMockInterceptor(MockInterceptor mockInterceptor)
           
protected  void assertContainerNotInitialized()
           
 void destroy()
           
 void destroyContainer()
           
<T> T
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()
           
 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)
           
 void setServletContext(MockServletContext servletContext)
           
 void setTestClass(Class<?> testClass)
           
 void setTestMethod(Method testMethod)
           
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

handler

protected final TigerAnnotationHandler handler

mockInterceptors

protected final List<MockInterceptor> mockInterceptors

container

protected S2Container container

servletContext

protected MockServletContext servletContext

servlet

protected Servlet servlet

servletConfig

protected MockServletConfig servletConfig

request

protected MockHttpServletRequest request

response

protected MockHttpServletResponse response

namingConvention

protected NamingConvention namingConvention

testClass

protected Class<?> testClass

testMethod

protected Method testMethod

autoIncluding

protected boolean autoIncluding

autoPreparing

protected boolean autoPreparing

containerInitialized

protected boolean containerInitialized
コンストラクタの詳細

InternalTestContextImpl

public InternalTestContextImpl()
メソッドの詳細

setContainer

public void setContainer(S2Container container)

setServletContext

public void setServletContext(MockServletContext servletContext)

setAutoIncluding

public void setAutoIncluding(boolean autoIncluding)
インタフェース TestContext の記述:
このコンテキストの初期化時に特定のS2コンテナを子コンテナとしてインクルードする場合はtrueを指定します。

定義:
インタフェース TestContext 内の setAutoIncluding
パラメータ:
autoIncluding - 自動インクルードをする場合true

setAutoPreparing

public void setAutoPreparing(boolean autoPreparing)
インタフェース TestContext の記述:
テストの実行前にテストデータを事前に準備する場合はtrueを指定します。

定義:
インタフェース TestContext 内の setAutoPreparing
パラメータ:
autoPreparing - 自動でテストデータを準備する場合true

setTestClass

public void setTestClass(Class<?> testClass)
定義:
インタフェース InternalTestContext 内の setTestClass

setTestMethod

public void setTestMethod(Method testMethod)
定義:
インタフェース InternalTestContext 内の setTestMethod

init

public void init()
          throws Throwable
例外:
Throwable

destroy

public void destroy()

initContainer

public void initContainer()
定義:
インタフェース InternalTestContext 内の initContainer

destroyContainer

public void destroyContainer()
定義:
インタフェース InternalTestContext 内の destroyContainer

include

public void include()
定義:
インタフェース InternalTestContext 内の include

include

public void include(String path)
インタフェース TestContext の記述:
指定された設定ファイルのパスからS2コンテナを生成し、子コンテナとしてルートのS2コンテナにインクルードします。

定義:
インタフェース TestContext 内の include
パラメータ:
path - 設定ファイルのパス

register

public void register(Class<?> componentClass,
                     String componentName)
インタフェース TestContext の記述:
指定された名前でクラスをコンポーネント定義として登録します。

定義:
インタフェース TestContext 内の register
パラメータ:
componentClass - コンポーネントのクラス
componentName - コンポーネント名

register

public void register(Class<?> componentClass)
インタフェース TestContext の記述:
クラスをコンポーネント定義として登録します。

定義:
インタフェース TestContext 内の register
パラメータ:
componentClass - コンポーネントのクラス

register

public void register(ComponentDef componentDef)
インタフェース TestContext の記述:
コンポーネント定義を登録します。

定義:
インタフェース TestContext 内の register
パラメータ:
componentDef - コンポーネント定義

register

public void register(Object component,
                     String componentName)
インタフェース TestContext の記述:
指定された名前でコンポーネントを登録します。

定義:
インタフェース TestContext 内の register
パラメータ:
component - コンポーネント
componentName - コンポーネント名

register

public void register(Object component)
インタフェース TestContext の記述:
コンポーネントを登録します。

定義:
インタフェース TestContext 内の register
パラメータ:
component - コンポーネント

getTestClassPackagePath

public String getTestClassPackagePath()
インタフェース TestContext の記述:
テストクラスのパッケージをパスに変換して返します。

定義:
インタフェース TestContext 内の getTestClassPackagePath
戻り値:
テストクラスのパッケージを表すパス

getTestClassShortName

public String getTestClassShortName()
インタフェース TestContext の記述:
テストクラスの単純名を返します。

定義:
インタフェース TestContext 内の getTestClassShortName
戻り値:
テストクラスの単純名

getTestMethodName

public String getTestMethodName()
インタフェース TestContext の記述:
テストメソッドの名称を返します。

定義:
インタフェース TestContext 内の getTestMethodName
戻り値:
テストメソッドの名称

prepareTestData

public void prepareTestData()
定義:
インタフェース InternalTestContext 内の prepareTestData

getExpected

public DataSet getExpected()
インタフェース TestContext の記述:
テストの期待値を返します。

定義:
インタフェース TestContext 内の getExpected
戻り値:
期待値が存在すればその値、存在しなければnull

getMockInterceptor

public MockInterceptor getMockInterceptor(int index)
インタフェース TestContext の記述:
番号で指定された位置のモックインターセプタを返します。

モックインターセプタはMockにより登録されます。 番号は0から始まります。

定義:
インタフェース TestContext 内の getMockInterceptor
パラメータ:
index - 番号
戻り値:
モックインターセプタ

getContainer

public S2Container getContainer()
定義:
インタフェース InternalTestContext 内の getContainer

getComponent

public <T> T getComponent(Class<? extends T> componentKey)
インタフェース TestContext の記述:
指定されたキーに対応するコンポーネントを返します。

定義:
インタフェース TestContext 内の getComponent
型パラメータ:
T - コンポーネントの型
パラメータ:
componentKey - コンポーネントを取得するためのキー
戻り値:
コンポーネント

getComponent

public Object getComponent(Object componentKey)
インタフェース TestContext の記述:
指定されたキーに対応するコンポーネントを返します。

定義:
インタフェース TestContext 内の getComponent
パラメータ:
componentKey - コンポーネントを取得するためのキー
戻り値:
コンポーネント

hasComponentDef

public boolean hasComponentDef(Object componentKey)
インタフェース TestContext の記述:
指定されたキーに対応するコンポーネント定義が存在する場合trueを返します。

定義:
インタフェース TestContext 内の hasComponentDef
パラメータ:
componentKey - コンポーネントを取得するためのキー
戻り値:
キーに対応するコンポーネント定義が存在する場合true、そうでない場合はfalse

getComponentDef

public ComponentDef getComponentDef(int index)
インタフェース TestContext の記述:
番号で指定された位置のコンポーネント定義を返します。

定義:
インタフェース TestContext 内の getComponentDef
パラメータ:
index - 番号
戻り値:
コンポーネント定義

getComponentDef

public ComponentDef getComponentDef(Object componentKey)
インタフェース TestContext の記述:
指定されたキーに対応するコンポーネント定義を返します。

定義:
インタフェース TestContext 内の getComponentDef
パラメータ:
componentKey - コンポーネントを取得するためのキー
戻り値:
コンポーネント定義

addMockInterceptor

public void addMockInterceptor(MockInterceptor mockInterceptor)
定義:
インタフェース InternalTestContext 内の addMockInterceptor

getMockInterceptorSize

public int getMockInterceptorSize()
インタフェース TestContext の記述:
登録されたモックインターセプタの数を返します。

モックインターセプタはMockにより登録されます。

定義:
インタフェース TestContext 内の getMockInterceptorSize
戻り値:
モックインターセプタ

addAspecDef

public void addAspecDef(Object componentKey,
                        AspectDef aspectDef)
定義:
インタフェース InternalTestContext 内の addAspecDef

assertContainerNotInitialized

protected void assertContainerNotInitialized()


Copyright © 2005-2007 The Seasar Foundation. All Rights Reserved.