diff --git a/spring-batch-admin-parent/pom.xml b/spring-batch-admin-parent/pom.xml index f763d168c..97967d24d 100755 --- a/spring-batch-admin-parent/pom.xml +++ b/spring-batch-admin-parent/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.batch spring-batch-admin-parent - 1.3.0.BUILD-SNAPSHOT + 2.0.0.BUILD-SNAPSHOT Spring Batch Admin Parent A set of services (Java, JSON) and a UI (webapp) for managing and launching Spring Batch jobs. http://www.springsource.org/spring-batch-admin @@ -34,10 +34,10 @@ false - 2.2.3.BUILD-SNAPSHOT - 3.2.1.RELEASE - 2.2.5.RELEASE - 1.0.2.RELEASE + 2.2.4.BUILD-SNAPSHOT + 4.0.0.BUILD-SNAPSHOT + 4.0.0.BUILD-SNAPSHOT + 1.0.3.RELEASE @@ -346,7 +346,7 @@ org.codehaus.jackson jackson-mapper-asl - 1.6.3 + 1.9.2 test diff --git a/spring-batch-integration/pom.xml b/spring-batch-integration/pom.xml index 2e7ed1bfa..08e25a0ca 100644 --- a/spring-batch-integration/pom.xml +++ b/spring-batch-integration/pom.xml @@ -7,7 +7,7 @@ org.springframework.batch spring-batch-admin-parent - 1.3.0.BUILD-SNAPSHOT + 2.0.0.BUILD-SNAPSHOT ../spring-batch-admin-parent diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/StepExecutionInterceptor.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/StepExecutionInterceptor.java index 7fd5a9083..056eade96 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/StepExecutionInterceptor.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/StepExecutionInterceptor.java @@ -18,11 +18,11 @@ package org.springframework.batch.integration.async; import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.scope.context.StepContext; import org.springframework.batch.core.scope.context.StepSynchronizationManager; -import org.springframework.integration.Message; -import org.springframework.integration.MessageChannel; import org.springframework.integration.channel.ChannelInterceptor; import org.springframework.integration.channel.interceptor.ChannelInterceptorAdapter; import org.springframework.integration.support.MessageBuilder; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageChannel; /** * A {@link ChannelInterceptor} that adds the current {@link StepExecution} (if @@ -30,9 +30,9 @@ import org.springframework.integration.support.MessageBuilder; * can then take advantage of the step context without needing to be step * scoped, which is a problem for handlers executing in another thread because * the scope context is not available. - * + * * @author Dave Syer - * + * */ public class StepExecutionInterceptor extends ChannelInterceptorAdapter { diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/ChunkMessageChannelItemWriter.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/ChunkMessageChannelItemWriter.java index 588a0fe63..0a6782790 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/ChunkMessageChannelItemWriter.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/ChunkMessageChannelItemWriter.java @@ -34,10 +34,10 @@ import org.springframework.batch.item.ExecutionContext; import org.springframework.batch.item.ItemStream; import org.springframework.batch.item.ItemStreamException; import org.springframework.batch.item.ItemWriter; -import org.springframework.integration.Message; -import org.springframework.integration.core.MessagingOperations; -import org.springframework.integration.core.PollableChannel; -import org.springframework.integration.message.GenericMessage; +import org.springframework.integration.core.MessagingTemplate; +import org.springframework.messaging.Message; +import org.springframework.messaging.PollableChannel; +import org.springframework.messaging.support.GenericMessage; import org.springframework.util.Assert; public class ChunkMessageChannelItemWriter extends StepExecutionListenerSupport implements ItemWriter, @@ -51,13 +51,13 @@ public class ChunkMessageChannelItemWriter extends StepExecutionListenerSuppo private static final long DEFAULT_THROTTLE_LIMIT = 6; - private MessagingOperations messagingGateway; + private MessagingTemplate messagingGateway; - private LocalState localState = new LocalState(); + private final LocalState localState = new LocalState(); private long throttleLimit = DEFAULT_THROTTLE_LIMIT; - private int DEFAULT_MAX_WAIT_TIMEOUTS = 40; + private final int DEFAULT_MAX_WAIT_TIMEOUTS = 40; private int maxWaitTimeouts = DEFAULT_MAX_WAIT_TIMEOUTS; @@ -67,7 +67,7 @@ public class ChunkMessageChannelItemWriter extends StepExecutionListenerSuppo * The maximum number of times to wait at the end of a step for a non-null result from the remote workers. This is a * multiplier on the receive timeout set separately on the gateway. The ideal value is a compromise between allowing * slow workers time to finish, and responsiveness if there is a dead worker. Defaults to 40. - * + * * @param maxWaitTimeouts the maximum number of wait timeouts */ public void setMaxWaitTimeouts(int maxWaitTimeouts) { @@ -83,7 +83,7 @@ public class ChunkMessageChannelItemWriter extends StepExecutionListenerSuppo this.throttleLimit = throttleLimit; } - public void setMessagingOperations(MessagingOperations messagingGateway) { + public void setMessagingOperations(MessagingTemplate messagingGateway) { this.messagingGateway = messagingGateway; } @@ -184,7 +184,7 @@ public class ChunkMessageChannelItemWriter extends StepExecutionListenerSuppo /** * Wait until all the results that are in the pipeline come back to the reply channel. - * + * * @return true if successfully received a result, false if timed out */ private boolean waitForResults() throws AsynchronousFailureException { @@ -210,9 +210,9 @@ public class ChunkMessageChannelItemWriter extends StepExecutionListenerSuppo /** * Get the next result if it is available (within the timeout specified in the gateway), otherwise do nothing. - * + * * @throws AsynchronousFailureException If there is a response and it contains a failed chunk response. - * + * * @throws IllegalStateException if the result contains the wrong job instance id (maybe we are sharing a channel * and we shouldn't be) */ @@ -263,17 +263,17 @@ public class ChunkMessageChannelItemWriter extends StepExecutionListenerSuppo private static class LocalState { - private AtomicInteger current = new AtomicInteger(-1); + private final AtomicInteger current = new AtomicInteger(-1); - private AtomicInteger actual = new AtomicInteger(); + private final AtomicInteger actual = new AtomicInteger(); - private AtomicInteger expected = new AtomicInteger(); + private final AtomicInteger expected = new AtomicInteger(); - private AtomicInteger redelivered = new AtomicInteger(); + private final AtomicInteger redelivered = new AtomicInteger(); private StepExecution stepExecution; - private Queue contributions = new LinkedBlockingQueue(); + private final Queue contributions = new LinkedBlockingQueue(); public int getExpecting() { return expected.get() - actual.get(); diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptor.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptor.java index c7372f097..e66b7d8ec 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptor.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptor.java @@ -3,11 +3,11 @@ package org.springframework.batch.integration.chunk; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.InitializingBean; -import org.springframework.integration.Message; -import org.springframework.integration.MessageChannel; import org.springframework.integration.channel.ChannelInterceptor; import org.springframework.integration.channel.interceptor.ChannelInterceptorAdapter; import org.springframework.integration.core.MessageSource; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageChannel; import org.springframework.util.Assert; @@ -16,9 +16,9 @@ import org.springframework.util.Assert; * receive() on the channel it will delegate to a {@link MessageSource} to pull the message directly from * an external source. This is particularly useful in combination with a message channel in thread scope, in which case * the receive() can join a transaction which was started by the caller. - * + * * @author Dave Syer - * + * */ public class MessageSourcePollerInterceptor extends ChannelInterceptorAdapter implements InitializingBean { @@ -44,7 +44,7 @@ public class MessageSourcePollerInterceptor extends ChannelInterceptorAdapter im /** * Optional MessageChannel for injecting the message received from the source (defaults to the channel intercepted * in {@link #preReceive(MessageChannel)}). - * + * * @param channel the channel to set */ public void setChannel(MessageChannel channel) { @@ -69,7 +69,7 @@ public class MessageSourcePollerInterceptor extends ChannelInterceptorAdapter im /** * Receive from the {@link MessageSource} and send immediately to the input channel, so that the call that we are * intercepting always a message to receive. - * + * * @see ChannelInterceptorAdapter#preReceive(MessageChannel) */ @Override diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/launch/JobLaunchingGateway.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/launch/JobLaunchingGateway.java index 201a03d2e..16b56f623 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/launch/JobLaunchingGateway.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/launch/JobLaunchingGateway.java @@ -19,9 +19,9 @@ package org.springframework.batch.integration.launch; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobExecutionException; import org.springframework.batch.core.launch.JobLauncher; -import org.springframework.integration.Message; import org.springframework.integration.MessageHandlingException; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; +import org.springframework.messaging.Message; import org.springframework.util.Assert; /** diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandler.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandler.java index b0fa801d8..b0599c1d7 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandler.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandler.java @@ -11,15 +11,15 @@ import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.partition.PartitionHandler; import org.springframework.batch.core.partition.StepExecutionSplitter; import org.springframework.batch.core.repository.JobRepository; -import org.springframework.integration.Message; -import org.springframework.integration.MessageChannel; import org.springframework.integration.annotation.Aggregator; import org.springframework.integration.annotation.MessageEndpoint; import org.springframework.integration.annotation.Payloads; import org.springframework.integration.channel.QueueChannel; -import org.springframework.integration.core.MessagingOperations; -import org.springframework.integration.core.PollableChannel; +import org.springframework.integration.core.MessagingTemplate; import org.springframework.integration.support.MessageBuilder; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageChannel; +import org.springframework.messaging.PollableChannel; import org.springframework.util.Assert; /** @@ -30,10 +30,10 @@ import org.springframework.util.Assert; * well as a remote web service or JMS implementation. If a remote worker fails or doesn't send a reply message, the job * will fail and can be restarted to pick up missing messages and processing. The remote workers need access to the * Spring Batch {@link JobRepository} so that the shared state across those restarts can be managed centrally. - * + * * @author Dave Syer * @author Will Schipp - * + * */ @MessageEndpoint public class MessageChannelPartitionHandler implements PartitionHandler { @@ -42,10 +42,10 @@ public class MessageChannelPartitionHandler implements PartitionHandler { private int gridSize = 1; - private MessagingOperations messagingGateway; + private MessagingTemplate messagingGateway; private String stepName; - + /** * pollable channel for the replies */ @@ -62,10 +62,10 @@ public class MessageChannelPartitionHandler implements PartitionHandler { * internally:
  • request channel capable of accepting {@link StepExecutionRequest} payloads
  • reply * channel that returns a list of {@link StepExecution} results
