use of org.pentaho.metaverse.frames.MergeJoinStepNode in project pentaho-metaverse by pentaho.
the class MetaverseValidationIT method testMergeJoinStepNode_duplicateFieldNames.
@Test
public void testMergeJoinStepNode_duplicateFieldNames() throws Exception {
MergeJoinStepNode node = root.getMergeJoinStepNode();
MergeJoinMeta meta = (MergeJoinMeta) getStepMeta(node);
assertEquals(meta.getJoinType(), node.getJoinType());
assertEquals(meta.getKeyFields1().length, node.getJoinFieldsLeft().size());
assertEquals(meta.getKeyFields2().length, node.getJoinFieldsRight().size());
Iterable<StreamFieldNode> usedFields = node.getStreamFieldNodesUses();
for (StreamFieldNode usedField : usedFields) {
boolean isOnLeft = node.getJoinFieldsLeft().contains(usedField.getName());
boolean isOnRight = node.getJoinFieldsRight().contains(usedField.getName());
assertTrue(isOnLeft || isOnRight);
assertTrue(usedField.getFieldNodesThatIJoinTo() != null);
assertTrue(usedField.getFieldNodesThatJoinToMe() != null);
}
Iterable<StreamFieldNode> outputFields = node.getOutputStreamFields();
assertEquals(getExpectedOutputFieldCount(meta), getIterableSize(outputFields));
for (StreamFieldNode outputField : outputFields) {
// these should have derives links
assertTrue(outputField.getFieldNodesThatDeriveMe() != null);
}
}
Aggregations