Remove @Ignore from test, fix build system issue

This commit is contained in:
Chris Schaefer
2014-06-09 15:51:55 -04:00
committed by Michael Minella
parent cfe2bfb60d
commit 3b36c132d5
3 changed files with 19 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008-2013 the original author or authors.
* Copyright 2008-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,9 @@ import java.util.List;
import java.util.Set;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.JobExecution;
@@ -38,6 +40,7 @@ import org.springframework.dao.OptimisticLockingFailureException;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
@FixMethodOrder(MethodSorters.JVM)
public abstract class AbstractJobExecutionDaoTests {
protected JobExecutionDao dao;

View File

@@ -16,17 +16,20 @@
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;
import org.springframework.batch.core.JobParametersBuilder;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.core.launch.JobOperator;
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;
@@ -35,7 +38,6 @@ import java.util.List;
import static org.junit.Assert.assertTrue;
@Ignore
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class OptimisticLockingFailureTests {
@@ -54,6 +56,8 @@ public class OptimisticLockingFailureTests {
.addLong("test", 1L)
.toJobParameters());
Thread.sleep(1000);
jobOperator.stop(jobExecution.getId());
while(jobExecution.isRunning()) {
@@ -102,4 +106,12 @@ public class OptimisticLockingFailureTests {
}
}
}
public static class SleepingTasklet implements Tasklet {
@Override
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
Thread.sleep(2000L);
return RepeatStatus.FINISHED;
}
}
}