use of org.talend.components.google.drive.runtime.data.GoogleDriveDataSource in project components by Talend.
the class GoogleDriveDatasetTestIT method testDatasetRuntime.
@Test
public void testDatasetRuntime() throws Exception {
GoogleDriveDatasetRuntime rt = new GoogleDriveDatasetRuntime();
rt.initialize(null, dataset);
Schema schema = rt.getSchema();
LOG.debug("schema = {}.", schema);
assertNotNull(schema);
counted = 0;
rt.getSample(LIMIT, new org.talend.daikon.java8.Consumer<IndexedRecord>() {
@Override
public void accept(IndexedRecord indexedRecord) {
counted++;
}
});
assertTrue(LIMIT >= counted);
GoogleDriveDataSource source = rt.createDataSource(properties);
GoogleDriveInputReader reader = (GoogleDriveInputReader) source.createReader(null);
assertTrue(reader.start());
IndexedRecord record = reader.getCurrent();
LOG.debug("record = {}.", record);
while (reader.advance()) {
assertNotNull(reader.getCurrent());
}
}
Aggregations