@Test public void testGetInputRowMetaInterfaces_isInFields() throws Exception { when( parentTransMeta.getPrevStepNames( parentStepMeta ) ).thenReturn( null ); RowMetaInterface rowMetaInterface = mock( RowMetaInterface.class ); doReturn( rowMetaInterface ).when( analyzer ).getOutputFields( meta ); when( meta.isInFields() ).thenReturn( true ); when( meta.getIsAFile() ).thenReturn( false ); when( meta.isReadUrl() ).thenReturn( false ); Map<String, RowMetaInterface> rowMetaInterfaces = analyzer.getInputRowMetaInterfaces( meta ); assertNotNull( rowMetaInterfaces ); assertEquals( 0, rowMetaInterfaces.size() ); }
@Override protected Map<String, RowMetaInterface> getInputRowMetaInterfaces( GetXMLDataMeta meta ) { Map<String, RowMetaInterface> inputRows = getInputFields( meta ); if ( inputRows == null ) { inputRows = new HashMap<>(); } boolean isInFields = meta.isInFields(); boolean isAFile = meta.getIsAFile(); boolean isAUrl = meta.isReadUrl(); if ( !isInFields || isAFile || isAUrl ) { RowMetaInterface stepFields = getOutputFields( meta ); RowMetaInterface clone = stepFields.clone(); for ( RowMetaInterface rowMetaInterface : inputRows.values() ) { for ( ValueMetaInterface valueMetaInterface : rowMetaInterface.getValueMetaList() ) { try { clone.removeValueMeta( valueMetaInterface.getName() ); } catch ( KettleValueException e ) { } } } inputRows.put( RESOURCE, clone ); } return inputRows; }
GetXMLDataStepAnalyzer extends ExternalResourceStepAnalyzer<GetXMLDataMeta> { @Override protected Map<String, RowMetaInterface> getInputRowMetaInterfaces( GetXMLDataMeta meta ) { Map<String, RowMetaInterface> inputRows = getInputFields( meta ); if ( inputRows == null ) { inputRows = new HashMap<>(); } boolean isInFields = meta.isInFields(); boolean isAFile = meta.getIsAFile(); boolean isAUrl = meta.isReadUrl(); if ( !isInFields || isAFile || isAUrl ) { RowMetaInterface stepFields = getOutputFields( meta ); RowMetaInterface clone = stepFields.clone(); for ( RowMetaInterface rowMetaInterface : inputRows.values() ) { for ( ValueMetaInterface valueMetaInterface : rowMetaInterface.getValueMetaList() ) { try { clone.removeValueMeta( valueMetaInterface.getName() ); } catch ( KettleValueException e ) { } } } inputRows.put( RESOURCE, clone ); } return inputRows; } }
GetXMLDataStepAnalyzer extends ExternalResourceStepAnalyzer<GetXMLDataMeta> { @Override protected Map<String, RowMetaInterface> getInputRowMetaInterfaces( GetXMLDataMeta meta ) { Map<String, RowMetaInterface> inputRows = getInputFields( meta ); if ( inputRows == null ) { inputRows = new HashMap<>(); } boolean isInFields = meta.isInFields(); boolean isAFile = meta.getIsAFile(); boolean isAUrl = meta.isReadUrl(); if ( !isInFields || isAFile || isAUrl ) { RowMetaInterface stepFields = getOutputFields( meta ); RowMetaInterface clone = stepFields.clone(); for ( RowMetaInterface rowMetaInterface : inputRows.values() ) { for ( ValueMetaInterface valueMetaInterface : rowMetaInterface.getValueMetaList() ) { try { clone.removeValueMeta( valueMetaInterface.getName() ); } catch ( KettleValueException e ) { } } } inputRows.put( RESOURCE, clone ); } return inputRows; }  }
GetXMLDataStepAnalyzer extends ExternalResourceStepAnalyzer<GetXMLDataMeta> { @Override protected Map<String, RowMetaInterface> getInputRowMetaInterfaces( GetXMLDataMeta meta ) { Map<String, RowMetaInterface> inputRows = getInputFields( meta ); if ( inputRows == null ) { inputRows = new HashMap<>(); } boolean isInFields = meta.isInFields(); boolean isAFile = meta.getIsAFile(); boolean isAUrl = meta.isReadUrl(); if ( !isInFields || isAFile || isAUrl ) { RowMetaInterface stepFields = getOutputFields( meta ); RowMetaInterface clone = stepFields.clone(); for ( RowMetaInterface rowMetaInterface : inputRows.values() ) { for ( ValueMetaInterface valueMetaInterface : rowMetaInterface.getValueMetaList() ) { try { clone.removeValueMeta( valueMetaInterface.getName() ); } catch ( KettleValueException e ) { } } } inputRows.put( RESOURCE, clone ); } return inputRows; }  @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 Map<String, RowMetaInterface> getInputRowMetaInterfaces( GetXMLDataMeta meta ) { Map<String, RowMetaInterface> inputRows = getInputFields( meta ); if ( inputRows == null ) { inputRows = new HashMap<>(); } boolean isInFields = meta.isInFields(); boolean isAFile = meta.getIsAFile(); boolean isAUrl = meta.isReadUrl(); if ( !isInFields || isAFile || isAUrl ) { RowMetaInterface stepFields = getOutputFields( meta ); RowMetaInterface clone = stepFields.clone(); for ( RowMetaInterface rowMetaInterface : inputRows.values() ) { for ( ValueMetaInterface valueMetaInterface : rowMetaInterface.getValueMetaList() ) { try { clone.removeValueMeta( valueMetaInterface.getName() ); } catch ( KettleValueException e ) { } } } inputRows.put( RESOURCE, clone ); } return inputRows; }  @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();  }