IN PROGRESS - issue BATCH-412: consistent ItemStream key prefixes
http://jira.springframework.org/browse/BATCH-412 all keys made private (not referenced outside tests)
This commit is contained in:
@@ -44,7 +44,7 @@ public class SingleColumnJdbcKeyGeneratorIntegrationTests extends AbstractTransa
|
||||
|
||||
public void testRestoreKeys(){
|
||||
|
||||
executionContext.putString(SingleColumnJdbcKeyGenerator.RESTART_KEY, "3");
|
||||
executionContext.putString("key", "3");
|
||||
|
||||
List keys = keyStrategy.retrieveKeys(executionContext);
|
||||
|
||||
@@ -58,7 +58,7 @@ public class SingleColumnJdbcKeyGeneratorIntegrationTests extends AbstractTransa
|
||||
keyStrategy.saveState(new Long(3), executionContext);
|
||||
|
||||
assertEquals(1, executionContext.size());
|
||||
assertEquals("3", executionContext.getString(SingleColumnJdbcKeyGenerator.RESTART_KEY));
|
||||
assertEquals("3", executionContext.getString("key"));
|
||||
}
|
||||
|
||||
public void testGetNullKeyAsStreamContext(){
|
||||
|
||||
@@ -161,7 +161,7 @@ public class FlatFileItemReaderAdvancedTests extends TestCase {
|
||||
// get restart data
|
||||
reader.update(executionContext);
|
||||
assertEquals(4, executionContext.getLong(
|
||||
FlatFileItemReader.class.getSimpleName() + "." + FlatFileItemReader.READ_STATISTICS_NAME));
|
||||
FlatFileItemReader.class.getSimpleName() + ".lines.read.count"));
|
||||
// close input
|
||||
reader.close(executionContext);
|
||||
|
||||
@@ -175,7 +175,7 @@ public class FlatFileItemReaderAdvancedTests extends TestCase {
|
||||
assertEquals("[testLine6]", reader.read().toString());
|
||||
|
||||
reader.update(executionContext);
|
||||
assertEquals(6, executionContext.getLong(FlatFileItemReader.class.getSimpleName() + "." + FlatFileItemReader.READ_STATISTICS_NAME));
|
||||
assertEquals(6, executionContext.getLong(FlatFileItemReader.class.getSimpleName() + ".lines.read.count"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ public class FlatFileItemWriterTests extends TestCase {
|
||||
}
|
||||
|
||||
// 3 lines were written to the file after restart
|
||||
assertEquals(3, executionContext.getLong(FlatFileItemWriter.class.getSimpleName() + "." + FlatFileItemWriter.WRITTEN_STATISTICS_NAME));
|
||||
assertEquals(3, executionContext.getLong(FlatFileItemWriter.class.getSimpleName() + ".written"));
|
||||
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ public class FlatFileItemWriterTests extends TestCase {
|
||||
inputSource.update(executionContext);
|
||||
assertNotNull(executionContext);
|
||||
assertEquals(3, executionContext.entrySet().size());
|
||||
assertEquals(0, executionContext.getLong(FlatFileItemWriter.class.getSimpleName() + "." + FlatFileItemWriter.RESTART_DATA_NAME));
|
||||
assertEquals(0, executionContext.getLong(FlatFileItemWriter.class.getSimpleName() + ".current.count"));
|
||||
}
|
||||
|
||||
private void commit() throws Exception {
|
||||
|
||||
@@ -119,7 +119,7 @@ public class StaxEventItemReaderTests extends TestCase {
|
||||
source.read();
|
||||
source.update(executionContext);
|
||||
System.out.println(executionContext);
|
||||
assertEquals(1, executionContext.getLong(StaxEventItemReader.class.getSimpleName() + "." + StaxEventItemReader.READ_COUNT_STATISTICS_NAME));
|
||||
assertEquals(1, executionContext.getLong(StaxEventItemReader.class.getSimpleName() + ".read.count"));
|
||||
List expectedAfterRestart = (List) source.read();
|
||||
|
||||
source = createNewInputSouce();
|
||||
@@ -134,7 +134,7 @@ public class StaxEventItemReaderTests extends TestCase {
|
||||
*/
|
||||
public void testInvalidRestore() {
|
||||
ExecutionContext context = new ExecutionContext();
|
||||
context.putLong(StaxEventItemReader.class.getSimpleName() + "." + StaxEventItemReader.READ_COUNT_STATISTICS_NAME, 100000);
|
||||
context.putLong(StaxEventItemReader.class.getSimpleName() + ".read.count", 100000);
|
||||
try {
|
||||
source.open(context);
|
||||
fail("Expected StreamException");
|
||||
@@ -214,7 +214,7 @@ public class StaxEventItemReaderTests extends TestCase {
|
||||
}
|
||||
|
||||
private long extractRecordCount() {
|
||||
return executionContext.getLong(StaxEventItemReader.class.getSimpleName() + "." + StaxEventItemReader.READ_COUNT_STATISTICS_NAME);
|
||||
return executionContext.getLong(StaxEventItemReader.class.getSimpleName() + ".read.count");
|
||||
}
|
||||
|
||||
public void testCloseWithoutOpen() throws Exception {
|
||||
|
||||
@@ -125,7 +125,7 @@ public class StaxEventItemWriterTests extends TestCase {
|
||||
for (int i = 1; i <= NUMBER_OF_RECORDS; i++) {
|
||||
writer.write(record);
|
||||
writer.update(executionContext);
|
||||
long writeStatistics = executionContext.getLong(StaxEventItemWriter.class.getSimpleName() + "." + StaxEventItemWriter.WRITE_STATISTICS_NAME);
|
||||
long writeStatistics = executionContext.getLong(StaxEventItemWriter.class.getSimpleName() + ".record.count");
|
||||
|
||||
assertEquals(i, writeStatistics);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user