use of org.pentaho.metaverse.frames.RowsToResultStepNode in project pentaho-metaverse by pentaho.
the class MetaverseValidationIT method testRowsToResultStepNode.
@Test
public void testRowsToResultStepNode() throws Exception {
RowsToResultStepNode rowsToResultStepNode = root.getRowsToResultStepNode();
assertNotNull(rowsToResultStepNode);
assertEquals("Copy rows to result", rowsToResultStepNode.getStepType());
Iterable<StreamFieldNode> streamFieldNodes = rowsToResultStepNode.getStreamFieldNodesCreates();
int countCreatedStreamFieldNode = getIterableSize(streamFieldNodes);
for (StreamFieldNode streamFieldNode : streamFieldNodes) {
assertNotNull(streamFieldNode.getKettleType());
// each field created is derived from an incoming field named the same thing
assertEquals(streamFieldNode.getName(), streamFieldNode.getFieldNodesThatDeriveMe().iterator().next().getName());
}
streamFieldNodes = rowsToResultStepNode.getStreamFieldNodesUses();
int countUsedStreamFieldNode = getIterableSize(streamFieldNodes);
for (StreamFieldNode streamFieldNode : streamFieldNodes) {
assertNotNull(streamFieldNode.getKettleType());
}
// should create a field for each one it uses
assertEquals(countCreatedStreamFieldNode, countUsedStreamFieldNode);
}
Aggregations