use of org.simpleflatmapper.csv.impl.primitive.ShortDelayedCellSetter in project SimpleFlatMapper by arnaudroger.
the class PrimitivesDelayedCellSetterTest method testShortGetSetValue.
@Test
public void testShortGetSetValue() throws Exception {
Setter<DbPrimitiveObjectWithSetter, Short> shortSetter = objectSetterFactory.getSetter(DbPrimitiveObjectWithSetter.class, "pShort");
ShortDelayedCellSetter<DbPrimitiveObjectWithSetter> setter = new ShortDelayedCellSetter<DbPrimitiveObjectWithSetter>(ObjectSetterFactory.toShortSetter(shortSetter), new ShortCellValueReaderImpl());
setter.set("13".toCharArray(), 0, 2, null);
assertEquals(new Short((short) 13), setter.consumeValue());
setter.set("13".toCharArray(), 0, 2, null);
DbPrimitiveObjectWithSetter o = new DbPrimitiveObjectWithSetter();
setter.set(o);
assertEquals((short) 13, o.getpShort());
setter.set("".toCharArray(), 0, 0, null);
assertNull(setter.consumeValue());
}
Aggregations