|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao
org.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.
| Field Summary |
|---|
| Fields inherited from class org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao |
|---|
DEFAULT_EXIT_MESSAGE_LENGTH, DEFAULT_TABLE_PREFIX |
| Constructor Summary | |
|---|---|
JobRepositoryTestUtils()
Default constructor. |
|
JobRepositoryTestUtils(org.springframework.batch.core.repository.JobRepository jobRepository,
javax.sql.DataSource dataSource)
Create a JobRepositoryTestUtils with all its mandatory
properties. |
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
java.util.List<org.springframework.batch.core.JobExecution> |
createJobExecutions(int count)
Use the JobRepository to create some JobExecution
instances each with a single step execution. |
java.util.List<org.springframework.batch.core.JobExecution> |
createJobExecutions(java.lang.String jobName,
java.lang.String[] stepNames,
int count)
Use the JobRepository to create some JobExecution
instances each with the given job name and each having step executions
with the given step names. |
void |
removeJobExecutions()
Remove all the JobExecution instances, and all associated
JobInstance and StepExecution instances from the standard
RDBMS locations used by Spring Batch. |
void |
removeJobExecutions(java.util.Collection<org.springframework.batch.core.JobExecution> list)
Remove the JobExecution instances, and all associated
JobInstance and StepExecution instances from the standard
RDBMS locations used by Spring Batch. |
void |
setDataSource(javax.sql.DataSource dataSource)
|
void |
setJobParametersIncrementer(org.springframework.batch.core.JobParametersIncrementer jobParametersIncrementer)
|
void |
setJobRepository(org.springframework.batch.core.repository.JobRepository jobRepository)
|
| Methods inherited from class org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao |
|---|
getClobTypeToUse, getJdbcTemplate, getQuery, getTablePrefix, setClobTypeToUse, setJdbcTemplate, setTablePrefix |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JobRepositoryTestUtils()
public JobRepositoryTestUtils(org.springframework.batch.core.repository.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.InitializingBeanafterPropertiesSet in class org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDaojava.lang.ExceptionInitializingBean.afterPropertiesSet()public void setDataSource(javax.sql.DataSource dataSource)
public void setJobParametersIncrementer(org.springframework.batch.core.JobParametersIncrementer jobParametersIncrementer)
jobParametersIncrementer - the jobParametersIncrementer to setpublic void setJobRepository(org.springframework.batch.core.repository.JobRepository jobRepository)
jobRepository - the jobRepository to set
public java.util.List<org.springframework.batch.core.JobExecution> createJobExecutions(java.lang.String jobName,
java.lang.String[] stepNames,
int count)
throws org.springframework.batch.core.repository.JobExecutionAlreadyRunningException,
org.springframework.batch.core.repository.JobRestartException,
org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException
JobRepository to create some JobExecution
instances each with the given job name and each having step executions
with the given step names.
jobName - the name of the jobstepNames - the names of the step executionscount - the required number of instances of JobExecution to
create
JobExecution
java.lang.Exception - if there is a problem in the JobRepository
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException
org.springframework.batch.core.repository.JobRestartException
org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException
public java.util.List<org.springframework.batch.core.JobExecution> createJobExecutions(int count)
throws org.springframework.batch.core.repository.JobExecutionAlreadyRunningException,
org.springframework.batch.core.repository.JobRestartException,
org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException
JobRepository to create some JobExecution
instances each with a single step execution.
count - the required number of instances of JobExecution to
create
JobExecution
java.lang.Exception - if there is a problem in the JobRepository
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException
org.springframework.batch.core.repository.JobRestartException
org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException
public void removeJobExecutions(java.util.Collection<org.springframework.batch.core.JobExecution> list)
throws org.springframework.dao.DataAccessException
JobExecution instances, and all associated
JobInstance and StepExecution instances from the standard
RDBMS locations used by Spring Batch.
list - a list of JobExecution
org.springframework.dao.DataAccessException - if there is a problem
public void removeJobExecutions()
throws org.springframework.dao.DataAccessException
JobExecution instances, and all associated
JobInstance and StepExecution instances 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 | ||||||||