RESOLVED - issue BATCH-973: Switch RetryPolicy back to Throwable instead of Exception as in 1.x

http://jira.springframework.org/browse/BATCH-973
This commit is contained in:
dsyer
2009-09-24 08:24:47 +00:00
parent ab5ece862a
commit 6ef8865ce2
18 changed files with 64 additions and 43 deletions

View File

@@ -62,7 +62,7 @@ public class CompositeRetryPolicyTests extends TestCase {
return !errorRegistered;
}
public void registerThrowable(RetryContext context, Exception throwable) {
public void registerThrowable(RetryContext context, Throwable throwable) {
errorRegistered = true;
}
} });
@@ -70,7 +70,7 @@ public class CompositeRetryPolicyTests extends TestCase {
assertNotNull(context);
assertTrue(policy.canRetry(context));
policy.registerThrowable(context, null);
assertFalse(policy.canRetry(context));
assertFalse("Should be still able to retry", policy.canRetry(context));
}
public void testNonTrivialPoliciesClose() throws Exception {

View File

@@ -16,14 +16,18 @@
package org.springframework.batch.retry.support;
import static org.easymock.EasyMock.createStrictMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.expectLastCall;
import static org.easymock.EasyMock.isA;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.fail;
import static org.easymock.EasyMock.*;
import java.util.Collections;
import org.junit.Test;
@@ -295,7 +299,7 @@ public class RetryTemplateTests {
}, null, new DefaultRetryState(tested) {
@Override
public boolean rollbackFor(Exception exception) {
public boolean rollbackFor(Throwable exception) {
return true;
}