BATCH-1847: Updated StepScope to not proxy abstract beans

This commit is contained in:
Michael Minella
2013-03-01 18:11:06 -06:00
parent 6dbf543309
commit b1bd3d3d1e
3 changed files with 30 additions and 6 deletions

View File

@@ -69,6 +69,15 @@ public class StepScopeConfigurationTests {
assertEquals("STEP", value.call());
}
@Test
public void testXmlStepScopeWithInheritence() throws Exception {
context = new ClassPathXmlApplicationContext(
"org/springframework/batch/core/configuration/annotation/StepScopeConfigurationTestsInheritence-context.xml");
StepSynchronizationManager.register(stepExecution);
SimpleHolder value = (SimpleHolder) context.getBean("child");
assertEquals("STEP", value.call());
}
@Test
public void testStepScopeWithProxyTargetClass() throws Exception {
init(StepScopeConfigurationRequiringProxyTargetClass.class);
@@ -165,7 +174,7 @@ public class StepScopeConfigurationTests {
return value;
}
}
public static class Wrapper {
private SimpleHolder value;
@@ -173,17 +182,17 @@ public class StepScopeConfigurationTests {
public Wrapper(SimpleHolder value) {
this.value = value;
}
public SimpleHolder getValue() {
return value;
}
}
@Configuration
@EnableBatchProcessing
public static class StepScopeConfigurationInjectingProxy {
@Bean
public Wrapper wrapper(SimpleHolder value) {
return new Wrapper(value);