use of org.pentaho.metaverse.frames.CsvFileInputStepNode in project pentaho-metaverse by pentaho.
the class MetaverseValidationIT method testCsvFileInputStep.
@Test
public void testCsvFileInputStep() throws Exception {
// this is testing a specific CsvFileInputStep instance
CsvFileInputStepNode csvFileInputStepNode = root.getCsvFileInputStepNode();
assertNotNull(csvFileInputStepNode);
Iterable<FramedMetaverseNode> inputFiles = csvFileInputStepNode.getInputFiles();
int countInputFiles = getIterableSize(inputFiles);
int countOutputs = getIterableSize(csvFileInputStepNode.getOutputStreamFields());
assertEquals(1, countInputFiles);
assertEquals(10, countOutputs);
for (FramedMetaverseNode inputFile : inputFiles) {
assertTrue(inputFile.getName().endsWith("customers-100.txt"));
}
assertEquals("CSV file input", csvFileInputStepNode.getStepType());
int fileFieldCount = 0;
Iterable<StreamFieldNode> outFields = csvFileInputStepNode.getOutputStreamFields();
for (StreamFieldNode outField : outFields) {
assertNotNull(outField.getKettleType());
FieldNode fieldPopulatesMe = outField.getFieldPopulatesMe();
assertNotNull(fieldPopulatesMe);
assertEquals(DictionaryConst.NODE_TYPE_FILE_FIELD, fieldPopulatesMe.getType());
assertEquals(csvFileInputStepNode, fieldPopulatesMe.getStepThatInputsMe());
fileFieldCount++;
}
assertEquals(countOutputs, fileFieldCount);
}
Aggregations