diff --git a/build.gradle b/build.gradle index 281b21631..11ff0b400 100644 --- a/build.gradle +++ b/build.gradle @@ -39,7 +39,7 @@ allprojects { springVersionDefault = '4.0.2.RELEASE' springVersion = project.hasProperty('springVersion') ? getProperty('springVersion') : springVersionDefault - springRetryVersion = '1.0.3.RELEASE' + springRetryVersion = '1.1.0.RC1' springAmqpVersion = '1.1.2.RELEASE' springDataCommonsVersion = '1.5.0.RELEASE' springDataGemfireVersion = '1.3.0.RELEASE' diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/step/item/JsrFaultTolerantChunkProcessor.java b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/step/item/JsrFaultTolerantChunkProcessor.java index 4e9ae0ab6..51d4de8c9 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/step/item/JsrFaultTolerantChunkProcessor.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/step/item/JsrFaultTolerantChunkProcessor.java @@ -15,9 +15,6 @@ */ package org.springframework.batch.core.jsr.step.item; -import java.util.List; - -import javax.batch.operations.BatchRuntimeException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.batch.core.StepContribution; @@ -43,6 +40,9 @@ import org.springframework.retry.RetryContext; import org.springframework.retry.RetryException; import org.springframework.util.Assert; +import javax.batch.operations.BatchRuntimeException; +import java.util.List; + /** * Extension of the {@link JsrChunkProcessor} that adds skip and retry functionality. * @@ -97,7 +97,7 @@ public class JsrFaultTolerantChunkProcessor extends JsrChunkProcessor * Register some {@link StepListener}s with the handler. Each will get the * callbacks in the order specified at the correct stage. * - * @param listeners + * @param listeners listeners to be registered */ @Override public void setListeners(List listeners) { @@ -126,7 +126,7 @@ public class JsrFaultTolerantChunkProcessor extends JsrChunkProcessor */ @Override protected I provide(final StepContribution contribution, final Chunk chunk) throws Exception { - RetryCallback retryCallback = new RetryCallback() { + RetryCallback retryCallback = new RetryCallback() { @Override public I doWithRetry(RetryContext arg0) throws Exception { @@ -217,11 +217,10 @@ public class JsrFaultTolerantChunkProcessor extends JsrChunkProcessor @SuppressWarnings("unchecked") protected O transform(final StepContribution contribution, final I item) throws Exception { if (!hasProcessor) { - O result = (O) item; - return result; + return (O) item; } - RetryCallback retryCallback = new RetryCallback() { + RetryCallback retryCallback = new RetryCallback() { @Override public O doWithRetry(RetryContext context) throws Exception { @@ -289,7 +288,7 @@ public class JsrFaultTolerantChunkProcessor extends JsrChunkProcessor @Override protected void persist(final StepContribution contribution, final Chunk chunk) throws Exception { - RetryCallback retryCallback = new RetryCallback() { + RetryCallback retryCallback = new RetryCallback() { @Override @SuppressWarnings({ "unchecked", "rawtypes" }) public Object doWithRetry(RetryContext context) throws Exception { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/BatchRetryTemplate.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/BatchRetryTemplate.java index 50b5c2f97..c16e63186 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/BatchRetryTemplate.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/BatchRetryTemplate.java @@ -16,11 +16,6 @@ package org.springframework.batch.core.step.item; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - import org.springframework.classify.Classifier; import org.springframework.retry.ExhaustedRetryException; import org.springframework.retry.RecoveryCallback; @@ -37,6 +32,11 @@ import org.springframework.retry.support.DefaultRetryState; import org.springframework.retry.support.RetrySynchronizationManager; import org.springframework.retry.support.RetryTemplate; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + /** * A special purpose retry template that deals specifically with multi-valued * stateful retry. This is useful in the case where the operation to be retried @@ -153,13 +153,13 @@ public class BatchRetryTemplate implements RetryOperations { @Override protected T handleRetryExhausted(RecoveryCallback recoveryCallback, RetryContext context, - RetryState state) throws Exception { + RetryState state) throws Throwable { BatchRetryState batchState = (BatchRetryState) state; BatchRetryContext batchContext = (BatchRetryContext) context; // Accumulate exceptions to be thrown so all the keys get a crack - Exception rethrowable = null; + Throwable rethrowable = null; ExhaustedRetryException exhausted = null; Iterator contextIterator = batchContext.contexts.iterator(); @@ -173,7 +173,7 @@ public class BatchRetryTemplate implements RetryOperations { catch (ExhaustedRetryException e) { exhausted = e; } - catch (Exception e) { + catch (Throwable e) { rethrowable = e; } @@ -199,37 +199,37 @@ public class BatchRetryTemplate implements RetryOperations { private RetryPolicy retryPolicy; - public T execute(RetryCallback retryCallback, Collection states) throws ExhaustedRetryException, + public T execute(RetryCallback retryCallback, Collection states) throws E, Exception { RetryState batchState = new BatchRetryState(states); return delegate.execute(retryCallback, batchState); } - public T execute(RetryCallback retryCallback, RecoveryCallback recoveryCallback, - Collection states) throws ExhaustedRetryException, Exception { + public T execute(RetryCallback retryCallback, RecoveryCallback recoveryCallback, + Collection states) throws E, Exception { RetryState batchState = new BatchRetryState(states); return delegate.execute(retryCallback, recoveryCallback, batchState); } @Override - public final T execute(RetryCallback retryCallback, RecoveryCallback recoveryCallback, - RetryState retryState) throws Exception, ExhaustedRetryException { + public final T execute(RetryCallback retryCallback, RecoveryCallback recoveryCallback, + RetryState retryState) throws E { return regular.execute(retryCallback, recoveryCallback, retryState); } @Override - public final T execute(RetryCallback retryCallback, RecoveryCallback recoveryCallback) throws Exception { + public final T execute(RetryCallback retryCallback, RecoveryCallback recoveryCallback) throws E { return regular.execute(retryCallback, recoveryCallback); } @Override - public final T execute(RetryCallback retryCallback, RetryState retryState) throws Exception, + public final T execute(RetryCallback retryCallback, RetryState retryState) throws E, ExhaustedRetryException { return regular.execute(retryCallback, retryState); } @Override - public final T execute(RetryCallback retryCallback) throws Exception { + public final T execute(RetryCallback retryCallback) throws E { return regular.execute(retryCallback); } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessor.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessor.java index 55d9e4d8b..2458f1a1f 100755 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessor.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessor.java @@ -16,13 +16,6 @@ package org.springframework.batch.core.step.item; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicReference; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.batch.core.StepContribution; @@ -42,6 +35,13 @@ import org.springframework.retry.RetryContext; import org.springframework.retry.RetryException; import org.springframework.retry.support.DefaultRetryState; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; + /** * FaultTolerant implementation of the {@link ChunkProcessor} interface, that * allows for skipping or retry of items that cause exceptions during writing. @@ -96,14 +96,14 @@ public class FaultTolerantChunkProcessor extends SimpleChunkProcessor rollbackClassifier) { this.rollbackClassifier = rollbackClassifier; } /** - * @param chunkMonitor + * @param chunkMonitor monitor */ public void setChunkMonitor(ChunkMonitor chunkMonitor) { this.chunkMonitor = chunkMonitor; @@ -115,7 +115,7 @@ public class FaultTolerantChunkProcessor extends SimpleChunkProcessor extends SimpleChunkProcessor retryCallback = new RetryCallback() { + RetryCallback retryCallback = new RetryCallback() { @Override public O doWithRetry(RetryContext context) throws Exception { @@ -317,7 +317,7 @@ public class FaultTolerantChunkProcessor extends SimpleChunkProcessor data = (UserData) inputs.getUserData(); final AtomicReference contextHolder = new AtomicReference(); - RetryCallback retryCallback = new RetryCallback() { + RetryCallback retryCallback = new RetryCallback() { @Override public Object doWithRetry(RetryContext context) throws Exception { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SimpleRetryExceptionHandler.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SimpleRetryExceptionHandler.java index 7aedd7999..c7202ff2b 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SimpleRetryExceptionHandler.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SimpleRetryExceptionHandler.java @@ -15,8 +15,6 @@ */ package org.springframework.batch.core.step.item; -import java.util.Collection; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.batch.repeat.RepeatContext; @@ -28,6 +26,8 @@ import org.springframework.retry.RetryContext; import org.springframework.retry.RetryPolicy; import org.springframework.retry.listener.RetryListenerSupport; +import java.util.Collection; + /** * An {@link ExceptionHandler} that is aware of the retry context so that it can * distinguish between a fatal exception and one that can be retried. Delegates @@ -58,7 +58,7 @@ public class SimpleRetryExceptionHandler extends RetryListenerSupport implements * exception is encountered * @param exceptionHandler the delegate to use if an exception actually * needs to be handled - * @param fatalExceptionClasses + * @param fatalExceptionClasses exceptions */ public SimpleRetryExceptionHandler(RetryPolicy retryPolicy, ExceptionHandler exceptionHandler, Collection> fatalExceptionClasses) { this.retryPolicy = retryPolicy; @@ -95,7 +95,7 @@ public class SimpleRetryExceptionHandler extends RetryListenerSupport implements * org.springframework.retry.RetryCallback, java.lang.Throwable) */ @Override - public void close(RetryContext context, RetryCallback callback, Throwable throwable) { + public void close(RetryContext context, RetryCallback callback, Throwable throwable) { if (!retryPolicy.canRetry(context)) { logger.debug("Marking retry as exhausted: "+context); getRepeatContext().setAttribute(EXHAUSTED, "true"); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/DummyRetryListener.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/DummyRetryListener.java index 8a006034e..bbe9288de 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/DummyRetryListener.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/DummyRetryListener.java @@ -26,16 +26,16 @@ import org.springframework.retry.RetryListener; public class DummyRetryListener implements RetryListener { @Override - public boolean open(RetryContext context, RetryCallback callback) { + public boolean open(RetryContext context, RetryCallback callback) { return false; } @Override - public void close(RetryContext context, RetryCallback callback, Throwable throwable) { + public void close(RetryContext context, RetryCallback callback, Throwable throwable) { } @Override - public void onError(RetryContext context, RetryCallback callback, Throwable throwable) { + public void onError(RetryContext context, RetryCallback callback, Throwable throwable) { } } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestRetryListener.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestRetryListener.java index 48b365a0f..c627166c6 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestRetryListener.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestRetryListener.java @@ -22,17 +22,17 @@ import org.springframework.retry.RetryListener; public class TestRetryListener extends AbstractTestComponent implements RetryListener { @Override - public void close(RetryContext context, RetryCallback callback, + public void close(RetryContext context, RetryCallback callback, Throwable throwable) { } @Override - public void onError(RetryContext context, RetryCallback callback, + public void onError(RetryContext context, RetryCallback callback, Throwable throwable) { } @Override - public boolean open(RetryContext context, RetryCallback callback) { + public boolean open(RetryContext context, RetryCallback callback) { executed = true; return true; } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/BatchRetryTemplateTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/BatchRetryTemplateTests.java index 16428c52a..26c667a11 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/BatchRetryTemplateTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/BatchRetryTemplateTests.java @@ -15,15 +15,6 @@ */ package org.springframework.batch.core.step.item; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - import org.junit.Test; import org.springframework.retry.ExhaustedRetryException; import org.springframework.retry.RecoveryCallback; @@ -33,6 +24,15 @@ import org.springframework.retry.RetryState; import org.springframework.retry.policy.SimpleRetryPolicy; import org.springframework.retry.support.DefaultRetryState; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + public class BatchRetryTemplateTests { @SuppressWarnings("serial") @@ -53,7 +53,7 @@ public class BatchRetryTemplateTests { BatchRetryTemplate template = new BatchRetryTemplate(); - String result = template.execute(new RetryCallback() { + String result = template.execute(new RetryCallback() { @Override public String doWithRetry(RetryContext context) throws Exception { assertTrue("Wrong context type: " + context.getClass().getSimpleName(), context.getClass() @@ -71,7 +71,7 @@ public class BatchRetryTemplateTests { BatchRetryTemplate template = new BatchRetryTemplate(); - RetryCallback retryCallback = new RetryCallback() { + RetryCallback retryCallback = new RetryCallback() { @Override public String[] doWithRetry(RetryContext context) throws Exception { assertEquals(count, context.getRetryCount()); @@ -103,7 +103,7 @@ public class BatchRetryTemplateTests { template.setRetryPolicy(new SimpleRetryPolicy(1, Collections ., Boolean> singletonMap(Exception.class, true))); - RetryCallback retryCallback = new RetryCallback() { + RetryCallback retryCallback = new RetryCallback() { @Override public String[] doWithRetry(RetryContext context) throws Exception { if (count++ < 2) { @@ -133,7 +133,7 @@ public class BatchRetryTemplateTests { template.setRetryPolicy(new SimpleRetryPolicy(1, Collections ., Boolean> singletonMap(Exception.class, true))); - RetryCallback retryCallback = new RetryCallback() { + RetryCallback retryCallback = new RetryCallback() { @Override public String[] doWithRetry(RetryContext context) throws Exception { if (count++ < 1) { @@ -188,7 +188,7 @@ public class BatchRetryTemplateTests { template.setRetryPolicy(new SimpleRetryPolicy(1, Collections ., Boolean> singletonMap(Exception.class, true))); - RetryCallback retryCallback = new RetryCallback() { + RetryCallback retryCallback = new RetryCallback() { @Override public String[] doWithRetry(RetryContext context) throws Exception { if (count++ < 2) { diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java index c4c937fda..9eddd947a 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java @@ -15,36 +15,35 @@ */ package org.springframework.batch.container.jms; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; - -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.TextMessage; - import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jms.core.JmsTemplate; import org.springframework.retry.RecoveryCallback; import org.springframework.retry.RetryCallback; import org.springframework.retry.RetryContext; import org.springframework.retry.policy.NeverRetryPolicy; import org.springframework.retry.support.DefaultRetryState; import org.springframework.retry.support.RetryTemplate; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.jms.core.JmsTemplate; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import javax.jms.JMSException; +import javax.jms.Message; +import javax.jms.MessageListener; +import javax.jms.TextMessage; +import java.util.SortedSet; +import java.util.TreeSet; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + /** * @author Dave Syer * @@ -137,7 +136,7 @@ public class BatchMessageListenerContainerIntegrationTests { @Override public void onMessage(final Message msg) { try { - RetryCallback callback = new RetryCallback() { + RetryCallback callback = new RetryCallback() { @Override public Message doWithRetry(RetryContext context) throws Exception { try { diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java index 6f8ee72c6..9dcf21422 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java @@ -16,14 +16,6 @@ package org.springframework.batch.jms; -import static org.junit.Assert.assertEquals; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.sql.DataSource; - import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -51,6 +43,13 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionTemplate; +import javax.sql.DataSource; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import static org.junit.Assert.assertEquals; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "/org/springframework/batch/jms/jms-context.xml") public class ExternalRetryInBatchTests { @@ -136,7 +135,7 @@ public class ExternalRetryInBatchTests { return RepeatStatus.FINISHED; } - RetryCallback callback = new RetryCallback() { + RetryCallback callback = new RetryCallback() { @Override public String doWithRetry(RetryContext context) throws Exception { // No need for transaction here: the whole batch will roll diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java index 73c21fdf3..ae98493d0 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java @@ -16,15 +16,6 @@ package org.springframework.batch.retry.jms; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.sql.DataSource; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -45,6 +36,14 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionTemplate; +import javax.sql.DataSource; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "/org/springframework/batch/jms/jms-context.xml") public class ExternalRetryTests { @@ -102,7 +101,7 @@ public class ExternalRetryTests { final ItemWriter writer = new ItemWriter() { @Override - public void write(final List texts) { + public void write(final List texts) { for (Object text : texts) { @@ -123,7 +122,7 @@ public class ExternalRetryTests { public Object doInTransaction(TransactionStatus status) { try { final Object item = provider.read(); - RetryCallback callback = new RetryCallback() { + RetryCallback callback = new RetryCallback() { @Override public Object doWithRetry(RetryContext context) throws Exception { writer.write(Collections.singletonList(item)); @@ -153,7 +152,7 @@ public class ExternalRetryTests { public Object doInTransaction(TransactionStatus status) { try { final String item = provider.read(); - RetryCallback callback = new RetryCallback() { + RetryCallback callback = new RetryCallback() { @Override public Object doWithRetry(RetryContext context) throws Exception { writer.write(Collections.singletonList(item)); @@ -187,7 +186,7 @@ public class ExternalRetryTests { assertInitialState(); final String item = provider.read(); - final RetryCallback callback = new RetryCallback() { + final RetryCallback callback = new RetryCallback() { @Override public String doWithRetry(RetryContext context) throws Exception { jdbcTemplate.update("INSERT into T_BARS (id,name,foo_date) values (?,?,null)", list.size(), item); diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java index a6cba292a..da69b798e 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java @@ -16,16 +16,6 @@ package org.springframework.batch.retry.jms; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.util.ArrayList; -import java.util.List; - -import javax.sql.DataSource; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -48,6 +38,15 @@ import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionTemplate; import org.springframework.util.ClassUtils; +import javax.sql.DataSource; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "/org/springframework/batch/jms/jms-context.xml") public class SynchronousTests { @@ -124,7 +123,7 @@ public class SynchronousTests { final String text = (String) jmsTemplate.receiveAndConvert("queue"); assertNotNull(text); - retryTemplate.execute(new RetryCallback() { + retryTemplate.execute(new RetryCallback() { @Override public String doWithRetry(RetryContext status) throws Exception { @@ -176,7 +175,7 @@ public class SynchronousTests { final String item = (String) provider.read(); - retryTemplate.execute(new RetryCallback() { + retryTemplate.execute(new RetryCallback() { @Override public String doWithRetry(RetryContext context) throws Exception { @@ -240,7 +239,7 @@ public class SynchronousTests { final String text = (String) jmsTemplate.receiveAndConvert("queue"); try { - retryTemplate.execute(new RetryCallback() { + retryTemplate.execute(new RetryCallback() { @Override public String doWithRetry(RetryContext status) throws Exception { @@ -297,7 +296,7 @@ public class SynchronousTests { assertInitialState(); - retryTemplate.execute(new RetryCallback() { + retryTemplate.execute(new RetryCallback() { @Override public String doWithRetry(RetryContext status) throws Exception { @@ -347,7 +346,7 @@ public class SynchronousTests { try { - retryTemplate.execute(new RetryCallback() { + retryTemplate.execute(new RetryCallback() { @Override public String doWithRetry(RetryContext status) throws Exception { diff --git a/spring-batch-parent/pom.xml b/spring-batch-parent/pom.xml index fb6191d3f..210368710 100644 --- a/spring-batch-parent/pom.xml +++ b/spring-batch-parent/pom.xml @@ -715,7 +715,7 @@ org.springframework.retry spring-retry - 1.0.3.RELEASE + 1.1.0.RC1 org.springframework.amqp