Add additional test for step scope
This commit is contained in:
@@ -95,6 +95,24 @@ public class StepScopePlaceholderIntegrationTests implements BeanFactoryAware {
|
||||
assertEquals("bar-bar", compound.getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCompoundPropertyTwice() throws Exception {
|
||||
|
||||
assertEquals("bar-bar", compound.getName());
|
||||
|
||||
StepSynchronizationManager.close();
|
||||
stepExecution = new StepExecution("foo", new JobExecution(11L), 123L);
|
||||
|
||||
ExecutionContext executionContext = new ExecutionContext();
|
||||
executionContext.put("foo", "spam");
|
||||
|
||||
stepExecution.setExecutionContext(executionContext);
|
||||
StepSynchronizationManager.register(stepExecution);
|
||||
|
||||
assertEquals("spam-bar", compound.getName());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParentByRef() throws Exception {
|
||||
assertEquals("bar", ref.getParent().getName());
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
|
||||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
|
||||
|
||||
<bean id="simple" class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
|
||||
<property name="name" value="#{stepExecutionContext[foo]}" />
|
||||
</bean>
|
||||
|
||||
Reference in New Issue
Block a user