Replace explicit type with diamond operator in integration module
This commit is contained in:
committed by
Mahmoud Ben Hassine
parent
eb9e0d1466
commit
3fe5fc3427
@@ -93,7 +93,7 @@ public class AsyncItemProcessor<I, O> implements ItemProcessor<I, Future<O>>, In
|
||||
*/
|
||||
public Future<O> process(final I item) throws Exception {
|
||||
final StepExecution stepExecution = getStepExecution();
|
||||
FutureTask<O> task = new FutureTask<O>(new Callable<O>() {
|
||||
FutureTask<O> task = new FutureTask<>(new Callable<O>() {
|
||||
public O call() throws Exception {
|
||||
if (stepExecution != null) {
|
||||
StepSynchronizationManager.register(stepExecution);
|
||||
|
||||
@@ -59,7 +59,7 @@ public class AsyncItemWriter<T> implements ItemStreamWriter<Future<T>>, Initiali
|
||||
* @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>();
|
||||
List<T> list = new ArrayList<>();
|
||||
for (Future<T> future : items) {
|
||||
try {
|
||||
T item = future.get();
|
||||
|
||||
@@ -104,7 +104,7 @@ public class ChunkMessageChannelItemWriter<T> extends StepExecutionListenerSuppo
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Dispatching chunk: " + request);
|
||||
}
|
||||
messagingGateway.send(new GenericMessage<ChunkRequest<T>>(request));
|
||||
messagingGateway.send(new GenericMessage<>(request));
|
||||
localState.incrementExpected();
|
||||
|
||||
}
|
||||
@@ -171,7 +171,7 @@ public class ChunkMessageChannelItemWriter<T> extends StepExecutionListenerSuppo
|
||||
}
|
||||
|
||||
public Collection<StepContribution> getStepContributions() {
|
||||
List<StepContribution> contributions = new ArrayList<StepContribution>();
|
||||
List<StepContribution> contributions = new ArrayList<>();
|
||||
for (ChunkResponse response : localState.pollChunkResponses()) {
|
||||
StepContribution contribution = response.getStepContribution();
|
||||
if (logger.isDebugEnabled()) {
|
||||
@@ -274,14 +274,14 @@ public class ChunkMessageChannelItemWriter<T> extends StepExecutionListenerSuppo
|
||||
|
||||
private StepExecution stepExecution;
|
||||
|
||||
private final Queue<ChunkResponse> contributions = new LinkedBlockingQueue<ChunkResponse>();
|
||||
private final Queue<ChunkResponse> contributions = new LinkedBlockingQueue<>();
|
||||
|
||||
public int getExpecting() {
|
||||
return expected.get() - actual.get();
|
||||
}
|
||||
|
||||
public <T> ChunkRequest<T> getRequest(List<? extends T> items) {
|
||||
return new ChunkRequest<T>(current.incrementAndGet(), items, getJobId(), createStepContribution());
|
||||
return new ChunkRequest<>(current.incrementAndGet(), items, getJobId(), createStepContribution());
|
||||
}
|
||||
|
||||
public void open(int expectedValue, int actualValue) {
|
||||
@@ -290,7 +290,7 @@ public class ChunkMessageChannelItemWriter<T> extends StepExecutionListenerSuppo
|
||||
}
|
||||
|
||||
public Collection<ChunkResponse> pollChunkResponses() {
|
||||
Collection<ChunkResponse> set = new ArrayList<ChunkResponse>();
|
||||
Collection<ChunkResponse> set = new ArrayList<>();
|
||||
synchronized (contributions) {
|
||||
ChunkResponse item = contributions.poll();
|
||||
while (item != null) {
|
||||
|
||||
@@ -101,7 +101,7 @@ public class ChunkProcessorChunkHandler<S> implements ChunkHandler<S>, Initializ
|
||||
*/
|
||||
private Throwable process(ChunkRequest<S> chunkRequest, StepContribution stepContribution) throws Exception {
|
||||
|
||||
Chunk<S> chunk = new Chunk<S>(chunkRequest.getItems());
|
||||
Chunk<S> chunk = new Chunk<>(chunkRequest.getItems());
|
||||
Throwable failure = null;
|
||||
try {
|
||||
chunkProcessor.process(stepContribution, chunk);
|
||||
|
||||
@@ -139,7 +139,7 @@ public class RemoteChunkHandlerFactoryBean<T> implements FactoryBean<ChunkHandle
|
||||
step.registerStepExecutionListener((StepExecutionListener) chunkWriter);
|
||||
}
|
||||
|
||||
ChunkProcessorChunkHandler<T> handler = new ChunkProcessorChunkHandler<T>();
|
||||
ChunkProcessorChunkHandler<T> handler = new ChunkProcessorChunkHandler<>();
|
||||
setNonBuffering(chunkProcessor);
|
||||
handler.setChunkProcessor(chunkProcessor);
|
||||
// TODO: create step context for the processor in case it has
|
||||
@@ -170,7 +170,7 @@ public class RemoteChunkHandlerFactoryBean<T> implements FactoryBean<ChunkHandle
|
||||
*/
|
||||
private void replaceChunkProcessor(ChunkOrientedTasklet<?> tasklet, ItemWriter<T> chunkWriter,
|
||||
final StepContributionSource stepContributionSource) {
|
||||
setField(tasklet, "chunkProcessor", new SimpleChunkProcessor<T, T>(new PassThroughItemProcessor<T>(),
|
||||
setField(tasklet, "chunkProcessor", new SimpleChunkProcessor<T, T>(new PassThroughItemProcessor<>(),
|
||||
chunkWriter) {
|
||||
@Override
|
||||
protected void write(StepContribution contribution, Chunk<T> inputs, Chunk<T> outputs) throws Exception {
|
||||
|
||||
@@ -237,7 +237,7 @@ public class MessageChannelPartitionHandler implements PartitionHandler, Initial
|
||||
}
|
||||
|
||||
private Collection<StepExecution> pollReplies(final StepExecution masterStepExecution, final Set<StepExecution> split) throws Exception {
|
||||
final Collection<StepExecution> result = new ArrayList<StepExecution>(split.size());
|
||||
final Collection<StepExecution> result = new ArrayList<>(split.size());
|
||||
|
||||
Callable<Collection<StepExecution>> callback = new Callable<Collection<StepExecution>>() {
|
||||
@Override
|
||||
@@ -269,7 +269,7 @@ public class MessageChannelPartitionHandler implements PartitionHandler, Initial
|
||||
}
|
||||
};
|
||||
|
||||
Poller<Collection<StepExecution>> poller = new DirectPoller<Collection<StepExecution>>(pollInterval);
|
||||
Poller<Collection<StepExecution>> poller = new DirectPoller<>(pollInterval);
|
||||
Future<Collection<StepExecution>> resultsFuture = poller.poll(callback);
|
||||
|
||||
if(timeout >= 0) {
|
||||
|
||||
@@ -25,7 +25,7 @@ public class SmokeTests {
|
||||
@Autowired
|
||||
private PollableChannel smokeout;
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void testDummyWithSimpleAssert() throws Exception {
|
||||
assertTrue(true);
|
||||
@@ -33,7 +33,7 @@ public class SmokeTests {
|
||||
|
||||
@Test
|
||||
public void testVanillaSendAndReceive() throws Exception {
|
||||
smokein.send(new GenericMessage<String>("foo"));
|
||||
smokein.send(new GenericMessage<>("foo"));
|
||||
@SuppressWarnings("unchecked")
|
||||
Message<String> message = (Message<String>) smokeout.receive(100);
|
||||
String result = message == null ? null : message.getPayload();
|
||||
|
||||
@@ -46,7 +46,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
@ContextConfiguration
|
||||
public class AsyncItemProcessorMessagingGatewayTests {
|
||||
|
||||
private final AsyncItemProcessor<String, String> processor = new AsyncItemProcessor<String, String>();
|
||||
private final AsyncItemProcessor<String, String> processor = new AsyncItemProcessor<>();
|
||||
|
||||
private final StepExecution stepExecution = MetaDataInstanceFactory.createStepExecution(new JobParametersBuilder().addLong("factor", 2L).toJobParameters());;
|
||||
|
||||
@@ -82,7 +82,7 @@ public class AsyncItemProcessorMessagingGatewayTests {
|
||||
public void testMultiExecution() throws Exception {
|
||||
processor.setDelegate(delegate);
|
||||
processor.setTaskExecutor(new SimpleAsyncTaskExecutor());
|
||||
List<Future<String>> list = new ArrayList<Future<String>>();
|
||||
List<Future<String>> list = new ArrayList<>();
|
||||
for (int count = 0; count < 10; count++) {
|
||||
list.add(processor.process("foo" + count));
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
||||
|
||||
public class AsyncItemProcessorTests {
|
||||
|
||||
private AsyncItemProcessor<String, String> processor = new AsyncItemProcessor<String, String>();
|
||||
private AsyncItemProcessor<String, String> processor = new AsyncItemProcessor<>();
|
||||
|
||||
private ItemProcessor<String, String> delegate = new ItemProcessor<String, String>() {
|
||||
public String process(String item) throws Exception {
|
||||
@@ -75,7 +75,7 @@ public class AsyncItemProcessorTests {
|
||||
public void testMultiExecution() throws Exception {
|
||||
processor.setDelegate(delegate);
|
||||
processor.setTaskExecutor(new SimpleAsyncTaskExecutor());
|
||||
List<Future<String>> list = new ArrayList<Future<String>>();
|
||||
List<Future<String>> list = new ArrayList<>();
|
||||
for (int count = 0; count < 10; count++) {
|
||||
list.add(processor.process("foo" + count));
|
||||
}
|
||||
|
||||
@@ -50,23 +50,23 @@ public class AsyncItemWriterTests {
|
||||
@Before
|
||||
public void setup() {
|
||||
taskExecutor = new SimpleAsyncTaskExecutor();
|
||||
writtenItems = new ArrayList<String>();
|
||||
writer = new AsyncItemWriter<String>();
|
||||
writtenItems = new ArrayList<>();
|
||||
writer = new AsyncItemWriter<>();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRoseyScenario() throws Exception {
|
||||
writer.setDelegate(new ListItemWriter(writtenItems));
|
||||
List<FutureTask<String>> processedItems = new ArrayList<FutureTask<String>>();
|
||||
List<FutureTask<String>> processedItems = new ArrayList<>();
|
||||
|
||||
processedItems.add(new FutureTask<String>(new Callable<String>() {
|
||||
processedItems.add(new FutureTask<>(new Callable<String>() {
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "foo";
|
||||
}
|
||||
}));
|
||||
|
||||
processedItems.add(new FutureTask<String>(new Callable<String>() {
|
||||
processedItems.add(new FutureTask<>(new Callable<String>() {
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "bar";
|
||||
@@ -87,16 +87,16 @@ public class AsyncItemWriterTests {
|
||||
@Test
|
||||
public void testFilteredItem() throws Exception {
|
||||
writer.setDelegate(new ListItemWriter(writtenItems));
|
||||
List<FutureTask<String>> processedItems = new ArrayList<FutureTask<String>>();
|
||||
List<FutureTask<String>> processedItems = new ArrayList<>();
|
||||
|
||||
processedItems.add(new FutureTask<String>(new Callable<String>() {
|
||||
processedItems.add(new FutureTask<>(new Callable<String>() {
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "foo";
|
||||
}
|
||||
}));
|
||||
|
||||
processedItems.add(new FutureTask<String>(new Callable<String>() {
|
||||
processedItems.add(new FutureTask<>(new Callable<String>() {
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return null;
|
||||
@@ -116,16 +116,16 @@ public class AsyncItemWriterTests {
|
||||
@Test
|
||||
public void testException() throws Exception {
|
||||
writer.setDelegate(new ListItemWriter(writtenItems));
|
||||
List<FutureTask<String>> processedItems = new ArrayList<FutureTask<String>>();
|
||||
List<FutureTask<String>> processedItems = new ArrayList<>();
|
||||
|
||||
processedItems.add(new FutureTask<String>(new Callable<String>() {
|
||||
processedItems.add(new FutureTask<>(new Callable<String>() {
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "foo";
|
||||
}
|
||||
}));
|
||||
|
||||
processedItems.add(new FutureTask<String>(new Callable<String>() {
|
||||
processedItems.add(new FutureTask<>(new Callable<String>() {
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
throw new RuntimeException("This was expected");
|
||||
@@ -149,7 +149,7 @@ public class AsyncItemWriterTests {
|
||||
public void testExecutionException() {
|
||||
ListItemWriter delegate = new ListItemWriter(writtenItems);
|
||||
writer.setDelegate(delegate);
|
||||
List<Future<String>> processedItems = new ArrayList<Future<String>>();
|
||||
List<Future<String>> processedItems = new ArrayList<>();
|
||||
|
||||
processedItems.add(new Future<String>() {
|
||||
|
||||
@@ -194,7 +194,7 @@ public class AsyncItemWriterTests {
|
||||
ListItemStreamWriter itemWriter = new ListItemStreamWriter(writtenItems);
|
||||
writer.setDelegate(itemWriter);
|
||||
|
||||
List<FutureTask<String>> processedItems = new ArrayList<FutureTask<String>>();
|
||||
List<FutureTask<String>> processedItems = new ArrayList<>();
|
||||
|
||||
ExecutionContext executionContext = new ExecutionContext();
|
||||
writer.open(executionContext);
|
||||
@@ -212,7 +212,7 @@ public class AsyncItemWriterTests {
|
||||
ListItemWriter itemWriter = new ListItemWriter(writtenItems);
|
||||
writer.setDelegate(itemWriter);
|
||||
|
||||
List<FutureTask<String>> processedItems = new ArrayList<FutureTask<String>>();
|
||||
List<FutureTask<String>> processedItems = new ArrayList<>();
|
||||
|
||||
ExecutionContext executionContext = new ExecutionContext();
|
||||
writer.open(executionContext);
|
||||
|
||||
@@ -47,7 +47,7 @@ import static org.junit.Assert.assertTrue;
|
||||
@ContextConfiguration
|
||||
public class PollingAsyncItemProcessorMessagingGatewayTests {
|
||||
|
||||
private AsyncItemProcessor<String, String> processor = new AsyncItemProcessor<String, String>();
|
||||
private AsyncItemProcessor<String, String> processor = new AsyncItemProcessor<>();
|
||||
|
||||
private StepExecution stepExecution = MetaDataInstanceFactory.createStepExecution(new JobParametersBuilder().addLong("factor", 2L).toJobParameters());;
|
||||
|
||||
@@ -83,7 +83,7 @@ public class PollingAsyncItemProcessorMessagingGatewayTests {
|
||||
public void testMultiExecution() throws Exception {
|
||||
processor.setDelegate(delegate);
|
||||
processor.setTaskExecutor(new SimpleAsyncTaskExecutor());
|
||||
List<Future<String>> list = new ArrayList<Future<String>>();
|
||||
List<Future<String>> list = new ArrayList<>();
|
||||
for (int count = 0; count < 10; count++) {
|
||||
list.add(processor.process("foo" + count));
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ import static org.junit.Assert.assertTrue;
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class ChunkMessageItemWriterIntegrationTests {
|
||||
|
||||
private final ChunkMessageChannelItemWriter<Object> writer = new ChunkMessageChannelItemWriter<Object>();
|
||||
private final ChunkMessageChannelItemWriter<Object> writer = new ChunkMessageChannelItemWriter<>();
|
||||
|
||||
@Autowired
|
||||
@Qualifier("requests")
|
||||
@@ -57,7 +57,7 @@ public class ChunkMessageItemWriterIntegrationTests {
|
||||
@Qualifier("replies")
|
||||
private PollableChannel replies;
|
||||
|
||||
private final SimpleStepFactoryBean<Object, Object> factory = new SimpleStepFactoryBean<Object, Object>();
|
||||
private final SimpleStepFactoryBean<Object, Object> factory = new SimpleStepFactoryBean<>();
|
||||
|
||||
private SimpleJobRepository jobRepository;
|
||||
|
||||
@@ -115,7 +115,7 @@ public class ChunkMessageItemWriterIntegrationTests {
|
||||
@Test
|
||||
public void testVanillaIteration() throws Exception {
|
||||
|
||||
factory.setItemReader(new ListItemReader<String>(Arrays.asList(StringUtils
|
||||
factory.setItemReader(new ListItemReader<>(Arrays.asList(StringUtils
|
||||
.commaDelimitedListToStringArray("1,2,3,4,5,6"))));
|
||||
|
||||
Step step = factory.getObject();
|
||||
@@ -133,7 +133,7 @@ public class ChunkMessageItemWriterIntegrationTests {
|
||||
@Test
|
||||
public void testSimulatedRestart() throws Exception {
|
||||
|
||||
factory.setItemReader(new ListItemReader<String>(Arrays.asList(StringUtils
|
||||
factory.setItemReader(new ListItemReader<>(Arrays.asList(StringUtils
|
||||
.commaDelimitedListToStringArray("1,2,3,4,5,6"))));
|
||||
|
||||
Step step = factory.getObject();
|
||||
@@ -158,7 +158,7 @@ public class ChunkMessageItemWriterIntegrationTests {
|
||||
@Test
|
||||
public void testSimulatedRestartWithBadMessagesFromAnotherJob() throws Exception {
|
||||
|
||||
factory.setItemReader(new ListItemReader<String>(Arrays.asList(StringUtils
|
||||
factory.setItemReader(new ListItemReader<>(Arrays.asList(StringUtils
|
||||
.commaDelimitedListToStringArray("1,2,3,4,5,6"))));
|
||||
|
||||
Step step = factory.getObject();
|
||||
@@ -192,14 +192,14 @@ public class ChunkMessageItemWriterIntegrationTests {
|
||||
StepContribution stepContribution = new JobExecution(new JobInstance(0L, "job"), new JobParameters())
|
||||
.createStepExecution("step").createStepContribution();
|
||||
ChunkRequest chunk = new ChunkRequest(0, StringUtils.commaDelimitedListToSet(string), jobId, stepContribution);
|
||||
GenericMessage<ChunkRequest> message = new GenericMessage<ChunkRequest>(chunk);
|
||||
GenericMessage<ChunkRequest> message = new GenericMessage<>(chunk);
|
||||
return message;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEarlyCompletionSignalledInHandler() throws Exception {
|
||||
|
||||
factory.setItemReader(new ListItemReader<String>(Arrays.asList(StringUtils
|
||||
factory.setItemReader(new ListItemReader<>(Arrays.asList(StringUtils
|
||||
.commaDelimitedListToStringArray("1,fail,3,4,5,6"))));
|
||||
factory.setCommitInterval(2);
|
||||
|
||||
@@ -226,7 +226,7 @@ public class ChunkMessageItemWriterIntegrationTests {
|
||||
@Test
|
||||
public void testSimulatedRestartWithNoBacklog() throws Exception {
|
||||
|
||||
factory.setItemReader(new ListItemReader<String>(Arrays.asList(StringUtils
|
||||
factory.setItemReader(new ListItemReader<>(Arrays.asList(StringUtils
|
||||
.commaDelimitedListToStringArray("1,2,3,4,5,6"))));
|
||||
|
||||
Step step = factory.getObject();
|
||||
@@ -262,7 +262,7 @@ public class ChunkMessageItemWriterIntegrationTests {
|
||||
@Test
|
||||
public void testFailureInStepListener() throws Exception {
|
||||
|
||||
factory.setItemReader(new ListItemReader<String>(Arrays.asList(StringUtils
|
||||
factory.setItemReader(new ListItemReader<>(Arrays.asList(StringUtils
|
||||
.commaDelimitedListToStringArray("wait,fail,3,4,5,6"))));
|
||||
|
||||
Step step = factory.getObject();
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
public class ChunkProcessorChunkHandlerTests {
|
||||
|
||||
private ChunkProcessorChunkHandler<Object> handler = new ChunkProcessorChunkHandler<Object>();
|
||||
private ChunkProcessorChunkHandler<Object> handler = new ChunkProcessorChunkHandler<>();
|
||||
|
||||
protected int count = 0;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ChunkProcessorChunkHandlerTests {
|
||||
}
|
||||
});
|
||||
StepContribution stepContribution = MetaDataInstanceFactory.createStepExecution().createStepContribution();
|
||||
ChunkResponse response = handler.handleChunk(new ChunkRequest<Object>(0, StringUtils
|
||||
ChunkResponse response = handler.handleChunk(new ChunkRequest<>(0, StringUtils
|
||||
.commaDelimitedListToSet("foo,bar"), 12L, stepContribution));
|
||||
assertEquals(stepContribution, response.getStepContribution());
|
||||
assertEquals(12, response.getJobId().longValue());
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.util.SerializationUtils;
|
||||
*/
|
||||
public class ChunkRequestTests {
|
||||
|
||||
private ChunkRequest<String> request = new ChunkRequest<String>(0, Arrays.asList("foo", "bar"),
|
||||
private ChunkRequest<String> request = new ChunkRequest<>(0, Arrays.asList("foo", "bar"),
|
||||
111L, MetaDataInstanceFactory.createStepExecution().createStepContribution());
|
||||
|
||||
@Test
|
||||
|
||||
@@ -48,7 +48,7 @@ public class MessageSourcePollerInterceptorTests {
|
||||
}
|
||||
|
||||
public Message<String> receive() {
|
||||
return new GenericMessage<String>(payload);
|
||||
return new GenericMessage<>(payload);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class TestItemReader<T> implements ItemReader<T> {
|
||||
*/
|
||||
public static final String WAIT_ON = "wait";
|
||||
|
||||
private List<T> items = new ArrayList<T>();
|
||||
private List<T> items = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* @param items the items to set
|
||||
|
||||
@@ -70,7 +70,7 @@ public class ResourceSplitterIntegrationTests {
|
||||
@Ignore //FIXME
|
||||
// This broke with Integration 2.0 in a milestone, so watch out when upgrading...
|
||||
public void testVanillaConversion() throws Exception {
|
||||
resources.send(new GenericMessage<String>("classpath:*-context.xml"));
|
||||
resources.send(new GenericMessage<>("classpath:*-context.xml"));
|
||||
Message<Resource> message = (Message<Resource>) requests.receive(200L);
|
||||
assertNotNull(message);
|
||||
message = (Message<Resource>) requests.receive(100L);
|
||||
|
||||
@@ -86,7 +86,7 @@ public class JobLaunchingGatewayIntegrationTests {
|
||||
@DirtiesContext
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testNoReply() {
|
||||
GenericMessage<JobLaunchRequest> trigger = new GenericMessage<JobLaunchRequest>(new JobLaunchRequest(job,
|
||||
GenericMessage<JobLaunchRequest> trigger = new GenericMessage<>(new JobLaunchRequest(job,
|
||||
new JobParameters()));
|
||||
try {
|
||||
requestChannel.send(trigger);
|
||||
@@ -107,10 +107,10 @@ public class JobLaunchingGatewayIntegrationTests {
|
||||
public void testReply() {
|
||||
JobParametersBuilder builder = new JobParametersBuilder();
|
||||
builder.addString("dontclash", "12");
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put(MessageHeaders.REPLY_CHANNEL, "response");
|
||||
MessageHeaders headers = new MessageHeaders(map);
|
||||
GenericMessage<JobLaunchRequest> trigger = new GenericMessage<JobLaunchRequest>(new JobLaunchRequest(job,
|
||||
GenericMessage<JobLaunchRequest> trigger = new GenericMessage<>(new JobLaunchRequest(job,
|
||||
builder.toJobParameters()), headers);
|
||||
requestChannel.send(trigger);
|
||||
Message<JobExecution> executionMessage = (Message<JobExecution>) responseChannel.receive(1000);
|
||||
@@ -149,10 +149,10 @@ public class JobLaunchingGatewayIntegrationTests {
|
||||
|
||||
JobParametersBuilder builder = new JobParametersBuilder();
|
||||
builder.addString("dontclash", "12");
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put(MessageHeaders.REPLY_CHANNEL, "response");
|
||||
MessageHeaders headers = new MessageHeaders(map);
|
||||
GenericMessage<JobLaunchRequest> trigger = new GenericMessage<JobLaunchRequest>(new JobLaunchRequest(testJob,
|
||||
GenericMessage<JobLaunchRequest> trigger = new GenericMessage<>(new JobLaunchRequest(testJob,
|
||||
builder.toJobParameters()), headers);
|
||||
requestChannel.send(trigger);
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public class JobLaunchingMessageHandlerIntegrationTests {
|
||||
@DirtiesContext
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testNoReply() {
|
||||
GenericMessage<JobLaunchRequest> trigger = new GenericMessage<JobLaunchRequest>(new JobLaunchRequest(job,
|
||||
GenericMessage<JobLaunchRequest> trigger = new GenericMessage<>(new JobLaunchRequest(job,
|
||||
new JobParameters()));
|
||||
try {
|
||||
requestChannel.send(trigger);
|
||||
@@ -72,10 +72,10 @@ public class JobLaunchingMessageHandlerIntegrationTests {
|
||||
public void testReply() {
|
||||
JobParametersBuilder builder = new JobParametersBuilder();
|
||||
builder.addString("dontclash", "12");
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put(MessageHeaders.REPLY_CHANNEL, "response");
|
||||
MessageHeaders headers = new MessageHeaders(map);
|
||||
GenericMessage<JobLaunchRequest> trigger = new GenericMessage<JobLaunchRequest>(new JobLaunchRequest(job,
|
||||
GenericMessage<JobLaunchRequest> trigger = new GenericMessage<>(new JobLaunchRequest(job,
|
||||
builder.toJobParameters()), headers);
|
||||
requestChannel.send(trigger);
|
||||
Message<JobExecution> executionMessage = (Message<JobExecution>) responseChannel.receive(1000);
|
||||
|
||||
@@ -41,9 +41,9 @@ public class JobLaunchingMessageHandlerTests extends AbstractJUnit4SpringContext
|
||||
|
||||
private static class StubJobLauncher implements JobLauncher {
|
||||
|
||||
List<Job> jobs = new ArrayList<Job>();
|
||||
List<Job> jobs = new ArrayList<>();
|
||||
|
||||
List<JobParameters> parameters = new ArrayList<JobParameters>();
|
||||
List<JobParameters> parameters = new ArrayList<>();
|
||||
|
||||
AtomicLong jobId = new AtomicLong();
|
||||
|
||||
|
||||
@@ -29,13 +29,13 @@ public class RepeatTransactionalPollingIntegrationTests implements ApplicationCo
|
||||
|
||||
private Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private static List<String> processed = new ArrayList<String>();
|
||||
private static List<String> processed = new ArrayList<>();
|
||||
|
||||
private static List<String> expected;
|
||||
|
||||
private static List<String> handled = new ArrayList<String>();
|
||||
private static List<String> handled = new ArrayList<>();
|
||||
|
||||
private static List<String> list = new ArrayList<String>();
|
||||
private static List<String> list = new ArrayList<>();
|
||||
|
||||
private Lifecycle bus;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class RetryRepeatTransactionalPollingIntegrationTests implements Applicat
|
||||
|
||||
private Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private volatile static List<String> list = new ArrayList<String>();
|
||||
private volatile static List<String> list = new ArrayList<>();
|
||||
|
||||
@Autowired
|
||||
private SimpleRecoverer recoverer;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class RetryTransactionalPollingIntegrationTests implements ApplicationCon
|
||||
|
||||
private Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private static List<String> list = new ArrayList<String>();
|
||||
private static List<String> list = new ArrayList<>();
|
||||
|
||||
@Autowired
|
||||
private SimpleRecoverer recoverer;
|
||||
|
||||
@@ -15,7 +15,7 @@ public final class SimpleRecoverer implements MethodInvocationRecoverer<String>
|
||||
|
||||
private Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private final List<String> recovered = new ArrayList<String>();
|
||||
private final List<String> recovered = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Public getter for the recovered.
|
||||
|
||||
@@ -14,9 +14,9 @@ public class SimpleService implements Service {
|
||||
|
||||
private Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private List<String> processed = new CopyOnWriteArrayList<String>();
|
||||
private List<String> processed = new CopyOnWriteArrayList<>();
|
||||
|
||||
private List<String> expected = new ArrayList<String>();
|
||||
private List<String> expected = new ArrayList<>();
|
||||
|
||||
private int count = 0;
|
||||
|
||||
|
||||
@@ -30,13 +30,13 @@ public class TransactionalPollingIntegrationTests implements ApplicationContextA
|
||||
|
||||
private Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private static List<String> processed = new ArrayList<String>();
|
||||
private static List<String> processed = new ArrayList<>();
|
||||
|
||||
private static List<String> handled = new ArrayList<String>();
|
||||
private static List<String> handled = new ArrayList<>();
|
||||
|
||||
private static List<String> expected = new ArrayList<String>();
|
||||
private static List<String> expected = new ArrayList<>();
|
||||
|
||||
private static List<String> list = new ArrayList<String>();
|
||||
private static List<String> list = new ArrayList<>();
|
||||
|
||||
private Lifecycle bus;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user