Final attempt at fixing test failure on build machine. Works as expected in a cloned plan

This commit is contained in:
Chris Schaefer
2014-06-09 18:24:44 -04:00
committed by Michael Minella
parent 1f8cc9a557
commit 0f5a7af1a3
2 changed files with 25 additions and 19 deletions

View File

@@ -16,9 +16,7 @@
package org.springframework.batch.core.repository.dao;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecution;
@@ -31,29 +29,22 @@ import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.util.List;
import static org.junit.Assert.assertTrue;
@Ignore
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class OptimisticLockingFailureTests {
@Autowired
private Job job;
@Autowired
private JobLauncher jobLauncher;
@Autowired
private JobOperator jobOperator;
@Test
public void testAsyncStopOfStartingJob() throws Exception {
ApplicationContext applicationContext =
new ClassPathXmlApplicationContext("org/springframework/batch/core/repository/dao/OptimisticLockingFailureTests-context.xml");
Job job = applicationContext.getBean(Job.class);
JobLauncher jobLauncher = applicationContext.getBean(JobLauncher.class);
JobOperator jobOperator = applicationContext.getBean(JobOperator.class);
JobExecution jobExecution = jobLauncher.run(job, new JobParametersBuilder()
.addLong("test", 1L)
.toJobParameters());