@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() ); }
@Override protected Set<StepField> getUsedFields( GetXMLDataMeta meta ) { Set<StepField> usedFields = new HashSet<>(); if ( meta.isInFields() ) { Set<StepField> stepFields = createStepFields( meta.getXMLField(), getInputs() ); usedFields.addAll( stepFields ); } return usedFields; }
GetXMLDataStepAnalyzer extends ExternalResourceStepAnalyzer<GetXMLDataMeta> { @Override protected Set<StepField> getUsedFields( GetXMLDataMeta meta ) { Set<StepField> usedFields = new HashSet<>(); if ( meta.isInFields() ) { Set<StepField> stepFields = createStepFields( meta.getXMLField(), getInputs() ); usedFields.addAll( stepFields ); } return usedFields; } }
GetXMLDataStepAnalyzer extends ExternalResourceStepAnalyzer<GetXMLDataMeta> { @Override protected Set<StepField> getUsedFields( GetXMLDataMeta meta ) { Set<StepField> usedFields = new HashSet<>(); if ( meta.isInFields() ) { Set<StepField> stepFields = createStepFields( meta.getXMLField(), getInputs() ); usedFields.addAll( stepFields ); } return usedFields; }  }
GetXMLDataStepAnalyzer extends ExternalResourceStepAnalyzer<GetXMLDataMeta> { @Override protected Set<StepField> getUsedFields( GetXMLDataMeta meta ) { Set<StepField> usedFields = new HashSet<>(); if ( meta.isInFields() ) { Set<StepField> stepFields = createStepFields( meta.getXMLField(), getInputs() ); usedFields.addAll( stepFields ); } return usedFields; }  @Override Set<Class<? extends BaseStepMeta>> getSupportedSteps(); @Override Set<ComponentDerivationRecord> getChangeRecords( GetXMLDataMeta meta ); @Override IMetaverseNode createResourceNode( IExternalResourceInfo resource ); @Override String getResourceInputNodeType(); @Override String getResourceOutputNodeType(); @Override boolean isOutput(); @Override boolean isInput(); }
GetXMLDataStepAnalyzer extends ExternalResourceStepAnalyzer<GetXMLDataMeta> { @Override protected Set<StepField> getUsedFields( GetXMLDataMeta meta ) { Set<StepField> usedFields = new HashSet<>(); if ( meta.isInFields() ) { Set<StepField> stepFields = createStepFields( meta.getXMLField(), getInputs() ); usedFields.addAll( stepFields ); } return usedFields; }  @Override Set<Class<? extends BaseStepMeta>> getSupportedSteps(); @Override Set<ComponentDerivationRecord> getChangeRecords( GetXMLDataMeta meta ); @Override IMetaverseNode createResourceNode( IExternalResourceInfo resource ); @Override String getResourceInputNodeType(); @Override String getResourceOutputNodeType(); @Override boolean isOutput(); @Override boolean isInput();  }