Search in sources :

Example 1 with RowsToResultStepNode

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);
}
Also used : StreamFieldNode(org.pentaho.metaverse.frames.StreamFieldNode) RowsToResultStepNode(org.pentaho.metaverse.frames.RowsToResultStepNode) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 RowsToResultStepNode (org.pentaho.metaverse.frames.RowsToResultStepNode)1 StreamFieldNode (org.pentaho.metaverse.frames.StreamFieldNode)1