REOPENED - BATCH-778: MapJobRepositoryFactoryBean shouldn't require transactionManager

tx code moved from AbstractJobRepositoryFactoryBean to JobRepositoryFactoryBean
This commit is contained in:
robokaso
2008-08-13 10:52:45 +00:00
parent b9810c6eeb
commit 1f731769f8
5 changed files with 102 additions and 106 deletions

View File

@@ -1,33 +1,24 @@
package org.springframework.batch.core.repository.support;
import junit.framework.TestCase;
import org.junit.Test;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.job.JobSupport;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.repository.JobRestartException;
import org.springframework.batch.support.transaction.ResourcelessTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
/**
* Tests for {@link MapJobRepositoryFactoryBean}.
*/
public class MapJobRepositoryFactoryBeanTests extends TestCase {
public class MapJobRepositoryFactoryBeanTests {
private MapJobRepositoryFactoryBean tested = new MapJobRepositoryFactoryBean();
private PlatformTransactionManager transactionManager = new ResourcelessTransactionManager();
protected void setUp() throws Exception {
tested.setTransactionManager(transactionManager);
tested.afterPropertiesSet();
}
/**
* Use the factory to create repository and check the repository remembers
* created executions.
*/
@Test
public void testCreateRepository() throws Exception {
JobRepository repository = (JobRepository) tested.getObject();
Job job = new JobSupport("jobName");