IN PROGRESS - issue BATCH-7: Remove transaction synchronization and state management from input/output sources (formerly buffering)

http://jira.springframework.org/browse/BATCH-7

More Statistics removal
This commit is contained in:
dsyer
2008-01-31 14:45:39 +00:00
parent 93639e1928
commit c2ccb7ed02
14 changed files with 69 additions and 93 deletions

View File

@@ -33,6 +33,7 @@ import org.springframework.batch.execution.scope.StepScope;
import org.springframework.batch.execution.scope.StepSynchronizationManager;
import org.springframework.batch.io.Skippable;
import org.springframework.batch.io.exception.BatchCriticalException;
import org.springframework.batch.item.ItemStream;
import org.springframework.batch.item.StreamContext;
import org.springframework.batch.item.stream.GenericStreamContext;
import org.springframework.batch.item.stream.SimpleStreamManager;
@@ -105,9 +106,9 @@ public class SimpleStepExecutor {
/**
* Public setter for the {@link StreamManager}. This will be used to create
* the {@link StepContext}, and hence any component that is a
* {@link StatisticsProvider} and in step scope will be registered with the
* service. The {@link StepContext} is then a source of aggregate statistics
* for the step.
* {@link ItemStream} and in step scope will be registered with the service. The
* {@link StepContext} is then a source of aggregate statistics for the
* step.
*
* @param streamManager the {@link StreamManager} to set. Default is a
* {@link SimpleStreamManager}.

View File

@@ -134,14 +134,14 @@ public class SimpleStepContextTests extends TestCase {
assertTrue(list.contains("spam"));
}
public void testStatisticsWithNotNullService() throws Exception {
public void testStreamContextWithNotNullService() throws Exception {
Map map = new HashMap();
context = new SimpleStepContext(null, null, new StubStreamManager(map));
assertEquals(1, context.getStreamContext().getProperties().size());
assertEquals("bar", context.getStreamContext().getProperties().getProperty("foo"));
}
public void testStatisticsServiceRegistration() throws Exception {
public void testStreamManagerRegistration() throws Exception {
Map map = new HashMap();
context = new SimpleStepContext(null, null, new StubStreamManager(map));
ItemStreamAdapter provider = new ItemStreamAdapter();

View File

@@ -409,7 +409,7 @@ public class SimpleStepExecutorTests extends TestCase {
JobExecution jobExecution = new JobExecution(jobInstance);
StepExecution stepExecution = new StepExecution(step, jobExecution);
assertEquals(null, stepExecution.getStreamContext().getString("foo"));
assertEquals(false, stepExecution.getStreamContext().containsKey("foo"));
final Map map = new HashMap();
stepExecutor.setStreamManager(new SimpleStreamManager() {

View File

@@ -19,7 +19,6 @@ package org.springframework.batch.execution.tasklet;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
import junit.framework.TestCase;
@@ -34,7 +33,6 @@ import org.springframework.batch.item.writer.AbstractItemWriter;
import org.springframework.batch.repeat.context.RepeatContextSupport;
import org.springframework.batch.repeat.synch.RepeatSynchronizationManager;
import org.springframework.batch.retry.policy.SimpleRetryPolicy;
import org.springframework.batch.support.PropertiesConverter;
/**
* @author Dave Syer
@@ -292,10 +290,6 @@ public class ItemOrientedTaskletTests extends TestCase {
list.add("provider");
}
public Properties getStatistics() {
return PropertiesConverter.stringToProperties("foo=bar");
}
public void close() throws StreamException {
}
}
@@ -320,10 +314,6 @@ public class ItemOrientedTaskletTests extends TestCase {
list.add("writer");
}
public Properties getStatistics() {
return PropertiesConverter.stringToProperties(props);
}
public void close() throws Exception {
}
}