OPEN - issue BATCH-498: Skip method should get ExecutionContext as an argument

Added SkipListener as new StepListener.
This commit is contained in:
dsyer
2008-03-25 19:15:00 +00:00
parent ea4e6f9ab1
commit 546010c887
18 changed files with 340 additions and 71 deletions

View File

@@ -173,7 +173,7 @@ public class SimpleJobTests extends TestCase {
}
public void testRunNormallyWithListener() throws Exception {
job.setJobListeners(new JobExecutionListenerSupport[] { new JobExecutionListenerSupport() {
job.setJobExecutionListeners(new JobExecutionListenerSupport[] { new JobExecutionListenerSupport() {
public void beforeJob(JobExecution jobExecution) {
list.add("before");
}
@@ -251,7 +251,7 @@ public class SimpleJobTests extends TestCase {
}
public void testFailedWithListener() throws Exception {
job.setJobListeners(new JobExecutionListenerSupport[] { new JobExecutionListenerSupport() {
job.setJobExecutionListeners(new JobExecutionListenerSupport[] { new JobExecutionListenerSupport() {
public void onError(JobExecution jobExecution, Throwable t) {
list.add(t);
}

View File

@@ -57,7 +57,7 @@ public class CompositeJobExecutionListenerTests extends TestCase {
/**
* Test method for
* {@link org.springframework.batch.core.listener.CompositeExecutionJobListener#registerListener(org.springframework.batch.core.JobExecutionListener)}.
* {@link org.springframework.batch.core.listener.CompositeExecutionJobListener#registerJobExecutionListener(org.springframework.batch.core.JobExecutionListener)}.
*/
public void testSetListener() {
listener.register(new JobExecutionListenerSupport() {

View File

@@ -59,7 +59,7 @@ public class CompositeStepExecutionListenerTests extends TestCase {
/**
* Test method for
* {@link org.springframework.batch.core.listener.CompositeStepExecutionListener#registerListener(org.springframework.batch.core.StepExecutionListener)}.
* {@link org.springframework.batch.core.listener.CompositeStepExecutionListener#registerJobExecutionListener(org.springframework.batch.core.StepExecutionListener)}.
*/
public void testSetListener() {
listener.register(new StepExecutionListenerSupport() {

View File

@@ -231,7 +231,7 @@ public class ItemOrientedStepTests extends TestCase {
};
itemOrientedStep.setItemHandler(new SimpleItemHandler(itemReader, itemWriter));
itemOrientedStep.registerStepListener(new StepExecutionListenerSupport() {
itemOrientedStep.registerStepExecutionListener(new StepExecutionListenerSupport() {
public ExitStatus onErrorInStep(StepExecution stepExecution, Throwable e) {
return ExitStatus.FAILED.addExitDescription("FOO");
}
@@ -394,7 +394,7 @@ public class ItemOrientedStepTests extends TestCase {
}
public void testDirectlyInjectedListener() throws Exception {
itemOrientedStep.registerStepListener(new StepExecutionListenerSupport() {
itemOrientedStep.registerStepExecutionListener(new StepExecutionListenerSupport() {
public void beforeStep(StepExecution stepExecution) {
list.add("foo");
}
@@ -421,7 +421,7 @@ public class ItemOrientedStepTests extends TestCase {
}
};
itemOrientedStep.setStreams(new ItemStream[] { reader });
itemOrientedStep.registerStepListener(reader);
itemOrientedStep.registerStepExecutionListener(reader);
StepExecution stepExecution = new StepExecution(itemOrientedStep, new JobExecution(jobInstance));
itemOrientedStep.execute(stepExecution);
assertEquals(1, list.size());
@@ -431,7 +431,7 @@ public class ItemOrientedStepTests extends TestCase {
final ExitStatus customStatus = new ExitStatus(false, "custom code");
itemOrientedStep.setStepListeners(new StepExecutionListener[] { new StepExecutionListenerSupport() {
itemOrientedStep.setStepExecutionListeners(new StepExecutionListener[] { new StepExecutionListenerSupport() {
public ExitStatus afterStep(StepExecution stepExecution) {
list.add("afterStepCalled");
return customStatus;
@@ -452,7 +452,7 @@ public class ItemOrientedStepTests extends TestCase {
}
public void testDirectlyInjectedListenerOnError() throws Exception {
itemOrientedStep.registerStepListener(new StepExecutionListenerSupport() {
itemOrientedStep.registerStepExecutionListener(new StepExecutionListenerSupport() {
public ExitStatus onErrorInStep(StepExecution stepExecution, Throwable e) {
list.add(e);
return null;