use of org.pentaho.metaverse.api.analyzer.kettle.step.StepNodes in project pentaho-metaverse by pentaho.
the class TransExecutorStepAnalyzerTest method testConnectToSubTransInputFields_noPrevFields.
@Test
public void testConnectToSubTransInputFields_noPrevFields() throws Exception {
IMetaverseNode childTransNode = mock(IMetaverseNode.class);
StepNodes inputs = new StepNodes();
doReturn(inputs).when(spyAnalyzer).getInputs();
doNothing().when(spyAnalyzer).linkUsedFieldToSubTrans(any(IMetaverseNode.class), any(TransMeta.class), any(IMetaverseNode.class), any(IComponentDescriptor.class));
spyAnalyzer.connectToSubTransInputFields(meta, childTransMeta, childTransNode, descriptor);
verify(spyAnalyzer, never()).linkUsedFieldToSubTrans(any(IMetaverseNode.class), any(TransMeta.class), any(IMetaverseNode.class), any(IComponentDescriptor.class));
}
use of org.pentaho.metaverse.api.analyzer.kettle.step.StepNodes in project pentaho-kettle by pentaho.
the class GetXMLDataStepAnalyzerTest method testGetUsedFields.
@Test
public void testGetUsedFields() throws Exception {
when(meta.isInFields()).thenReturn(true);
when(meta.getXMLField()).thenReturn("xml");
StepNodes inputs = new StepNodes();
inputs.addNode("previousStep", "xml", node);
inputs.addNode("previousStep", "otherField", node);
doReturn(inputs).when(analyzer).getInputs();
Set<StepField> usedFields = analyzer.getUsedFields(meta);
assertEquals(1, usedFields.size());
assertEquals("xml", usedFields.iterator().next().getFieldName());
}
Aggregations