The timeout for the repoy should be set * sufficiently long that the remote steps have time to complete. - * + * * @param messagingGateway the {@link MessagingOperations} to set */ - public void setMessagingOperations(MessagingOperations messagingGateway) { + public void setMessagingOperations(MessagingTemplate messagingGateway) { this.messagingGateway = messagingGateway; } @@ -73,7 +73,7 @@ public class MessageChannelPartitionHandler implements PartitionHandler { * Passed to the {@link StepExecutionSplitter} in the {@link #handle(StepExecutionSplitter, StepExecution)} method, * instructing it how many {@link StepExecution} instances are required, ideally. The {@link StepExecutionSplitter} * is allowed to ignore the grid size in the case of a restart, since the input data partitions must be preserved. - * + * * @param gridSize the number of step executions that will be created */ public void setGridSize(int gridSize) { @@ -85,7 +85,7 @@ public class MessageChannelPartitionHandler implements PartitionHandler { * regular Spring Batch step, with all the business logic required to complete an execution based on the input * parameters in its {@link StepExecution} context. The name will be translated into a {@link Step} instance by the * remote worker. - * + * * @param stepName the name of the {@link Step} instance to execute business logic */ public void setStepName(String stepName) { @@ -110,7 +110,7 @@ public class MessageChannelPartitionHandler implements PartitionHandler { * receives the result back as a list of {@link StepExecution} on a reply channel. Use the {@link #aggregate(List)} * method as an aggregator of the individual remote replies. The receive timeout needs to be set realistically in * the {@link MessagingOperations} and the aggregator, so that there is a good chance of all work being done. - * + * * @see PartitionHandler#handle(StepExecutionSplitter, StepExecution) */ public Collection handle(StepExecutionSplitter stepExecutionSplitter, @@ -118,11 +118,11 @@ public class MessageChannelPartitionHandler implements PartitionHandler { Set split = stepExecutionSplitter.split(masterStepExecution, gridSize); int count = 0; - + if (replyChannel == null) { replyChannel = new QueueChannel(); - }//end if - + }//end if + for (StepExecution stepExecution : split) { Message request = createMessage(count++, split.size(), new StepExecutionRequest( stepName, stepExecution.getJobExecutionId(), stepExecution.getId()), replyChannel); diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/SmokeTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/SmokeTests.java index 288d57cfa..bb5d10281 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/SmokeTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/SmokeTests.java @@ -6,12 +6,12 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.integration.Message; -import org.springframework.integration.MessageChannel; import org.springframework.integration.annotation.MessageEndpoint; import org.springframework.integration.annotation.ServiceActivator; -import org.springframework.integration.core.PollableChannel; -import org.springframework.integration.message.GenericMessage; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageChannel; +import org.springframework.messaging.PollableChannel; +import org.springframework.messaging.support.GenericMessage; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -25,7 +25,7 @@ public class SmokeTests { @Autowired private PollableChannel smokeout; - + // This has to be static because Spring Integration registers the handler // more than once (every time a test instance is created), but only one of // them will get the message. @@ -48,7 +48,7 @@ public class SmokeTests { smokein.send(new GenericMessage("foo")); @SuppressWarnings("unchecked") Message message = (Message) smokeout.receive(100); - String result = (String) (message == null ? null : message.getPayload()); + String result = message == null ? null : message.getPayload(); assertEquals("foo: 1", result); assertEquals(1, count); } diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkMessageItemWriterIntegrationTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkMessageItemWriterIntegrationTests.java index f4e795c7b..fe9d1ab9c 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkMessageItemWriterIntegrationTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkMessageItemWriterIntegrationTests.java @@ -33,11 +33,11 @@ import org.springframework.batch.item.support.ListItemReader; import org.springframework.batch.support.transaction.ResourcelessTransactionManager; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.integration.Message; -import org.springframework.integration.MessageChannel; import org.springframework.integration.core.MessagingTemplate; -import org.springframework.integration.core.PollableChannel; -import org.springframework.integration.message.GenericMessage; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageChannel; +import org.springframework.messaging.PollableChannel; +import org.springframework.messaging.support.GenericMessage; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.util.StringUtils; @@ -46,7 +46,7 @@ import org.springframework.util.StringUtils; @RunWith(SpringJUnit4ClassRunner.class) public class ChunkMessageItemWriterIntegrationTests { - private ChunkMessageChannelItemWriter writer = new ChunkMessageChannelItemWriter(); + private final ChunkMessageChannelItemWriter writer = new ChunkMessageChannelItemWriter(); @Autowired @Qualifier("requests") @@ -56,7 +56,7 @@ public class ChunkMessageItemWriterIntegrationTests { @Qualifier("replies") private PollableChannel replies; - private SimpleStepFactoryBean factory = new SimpleStepFactoryBean(); + private final SimpleStepFactoryBean factory = new SimpleStepFactoryBean(); private SimpleJobRepository jobRepository; diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptorTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptorTests.java index a21368395..d319f4bc8 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptorTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptorTests.java @@ -4,10 +4,10 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import org.junit.Test; -import org.springframework.integration.Message; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.core.MessageSource; -import org.springframework.integration.message.GenericMessage; +import org.springframework.messaging.Message; +import org.springframework.messaging.support.GenericMessage; public class MessageSourcePollerInterceptorTests { @@ -40,7 +40,7 @@ public class MessageSourcePollerInterceptorTests { private static class TestMessageSource implements MessageSource { - private String payload; + private final String payload; public TestMessageSource(String payload) { super(); diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests.java index dd006fb19..ebc2b45e6 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests.java @@ -16,8 +16,8 @@ import org.springframework.batch.core.JobParametersBuilder; import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.launch.JobLauncher; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.integration.Message; -import org.springframework.integration.core.PollableChannel; +import org.springframework.messaging.Message; +import org.springframework.messaging.PollableChannel; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -30,10 +30,10 @@ public class RemoteChunkFaultTolerantStepIntegrationTests { @Autowired private Job job; - + @Autowired private PollableChannel replies; - + @Before public void drain() { Message message = replies.receive(100L); diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepJdbcIntegrationTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepJdbcIntegrationTests.java index 604168364..373d8a193 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepJdbcIntegrationTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepJdbcIntegrationTests.java @@ -16,8 +16,8 @@ import org.springframework.batch.core.JobParametersBuilder; import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.launch.JobLauncher; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.integration.Message; -import org.springframework.integration.core.PollableChannel; +import org.springframework.messaging.Message; +import org.springframework.messaging.PollableChannel; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/file/FileToMessagesJobIntegrationTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/file/FileToMessagesJobIntegrationTests.java index 0b87f3140..6175bc647 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/file/FileToMessagesJobIntegrationTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/file/FileToMessagesJobIntegrationTests.java @@ -27,15 +27,15 @@ import org.springframework.batch.core.JobParametersBuilder; import org.springframework.batch.core.launch.JobLauncher; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.integration.Message; -import org.springframework.integration.core.MessageHandler; -import org.springframework.integration.core.SubscribableChannel; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageHandler; +import org.springframework.messaging.SubscribableChannel; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * @author Dave Syer - * + * */ @ContextConfiguration() @RunWith(SpringJUnit4ClassRunner.class) diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/file/ResourceSplitterIntegrationTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/file/ResourceSplitterIntegrationTests.java index 8d570ba07..7c06b4c9e 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/file/ResourceSplitterIntegrationTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/file/ResourceSplitterIntegrationTests.java @@ -25,18 +25,18 @@ import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.core.io.Resource; -import org.springframework.integration.Message; -import org.springframework.integration.MessageChannel; import org.springframework.integration.annotation.MessageEndpoint; import org.springframework.integration.annotation.Splitter; -import org.springframework.integration.core.PollableChannel; -import org.springframework.integration.message.GenericMessage; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageChannel; +import org.springframework.messaging.PollableChannel; +import org.springframework.messaging.support.GenericMessage; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * @author Dave Syer - * + * */ @ContextConfiguration() @RunWith(SpringJUnit4ClassRunner.class) @@ -53,7 +53,7 @@ public class ResourceSplitterIntegrationTests { /* * This is so cool (but see INT-190)...
- * + * * The incoming message is a Resource pattern, and it is converted to the * correct payload type with Spring's default strategy */ diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingGatewayIntegrationTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingGatewayIntegrationTests.java index 9d5f02f2f..fa35bccd6 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingGatewayIntegrationTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingGatewayIntegrationTests.java @@ -36,14 +36,14 @@ import org.springframework.batch.integration.JobSupport; import org.springframework.batch.integration.step.TestTasklet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.integration.Message; -import org.springframework.integration.MessageChannel; import org.springframework.integration.MessageHandlingException; -import org.springframework.integration.MessageHeaders; -import org.springframework.integration.MessagingException; -import org.springframework.integration.core.PollableChannel; -import org.springframework.integration.message.GenericMessage; import org.springframework.integration.support.MessageBuilder; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageChannel; +import org.springframework.messaging.MessageHeaders; +import org.springframework.messaging.MessagingException; +import org.springframework.messaging.PollableChannel; +import org.springframework.messaging.support.GenericMessage; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -72,7 +72,7 @@ public class JobLaunchingGatewayIntegrationTests { @Autowired private Job testJob; - private JobSupport job = new JobSupport("testJob"); + private final JobSupport job = new JobSupport("testJob"); @Before public void setUp() { diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingGatewayTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingGatewayTests.java index 0765195d4..f6601b572 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingGatewayTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingGatewayTests.java @@ -27,9 +27,9 @@ import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.JobParametersInvalidException; import org.springframework.batch.core.launch.JobLauncher; import org.springframework.batch.integration.JobSupport; -import org.springframework.integration.Message; import org.springframework.integration.MessageHandlingException; import org.springframework.integration.support.MessageBuilder; +import org.springframework.messaging.Message; /** * diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingMessageHandlerIntegrationTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingMessageHandlerIntegrationTests.java index 746b0ea2a..e67c3a73a 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingMessageHandlerIntegrationTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingMessageHandlerIntegrationTests.java @@ -16,12 +16,12 @@ import org.springframework.batch.core.JobParametersBuilder; import org.springframework.batch.integration.JobSupport; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.integration.Message; -import org.springframework.integration.MessageChannel; -import org.springframework.integration.MessageHeaders; -import org.springframework.integration.MessagingException; -import org.springframework.integration.core.PollableChannel; -import org.springframework.integration.message.GenericMessage; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageChannel; +import org.springframework.messaging.MessageHeaders; +import org.springframework.messaging.MessagingException; +import org.springframework.messaging.PollableChannel; +import org.springframework.messaging.support.GenericMessage; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -38,7 +38,7 @@ public class JobLaunchingMessageHandlerIntegrationTests { @Qualifier("response") private PollableChannel responseChannel; - private JobSupport job = new JobSupport("testJob"); + private final JobSupport job = new JobSupport("testJob"); @Before public void setUp() { diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandlerTest.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandlerTest.java index 6c425a036..3b5d812c4 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandlerTest.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandlerTest.java @@ -12,19 +12,19 @@ import java.util.Collections; import org.junit.Test; import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.partition.StepExecutionSplitter; -import org.springframework.integration.Message; -import org.springframework.integration.core.MessagingOperations; -import org.springframework.integration.core.PollableChannel; +import org.springframework.integration.core.MessagingTemplate; +import org.springframework.messaging.Message; +import org.springframework.messaging.PollableChannel; /** - * + * * @author Will Schipp * */ public class MessageChannelPartitionHandlerTest { private MessageChannelPartitionHandler messageChannelPartitionHandler; - + @Test public void testHandleNoReply() throws Exception { //execute with no default set @@ -32,21 +32,21 @@ public class MessageChannelPartitionHandlerTest { //mock StepExecution masterStepExecution = mock(StepExecution.class); StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class); - MessagingOperations operations = mock(MessagingOperations.class); + MessagingTemplate operations = mock(MessagingTemplate.class); Message message = mock(Message.class); //when when(message.getPayload()).thenReturn(Collections.emptyList()); when(operations.receive((PollableChannel) anyObject())).thenReturn(message); //set messageChannelPartitionHandler.setMessagingOperations(operations); - + //execute Collection executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution); //verify assertNotNull(executions); assertTrue(executions.isEmpty()); } - + @Test public void testHandleWithReplyChannel() throws Exception { //execute with no default set @@ -54,7 +54,7 @@ public class MessageChannelPartitionHandlerTest { //mock StepExecution masterStepExecution = mock(StepExecution.class); StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class); - MessagingOperations operations = mock(MessagingOperations.class); + MessagingTemplate operations = mock(MessagingTemplate.class); Message message = mock(Message.class); PollableChannel replyChannel = mock(PollableChannel.class); //when @@ -63,13 +63,13 @@ public class MessageChannelPartitionHandlerTest { //set messageChannelPartitionHandler.setMessagingOperations(operations); messageChannelPartitionHandler.setReplyChannel(replyChannel); - + //execute Collection executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution); //verify assertNotNull(executions); assertTrue(executions.isEmpty()); - + } } diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests-context.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests-context.xml index 83d6363c0..935772bbf 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests-context.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests-context.xml @@ -105,7 +105,7 @@ + pointcut="execution(* org.springframework.messaging.MessageChannel+.send(..)) and bean(requests)" /> \ No newline at end of file