org.seasar.junitcdi.core.runner
クラス CDI

java.lang.Object
  上位を拡張 org.junit.runner.Runner
      上位を拡張 org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
          上位を拡張 org.junit.runners.BlockJUnit4ClassRunner
              上位を拡張 org.seasar.junitcdi.core.runner.CDI
すべての実装されたインタフェース:
Describable, Filterable, Sortable

public class CDI
extends BlockJUnit4ClassRunner

JUnit4のテストクラスでJSR-299 CDI(Contexts and Dependency Injection)を利用するための Runnerです.

テストクラスのRunWithアノテーションでこのクラスを指定することで, CDIがブートストラップされます.

 @RunWith(CDI.class)
 public class XxxTest {
     ...
 }
 

作成者:
koichik

フィールドの概要
protected  BeanManager beanManager
          CDIコンテナ
protected  CreationalContext<?> creationalContext
          テストクラスのインスタンスを作成したコンテキスト
protected  Bean<?> testBean
          テストクラスのbean定義
protected  TestEventNotifier testEventNotifier
          テストイベントを通知するbean
 
コンストラクタの概要
CDI(Class<?> clazz)
           
 
メソッドの概要
protected static String capitalize(String s)
          文字列をキャピタライズして返します.
protected  org.junit.runners.model.Statement classBlock(RunNotifier notifier)
           
protected  Object createTest()
           
protected  List<org.junit.runners.model.FrameworkMethod> getCallbackMethods(String testMethod, org.seasar.junitcdi.core.runner.CDI.CallbackMethodType type)
          指定したテストメソッドに対応するBeforeまたはAfterメソッドを返します.
protected static boolean isCallbackMethod(org.junit.runners.model.FrameworkMethod method, String testMethod, org.seasar.junitcdi.core.runner.CDI.CallbackMethodType type)
          メソッドが指定のメソッドに対応するBeforeまたはAfterメソッドならtrueを返します.
protected static boolean isCallbackMethod(String[] targetMethods, String testMethod)
          メソッドが指定のメソッドに対応するBeforeまたはAfterメソッドならtrueを返します.
protected static boolean isCallbackMethod(String method, String testMethod, String prefix)
          メソッドが指定のメソッドに対応するBeforeまたはAfterメソッドならtrueを返します.
protected  org.junit.runners.model.Statement methodBlock(org.junit.runners.model.FrameworkMethod method)
           
protected  org.junit.runners.model.Statement methodInvoker(org.junit.runners.model.FrameworkMethod method, Object test)
           
protected  void runChild(org.junit.runners.model.FrameworkMethod method, RunNotifier runNotifier)
           
protected  org.junit.runners.model.Statement withAfters(org.junit.runners.model.FrameworkMethod method, Object target, org.junit.runners.model.Statement statement)
           
protected  org.junit.runners.model.Statement withBefores(org.junit.runners.model.FrameworkMethod method, Object target, org.junit.runners.model.Statement statement)
           
 
クラス org.junit.runners.BlockJUnit4ClassRunner から継承されたメソッド
collectInitializationErrors, computeTestMethods, describeChild, getChildren, possiblyExpectingExceptions, testName, validateInstanceMethods, validateTestMethods, validateZeroArgConstructor, withPotentialTimeout
 
クラス org.junit.runners.ParentRunner から継承されたメソッド
childrenInvoker, filter, getDescription, getName, getTestClass, run, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses
 
クラス org.junit.runner.Runner から継承されたメソッド
testCount
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
インタフェース org.junit.runner.manipulation.Filterable から継承されたメソッド
filter
 
インタフェース org.junit.runner.manipulation.Sortable から継承されたメソッド
sort
 

フィールドの詳細

beanManager

protected BeanManager beanManager
CDIコンテナ


testEventNotifier

protected TestEventNotifier testEventNotifier
テストイベントを通知するbean


testBean

protected Bean<?> testBean
テストクラスのbean定義


