クラス JobRepositoryTestUtils
java.lang.ObjectSE
org.springframework.batch.test.JobRepositoryTestUtils
データベースから
JobExecution
インスタンスを作成および削除するための便利なクラス。テストケースでの一般的な使用箇所は、トランザクションの前にインスタンスを作成し、結果を保存し、それを使用してトランザクション後に削除することです。- 作成者:
- Dave Syer, Mahmoud Ben Hassine
コンストラクターのサマリー
コンストラクター説明デフォルトコンストラクター。JobRepositoryTestUtils
(JobRepository jobRepository) すべての必須プロパティを含むJobRepositoryTestUtils
を作成します。メソッドのサマリー
修飾子と型メソッド説明createJobExecutions
(int count) JobRepository
を使用して、それぞれがシングルステップ実行のJobExecution
インスタンスをいくつか作成します。createJobExecutions
(StringSE jobName, StringSE[] stepNames, int count) JobRepository
を使用して、それぞれが指定されたジョブ名を持ち、それぞれが指定されたステップ名でステップ実行を持ついくつかのJobExecution
インスタンスを作成します。void
removeJobExecution
(JobExecution jobExecution) void
すべてのJobExecution
インスタンス、および関連するすべてのJobInstance
およびStepExecution
インスタンスを、Spring Batch によって使用される標準の場所から削除します。void
removeJobExecutions
(CollectionSE<JobExecution> jobExecutions) Spring Batch によって使用される標準の場所から、JobExecution
インスタンス、および関連するすべてのJobInstance
およびStepExecution
インスタンスを削除します。void
setJobParametersIncrementer
(JobParametersIncrementer jobParametersIncrementer) void
setJobRepository
(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 によって使用される標準の場所から削除します。