use of io.crate.testing.TestingRowConsumer in project crate by crate.
the class FileReadingCollectorTest method testCollectWithEmptyLine.
@Test
public void testCollectWithEmptyLine() throws Throwable {
TestingRowConsumer consumer = getObjects(Paths.get(tmpFileEmptyLine.toURI()).toUri().toString());
assertCorrectResult(consumer.getBucket());
}
use of io.crate.testing.TestingRowConsumer in project crate by crate.
the class FileReadingCollectorTest method testDoCollectRaw.
@Test
public void testDoCollectRaw() throws Throwable {
TestingRowConsumer consumer = getObjects(Paths.get(tmpFile.toURI()).toUri().toString());
assertCorrectResult(consumer.getBucket());
}
use of io.crate.testing.TestingRowConsumer in project crate by crate.
the class FileReadingCollectorTest method testMultipleUriSupport.
@Test
public void testMultipleUriSupport() throws Throwable {
List<String> fileUris = new ArrayList<>();
fileUris.add(Paths.get(tmpFile.toURI()).toUri().toString());
fileUris.add(Paths.get(tmpFileEmptyLine.toURI()).toUri().toString());
TestingRowConsumer consumer = getObjects(fileUris, null);
Iterator<Row> it = consumer.getBucket().iterator();
assertThat(it.next(), isRow("{\"name\": \"Arthur\", \"id\": 4, \"details\": {\"age\": 38}}"));
assertThat(it.next(), isRow("{\"id\": 5, \"name\": \"Trillian\", \"details\": {\"age\": 33}}"));
assertThat(it.next(), isRow("{\"name\": \"Arthur\", \"id\": 4, \"details\": {\"age\": 38}}"));
assertThat(it.next(), isRow("{\"id\": 5, \"name\": \"Trillian\", \"details\": {\"age\": 33}}"));
}
use of io.crate.testing.TestingRowConsumer in project crate by crate.
the class FileReadingCollectorTest method testCollectFromUriWithGlob.
@Test
public void testCollectFromUriWithGlob() throws Throwable {
TestingRowConsumer projector = getObjects(Paths.get(tmpFile.getParentFile().toURI()).toUri().toString() + "file*.json");
assertCorrectResult(projector.getBucket());
}
use of io.crate.testing.TestingRowConsumer in project crate by crate.
the class FileReadingCollectorTest method testRelativeImport.
@Test(expected = IllegalArgumentException.class)
public void testRelativeImport() throws Throwable {
TestingRowConsumer projector = getObjects("xy");
assertCorrectResult(projector.getBucket());
}
Aggregations