creationalContext

protected CreationalContext<?> creationalContext
テストクラスのインスタンスを作成したコンテキスト

コンストラクタの詳細

CDI

public CDI(Class<?> clazz)
    throws Exception
パラメータ:
clazz -
例外:
Exception
メソッドの詳細

classBlock

protected org.junit.runners.model.Statement classBlock(RunNotifier notifier)
オーバーライド:
クラス ParentRunner<org.junit.runners.model.FrameworkMethod> 内の classBlock

runChild

protected void runChild(org.junit.runners.model.FrameworkMethod method,
                        RunNotifier runNotifier)
オーバーライド:
クラス BlockJUnit4ClassRunner 内の runChild

methodBlock

protected org.junit.runners.model.Statement methodBlock(org.junit.runners.model.FrameworkMethod method)
オーバーライド:
クラス BlockJUnit4ClassRunner 内の methodBlock

createTest

protected Object createTest()
                     throws Exception
オーバーライド:
クラス BlockJUnit4ClassRunner 内の createTest
例外:
Exception

methodInvoker

protected org.junit.runners.model.Statement methodInvoker(org.junit.runners.model.FrameworkMethod method,
                                                          Object test)
オーバーライド:
クラス BlockJUnit4ClassRunner 内の methodInvoker

withBefores

protected org.junit.runners.model.Statement withBefores(org.junit.runners.model.FrameworkMethod method,
                                                        Object target,
                                                        org.junit.runners.model.Statement statement)
オーバーライド:
クラス BlockJUnit4ClassRunner 内の withBefores

withAfters

protected org.junit.runners.model.Statement withAfters(org.junit.runners.model.FrameworkMethod method,
                                                       Object target,
                                                       org.junit.runners.model.Statement statement)
オーバーライド:
クラス BlockJUnit4ClassRunner 内の withAfters

getCallbackMethods

protected List<org.junit.runners.model.FrameworkMethod> getCallbackMethods(String testMethod,
                                                                           org.seasar.junitcdi.core.runner.CDI.CallbackMethodType type)
指定したテストメソッドに対応するBeforeまたはAfterメソッドを返します.

パラメータ:
testMethod - テストメソッド
type - BeforeまたはAfter
戻り値:
テストメソッドに対応するBeforeまたはAfterメソッド

isCallbackMethod

protected static boolean isCallbackMethod(org.junit.runners.model.FrameworkMethod method,
                                          String testMethod,
                                          org.seasar.junitcdi.core.runner.CDI.CallbackMethodType type)
メソッドが指定のメソッドに対応するBeforeまたはAfterメソッドならtrueを返します.

パラメータ:
method - メソッド
testMethod - テストメソッド
type - BeforeまたはAfter
戻り値:
メソッドが指定のメソッドに対応するBeforeまたはAfterメソッドならtrue

isCallbackMethod

protected static boolean isCallbackMethod(String method,
                                          String testMethod,
                                          String prefix)
メソッドが指定のメソッドに対応するBeforeまたはAfterメソッドならtrueを返します.

パラメータ:
method - メソッド
testMethod - テストメソッド
prefix - 接頭辞
戻り値:
メソッドが指定のメソッドに対応するBeforeまたはAfterメソッドならtrue

isCallbackMethod

protected static boolean isCallbackMethod(String[] targetMethods,
                                          String testMethod)
メソッドが指定のメソッドに対応するBeforeまたはAfterメソッドならtrueを返します.

パラメータ:
targetMethods - メソッドが対称とするテストメソッド
testMethod - テストメソッド
戻り値:
メソッドが指定のメソッドに対応するBeforeまたはAfterメソッドならtrue

capitalize

protected static String capitalize(String s)
文字列をキャピタライズして返します.

パラメータ:
s - 文字列
戻り値:
キャピタライズした文字列


Copyright © 2010 The Seasar Foundation. All Rights Reserved.