From cd12d1050ea7c47cc061c38a70f035b735eb79df Mon Sep 17 00:00:00 2001 From: dsyer Date: Fri, 18 Sep 2009 16:29:51 +0000 Subject: [PATCH] Add additional integration test for list values in step scope. --- spring-batch-core/.classpath | 8 ++++---- .../batch/core/scope/Collaborator.java | 4 ++++ .../StepScopePlaceholderIntegrationTests.java | 9 +++++++++ .../batch/core/scope/TestCollaborator.java | 11 +++++++++++ ...ScopePlaceholderIntegrationTests-context.xml | 17 ++++++++++++----- 5 files changed, 40 insertions(+), 9 deletions(-) diff --git a/spring-batch-core/.classpath b/spring-batch-core/.classpath index 9e78ce207..bc2bc4663 100644 --- a/spring-batch-core/.classpath +++ b/spring-batch-core/.classpath @@ -1,9 +1,9 @@ - - - - + + + + diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/scope/Collaborator.java b/spring-batch-core/src/test/java/org/springframework/batch/core/scope/Collaborator.java index 2bfc6759c..4b99b102d 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/scope/Collaborator.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/scope/Collaborator.java @@ -1,9 +1,13 @@ package org.springframework.batch.core.scope; +import java.util.List; + public interface Collaborator { String getName(); Collaborator getParent(); + List getList(); + } \ No newline at end of file diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/scope/StepScopePlaceholderIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/scope/StepScopePlaceholderIntegrationTests.java index a526767bf..ef95a52b0 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/scope/StepScopePlaceholderIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/scope/StepScopePlaceholderIntegrationTests.java @@ -39,6 +39,10 @@ public class StepScopePlaceholderIntegrationTests implements BeanFactoryAware { @Qualifier("ref") private Collaborator ref; + @Autowired + @Qualifier("list") + private Collaborator list; + @Autowired @Qualifier("bar") private Collaborator bar; @@ -101,4 +105,9 @@ public class StepScopePlaceholderIntegrationTests implements BeanFactoryAware { assertEquals("bar", value.getParent().getName()); } + @Test + public void testList() throws Exception { + assertEquals("[bar]", list.getList().toString()); + } + } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/scope/TestCollaborator.java b/spring-batch-core/src/test/java/org/springframework/batch/core/scope/TestCollaborator.java index aa525ec99..bb21208cf 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/scope/TestCollaborator.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/scope/TestCollaborator.java @@ -1,6 +1,7 @@ package org.springframework.batch.core.scope; import java.io.Serializable; +import java.util.List; public class TestCollaborator implements Collaborator, Serializable { @@ -8,6 +9,16 @@ public class TestCollaborator implements Collaborator, Serializable { private String name; private Collaborator parent; + + private List list; + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } public Collaborator getParent() { return parent; diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/scope/StepScopePlaceholderIntegrationTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/scope/StepScopePlaceholderIntegrationTests-context.xml index bb82623c7..85e590191 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/scope/StepScopePlaceholderIntegrationTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/scope/StepScopePlaceholderIntegrationTests-context.xml @@ -1,12 +1,10 @@ - - + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> @@ -20,6 +18,15 @@ + + + + + #{stepExecutionContext[foo]} + + + +