|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectorg.seasar.framework.unit.impl.AnnotationTestIntrospector
org.seasar.framework.unit.impl.ConventionTestIntrospector
public class ConventionTestIntrospector
命名規約を解釈してテストクラスを分析するイントロスペクターです。
| フィールドの概要 | |
|---|---|
protected String |
afterClassMethodName
テストクラスの解放メソッドの名前 |
protected String |
afterMethodName
全テストケースの解放メソッドを名前 |
protected String |
beforeClassMethodName
テストクラスの初期化メソッドの名前 |
protected String |
beforeMethodName
全テストケースの初期化メソッドの名前 |
protected Set<Class<? extends Annotation>> |
nonTestAnnotations
テストメソッドとして解釈すべきでないメソッドに付与されるアノテーションのセット |
protected Set<Pattern> |
nonTestMethodNamePatterns
テストメソッドとして解釈すべきでないメソッド名の正規表現 |
protected String |
recordMethodName
テストケース個別にモックの振る舞いを記録するメソッドの名前のプレフィックス |
| クラス org.seasar.framework.unit.impl.AnnotationTestIntrospector から継承されたフィールド |
|---|
afterAnnotation, afterClassAnnotation, beforeAnnotation, beforeClassAnnotation, enableIgnore, enablePrerequisite |
| コンストラクタの概要 | |
|---|---|
ConventionTestIntrospector()
|
|
| メソッドの概要 | |
|---|---|
void |
addNonTestAnnotation(Class<? extends Annotation> annotation)
テストメソッドと解釈すべきでないメソッドに付与するアノテーションを登録します。 |
void |
addNonTestMethodNamePattern(String pattern)
テストメソッドとして解釈すべきでないメソッド名の正規表現を登録します。 |
List<Method> |
getAfterClassMethods(Class<?> clazz)
テストクラスの解放メソッドのリストを返します。 |
List<Method> |
getAfterMethods(Class<?> clazz)
すべてのテストケース共通の解放メソッドのリストを返します。 |
List<Method> |
getBeforeClassMethods(Class<?> clazz)
テストクラスの初期化メソッドのリストを返します。 |
List<Method> |
getBeforeMethods(Class<?> clazz)
すべてのテストケース共通の初期化メソッドのリストを返します。 |
Method |
getEachAfterMethod(Class<?> clazz,
Method method)
テストケース個別の解放メソッドを返します。 |
Method |
getEachBeforeMethod(Class<?> clazz,
Method method)
テストケース個別の初期化メソッドを返します。 |
Method |
getEachRecordMethod(Class<?> clazz,
Method method)
テストケース個別の記録メソッドを返します。 |
protected Method |
getMethod(Class<?> clazz,
String methodName)
指定されたクラスを基点にスーパークラスを辿り指定されたメソッドを返します。 |
protected List<Class<?>> |
getSuperClasses(Class<?> clazz)
スーパークラスのリストを返します。 |
List<Method> |
getTestMethods(Class<?> clazz)
指定されたテストクラス内のすべてのテストメソッドを返します。 |
protected boolean |
hasNonTestAnnotation(Method method)
指定されたメソッドにテストメソッドとして解釈すべきでないアノテーションが付与されている場合 true |
protected boolean |
hasNonTestMethodName(Method method)
指定されたメソッドの名前がテストメソッドとして解釈すべきでない名前の場合 trueを返します。 |
protected boolean |
hasValidNonStaticSignature(Method method)
メソッドが非staticかつ適切なシグネチャを持つ場合 trueを返します。 |
protected boolean |
hasValidSignature(Method method)
メソッドが適切なシグネチャを持つ場合 trueを返します。 |
protected boolean |
hasValidStaticSignature(Method method)
メソッドがstaticかつ適切なシグネチャを持つ場合 trueを返します。 |
void |
init()
初期化メソッド |
protected boolean |
isShadowed(Method method,
List<Method> results)
methodがresult内のメソッドに隠蔽されるならばtrueを返します。 |
protected boolean |
isShadowed(Method current,
Method previous)
currentがpreviousに隠蔽される場合trueを返します。 |
protected boolean |
isTestMethod(Method method)
指定されたメソッドがテストメソッドの場合 trueを返します。 |
void |
setAfterClassMethodName(String afterClassMethodName)
テストクラスの解放メソッドの名前を設定します。 |
void |
setAfterMethodName(String afterMethodName)
全テストケースの解放メソッドの名前を設定します。 |
void |
setBeforeClassMethodName(String beforeClassMethodName)
テストクラスの初期化メソッドの名前を設定します。 |
void |
setBeforeMethodName(String beforeMethodName)
全テストケースの初期化メソッドの名前を設定します。 |
void |
setRecordMethodName(String recordMethodName)
テストケース個別にモックの振る舞いを記録するメソッドの名前のプレフィックスを設定します。 |
| クラス org.seasar.framework.unit.impl.AnnotationTestIntrospector から継承されたメソッド |
|---|
createExpression, createMock, createMock, expectedException, getRootDicon, getTimeout, getTxBehaviorType, isFulfilled, isFulfilled, isIgnored, needsTransaction, needsWarmDeploy, requiresTransactionCommitment, setAfterAnnotation, setAfterClassAnnotation, setBeforeAnnotation, setBeforeClassAnnotation, setEnableIgnore, setEnablePrerequisite |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
|---|
protected final Set<Class<? extends Annotation>> nonTestAnnotations
protected final Set<Pattern> nonTestMethodNamePatterns
protected String beforeClassMethodName
protected String afterClassMethodName
protected String beforeMethodName
protected String afterMethodName
protected String recordMethodName
| コンストラクタの詳細 |
|---|
public ConventionTestIntrospector()
| メソッドの詳細 |
|---|
public void init()
public void setBeforeClassMethodName(String beforeClassMethodName)
beforeClassMethodName - 初期化メソッドの名前public void setAfterClassMethodName(String afterClassMethodName)
afterClassMethodName - 解放メソッドの名前public void setBeforeMethodName(String beforeMethodName)
beforeMethodName - 初期化メソッドの名前public void setAfterMethodName(String afterMethodName)
afterMethodName - 解放メソッドの名前public void setRecordMethodName(String recordMethodName)
recordMethodName - 記録メソッド名のプレフィックスpublic void addNonTestAnnotation(Class<? extends Annotation> annotation)
annotation - テストメソッドと解釈すべきでないメソッドに付与するアノテーションpublic void addNonTestMethodNamePattern(String pattern)
pattern - テストメソッドとして解釈すべきでないメソッド名の正規表現public List<Method> getBeforeClassMethods(Class<?> clazz)
S2TestIntrospector の記述:
S2TestIntrospector 内の getBeforeClassMethodsAnnotationTestIntrospector 内の getBeforeClassMethodsclazz - テストクラス
public List<Method> getAfterClassMethods(Class<?> clazz)
S2TestIntrospector の記述:
S2TestIntrospector 内の getAfterClassMethodsAnnotationTestIntrospector 内の getAfterClassMethodsclazz - テストクラス
public List<Method> getBeforeMethods(Class<?> clazz)
S2TestIntrospector の記述:
S2TestIntrospector 内の getBeforeMethodsAnnotationTestIntrospector 内の getBeforeMethodsclazz - テストクラス
public List<Method> getAfterMethods(Class<?> clazz)
S2TestIntrospector の記述:
S2TestIntrospector 内の getAfterMethodsAnnotationTestIntrospector 内の getAfterMethodsclazz - テストクラス
public Method getEachBeforeMethod(Class<?> clazz,
Method method)
S2TestIntrospector の記述:
S2TestIntrospector 内の getEachBeforeMethodAnnotationTestIntrospector 内の getEachBeforeMethodclazz - テストクラスmethod - テストメソッド
public Method getEachAfterMethod(Class<?> clazz,
Method method)
S2TestIntrospector の記述:
S2TestIntrospector 内の getEachAfterMethodAnnotationTestIntrospector 内の getEachAfterMethodclazz - テストクラスmethod - テストメソッド
public Method getEachRecordMethod(Class<?> clazz,
Method method)
S2TestIntrospector の記述: 記録メソッドはEasyMockを利用して作成されたモックの振る舞いを記録するメソッドです。
S2TestIntrospector 内の getEachRecordMethodAnnotationTestIntrospector 内の getEachRecordMethodclazz - テストクラスmethod - テストメソッド
public List<Method> getTestMethods(Class<?> clazz)
S2TestIntrospector の記述:
S2TestIntrospector 内の getTestMethodsAnnotationTestIntrospector 内の getTestMethodsclazz - テストクラス
protected List<Class<?>> getSuperClasses(Class<?> clazz)
clazz - 基点となるクラス
protected boolean isShadowed(Method method,
List<Method> results)
methodがresult内のメソッドに隠蔽されるならばtrueを返します。
method - 検査の対象のメソッドresults - 隠蔽されていないメソッドのリスト
result内のメソッドにmethodが隠蔽される場合true、そうでない場合false
protected boolean isShadowed(Method current,
Method previous)
currentがpreviousに隠蔽される場合trueを返します。
current - 検査の対象のメソッドprevious - 隠蔽されていないメソッド
currentがpreviousに隠蔽される場合true、そうでない場合falseprotected boolean isTestMethod(Method method)
trueを返します。
method - メソッド
true、そうでない場合falseprotected boolean hasNonTestAnnotation(Method method)
true
method - メソッド
true、そうでない場合falseprotected boolean hasNonTestMethodName(Method method)
trueを返します。
method - メソッド
true、そうでない場合falseprotected boolean hasValidStaticSignature(Method method)
trueを返します。
method -
true、そうでない場合falseprotected boolean hasValidNonStaticSignature(Method method)
trueを返します。
method - メソッド
true、そうでない場合falseprotected boolean hasValidSignature(Method method)
trueを返します。
適切なシグネチャをもつメソッドとは以下の条件を満たしているシグネチャを意味します。
method - メソッド
true、そうでない場合false
protected Method getMethod(Class<?> clazz,
String methodName)
clazz - 基点となるクラスmethodName - メソッド名
null
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||