Package nablarch.test.core.entity
Class NablarchValidationTestStrategy
java.lang.Object
nablarch.test.core.entity.NablarchValidationTestStrategy
- All Implemented Interfaces:
- ValidationTestStrategy
Nablarch Validationを使用するときの
ValidationTestStrategy実装クラス。- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionnablarch.core.message.MessagecreateExpectedMessage(nablarch.core.message.MessageLevel level, String messageString, Object[] options) メッセージ比較用のMessageを生成する。nablarch.core.message.MessagecreateExpectedValidationResultMessage(String propertyName, String messageString, Object[] options) メッセージ比較用のValidationResultMessageを生成する。Class<?>getGroupFromName(String groupKey) Bean Validationのグループを取得する。invokeValidation(Class<?> entityClass, String targetPropertyName, String[] paramValues, Class<?> notUse) 単一のプロパティについて、バリデーションを実行する。validateParameters(String prefix, Class<?> entityClass, Map<String, String[]> params, String validateFor, Class<?> notUse) 入力全体のバリデーションを実行する。
- 
Constructor Details- 
NablarchValidationTestStrategypublic NablarchValidationTestStrategy()
 
- 
- 
Method Details- 
invokeValidationpublic ValidationTestContext invokeValidation(Class<?> entityClass, String targetPropertyName, String[] paramValues, Class<?> notUse) Description copied from interface:ValidationTestStrategy単一のプロパティについて、バリデーションを実行する。- Specified by:
- invokeValidationin interface- ValidationTestStrategy
- Parameters:
- entityClass- テスト対象対象クラス名
- targetPropertyName- バリデーション対象プロパティ名
- paramValues- パラメータとして使用する値
- notUse- Bean Validationのグループ(Bean Validationを使用するときのみ有効)
- Returns:
- テスト用バリデーションコンテキスト
 
- 
validateParameterspublic ValidationTestContext validateParameters(String prefix, Class<?> entityClass, Map<String, String[]> params, String validateFor, Class<?> notUse) Description copied from interface:ValidationTestStrategy入力全体のバリデーションを実行する。- Specified by:
- validateParametersin interface- ValidationTestStrategy
- Parameters:
- prefix- 入力値のマップに入ったキーのプレフィクス
- entityClass- テスト対象対象クラス名
- params- 入力値を表すマップ
- validateFor- バリデーション対象メソッド名
- notUse- Bean Validationのグループ(Bean Validationを使用するときのみ有効)
- Returns:
- テスト用バリデーションコンテキスト
 
- 
getGroupFromNameBean Validationのグループを取得する。 Nablarch Validationではグループを使用しないため、常にnullを返却する。- Specified by:
- getGroupFromNamein interface- ValidationTestStrategy
- Parameters:
- groupKey- グループ名
- Returns:
- Bean Validationのグループ
 
- 
createExpectedValidationResultMessagepublic nablarch.core.message.Message createExpectedValidationResultMessage(String propertyName, String messageString, Object[] options) Description copied from interface:ValidationTestStrategyメッセージ比較用のValidationResultMessageを生成する。- Specified by:
- createExpectedValidationResultMessagein interface- ValidationTestStrategy
- Parameters:
- propertyName- プロパティ名
- messageString- メッセージを特定する文字列
- options- オプションパラメータ
- Returns:
- ValidationResultMessage
 
- 
createExpectedMessagepublic nablarch.core.message.Message createExpectedMessage(nablarch.core.message.MessageLevel level, String messageString, Object[] options) Description copied from interface:ValidationTestStrategyメッセージ比較用のMessageを生成する。- Specified by:
- createExpectedMessagein interface- ValidationTestStrategy
- Parameters:
- level- メッセージレベル
- messageString- メッセージを特定する文字列
- options- オプションパラメータ
- Returns:
- Message
 
 
-