BATCH-2149

This commit is contained in:
Tobias Flohre
2013-12-24 13:04:47 +01:00
committed by Michael Minella
parent 440e234c58
commit 6edc91fcea
2 changed files with 20 additions and 3 deletions

View File

@@ -722,5 +722,21 @@ public class FaultTolerantStepBuilder<I, O> extends SimpleStepBuilder<I, O> {
throw new FatalStepExecutionException("ChunkListener threw exception, rethrowing as fatal", t);
}
}
@Override
public int hashCode() {
return chunkListener.hashCode();
}
@SuppressWarnings("unchecked")
@Override
public boolean equals(Object obj) {
if (obj instanceof FaultTolerantStepBuilder.TerminateOnExceptionChunkListenerDelegate){
// unwrap the ChunkListener
obj = ((TerminateOnExceptionChunkListenerDelegate)obj).chunkListener;
}
return chunkListener.equals(obj);
}
}
}

View File

@@ -85,7 +85,7 @@ public class RegisterMultiListenerTests {
* @throws Exception
*/
@Test
public void testMultiListenerSimpleStep() throws Exception {
public void testMultiListenerFaultTolerantStep() throws Exception {
bootstrap(MultiListenerFaultTolerantTestConfiguration.class);
JobExecution execution = jobLauncher.run(job, new JobParameters());
@@ -97,7 +97,7 @@ public class RegisterMultiListenerTests {
}
@Test
public void testMultiListenerFaultTolerantStep() throws Exception {
public void testMultiListenerSimpleStep() throws Exception {
bootstrap(MultiListenerTestConfiguration.class);
JobExecution execution = jobLauncher.run(job, new JobParameters());
@@ -201,8 +201,9 @@ public class RegisterMultiListenerTests {
.writer(writer())
.faultTolerant()
.skipLimit(1)
.listener((SkipListener<String, String>) listener())
.skip(MySkippableException.class)
// ChunkListener registered twice for checking BATCH-2149
.listener((ChunkListener) listener())
.build();
}
}