Remove usage of master/slave terminology
This commit is contained in:
@@ -48,6 +48,7 @@ import static org.mockito.Mockito.when;
|
||||
*
|
||||
* @author Will Schipp
|
||||
* @author Michael Minella
|
||||
* @author Mahmoud Ben Hassine
|
||||
*
|
||||
*/
|
||||
public class MessageChannelPartitionHandlerTests {
|
||||
@@ -59,11 +60,11 @@ public class MessageChannelPartitionHandlerTests {
|
||||
//execute with no default set
|
||||
messageChannelPartitionHandler = new MessageChannelPartitionHandler();
|
||||
//mock
|
||||
StepExecution masterStepExecution = mock(StepExecution.class);
|
||||
StepExecution managerStepExecution = mock(StepExecution.class);
|
||||
StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class);
|
||||
|
||||
//execute
|
||||
Collection<StepExecution> executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution);
|
||||
Collection<StepExecution> executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, managerStepExecution);
|
||||
//verify
|
||||
assertTrue(executions.isEmpty());
|
||||
}
|
||||
@@ -74,7 +75,7 @@ public class MessageChannelPartitionHandlerTests {
|
||||
//execute with no default set
|
||||
messageChannelPartitionHandler = new MessageChannelPartitionHandler();
|
||||
//mock
|
||||
StepExecution masterStepExecution = mock(StepExecution.class);
|
||||
StepExecution managerStepExecution = mock(StepExecution.class);
|
||||
StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class);
|
||||
MessagingTemplate operations = mock(MessagingTemplate.class);
|
||||
Message message = mock(Message.class);
|
||||
@@ -88,7 +89,7 @@ public class MessageChannelPartitionHandlerTests {
|
||||
messageChannelPartitionHandler.setMessagingOperations(operations);
|
||||
|
||||
//execute
|
||||
Collection<StepExecution> executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution);
|
||||
Collection<StepExecution> executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, managerStepExecution);
|
||||
//verify
|
||||
assertNotNull(executions);
|
||||
assertTrue(executions.isEmpty());
|
||||
@@ -100,7 +101,7 @@ public class MessageChannelPartitionHandlerTests {
|
||||
//execute with no default set
|
||||
messageChannelPartitionHandler = new MessageChannelPartitionHandler();
|
||||
//mock
|
||||
StepExecution masterStepExecution = mock(StepExecution.class);
|
||||
StepExecution managerStepExecution = mock(StepExecution.class);
|
||||
StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class);
|
||||
MessagingTemplate operations = mock(MessagingTemplate.class);
|
||||
Message message = mock(Message.class);
|
||||
@@ -116,7 +117,7 @@ public class MessageChannelPartitionHandlerTests {
|
||||
messageChannelPartitionHandler.setReplyChannel(replyChannel);
|
||||
|
||||
//execute
|
||||
Collection<StepExecution> executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution);
|
||||
Collection<StepExecution> executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, managerStepExecution);
|
||||
//verify
|
||||
assertNotNull(executions);
|
||||
assertTrue(executions.isEmpty());
|
||||
@@ -129,7 +130,7 @@ public class MessageChannelPartitionHandlerTests {
|
||||
//execute with no default set
|
||||
messageChannelPartitionHandler = new MessageChannelPartitionHandler();
|
||||
//mock
|
||||
StepExecution masterStepExecution = mock(StepExecution.class);
|
||||
StepExecution managerStepExecution = mock(StepExecution.class);
|
||||
StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class);
|
||||
MessagingTemplate operations = mock(MessagingTemplate.class);
|
||||
Message message = mock(Message.class);
|
||||
@@ -142,7 +143,7 @@ public class MessageChannelPartitionHandlerTests {
|
||||
messageChannelPartitionHandler.setMessagingOperations(operations);
|
||||
|
||||
//execute
|
||||
messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution);
|
||||
messageChannelPartitionHandler.handle(stepExecutionSplitter, managerStepExecution);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -151,7 +152,7 @@ public class MessageChannelPartitionHandlerTests {
|
||||
messageChannelPartitionHandler = new MessageChannelPartitionHandler();
|
||||
//mock
|
||||
JobExecution jobExecution = new JobExecution(5L, new JobParameters());
|
||||
StepExecution masterStepExecution = new StepExecution("step1", jobExecution, 1L);
|
||||
StepExecution managerStepExecution = new StepExecution("step1", jobExecution, 1L);
|
||||
StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class);
|
||||
MessagingTemplate operations = mock(MessagingTemplate.class);
|
||||
JobExplorer jobExplorer = mock(JobExplorer.class);
|
||||
@@ -179,7 +180,7 @@ public class MessageChannelPartitionHandlerTests {
|
||||
messageChannelPartitionHandler.afterPropertiesSet();
|
||||
|
||||
//execute
|
||||
Collection<StepExecution> executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution);
|
||||
Collection<StepExecution> executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, managerStepExecution);
|
||||
//verify
|
||||
assertNotNull(executions);
|
||||
assertEquals(3, executions.size());
|
||||
@@ -197,7 +198,7 @@ public class MessageChannelPartitionHandlerTests {
|
||||
messageChannelPartitionHandler = new MessageChannelPartitionHandler();
|
||||
//mock
|
||||
JobExecution jobExecution = new JobExecution(5L, new JobParameters());
|
||||
StepExecution masterStepExecution = new StepExecution("step1", jobExecution, 1L);
|
||||
StepExecution managerStepExecution = new StepExecution("step1", jobExecution, 1L);
|
||||
StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class);
|
||||
MessagingTemplate operations = mock(MessagingTemplate.class);
|
||||
JobExplorer jobExplorer = mock(JobExplorer.class);
|
||||
@@ -223,6 +224,6 @@ public class MessageChannelPartitionHandlerTests {
|
||||
messageChannelPartitionHandler.afterPropertiesSet();
|
||||
|
||||
//execute
|
||||
messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution);
|
||||
messageChannelPartitionHandler.handle(stepExecutionSplitter, managerStepExecution);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,8 +46,8 @@ import static org.springframework.test.util.ReflectionTestUtils.getField;
|
||||
* @author Mahmoud Ben Hassine
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@ContextConfiguration(classes = {RemotePartitioningMasterStepBuilderTests.BatchConfiguration.class})
|
||||
public class RemotePartitioningMasterStepBuilderTests {
|
||||
@ContextConfiguration(classes = {RemotePartitioningManagerStepBuilderTests.BatchConfiguration.class})
|
||||
public class RemotePartitioningManagerStepBuilderTests {
|
||||
|
||||
@Autowired
|
||||
private JobRepository jobRepository;
|
||||
@@ -151,7 +151,7 @@ public class RemotePartitioningMasterStepBuilderTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMasterStepCreationWhenPollingRepository() {
|
||||
public void testManagerStepCreationWhenPollingRepository() {
|
||||
// given
|
||||
int gridSize = 5;
|
||||
int startLimit = 3;
|
||||
@@ -162,7 +162,7 @@ public class RemotePartitioningMasterStepBuilderTests {
|
||||
StepExecutionAggregator stepExecutionAggregator = (result, executions) -> { };
|
||||
|
||||
// when
|
||||
Step step = new RemotePartitioningManagerStepBuilder("masterStep")
|
||||
Step step = new RemotePartitioningManagerStepBuilder("managerStep")
|
||||
.repository(jobRepository)
|
||||
.outputChannel(outputChannel)
|
||||
.partitioner("workerStep", partitioner)
|
||||
@@ -196,7 +196,7 @@ public class RemotePartitioningMasterStepBuilderTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMasterStepCreationWhenAggregatingReplies() {
|
||||
public void testManagerStepCreationWhenAggregatingReplies() {
|
||||
// given
|
||||
int gridSize = 5;
|
||||
int startLimit = 3;
|
||||
@@ -205,7 +205,7 @@ public class RemotePartitioningMasterStepBuilderTests {
|
||||
StepExecutionAggregator stepExecutionAggregator = (result, executions) -> { };
|
||||
|
||||
// when
|
||||
Step step = new RemotePartitioningManagerStepBuilder("masterStep")
|
||||
Step step = new RemotePartitioningManagerStepBuilder("managerStep")
|
||||
.repository(jobRepository)
|
||||
.outputChannel(outputChannel)
|
||||
.partitioner("workerStep", partitioner)
|
||||
@@ -6,7 +6,7 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/batch-integration
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd">
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd">
|
||||
|
||||
<batch-int:remote-chunking-master message-template="messagingTemplate" step="process" reply-channel="replies"/>
|
||||
<batch-int:remote-chunking-manager message-template="messagingTemplate" step="process" reply-channel="replies"/>
|
||||
</beans>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/batch-integration
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd">
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd">
|
||||
|
||||
<batch-int:remote-chunking-master id="itemWriter" step="process" reply-channel="replies"/>
|
||||
<batch-int:remote-chunking-manager id="itemWriter" step="process" reply-channel="replies"/>
|
||||
</beans>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/batch-integration
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd">
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd">
|
||||
|
||||
<batch-int:remote-chunking-master id="itemWriter" message-template="messagingTemplate" step="process"/>
|
||||
<batch-int:remote-chunking-manager id="itemWriter" message-template="messagingTemplate" step="process"/>
|
||||
</beans>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/batch-integration
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd">
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd">
|
||||
|
||||
<batch-int:remote-chunking-master id="itemWriter" message-template="messagingTemplate" reply-channel="replies"/>
|
||||
<batch-int:remote-chunking-manager id="itemWriter" message-template="messagingTemplate" reply-channel="replies"/>
|
||||
</beans>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
http://www.springframework.org/schema/batch
|
||||
https://www.springframework.org/schema/batch/spring-batch.xsd
|
||||
http://www.springframework.org/schema/batch-integration
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd
|
||||
http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd">
|
||||
|
||||
<batch:job id="processingJob">
|
||||
@@ -37,7 +37,7 @@
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<batch-int:remote-chunking-master id="itemWriter" message-template="messagingTemplate" step="process" reply-channel="replies"/>
|
||||
<batch-int:remote-chunking-manager id="itemWriter" message-template="messagingTemplate" step="process" reply-channel="replies"/>
|
||||
|
||||
<bean id="messagingTemplate" class="org.springframework.integration.core.MessagingTemplate"/>
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/batch-integration
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd">
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd">
|
||||
|
||||
<batch-int:remote-chunking-slave input-channel="requests" output-channel="replies"
|
||||
<batch-int:remote-chunking-worker input-channel="requests" output-channel="replies"
|
||||
item-processor="itemProcessor" item-writer="itemWriter"/>
|
||||
</beans>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/batch-integration
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd">
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd">
|
||||
|
||||
<batch-int:remote-chunking-slave id="remote-chunking-slave" output-channel="replies"
|
||||
<batch-int:remote-chunking-worker id="remote-chunking-worker" output-channel="replies"
|
||||
item-processor="itemProcessor" item-writer="itemWriter"/>
|
||||
</beans>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/batch-integration
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd">
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd">
|
||||
|
||||
<batch-int:remote-chunking-slave id="remote-chunking-slave" input-channel="requests" output-channel="replies"
|
||||
<batch-int:remote-chunking-worker id="remote-chunking-worker" input-channel="requests" output-channel="replies"
|
||||
item-processor="itemProcessor"/>
|
||||
</beans>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/batch-integration
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd">
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd">
|
||||
|
||||
<batch-int:remote-chunking-slave id="remote-chunking-slave" input-channel="requests"
|
||||
<batch-int:remote-chunking-worker id="remote-chunking-worker" input-channel="requests"
|
||||
item-processor="itemProcessor" item-writer="itemWriter"/>
|
||||
</beans>
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/batch-integration
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd">
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd">
|
||||
|
||||
<batch-int:remote-chunking-slave id="remote-chunking-slave" input-channel="requests" output-channel="replies"
|
||||
<batch-int:remote-chunking-worker id="remote-chunking-worker" input-channel="requests" output-channel="replies"
|
||||
item-writer="itemWriter"/>
|
||||
|
||||
<bean id="itemProcessor" class="org.springframework.batch.integration.config.xml.RemoteChunkingParserTests$Processor"/>
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/batch-integration
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd">
|
||||
https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd">
|
||||
|
||||
<batch-int:remote-chunking-slave id="remote-chunking-slave" input-channel="requests" output-channel="replies"
|
||||
<batch-int:remote-chunking-worker id="remote-chunking-worker" input-channel="requests" output-channel="replies"
|
||||
item-processor="itemProcessor" item-writer="itemWriter"/>
|
||||
|
||||
<bean id="itemProcessor" class="org.springframework.batch.integration.config.xml.RemoteChunkingParserTests$Processor"/>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
</bean>
|
||||
|
||||
<job id="job1" xmlns="http://www.springframework.org/schema/batch">
|
||||
<step id="step1-master">
|
||||
<step id="step1-manager">
|
||||
<partition handler="partitionHandler" partitioner="partitioner" />
|
||||
</step>
|
||||
</job>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</bean>
|
||||
|
||||
<job id="job1" xmlns="http://www.springframework.org/schema/batch">
|
||||
<step id="step1-master">
|
||||
<step id="step1-manager">
|
||||
<partition handler="partitionHandler" partitioner="partitioner" />
|
||||
</step>
|
||||
</job>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</bean>
|
||||
|
||||
<job id="job1" xmlns="http://www.springframework.org/schema/batch">
|
||||
<step id="step1-master">
|
||||
<step id="step1-manager">
|
||||
<partition handler="partitionHandler" partitioner="partitioner" />
|
||||
</step>
|
||||
</job>
|
||||
|
||||
Reference in New Issue
Block a user