use of eu.esdihumboldt.hale.io.csv.reader.internal.CSVSchemaReader in project hale by halestudio.
the class CSVSchemaReaderTest method failTest.
/**
* Test for no given property names and only 2 (of 4) given property types
* (if there are not given 0 or maximum, in this case 4, property types we
* expect an error)
*
* @throws Exception the Exception thrown if the test fails
*/
public void failTest() throws Exception {
CSVSchemaReader schemaReader = new CSVSchemaReader();
schemaReader.setSource(new DefaultInputSupplier(getClass().getResource("/data/test1.csv").toURI()));
schemaReader.setParameter(CommonSchemaConstants.PARAM_TYPENAME, Value.of("TestTyp"));
schemaReader.setParameter(CSVSchemaReader.PARAM_PROPERTY, null);
schemaReader.setParameter(CSVSchemaReader.PARAM_PROPERTYTYPE, Value.of("java.lang.String,java.lang.String"));
schemaReader.setParameter(CSVSchemaReader.PARAM_SEPARATOR, null);
schemaReader.setParameter(CSVSchemaReader.PARAM_QUOTE, null);
schemaReader.setParameter(CSVSchemaReader.PARAM_ESCAPE, null);
IOReport report = schemaReader.execute(new LogProgressIndicator());
assertFalse(report.getErrors().isEmpty());
assertFalse(report.isSuccess());
}
use of eu.esdihumboldt.hale.io.csv.reader.internal.CSVSchemaReader in project hale by halestudio.
the class CSVSchemaReaderTest method failTest2.
/**
* Test for no given type name. So we expect the reporter not to be
* successful.
*
* @throws Exception the Exception thrown if the test fails
*/
@Test
public void failTest2() throws Exception {
CSVSchemaReader schemaReader2 = new CSVSchemaReader();
schemaReader2.setSource(new DefaultInputSupplier(getClass().getResource("/data/test1.csv").toURI()));
schemaReader2.setParameter(CommonSchemaConstants.PARAM_TYPENAME, null);
IOReport report = schemaReader2.execute(new LogProgressIndicator());
assertFalse(report.isSuccess());
}
Aggregations