IN PROGRESS - BATCH-857: map daos need to be truly transactional for correct restart
moved transaction manager and proxy up to AbstractJobRepository so that it applies to Map implementation too
This commit is contained in:
@@ -104,11 +104,13 @@ public class JobRepositoryFactoryBeanTests {
|
||||
@Test
|
||||
public void testMissingTransactionManager() throws Exception {
|
||||
|
||||
factory.setDatabaseType("mockDb");
|
||||
factory.setTransactionManager(null);
|
||||
try {
|
||||
expect(incrementerFactory.isSupportedIncrementerType(null)).andReturn(true);
|
||||
expect(incrementerFactory.isSupportedIncrementerType("mockDb")).andReturn(true);
|
||||
expect(incrementerFactory.getSupportedIncrementerTypes()).andReturn(new String[0]);
|
||||
replay(incrementerFactory);
|
||||
|
||||
factory.afterPropertiesSet();
|
||||
fail();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.job.JobSupport;
|
||||
import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;
|
||||
import org.springframework.batch.core.repository.JobRepository;
|
||||
import org.springframework.batch.support.transaction.ResourcelessTransactionManager;
|
||||
|
||||
/**
|
||||
* Tests for {@link MapJobRepositoryFactoryBean}.
|
||||
@@ -22,6 +23,8 @@ public class MapJobRepositoryFactoryBeanTests {
|
||||
*/
|
||||
@Test
|
||||
public void testCreateRepository() throws Exception {
|
||||
tested.setTransactionManager(new ResourcelessTransactionManager());
|
||||
tested.afterPropertiesSet();
|
||||
JobRepository repository = (JobRepository) tested.getObject();
|
||||
Job job = new JobSupport("jobName");
|
||||
JobParameters jobParameters = new JobParameters();
|
||||
|
||||
Reference in New Issue
Block a user