Updated for various code warnings
This commit addresses a number of deprications and other code warnings. There are still many more to address, but this is a start.
This commit is contained in:
@@ -56,7 +56,7 @@ public class AsyncItemWriter<T> implements ItemStreamWriter<Future<T>>, Initiali
|
||||
* unwrapped and the cause will be thrown.
|
||||
*
|
||||
* @param items {@link java.util.concurrent.Future}s to be upwrapped and passed to the delegate
|
||||
* @throws Exception
|
||||
* @throws Exception The exception returned by the Future if one was thrown
|
||||
*/
|
||||
public void write(List<? extends Future<T>> items) throws Exception {
|
||||
List<T> list = new ArrayList<T>();
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
package org.springframework.batch.integration.chunk;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.batch.core.BatchStatus;
|
||||
import org.springframework.batch.core.ExitStatus;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
@@ -42,6 +40,9 @@ import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class ChunkMessageItemWriterIntegrationTests {
|
||||
@@ -186,11 +187,6 @@ public class ChunkMessageItemWriterIntegrationTests {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jobId
|
||||
* @param string
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
private GenericMessage<ChunkRequest> getSimpleMessage(String string, Long jobId) {
|
||||
StepContribution stepContribution = new JobExecution(new JobInstance(0L, "job"), new JobParameters())
|
||||
@@ -262,8 +258,6 @@ public class ChunkMessageItemWriterIntegrationTests {
|
||||
/**
|
||||
* This one is flakey - we try to force it to wait until after the step to
|
||||
* finish processing just by waiting for long enough.
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
public void testFailureInStepListener() throws Exception {
|
||||
@@ -294,11 +288,6 @@ public class ChunkMessageItemWriterIntegrationTests {
|
||||
|
||||
// TODO : test non-dispatch of empty chunk
|
||||
|
||||
/**
|
||||
* @param expected
|
||||
* @param maxWait
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private void waitForResults(int expected, int maxWait) throws InterruptedException {
|
||||
int count = 0;
|
||||
while (TestItemWriter.count < expected && count < maxWait) {
|
||||
|
||||
@@ -15,7 +15,10 @@
|
||||
*/
|
||||
package org.springframework.batch.integration.config.xml;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.batch.core.step.item.ChunkProcessor;
|
||||
import org.springframework.batch.core.step.item.SimpleChunkProcessor;
|
||||
import org.springframework.batch.integration.chunk.ChunkHandler;
|
||||
@@ -32,7 +35,6 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.integration.config.ServiceActivatorFactoryBean;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
@@ -47,7 +49,10 @@ import static org.junit.Assert.fail;
|
||||
* @author Chris Schaefer
|
||||
* @since 3.1
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public class RemoteChunkingParserTests {
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Test
|
||||
public void testRemoteChunkingSlaveParserWithProcessorDefined() {
|
||||
ApplicationContext applicationContext =
|
||||
@@ -80,6 +85,7 @@ public class RemoteChunkingParserTests {
|
||||
assertNotNull("Target object must not be null", targetObject);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Test
|
||||
public void testRemoteChunkingSlaveParserWithProcessorNotDefined() {
|
||||
ApplicationContext applicationContext =
|
||||
@@ -94,6 +100,7 @@ public class RemoteChunkingParserTests {
|
||||
assertTrue("Got wrong instance of ItemProcessor", itemProcessor instanceof PassThroughItemProcessor);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Test
|
||||
public void testRemoteChunkingMasterParser() {
|
||||
ApplicationContext applicationContext =
|
||||
@@ -103,7 +110,7 @@ public class RemoteChunkingParserTests {
|
||||
assertNotNull("Messaging template must not be null", TestUtils.getPropertyValue(itemWriter, "messagingGateway"));
|
||||
assertNotNull("Reply channel must not be null", TestUtils.getPropertyValue(itemWriter, "replyChannel"));
|
||||
|
||||
FactoryBean remoteChunkingHandlerFactoryBean = applicationContext.getBean(RemoteChunkHandlerFactoryBean.class);
|
||||
FactoryBean<ChunkHandler> remoteChunkingHandlerFactoryBean = applicationContext.getBean(RemoteChunkHandlerFactoryBean.class);
|
||||
assertNotNull("Chunk writer must not be null", TestUtils.getPropertyValue(remoteChunkingHandlerFactoryBean, "chunkWriter"));
|
||||
assertNotNull("Step must not be null", TestUtils.getPropertyValue(remoteChunkingHandlerFactoryBean, "step"));
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ public class MessageChannelPartitionHandlerTests {
|
||||
assertNull(executions);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Test
|
||||
public void testHandleNoReply() throws Exception {
|
||||
//execute with no default set
|
||||
@@ -79,6 +80,7 @@ public class MessageChannelPartitionHandlerTests {
|
||||
assertTrue(executions.isEmpty());
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Test
|
||||
public void testHandleWithReplyChannel() throws Exception {
|
||||
//execute with no default set
|
||||
@@ -107,6 +109,7 @@ public class MessageChannelPartitionHandlerTests {
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Test(expected = MessageTimeoutException.class)
|
||||
public void messageReceiveTimeout() throws Exception {
|
||||
//execute with no default set
|
||||
|
||||
Reference in New Issue
Block a user