类 JobRepositoryTestUtils
- java.lang.Object
- org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao
- org.springframework.batch.test.JobRepositoryTestUtils
 
 
- 所有已实现的接口:
- org.springframework.beans.factory.InitializingBean
 - public class JobRepositoryTestUtils extends AbstractJdbcBatchMetadataDao implements org.springframework.beans.factory.InitializingBean Convenience class for creating and removing- JobExecutioninstances from a database. Typical usage in test case would be to create instances before a transaction, save the result, and then use it to remove them after the transaction.- 作者:
- Dave Syer, Mahmoud Ben Hassine
 
- 字段概要- 从类继承的字段 org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao- DEFAULT_EXIT_MESSAGE_LENGTH, DEFAULT_TABLE_PREFIX
 
 - 构造器概要- 构造器 - 构造器 - 说明 - JobRepositoryTestUtils()Default constructor.- JobRepositoryTestUtils(JobRepository jobRepository, javax.sql.DataSource dataSource)Create a- JobRepositoryTestUtilswith all its mandatory properties.
 - 方法概要- 所有方法 实例方法 具体方法 - 修饰符和类型 - 方法 - 说明 - void- afterPropertiesSet()- java.util.List<JobExecution>- createJobExecutions(int count)Use the- JobRepositoryto create some- JobExecutioninstances each with a single step execution.- java.util.List<JobExecution>- createJobExecutions(java.lang.String jobName, java.lang.String[] stepNames, int count)Use the- JobRepositoryto create some- JobExecutioninstances each with the given job name and each having step executions with the given step names.- void- removeJobExecutions()Remove all the- JobExecutioninstances, and all associated- JobInstanceand- StepExecutioninstances from the standard RDBMS locations used by Spring Batch.- void- removeJobExecutions(java.util.Collection<JobExecution> list)Remove the- JobExecutioninstances, and all associated- JobInstanceand- StepExecutioninstances from the standard RDBMS locations used by Spring Batch.- void- setDataSource(javax.sql.DataSource dataSource)- void- setJobParametersIncrementer(JobParametersIncrementer jobParametersIncrementer)- void- setJobRepository(JobRepository jobRepository)- 从类继承的方法 org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao- getClobTypeToUse, getJdbcTemplate, getQuery, getTablePrefix, setClobTypeToUse, setJdbcTemplate, setTablePrefix
 
 
- 构造器详细资料- JobRepositoryTestUtils- public JobRepositoryTestUtils() Default constructor.
 - JobRepositoryTestUtils- public JobRepositoryTestUtils(JobRepository jobRepository, javax.sql.DataSource dataSource) Create a- JobRepositoryTestUtilswith all its mandatory properties.- 参数:
- jobRepository- a- JobRepositorybacked by a database
- dataSource- a- DataSource
 
 
 - 方法详细资料- afterPropertiesSet- public void afterPropertiesSet() throws java.lang.Exception - 指定者:
- afterPropertiesSet在接口中- org.springframework.beans.factory.InitializingBean
- 覆盖:
- afterPropertiesSet在类中- AbstractJdbcBatchMetadataDao
- 抛出:
- java.lang.Exception
- 另请参阅:
- InitializingBean.afterPropertiesSet()
 
 - setDataSource- @Autowired public final void setDataSource(javax.sql.DataSource dataSource) 
 - setJobParametersIncrementer- public void setJobParametersIncrementer(JobParametersIncrementer jobParametersIncrementer) - 参数:
- jobParametersIncrementer- the jobParametersIncrementer to set
 
 - setJobRepository- @Autowired public void setJobRepository(JobRepository jobRepository) - 参数:
- jobRepository- the jobRepository to set
 
 - createJobExecutions- public java.util.List<JobExecution> createJobExecutions(java.lang.String jobName, java.lang.String[] stepNames, int count) throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException Use the- JobRepositoryto create some- JobExecutioninstances each with the given job name and each having step executions with the given step names.- 参数:
- jobName- the name of the job
- stepNames- the names of the step executions
- count- the required number of instances of- JobExecutionto create
- 返回:
- a collection of JobExecution
- 抛出:
- JobExecutionAlreadyRunningException- thrown if Job is already running.
- JobRestartException- thrown if Job is not restartable.
- JobInstanceAlreadyCompleteException- thrown if Job Instance is already complete.
 
 - createJobExecutions- public java.util.List<JobExecution> createJobExecutions(int count) throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException Use the- JobRepositoryto create some- JobExecutioninstances each with a single step execution.- 参数:
- count- the required number of instances of- JobExecutionto create
- 返回:
- a collection of JobExecution
- 抛出:
- JobExecutionAlreadyRunningException- thrown if Job is already running.
- JobRestartException- thrown if Job is not restartable.
- JobInstanceAlreadyCompleteException- thrown if Job Instance is already complete.
 
 - removeJobExecutions- public void removeJobExecutions(java.util.Collection<JobExecution> list) throws org.springframework.dao.DataAccessException Remove the- JobExecutioninstances, and all associated- JobInstanceand- StepExecutioninstances from the standard RDBMS locations used by Spring Batch.- 参数:
- list- a list of- JobExecution
- 抛出:
- org.springframework.dao.DataAccessException- if there is a problem
 
 - removeJobExecutions- public void removeJobExecutions() throws org.springframework.dao.DataAccessException Remove all the- JobExecutioninstances, and all associated- JobInstanceand- StepExecutioninstances from the standard RDBMS locations used by Spring Batch.- 抛出:
- org.springframework.dao.DataAccessException- if there is a problem