use of org.neo4j.unsafe.impl.batchimport.input.Input in project neo4j by neo4j.
the class CsvInputTest method shouldPropagateExceptionFromFailingDecorator.
@Test
public void shouldPropagateExceptionFromFailingDecorator() throws Exception {
// GIVEN
RuntimeException failure = new RuntimeException("FAILURE");
Iterable<DataFactory<InputNode>> data = DataFactories.nodeData(CsvInputTest.<InputNode>data(":ID,name\n1,Mattias", new FailingNodeDecorator(failure)));
Input input = new CsvInput(data, defaultFormatNodeFileHeader(), null, null, IdType.INTEGER, config(COMMAS), silentBadCollector(0), getRuntime().availableProcessors());
// WHEN
try (InputIterator<InputNode> nodes = input.nodes().iterator()) {
nodes.next();
} catch (RuntimeException e) {
// THEN
assertTrue(e == failure);
}
}
Aggregations