add spring3 profile
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<project name="Spring Batch: ${project.name}">
|
||||
|
||||
<bannerLeft>
|
||||
<name>Spring Batch: ${project.name}</name>
|
||||
<href>index.html</href>
|
||||
</bannerLeft>
|
||||
|
||||
<skin>
|
||||
<groupId>org.springframework.maven.skins</groupId>
|
||||
<artifactId>maven-spring-skin</artifactId>
|
||||
<version>1.0.5</version>
|
||||
</skin>
|
||||
|
||||
<body>
|
||||
|
||||
<links>
|
||||
<item name="${project.name}" href="index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
|
||||
</project>
|
||||
@@ -1,151 +0,0 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.FutureTask;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
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.batch.item.ExecutionContext;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.ListableBeanFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class AsyncStepScopeIntegrationTests implements BeanFactoryAware {
|
||||
|
||||
private Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
@Autowired
|
||||
@Qualifier("simple")
|
||||
private Collaborator simple;
|
||||
|
||||
private TaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();
|
||||
|
||||
private ListableBeanFactory beanFactory;
|
||||
|
||||
private int beanCount;
|
||||
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
this.beanFactory = (ListableBeanFactory) beanFactory;
|
||||
}
|
||||
|
||||
@Before
|
||||
public void countBeans() {
|
||||
StepSynchronizationManager.release();
|
||||
beanCount = beanFactory.getBeanDefinitionCount();
|
||||
}
|
||||
|
||||
@After
|
||||
public void cleanUp() {
|
||||
StepSynchronizationManager.close();
|
||||
// Check that all temporary bean definitions are cleaned up
|
||||
assertEquals(beanCount, beanFactory.getBeanDefinitionCount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleProperty() throws Exception {
|
||||
StepExecution stepExecution = new StepExecution("step", new JobExecution(0L), 123L);
|
||||
ExecutionContext executionContext = stepExecution.getExecutionContext();
|
||||
executionContext.put("foo", "bar");
|
||||
StepSynchronizationManager.register(stepExecution);
|
||||
assertEquals("bar", simple.getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetMultipleInMultipleThreads() throws Exception {
|
||||
|
||||
List<FutureTask<String>> tasks = new ArrayList<FutureTask<String>>();
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
final String value = "foo" + i;
|
||||
final Long id = 123L + i;
|
||||
FutureTask<String> task = new FutureTask<String>(new Callable<String>() {
|
||||
public String call() throws Exception {
|
||||
StepExecution stepExecution = new StepExecution(value, new JobExecution(0L), id);
|
||||
ExecutionContext executionContext = stepExecution.getExecutionContext();
|
||||
executionContext.put("foo", value);
|
||||
StepContext context = StepSynchronizationManager.register(stepExecution);
|
||||
logger.debug("Registered: " + context.getStepExecutionContext());
|
||||
try {
|
||||
return simple.getName();
|
||||
}
|
||||
finally {
|
||||
StepSynchronizationManager.close();
|
||||
}
|
||||
}
|
||||
});
|
||||
tasks.add(task);
|
||||
taskExecutor.execute(task);
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for (FutureTask<String> task : tasks) {
|
||||
assertEquals("foo" + i, task.get());
|
||||
i++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetSameInMultipleThreads() throws Exception {
|
||||
|
||||
List<FutureTask<String>> tasks = new ArrayList<FutureTask<String>>();
|
||||
final StepExecution stepExecution = new StepExecution("foo", new JobExecution(0L), 123L);
|
||||
ExecutionContext executionContext = stepExecution.getExecutionContext();
|
||||
executionContext.put("foo", "foo");
|
||||
StepSynchronizationManager.register(stepExecution);
|
||||
assertEquals("foo", simple.getName());
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
final String value = "foo" + i;
|
||||
FutureTask<String> task = new FutureTask<String>(new Callable<String>() {
|
||||
public String call() throws Exception {
|
||||
ExecutionContext executionContext = stepExecution.getExecutionContext();
|
||||
executionContext.put("foo", value);
|
||||
StepContext context = StepSynchronizationManager.register(stepExecution);
|
||||
logger.debug("Registered: " + context.getStepExecutionContext());
|
||||
try {
|
||||
return simple.getName();
|
||||
}
|
||||
finally {
|
||||
StepSynchronizationManager.close();
|
||||
}
|
||||
}
|
||||
});
|
||||
tasks.add(task);
|
||||
taskExecutor.execute(task);
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for (FutureTask<String> task : tasks) {
|
||||
assertEquals("foo", task.get());
|
||||
i++;
|
||||
}
|
||||
|
||||
// Don't close the outer scope until all tasks are finished. This should
|
||||
// always be the case if using an AbstractStep
|
||||
StepSynchronizationManager.close();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
public interface Collaborator {
|
||||
|
||||
String getName();
|
||||
|
||||
Collaborator getParent();
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.Step;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
|
||||
public class JobStartupRunner {
|
||||
|
||||
private Step step;
|
||||
|
||||
public void setStep(Step step) {
|
||||
this.step = step;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void launch() throws Exception {
|
||||
StepExecution stepExecution = new StepExecution("step", new JobExecution(1L), 0L);
|
||||
step.execute(stepExecution);
|
||||
// expect no errors
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class PlaceholderTests {
|
||||
|
||||
@Autowired
|
||||
private TestBean bean;
|
||||
|
||||
@Test
|
||||
public void testString() throws Exception {
|
||||
assertEquals("foo", bean.getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInteger() throws Exception {
|
||||
assertEquals(100, bean.getValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStrings() throws Exception {
|
||||
assertEquals(3, bean.getValues().length);
|
||||
}
|
||||
|
||||
public static class TestBean {
|
||||
private int value;
|
||||
|
||||
private String[] values;
|
||||
|
||||
private String name;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String[] getValues() {
|
||||
return values;
|
||||
}
|
||||
|
||||
public void setValues(String[] values) {
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.Step;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class StepScopeDestructionCallbackIntegrationTests {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("proxied")
|
||||
private Step proxied;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("nested")
|
||||
private Step nested;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("foo")
|
||||
private Collaborator foo;
|
||||
|
||||
@Before
|
||||
@After
|
||||
public void resetMessage() throws Exception {
|
||||
TestDisposableCollaborator.message = "none";
|
||||
TestAdvice.names.clear();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDisposableScopedProxy() throws Exception {
|
||||
assertNotNull(proxied);
|
||||
proxied.execute(new StepExecution("step", new JobExecution(0L), 1L));
|
||||
assertEquals("destroyed", TestDisposableCollaborator.message);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDisposableInnerScopedProxy() throws Exception {
|
||||
assertNotNull(nested);
|
||||
nested.execute(new StepExecution("step", new JobExecution(0L), 1L));
|
||||
assertEquals("destroyed", TestDisposableCollaborator.message);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProxiedScopedProxy() throws Exception {
|
||||
assertNotNull(nested);
|
||||
nested.execute(new StepExecution("step", new JobExecution(0L), 1L));
|
||||
assertEquals(4, TestAdvice.names.size());
|
||||
assertEquals("bar", TestAdvice.names.get(0));
|
||||
assertEquals("destroyed", TestDisposableCollaborator.message);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProxiedNormalBean() throws Exception {
|
||||
assertNotNull(nested);
|
||||
String name = foo.getName();
|
||||
assertEquals(1, TestAdvice.names.size());
|
||||
assertEquals(name, TestAdvice.names.get(0));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.Step;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.scope.context.StepSynchronizationManager;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class StepScopeIntegrationTests {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("vanilla")
|
||||
private Step vanilla;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("proxied")
|
||||
private Step proxied;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("nested")
|
||||
private Step nested;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("enhanced")
|
||||
private Step enhanced;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("double")
|
||||
private Step doubleEnhanced;
|
||||
|
||||
@Before
|
||||
@After
|
||||
public void start() {
|
||||
StepSynchronizationManager.close();
|
||||
TestStep.reset();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testScopeCreation() throws Exception {
|
||||
vanilla.execute(new StepExecution("foo", new JobExecution(11L), 12L));
|
||||
assertNotNull(TestStep.getContext());
|
||||
assertNull(StepSynchronizationManager.getContext());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testScopedProxy() throws Exception {
|
||||
proxied.execute(new StepExecution("foo", new JobExecution(11L), 31L));
|
||||
assertTrue(TestStep.getContext().attributeNames().length > 0);
|
||||
String collaborator = (String) TestStep.getContext().getAttribute("collaborator");
|
||||
assertNotNull(collaborator);
|
||||
assertEquals("bar", collaborator);
|
||||
assertTrue("Scoped proxy not created", ((String) TestStep.getContext().getAttribute("collaborator.class"))
|
||||
.startsWith("class $Proxy"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNestedScopedProxy() throws Exception {
|
||||
nested.execute(new StepExecution("foo", new JobExecution(11L), 31L));
|
||||
assertTrue(TestStep.getContext().attributeNames().length > 0);
|
||||
String collaborator = (String) TestStep.getContext().getAttribute("collaborator");
|
||||
assertNotNull(collaborator);
|
||||
assertEquals("foo", collaborator);
|
||||
String parent = (String) TestStep.getContext().getAttribute("parent");
|
||||
assertNotNull(parent);
|
||||
assertEquals("bar", parent);
|
||||
assertTrue("Scoped proxy not created", ((String) TestStep.getContext().getAttribute("parent.class"))
|
||||
.startsWith("class $Proxy"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExecutionContext() throws Exception {
|
||||
StepExecution stepExecution = new StepExecution("foo", new JobExecution(11L), 1L);
|
||||
ExecutionContext executionContext = new ExecutionContext();
|
||||
executionContext.put("name", "spam");
|
||||
stepExecution.setExecutionContext(executionContext);
|
||||
proxied.execute(stepExecution);
|
||||
assertTrue(TestStep.getContext().attributeNames().length > 0);
|
||||
String collaborator = (String) TestStep.getContext().getAttribute("collaborator");
|
||||
assertNotNull(collaborator);
|
||||
assertEquals("bar", collaborator);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testScopedProxyForReference() throws Exception {
|
||||
enhanced.execute(new StepExecution("foo", new JobExecution(11L), 123L));
|
||||
assertTrue(TestStep.getContext().attributeNames().length > 0);
|
||||
String collaborator = (String) TestStep.getContext().getAttribute("collaborator");
|
||||
assertNotNull(collaborator);
|
||||
assertEquals("bar", collaborator);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testScopedProxyForSecondReference() throws Exception {
|
||||
doubleEnhanced.execute(new StepExecution("foo", new JobExecution(11L), 321L));
|
||||
assertTrue(TestStep.getContext().attributeNames().length > 0);
|
||||
String collaborator = (String) TestStep.getContext().getAttribute("collaborator");
|
||||
assertNotNull(collaborator);
|
||||
assertEquals("bar", collaborator);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.Step;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class StepScopeNestedIntegrationTests implements BeanFactoryAware {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("step1")
|
||||
private Step step1;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("step2")
|
||||
private Step step2;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("step3")
|
||||
private Step step3;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("parent")
|
||||
private Collaborator parent;
|
||||
|
||||
private StepExecution stepExecution;
|
||||
|
||||
private ConfigurableListableBeanFactory beanFactory;
|
||||
|
||||
private List<String> names;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
this.beanFactory = (ConfigurableListableBeanFactory) beanFactory;
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
TestStep.reset();
|
||||
stepExecution = new StepExecution("step", new JobExecution(11L), 12L);
|
||||
names = Arrays.asList(beanFactory.getBeanDefinitionNames());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNestedScopedProxy() throws Exception {
|
||||
assertNotNull(step1);
|
||||
assertEquals("foo", parent.getName());
|
||||
assertTrue("Proxy was not created for explicitly scoped bean", names.contains("lazyBindingProxy.bar"));
|
||||
assertFalse("Proxy was created for unscoped bean", names.contains("foo"));
|
||||
stepExecution.getExecutionContext().putString("bar", "bar");
|
||||
step1.execute(stepExecution);
|
||||
assertNotNull(stepExecution.getExecutionContext().getString("foo"));
|
||||
assertEquals("bar", TestStep.getContext().getAttribute("collaborator"));
|
||||
assertEquals("foo", TestStep.getContext().getAttribute("parent"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNestedUnScoped() throws Exception {
|
||||
assertNotNull(step2);
|
||||
assertTrue("Proxy was not created for explicitly scoped bean", names.contains("lazyBindingProxy.spam"));
|
||||
assertFalse("Proxy was created for unscoped bean", names.contains("bucket"));
|
||||
stepExecution.getExecutionContext().putString("spam", "spam");
|
||||
step2.execute(stepExecution);
|
||||
assertNotNull(stepExecution.getExecutionContext().getString("foo"));
|
||||
assertEquals("spam", TestStep.getContext().getAttribute("collaborator"));
|
||||
assertEquals("bucket", TestStep.getContext().getAttribute("parent"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTwiceNestedScopedProxy() throws Exception {
|
||||
assertNotNull(step3);
|
||||
assertTrue("Proxy was not created for explicitly scoped bean", names.contains("lazyBindingProxy.maps"));
|
||||
assertFalse("Proxy was created for implicitly scoped bean", names.contains("lazyBindingProxy.rab"));
|
||||
assertEquals("foo", parent.getName());
|
||||
stepExecution.getExecutionContext().putString("maps", "maps");
|
||||
stepExecution.getExecutionContext().putString("rab", "rab");
|
||||
step3.execute(stepExecution);
|
||||
assertNotNull(stepExecution.getExecutionContext().getString("foo"));
|
||||
assertEquals("maps", TestStep.getContext().getAttribute("collaborator"));
|
||||
assertEquals("rab", TestStep.getContext().getAttribute("parent"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.scope.context.StepSynchronizationManager;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.item.ItemStreamReader;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.util.StopWatch;
|
||||
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class StepScopePerformanceTests implements ApplicationContextAware {
|
||||
|
||||
private Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
public void setApplicationContext(ApplicationContext applicationContext)
|
||||
throws BeansException {
|
||||
this.applicationContext = applicationContext;
|
||||
|
||||
}
|
||||
|
||||
@Before
|
||||
public void start() throws Exception {
|
||||
int count = doTest("vanilla", "warmup");
|
||||
logger.info("Item count: "+count);
|
||||
StepSynchronizationManager.register(new StepExecution("step", new JobExecution(0L),1L));
|
||||
}
|
||||
|
||||
@Before
|
||||
@After
|
||||
public void cleanup() {
|
||||
StepSynchronizationManager.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVanilla() throws Exception {
|
||||
int count = doTest("vanilla", "vanilla");
|
||||
logger.info("Item count: "+count);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProxied() throws Exception {
|
||||
int count = doTest("proxied", "proxied");
|
||||
logger.info("Item count: "+count);
|
||||
}
|
||||
|
||||
private int doTest(String name, String test) throws Exception {
|
||||
@SuppressWarnings("unchecked")
|
||||
ItemStreamReader<String> reader = (ItemStreamReader<String>) applicationContext.getBean(name);
|
||||
reader.open(new ExecutionContext());
|
||||
StopWatch stopWatch = new StopWatch(test);
|
||||
stopWatch.start();
|
||||
int count = 0;
|
||||
while (reader.read() != null) {
|
||||
// do nothing
|
||||
count++;
|
||||
}
|
||||
stopWatch.stop();
|
||||
reader.close();
|
||||
logger.info(stopWatch.shortSummary());
|
||||
return count;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.scope.context.StepSynchronizationManager;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.ListableBeanFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class StepScopePlaceholderIntegrationTests implements BeanFactoryAware {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("simple")
|
||||
private Collaborator simple;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("compound")
|
||||
private Collaborator compound;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("value")
|
||||
private Collaborator value;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("ref")
|
||||
private Collaborator ref;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("bar")
|
||||
private Collaborator bar;
|
||||
|
||||
private StepExecution stepExecution;
|
||||
|
||||
private ListableBeanFactory beanFactory;
|
||||
|
||||
private int beanCount;
|
||||
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
this.beanFactory = (ListableBeanFactory) beanFactory;
|
||||
}
|
||||
|
||||
@Before
|
||||
public void start() {
|
||||
|
||||
StepSynchronizationManager.close();
|
||||
stepExecution = new StepExecution("foo", new JobExecution(11L), 123L);
|
||||
|
||||
ExecutionContext executionContext = new ExecutionContext();
|
||||
executionContext.put("foo", "bar");
|
||||
executionContext.put("parent", bar);
|
||||
|
||||
stepExecution.setExecutionContext(executionContext);
|
||||
StepSynchronizationManager.register(stepExecution);
|
||||
|
||||
beanCount = beanFactory.getBeanDefinitionCount();
|
||||
|
||||
}
|
||||
|
||||
@After
|
||||
public void cleanUp() {
|
||||
StepSynchronizationManager.close();
|
||||
// Check that all temporary bean definitions are cleaned up
|
||||
assertEquals(beanCount, beanFactory.getBeanDefinitionCount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleProperty() throws Exception {
|
||||
assertEquals("bar", simple.getName());
|
||||
// Once the step context is set up it should be baked into the proxies
|
||||
// so changing it now should have no effect
|
||||
stepExecution.getExecutionContext().put("foo", "wrong!");
|
||||
assertEquals("bar", simple.getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCompoundProperty() throws Exception {
|
||||
assertEquals("bar-bar", compound.getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParentByRef() throws Exception {
|
||||
assertEquals("bar", ref.getParent().getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParentByValue() throws Exception {
|
||||
assertEquals("bar", value.getParent().getName());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.scope.context.StepSynchronizationManager;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.ListableBeanFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class StepScopeProxyTargetClassIntegrationTests implements BeanFactoryAware {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("simple")
|
||||
private TestCollaborator simple;
|
||||
|
||||
private StepExecution stepExecution;
|
||||
|
||||
private ListableBeanFactory beanFactory;
|
||||
|
||||
private int beanCount;
|
||||
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
this.beanFactory = (ListableBeanFactory) beanFactory;
|
||||
}
|
||||
|
||||
@Before
|
||||
public void start() {
|
||||
|
||||
StepSynchronizationManager.close();
|
||||
stepExecution = new StepExecution("foo", new JobExecution(11L), 123L);
|
||||
|
||||
ExecutionContext executionContext = new ExecutionContext();
|
||||
executionContext.put("foo", "bar");
|
||||
|
||||
stepExecution.setExecutionContext(executionContext);
|
||||
StepSynchronizationManager.register(stepExecution);
|
||||
|
||||
beanCount = beanFactory.getBeanDefinitionCount();
|
||||
|
||||
}
|
||||
|
||||
@After
|
||||
public void cleanUp() {
|
||||
StepSynchronizationManager.close();
|
||||
// Check that all temporary bean definitions are cleaned up
|
||||
assertEquals(beanCount, beanFactory.getBeanDefinitionCount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleProperty() throws Exception {
|
||||
assertEquals("bar", simple.getName());
|
||||
// Once the step context is set up it should be baked into the proxies
|
||||
// so changing it now should have no effect
|
||||
stepExecution.getExecutionContext().put("foo", "wrong!");
|
||||
assertEquals("bar", simple.getName());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class StepScopeStartupIntegrationTests {
|
||||
|
||||
@Test
|
||||
public void testScopedProxyDuringStartup() throws Exception {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,192 +0,0 @@
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
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.beans.BeansException;
|
||||
import org.springframework.beans.factory.ObjectFactory;
|
||||
import org.springframework.context.support.StaticApplicationContext;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
public class StepScopeTests {
|
||||
|
||||
private StepScope scope = new StepScope();
|
||||
|
||||
private StepExecution stepExecution = new StepExecution("foo", new JobExecution(0L), 123L);
|
||||
|
||||
private StepContext context;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
context = StepSynchronizationManager.register(stepExecution);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
StepSynchronizationManager.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetWithNoContext() throws Exception {
|
||||
final String foo = "bar";
|
||||
StepSynchronizationManager.close();
|
||||
try {
|
||||
scope.get("foo", new ObjectFactory<String>() {
|
||||
public String getObject() throws BeansException {
|
||||
return foo;
|
||||
}
|
||||
});
|
||||
fail("Expected IllegalStateException");
|
||||
}
|
||||
catch (IllegalStateException e) {
|
||||
// expected
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetWithNothingAlreadyThere() {
|
||||
final String foo = "bar";
|
||||
Object value = scope.get("foo", new ObjectFactory<String>() {
|
||||
public String getObject() throws BeansException {
|
||||
return foo;
|
||||
}
|
||||
});
|
||||
assertEquals(foo, value);
|
||||
assertTrue(context.hasAttribute("foo"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetWithSomethingAlreadyThere() {
|
||||
context.setAttribute("foo", "bar");
|
||||
Object value = scope.get("foo", new ObjectFactory<Object>() {
|
||||
public Object getObject() throws BeansException {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
assertEquals("bar", value);
|
||||
assertTrue(context.hasAttribute("foo"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetWithSomethingAlreadyInParentContext() {
|
||||
context.setAttribute("foo", "bar");
|
||||
StepContext context = StepSynchronizationManager.register(new StepExecution("bar", new JobExecution(0L)));
|
||||
Object value = scope.get("foo", new ObjectFactory<String>() {
|
||||
public String getObject() throws BeansException {
|
||||
return "spam";
|
||||
}
|
||||
});
|
||||
assertEquals("spam", value);
|
||||
assertTrue(context.hasAttribute("foo"));
|
||||
StepSynchronizationManager.close();
|
||||
assertEquals("bar", scope.get("foo", null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParentContextWithSameStepExecution() {
|
||||
context.setAttribute("foo", "bar");
|
||||
StepContext other = StepSynchronizationManager.register(stepExecution);
|
||||
assertSame(other, context);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetConversationId() {
|
||||
String id = scope.getConversationId();
|
||||
assertNotNull(id);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRegisterDestructionCallback() {
|
||||
final List<String> list = new ArrayList<String>();
|
||||
context.setAttribute("foo", "bar");
|
||||
scope.registerDestructionCallback("foo", new Runnable() {
|
||||
public void run() {
|
||||
list.add("foo");
|
||||
}
|
||||
});
|
||||
assertEquals(0, list.size());
|
||||
// When the context is closed, provided the attribute exists the
|
||||
// callback is called...
|
||||
context.close();
|
||||
assertEquals(1, list.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRegisterAnotherDestructionCallback() {
|
||||
final List<String> list = new ArrayList<String>();
|
||||
context.setAttribute("foo", "bar");
|
||||
scope.registerDestructionCallback("foo", new Runnable() {
|
||||
public void run() {
|
||||
list.add("foo");
|
||||
}
|
||||
});
|
||||
scope.registerDestructionCallback("foo", new Runnable() {
|
||||
public void run() {
|
||||
list.add("bar");
|
||||
}
|
||||
});
|
||||
assertEquals(0, list.size());
|
||||
// When the context is closed, provided the attribute exists the
|
||||
// callback is called...
|
||||
context.close();
|
||||
assertEquals(2, list.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRemove() {
|
||||
context.setAttribute("foo", "bar");
|
||||
scope.remove("foo");
|
||||
assertFalse(context.hasAttribute("foo"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOrder() throws Exception {
|
||||
assertEquals(Integer.MAX_VALUE, scope.getOrder());
|
||||
scope.setOrder(11);
|
||||
assertEquals(11, scope.getOrder());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testName() throws Exception {
|
||||
scope.setName("foo");
|
||||
StaticApplicationContext beanFactory = new StaticApplicationContext();
|
||||
scope.postProcessBeanFactory(beanFactory.getDefaultListableBeanFactory());
|
||||
String[] scopes = beanFactory.getDefaultListableBeanFactory().getRegisteredScopeNames();
|
||||
assertEquals(1, scopes.length);
|
||||
assertEquals("foo", scopes[0]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
|
||||
@Aspect
|
||||
public class TestAdvice {
|
||||
|
||||
public static final List<String> names = new ArrayList<String>();
|
||||
|
||||
@AfterReturning(pointcut="execution(String org.springframework.batch.core.scope.Collaborator+.getName(..))", returning="name")
|
||||
public void registerCollaborator(String name) {
|
||||
names.add(name);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
public class TestCollaborator implements Collaborator, Serializable {
|
||||
|
||||
private String name;
|
||||
|
||||
private Collaborator parent;
|
||||
|
||||
public Collaborator getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setParent(Collaborator parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
|
||||
|
||||
public class TestDisposableCollaborator extends TestCollaborator implements DisposableBean {
|
||||
|
||||
public static volatile String message = "none";
|
||||
|
||||
public void destroy() throws Exception {
|
||||
message = "destroyed";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import org.springframework.batch.core.JobInterruptedException;
|
||||
import org.springframework.batch.core.Step;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.scope.context.StepContext;
|
||||
import org.springframework.batch.core.scope.context.StepSynchronizationManager;
|
||||
|
||||
public class TestStep implements Step {
|
||||
|
||||
private static StepContext context;
|
||||
|
||||
private Collaborator collaborator;
|
||||
|
||||
public void setCollaborator(Collaborator collaborator) {
|
||||
this.collaborator = collaborator;
|
||||
}
|
||||
|
||||
public static StepContext getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public static void reset() {
|
||||
context = null;
|
||||
}
|
||||
|
||||
public void execute(StepExecution stepExecution) throws JobInterruptedException {
|
||||
context = StepSynchronizationManager.getContext();
|
||||
setContextFromCollaborator();
|
||||
stepExecution.getExecutionContext().put("foo", "changed but it shouldn't affect the collaborator");
|
||||
setContextFromCollaborator();
|
||||
}
|
||||
|
||||
private void setContextFromCollaborator() {
|
||||
if (context != null) {
|
||||
context.setAttribute("collaborator", collaborator.getName());
|
||||
context.setAttribute("collaborator.class", collaborator.getClass().toString());
|
||||
if (collaborator.getParent()!=null) {
|
||||
context.setAttribute("parent", collaborator.getParent().getName());
|
||||
context.setAttribute("parent.class", collaborator.getParent().getClass().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "foo";
|
||||
}
|
||||
|
||||
public int getStartLimit() {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
public boolean isAllowStartIfComplete() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
log4j.rootCategory=INFO, stdout
|
||||
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
|
||||
|
||||
log4j.category.org.apache.activemq=ERROR
|
||||
log4j.category.org.springframework.batch=DEBUG
|
||||
log4j.category.org.springframework.transaction=INFO
|
||||
|
||||
log4j.category.org.hibernate.SQL=DEBUG
|
||||
# for debugging datasource initialization
|
||||
# log4j.category.test.jdbc=DEBUG
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
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>
|
||||
|
||||
<bean class="org.springframework.batch.core.scope.StepScope" />
|
||||
|
||||
</beans>
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
|
||||
|
||||
<bean id="bean" class="org.springframework.batch.core.scope.PlaceholderTests$TestBean">
|
||||
<property name="name" value="#{properties['name']}" />
|
||||
<property name="value" value="#{properties['value']}" />
|
||||
<property name="values" value="#{properties['values']}" />
|
||||
</bean>
|
||||
|
||||
<util:properties id="properties">
|
||||
<prop key="name">foo</prop>
|
||||
<prop key="value">100</prop>
|
||||
<prop key="values">a,b,c</prop>
|
||||
</util:properties>
|
||||
|
||||
</beans>
|
||||
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.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">
|
||||
|
||||
<context:annotation-config />
|
||||
|
||||
<bean id="proxied" class="org.springframework.batch.core.scope.TestStep">
|
||||
<property name="collaborator">
|
||||
<bean
|
||||
class="org.springframework.batch.core.scope.TestDisposableCollaborator"
|
||||
scope="step">
|
||||
<property name="name" value="bar" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="nested" class="org.springframework.batch.core.scope.TestStep">
|
||||
<property name="collaborator">
|
||||
<bean class="org.springframework.batch.core.scope.TestCollaborator"
|
||||
scope="step">
|
||||
<property name="name" value="bar" />
|
||||
<property name="parent">
|
||||
<bean
|
||||
class="org.springframework.batch.core.scope.TestDisposableCollaborator">
|
||||
<property name="name" value="foo" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="foo"
|
||||
class="org.springframework.batch.core.scope.TestDisposableCollaborator">
|
||||
<property name="name" value="foo" />
|
||||
</bean>
|
||||
|
||||
<aop:aspectj-autoproxy />
|
||||
<bean class="org.springframework.batch.core.scope.TestAdvice" />
|
||||
<bean class="org.springframework.batch.core.scope.context.StepScopeManager" />
|
||||
<bean class="org.springframework.batch.core.scope.StepScope" />
|
||||
|
||||
</beans>
|
||||
@@ -1,54 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
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="vanilla" class="org.springframework.batch.core.scope.TestStep">
|
||||
<property name="collaborator">
|
||||
<bean class="org.springframework.batch.core.scope.TestCollaborator">
|
||||
<property name="name" value="bar" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="proxied" class="org.springframework.batch.core.scope.TestStep">
|
||||
<property name="collaborator">
|
||||
<bean class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
|
||||
<property name="name" value="bar" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="nested" class="org.springframework.batch.core.scope.TestStep">
|
||||
<property name="collaborator">
|
||||
<bean class="org.springframework.batch.core.scope.TestCollaborator">
|
||||
<property name="name" value="foo" />
|
||||
<property name="parent">
|
||||
<bean class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
|
||||
<property name="name" value="bar" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="enhanced" class="org.springframework.batch.core.scope.TestStep">
|
||||
<property name="collaborator" ref="collaborator" />
|
||||
</bean>
|
||||
|
||||
<bean id="double" class="org.springframework.batch.core.scope.TestStep">
|
||||
<property name="collaborator" ref="collaborator" />
|
||||
</bean>
|
||||
|
||||
<bean id="collaborator" class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
|
||||
<property name="name" value="bar" />
|
||||
</bean>
|
||||
|
||||
<aop:aspectj-autoproxy />
|
||||
<bean class="org.springframework.batch.core.scope.context.StepScopeManager" />
|
||||
<bean class="org.springframework.batch.core.scope.StepScope" />
|
||||
|
||||
</beans>
|
||||
@@ -1,55 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
|
||||
|
||||
<bean id="step1" class="org.springframework.batch.core.scope.TestStep">
|
||||
<property name="collaborator">
|
||||
<bean id="bar" class="org.springframework.batch.core.scope.TestDisposableCollaborator" scope="step">
|
||||
<property name="name" value="#{stepExecutionContext['bar']}" />
|
||||
<property name="parent" ref="parent" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="parent" class="org.springframework.batch.core.scope.TestDisposableCollaborator">
|
||||
<property name="name" value="foo" />
|
||||
</bean>
|
||||
|
||||
<bean id="step2" class="org.springframework.batch.core.scope.TestStep">
|
||||
<property name="collaborator" ref="spam" />
|
||||
</bean>
|
||||
|
||||
<bean id="spam" class="org.springframework.batch.core.scope.TestDisposableCollaborator" scope="step">
|
||||
<property name="name" value="#{stepExecutionContext['spam']}" />
|
||||
<property name="parent">
|
||||
<bean id="bucket" class="org.springframework.batch.core.scope.TestDisposableCollaborator" scope="singleton">
|
||||
<property name="name" value="#{properties['parent.name']}" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="step3" class="org.springframework.batch.core.scope.TestStep">
|
||||
<property name="collaborator" ref="maps" />
|
||||
</bean>
|
||||
|
||||
<bean id="maps" class="org.springframework.batch.core.scope.TestDisposableCollaborator" scope="step">
|
||||
<property name="name" value="#{stepExecutionContext['maps']}" />
|
||||
<property name="parent">
|
||||
<bean id="rab" class="org.springframework.batch.core.scope.TestDisposableCollaborator">
|
||||
<property name="name" value="#{stepExecutionContext['rab']}" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<util:properties id="properties">
|
||||
<prop key="parent.name">bucket</prop>
|
||||
</util:properties>
|
||||
|
||||
<aop:aspectj-autoproxy />
|
||||
<bean class="org.springframework.batch.core.scope.context.StepScopeManager" />
|
||||
<bean class="org.springframework.batch.core.scope.StepScope" />
|
||||
|
||||
</beans>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
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="vanilla" class="org.springframework.batch.item.file.FlatFileItemReader">
|
||||
<property name="lineMapper">
|
||||
<bean
|
||||
class="org.springframework.batch.item.file.mapping.PassThroughLineMapper" />
|
||||
</property>
|
||||
<property name="resource" value="classpath:/org/springframework/batch/core/scope/StepScopePerformanceTests-input.txt"></property>
|
||||
</bean>
|
||||
|
||||
<bean id="proxied" class="org.springframework.batch.item.file.FlatFileItemReader" scope="step">
|
||||
<property name="lineMapper">
|
||||
<bean
|
||||
class="org.springframework.batch.item.file.mapping.PassThroughLineMapper" />
|
||||
</property>
|
||||
<property name="resource" value="classpath:/org/springframework/batch/core/scope/StepScopePerformanceTests-input.txt"></property>
|
||||
</bean>
|
||||
|
||||
<bean class="org.springframework.batch.core.scope.StepScope" />
|
||||
|
||||
</beans>
|
||||
@@ -1,660 +0,0 @@
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spamfoo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spamfoo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spamfoo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spamfoo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spamfoo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spamfoo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spamfoo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spamfoo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spamfoo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spamfoo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spamfoo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spamfoo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
foo bar spam
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
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>
|
||||
|
||||
<bean id="compound" class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
|
||||
<property name="name" value="#{stepExecutionContext[foo]}-bar" />
|
||||
</bean>
|
||||
|
||||
<bean id="value" class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
|
||||
<property name="name" value="foo" />
|
||||
<property name="parent" value="#{stepExecutionContext[parent]}" />
|
||||
</bean>
|
||||
|
||||
<bean id="ref" class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
|
||||
<property name="name" value="foo" />
|
||||
<property name="parent" ref="#{stepExecutionContext[foo]}" />
|
||||
</bean>
|
||||
|
||||
<bean id="bar" class="org.springframework.batch.core.scope.TestCollaborator">
|
||||
<property name="name" value="bar" />
|
||||
</bean>
|
||||
|
||||
<bean class="org.springframework.batch.core.scope.StepScope" />
|
||||
|
||||
</beans>
|
||||
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
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>
|
||||
|
||||
<bean class="org.springframework.batch.core.scope.StepScope">
|
||||
<property name="proxyTargetClass" value="true"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.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">
|
||||
|
||||
<context:annotation-config />
|
||||
|
||||
<bean class="org.springframework.batch.core.scope.JobStartupRunner">
|
||||
<property name="step" ref="proxied" />
|
||||
</bean>
|
||||
|
||||
<bean id="proxied" class="org.springframework.batch.core.scope.TestStep">
|
||||
<property name="collaborator">
|
||||
<bean class="org.springframework.batch.core.scope.TestCollaborator"
|
||||
scope="step">
|
||||
<property name="name" value="bar" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<aop:aspectj-autoproxy />
|
||||
<bean class="org.springframework.batch.core.scope.context.StepScopeManager" />
|
||||
<bean class="org.springframework.batch.core.scope.StepScope" />
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user