use of org.pentaho.metaverse.api.StepField in project pentaho-metaverse by pentaho.
the class CalculatorStepAnalyzerTest method testGetUsedFields.
@Test
public void testGetUsedFields() throws Exception {
StepNodes inputNodes = new StepNodes();
inputNodes.addNode("input", "height", node);
inputNodes.addNode("input", "width", node);
inputNodes.addNode("input", "radius", node);
inputNodes.addNode("input", "pi", node);
inputNodes.addNode("input", "two", node);
inputNodes.addNode("input", "NOT USED", node);
when(analyzer.getInputs()).thenReturn(inputNodes);
Set<StepField> usedFields = analyzer.getUsedFields(calculatorMeta);
assertEquals(5, usedFields.size());
}
use of org.pentaho.metaverse.api.StepField in project pentaho-metaverse by pentaho.
the class ExcelInputStepAnalyzerTest method testGetUsedFields_fileNameFromField.
@Test
public void testGetUsedFields_fileNameFromField() throws Exception {
when(meta.isAcceptingFilenames()).thenReturn(true);
when(meta.getAcceptingField()).thenReturn("filename");
when(meta.getAcceptingStepName()).thenReturn("previousStep");
Set<StepField> usedFields = analyzer.getUsedFields(meta);
assertNotNull(usedFields);
assertEquals(1, usedFields.size());
StepField used = usedFields.iterator().next();
assertEquals("previousStep", used.getStepName());
assertEquals("filename", used.getFieldName());
}
use of org.pentaho.metaverse.api.StepField in project pentaho-metaverse by pentaho.
the class MergeJoinStepAnalyzerTest method testIsPassthrough_leftSideField.
@Test
public void testIsPassthrough_leftSideField() throws Exception {
StepField passthroughField = new StepField("leftStep", "value");
assertTrue(analyzer.isPassthrough(passthroughField));
}
use of org.pentaho.metaverse.api.StepField in project pentaho-metaverse by pentaho.
the class MergeJoinStepAnalyzerTest method testIsPassthrough_rightSideField.
@Test
public void testIsPassthrough_rightSideField() throws Exception {
StepField passthroughField = new StepField("rightStep", "ST");
assertTrue(analyzer.isPassthrough(passthroughField));
}
use of org.pentaho.metaverse.api.StepField in project pentaho-metaverse by pentaho.
the class MergeJoinStepAnalyzerTest method testIsPassthrough_rightSideFieldRenamed.
@Test
public void testIsPassthrough_rightSideFieldRenamed() throws Exception {
// the right side value field gets renamed to value_1, so this one is not a passthrough
StepField passthroughField = new StepField("rightStep", "value");
assertFalse(analyzer.isPassthrough(passthroughField));
}
Aggregations