クラス JobRepositoryTestUtils
java.lang.ObjectSE
org.springframework.batch.test.JobRepositoryTestUtils
データベースから
JobExecution インスタンスを作成および削除するための便利なクラス。テストケースでの一般的な使用箇所は、トランザクションの前にインスタンスを作成し、結果を保存し、それを使用してトランザクション後に削除することです。- 作成者:
- Dave Syer, Mahmoud Ben Hassine, Yanming Zhou
コンストラクターの概要
コンストラクターコンストラクター説明デフォルトコンストラクター。JobRepositoryTestUtils(JobRepository jobRepository) すべての必須プロパティを含むJobRepositoryTestUtilsを作成します。方法の概要
修飾子と型メソッド説明createJobExecutions(int count) JobRepositoryを使用して、それぞれがシングルステップ実行のJobExecutionインスタンスをいくつか作成します。createJobExecutions(StringSE jobName, StringSE[] stepNames, int count) JobRepositoryを使用して、それぞれが指定されたジョブ名を持ち、それぞれが指定されたステップ名でステップ実行を持ついくつかのJobExecutionインスタンスを作成します。voidremoveJobExecution(JobExecution jobExecution) voidすべてのJobExecutionインスタンス、および関連するすべてのJobInstanceおよびStepExecutionインスタンスを、Spring Batch によって使用される標準の場所から削除します。voidremoveJobExecutions(CollectionSE<JobExecution> jobExecutions) Spring Batch によって使用される標準の場所から、JobExecutionインスタンス、および関連するすべてのJobInstanceおよびStepExecutionインスタンスを削除します。voidsetJobParametersIncrementer(JobParametersIncrementer jobParametersIncrementer) voidsetJobRepository(JobRepository jobRepository)
コンストラクターの詳細
JobRepositoryTestUtils
public JobRepositoryTestUtils()デフォルトコンストラクター。JobRepositoryTestUtils
すべての必須プロパティを含むJobRepositoryTestUtilsを作成します。- パラメーター:
jobRepository-JobRepository。
メソッドの詳細
setJobParametersIncrementer
- パラメーター:
jobParametersIncrementer- 設定する jobParametersIncrementer
setJobRepository
- パラメーター:
jobRepository- 設定する jobRepository
createJobExecutions
public ListSE<JobExecution> createJobExecutions(StringSE jobName, StringSE[] stepNames, int count) throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException JobRepositoryを使用して、それぞれが指定されたジョブ名を持ち、それぞれが指定されたステップ名でステップ実行を持ついくつかのJobExecutionインスタンスを作成します。- パラメーター:
jobName- ジョブの名前stepNames- ステップ実行の名前count- 作成するJobExecutionのインスタンスの必要数- 戻り値:
JobExecutionのコレクション- 例外:
JobExecutionAlreadyRunningException- ジョブがすでに実行されている場合にスローされます。JobRestartException- ジョブが再起動可能でない場合にスローされます。JobInstanceAlreadyCompleteException- ジョブインスタンスがすでに完了している場合にスローされます。
createJobExecutions
public ListSE<JobExecution> createJobExecutions(int count) throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException JobRepositoryを使用して、それぞれがシングルステップ実行のJobExecutionインスタンスをいくつか作成します。- パラメーター:
count- 作成するJobExecutionのインスタンスの必要数- 戻り値:
JobExecutionのコレクション- 例外:
JobExecutionAlreadyRunningException- ジョブがすでに実行されている場合にスローされます。JobRestartException- ジョブが再起動可能でない場合にスローされます。JobInstanceAlreadyCompleteException- ジョブインスタンスがすでに完了している場合にスローされます。
removeJobExecutions
Spring Batch によって使用される標準の場所から、JobExecutionインスタンス、および関連するすべてのJobInstanceおよびStepExecutionインスタンスを削除します。- パラメーター:
jobExecutions-JobExecutionのコレクション
removeJobExecution
Spring Batch によって使用される標準の場所から、JobExecutionおよびそれに関連付けられたStepExecutionインスタンスを削除します。- パラメーター:
jobExecution- 削除するJobExecution
removeJobExecutions
public void removeJobExecutions()すべてのJobExecutionインスタンス、および関連するすべてのJobInstanceおよびStepExecutionインスタンスを、Spring Batch によって使用される標準の場所から削除します。