use of org.simpleflatmapper.csv.CsvMapperFactory in project SimpleFlatMapper by arnaudroger.
the class CsvMapperJoinTest method testDynamicProfessorField.
@Test
public void testDynamicProfessorField() throws IOException {
final CsvMapperFactory mapperFactory = getCsvMapperFactory();
final List<ProfessorField> professors = mapperFactory.newMapper(ProfessorField.class).forEach(new StringReader(HEADER_DATA), new ListCollector<ProfessorField>()).getList();
JoinTest.validateProfessors(professors);
}
use of org.simpleflatmapper.csv.CsvMapperFactory in project SimpleFlatMapper by arnaudroger.
the class CsvMapperJoinTest method testDynamicProfessorC.
@Test
public void testDynamicProfessorC() throws IOException {
final CsvMapperFactory mapperFactory = getCsvMapperFactory();
final List<ProfessorC> professors = mapperFactory.newMapper(ProfessorC.class).forEach(new StringReader(HEADER_DATA), new ListCollector<ProfessorC>()).getList();
JoinTest.validateProfessors(professors);
}
use of org.simpleflatmapper.csv.CsvMapperFactory in project SimpleFlatMapper by arnaudroger.
the class CsvMapperDateFormatDefinitionTest method testCustomDateFormatOnFactory.
@Test
public void testCustomDateFormatOnFactory() throws IOException, ParseException {
CsvMapperFactory csvMapperFactory = CsvMapperFactory.newInstance();
csvMapperFactory.addColumnDefinition("date0", CsvColumnDefinition.dateFormatDefinition(df1).addTimeZone(tz1));
csvMapperFactory.addColumnDefinition("date1", CsvColumnDefinition.dateFormatDefinition(df2).addTimeZone(tz2));
CsvMapper<Tuple2<Date, Date>> mapper = csvMapperFactory.newMapper(Tuples.typeDef(Date.class, Date.class));
Tuple2<Date, Date> next = mapper.iterator(new StringReader("date0,date1\n20140909,091409")).next();
assertEquals(sdf1.parse("20140909"), next.first());
assertEquals(sdf2.parse("091409"), next.second());
}
use of org.simpleflatmapper.csv.CsvMapperFactory in project SimpleFlatMapper by arnaudroger.
the class CsvMapperJoinTest method testDynamicProfessorGS.
@Test
public void testDynamicProfessorGS() throws IOException {
final CsvMapperFactory mapperFactory = getCsvMapperFactory();
final List<ProfessorGS> professors = mapperFactory.newMapper(ProfessorGS.class).forEach(new StringReader(HEADER_DATA), new ListCollector<ProfessorGS>()).getList();
JoinTest.validateProfessors(professors);
}
use of org.simpleflatmapper.csv.CsvMapperFactory in project SimpleFlatMapper by arnaudroger.
the class CsvMapperJoinTest method testDynamicProfessorGSSharding.
@Test
public void testDynamicProfessorGSSharding() throws IOException {
final CsvMapperFactory mapperFactory = getCsvShardingMapperFactory();
final List<ProfessorGS> professors = mapperFactory.newMapper(ProfessorGS.class).forEach(new StringReader(HEADER_DATA), new ListCollector<ProfessorGS>()).getList();
JoinTest.validateProfessors(professors);
}
Aggregations