IN PROGRESS - issue BATCH-7: Remove transaction synchronization and state management from input/output sources (formerly buffering)
http://jira.springframework.org/browse/BATCH-7 Remove GenericStreamContext
This commit is contained in:
@@ -18,8 +18,6 @@ package org.springframework.batch.core.domain;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.item.StreamContext;
|
||||
import org.springframework.batch.item.stream.GenericStreamContext;
|
||||
import org.springframework.batch.support.PropertiesConverter;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
@@ -47,7 +45,9 @@ public class StepContributionTests extends TestCase {
|
||||
*/
|
||||
public void testSetStreamContext() {
|
||||
assertEquals(null, contribution.getStreamContext());
|
||||
contribution.setStreamContext(new GenericStreamContext(PropertiesConverter.stringToProperties("foo=bar")));
|
||||
StreamContext context = new StreamContext();
|
||||
context.putString("foo", "bar");
|
||||
contribution.setStreamContext(context);
|
||||
assertEquals(1, contribution.getStreamContext().getProperties().size());
|
||||
}
|
||||
|
||||
|
||||
@@ -15,11 +15,10 @@
|
||||
*/
|
||||
package org.springframework.batch.core.domain;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.item.stream.GenericStreamContext;
|
||||
import org.springframework.batch.item.StreamContext;
|
||||
import org.springframework.batch.support.PropertiesConverter;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
@@ -51,9 +50,7 @@ public class StepInstanceTests extends TestCase {
|
||||
public void testGetStreamContext() {
|
||||
assertNotNull(instance.getStreamContext());
|
||||
assertTrue(instance.getStreamContext().getProperties().isEmpty());
|
||||
instance.setStreamContext(new GenericStreamContext(new Properties() {{
|
||||
setProperty("foo", "bar");
|
||||
}}));
|
||||
instance.setStreamContext(new StreamContext(PropertiesConverter.stringToProperties("foo=bar")));
|
||||
assertEquals("bar", instance.getStreamContext().getProperties().getProperty("foo"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user