RESOLVED - issue BATCH-330: Modify RestartData to be a typesafe form of map

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

Remove references to RestartData
This commit is contained in:
dsyer
2008-02-05 09:44:45 +00:00
parent 8c1cb2808f
commit 8ac9c65b78
5 changed files with 15 additions and 45 deletions

View File

@@ -40,34 +40,4 @@ public class MultipleColumnJdbcDrivingQueryItemReaderIntegrationTests extends
return fooItemReader;
}
// private static class FooRestartDataConverter implements RestartDataRowMapper{
//
// private static final String ID_RESTART_KEY = "FooRestartDataConverter.id";
// private static final String VALUE_RESTART_KEY = "FooRestartDataConverter.value";
//
// public RestartData createRestartData(Object compositeKey) {
//
// List values = (List)compositeKey;
// Properties data = new Properties();
// data.setProperty(ID_RESTART_KEY, values.get(0).toString());
// data.setProperty(VALUE_RESTART_KEY, values.get(1).toString());
// return new GenericRestartData(data);
// }
//
// public Object[] createSetter(RestartData restartData) {
// Object[] args = new Object[2];
// args[0] = restartData.getProperties().get(ID_RESTART_KEY);
// args[1] = restartData.getProperties().getProperty(VALUE_RESTART_KEY);
// return args;
// }
// }
//
// private static class FooCompositeKeyMapper implements RowMapper{
// public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
// List key = new ArrayList();
// key.add(new Long(rs.getLong(1)));
// key.add(new Long(rs.getLong(2)));
// return key;
// }
// }
}

View File

@@ -18,7 +18,7 @@ import org.springframework.jdbc.core.PreparedStatementSetter;
/**
* @author Lucas Ward
*/
public class ColumnMapRestartDataRowMapperTests extends TestCase {
public class ColumnMapExecutionAttributesRowMapperTests extends TestCase {
private static final String KEY = ColumnMapExecutionAttributesRowMapper.KEY_PREFIX;
@@ -39,7 +39,7 @@ public class ColumnMapRestartDataRowMapperTests extends TestCase {
key.put("2", new Integer(2));
}
public void testCreateRestartDataWithInvalidType() throws Exception {
public void testCreateExecutionAttributesWithInvalidType() throws Exception {
try{
mapper.createExecutionAttributes(new Object());
@@ -49,7 +49,7 @@ public class ColumnMapRestartDataRowMapperTests extends TestCase {
}
}
public void testCreateRestartDataWithNull(){
public void testCreateExecutionAttributesWithNull(){
try{
mapper.createExecutionAttributes(null);
@@ -59,14 +59,14 @@ public class ColumnMapRestartDataRowMapperTests extends TestCase {
}
}
public void testCreateRestartData() throws Exception {
public void testCreateExecutionAttributes() throws Exception {
ExecutionAttributes streamContext = mapper.createExecutionAttributes(key);
Properties props = streamContext.getProperties();
assertEquals("1", props.getProperty(KEY + "0"));
assertEquals("2", props.getProperty(KEY + "1"));
}
public void testCreateRestartDataFromEmptyKeys() throws Exception {
public void testCreateExecutionAttributesFromEmptyKeys() throws Exception {
ExecutionAttributes streamContext = mapper.createExecutionAttributes(new HashMap());
assertEquals(0, streamContext.getProperties().size());

View File

@@ -60,7 +60,7 @@ public class MultipleColumnJdbcKeyGeneratorIntegrationTests extends AbstractTran
assertEquals(new Integer(5), key.get("VALUE"));
}
public void testGetKeyAsRestartData(){
public void testGetKeyAsExecutionAttributes(){
Map key = CollectionFactory.createLinkedCaseInsensitiveMapIfPossible(1);
key.put("ID", new Long(3));