use of org.pentaho.metaverse.frames.FixedFileInputStepNode in project pentaho-metaverse by pentaho.
the class MetaverseValidationIT method testFixedFileInputStep.
@Test
public void testFixedFileInputStep() throws Exception {
// this is testing a specific FixedFileInputStep instance
FixedFileInputStepNode fixedFileInputStepNode = root.getFixedFileInputStepNode();
assertNotNull(fixedFileInputStepNode);
Iterable<FramedMetaverseNode> inputFiles = fixedFileInputStepNode.getInputFiles();
int countInputFiles = getIterableSize(inputFiles);
assertEquals(1, countInputFiles);
for (FramedMetaverseNode inputFile : inputFiles) {
assertTrue(inputFile.getName().endsWith("Textfile input - fixed length sample data.txt"));
}
assertEquals("Fixed file input", fixedFileInputStepNode.getStepType());
int countFileFieldNode = getIterableSize(fixedFileInputStepNode.getFileFieldNodesUses());
assertEquals(0, countFileFieldNode);
int countOutputs = getIterableSize(fixedFileInputStepNode.getOutputStreamFields());
int fileFieldCount = 0;
Iterable<StreamFieldNode> outFields = fixedFileInputStepNode.getOutputStreamFields();
for (StreamFieldNode outField : outFields) {
assertNotNull(outField.getKettleType());
FieldNode fieldPopulatesMe = outField.getFieldPopulatesMe();
assertNotNull(fieldPopulatesMe);
assertEquals(DictionaryConst.NODE_TYPE_FILE_FIELD, fieldPopulatesMe.getType());
assertEquals(fixedFileInputStepNode, fieldPopulatesMe.getStepThatInputsMe());
fileFieldCount++;
}
assertEquals(countOutputs, fileFieldCount);
}
Aggregations