|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.batch.test.JobRepositoryTestUtils
public class JobRepositoryTestUtils
Convenience class for creating and removing JobExecution instances
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.
| Constructor Summary | |
|---|---|
JobRepositoryTestUtils()
Default constructor. |
|
JobRepositoryTestUtils(JobRepository jobRepository,
javax.sql.DataSource dataSource)
Create a JobRepositoryTestUtils with all its mandatory
properties. |
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
java.util.List<JobExecution> |
createJobExecutions(int count)
Use the JobRepository to create some JobExecution
instances. |
void |
removeJobExecutions(java.util.Collection<JobExecution> list)
Remove the JobExecution instances provided from the standard
RDBMS locations used by Spring Batch. |
void |
setDataSource(javax.sql.DataSource dataSource)
|
void |
setJobParametersIncrementer(JobParametersIncrementer jobParametersIncrementer)
|
void |
setJobRepository(JobRepository jobRepository)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JobRepositoryTestUtils()
public JobRepositoryTestUtils(JobRepository jobRepository,
javax.sql.DataSource dataSource)
JobRepositoryTestUtils with all its mandatory
properties.
jobRepository - a JobRepository backed by a databasedataSource - a DataSource| Method Detail |
|---|
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.ExceptionInitializingBean.afterPropertiesSet()public void setDataSource(javax.sql.DataSource dataSource)
public void setJobParametersIncrementer(JobParametersIncrementer jobParametersIncrementer)
jobParametersIncrementer - the jobParametersIncrementer to setpublic void setJobRepository(JobRepository jobRepository)
jobRepository - the jobRepository to set
public java.util.List<JobExecution> createJobExecutions(int count)
throws JobExecutionAlreadyRunningException,
JobRestartException,
JobInstanceAlreadyCompleteException
JobRepository to create some JobExecution
instances.
count - the required number of instances
JobExecution
java.lang.Exception - if there is a problem in the JobRepository
JobExecutionAlreadyRunningException
JobRestartException
JobInstanceAlreadyCompleteException
public void removeJobExecutions(java.util.Collection<JobExecution> list)
throws org.springframework.dao.DataAccessException
JobExecution instances provided from the standard
RDBMS locations used by Spring Batch.
list - a list of JobExecution
org.springframework.dao.DataAccessException - if there is a problem
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||