From a41fef7eb67cfe8276bfc090d7491f92addd75f0 Mon Sep 17 00:00:00 2001 From: lucasward Date: Wed, 19 Dec 2007 15:22:32 +0000 Subject: [PATCH] BATCH-261:Added an extra test case to FieldSetTests to ensure padded input doesn't cause issues in the FieldSet. As mentioned in the issue, the BeanWrapperFieldSetMapper is likely causing the issue. --- .../org/springframework/batch/io/file/FieldSetTests.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/file/FieldSetTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/file/FieldSetTests.java index 19b7c7b00..b18f52df5 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/file/FieldSetTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/file/FieldSetTests.java @@ -428,4 +428,11 @@ public class FieldSetTests extends TestCase { assertEquals(tokens[i], values[i]); } } + + public void testPaddedLong(){ + FieldSet fs = new FieldSet(new String[]{"00000009"}); + + long value = fs.readLong(0); + assertEquals(value, 9); + } }