@Test public void testFieldSetWithDateFormat() throws Exception { SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd"); factory.setDateFormat(format); FieldSet fieldSet = factory.create(new String[] {"1999/12/18", "bar"} ); assertEquals(format.parse("1999/12/18"), fieldSet.readDate(0)); }
@Test public void testVanillaFieldSet() throws Exception { FieldSet fieldSet = factory.create(new String[] {"foo", "bar"} ); assertEquals("foo", fieldSet.readString(0)); }
@Test public void testVanillaFieldSetWithNames() throws Exception { FieldSet fieldSet = factory.create(new String[] {"1", "bar"}, new String[] {"foo", "bar"} ); assertEquals(1, fieldSet.readInt("foo")); }
@Test public void testFieldSetWithNumberFormat() throws Exception { factory.setNumberFormat(NumberFormat.getNumberInstance(Locale.GERMAN)); FieldSet fieldSet = factory.create(new String[] {"19.991.218", "bar"} ); assertEquals(19991218, fieldSet.readInt(0)); }