@Test public void getUnavailableSourceSteps() { TargetStepAttribute targetStep = new TargetStepAttribute( TEST_TARGET_STEP_NAME, TEST_ATTR_VALUE, false ); SourceStepField unavailableSourceStep = new SourceStepField( UNAVAILABLE_STEP, TEST_FIELD ); Map<TargetStepAttribute, SourceStepField> targetMap = Collections.singletonMap( targetStep, unavailableSourceStep ); TransMeta sourceTransMeta = mock( TransMeta.class ); doReturn( new String[0] ).when( sourceTransMeta ).getPrevStepNames( any( StepMeta.class ) ); Set<SourceStepField> actualSet = MetaInject.getUnavailableSourceSteps( targetMap, sourceTransMeta, mock( StepMeta.class ) ); assertTrue( actualSet.contains( unavailableSourceStep ) ); }
public static Set<SourceStepField> getUnavailableSourceSteps( Map<TargetStepAttribute, SourceStepField> targetMap, TransMeta sourceTransMeta, StepMeta stepMeta ) { String[] stepNamesArray = sourceTransMeta.getPrevStepNames( stepMeta ); Set<String> existedStepNames = convertToUpperCaseSet( stepNamesArray ); Set<SourceStepField> unavailableSourceSteps = new HashSet<SourceStepField>(); for ( SourceStepField currentSource : targetMap.values() ) { if ( currentSource.getStepname() != null ) { if ( !existedStepNames.contains( currentSource.getStepname().toUpperCase() ) ) { unavailableSourceSteps.add( currentSource ); } } } return Collections.unmodifiableSet( unavailableSourceSteps ); }
MetaInject extends BaseStep implements StepInterface { public static Set<SourceStepField> getUnavailableSourceSteps( Map<TargetStepAttribute, SourceStepField> targetMap, TransMeta sourceTransMeta, StepMeta stepMeta ) { String[] stepNamesArray = sourceTransMeta.getPrevStepNames( stepMeta ); Set<String> existedStepNames = convertToUpperCaseSet( stepNamesArray ); Set<SourceStepField> unavailableSourceSteps = new HashSet<SourceStepField>(); for ( SourceStepField currentSource : targetMap.values() ) { if ( currentSource.getStepname() != null ) { if ( !existedStepNames.contains( currentSource.getStepname().toUpperCase() ) ) { unavailableSourceSteps.add( currentSource ); } } } return Collections.unmodifiableSet( unavailableSourceSteps ); } }
MetaInject extends BaseStep implements StepInterface { public static Set<SourceStepField> getUnavailableSourceSteps( Map<TargetStepAttribute, SourceStepField> targetMap, TransMeta sourceTransMeta, StepMeta stepMeta ) { String[] stepNamesArray = sourceTransMeta.getPrevStepNames( stepMeta ); Set<String> existedStepNames = convertToUpperCaseSet( stepNamesArray ); Set<SourceStepField> unavailableSourceSteps = new HashSet<SourceStepField>(); for ( SourceStepField currentSource : targetMap.values() ) { if ( currentSource.getStepname() != null ) { if ( !existedStepNames.contains( currentSource.getStepname().toUpperCase() ) ) { unavailableSourceSteps.add( currentSource ); } } } return Collections.unmodifiableSet( unavailableSourceSteps ); } MetaInject( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
      Trans trans ); }
MetaInject extends BaseStep implements StepInterface { public static Set<SourceStepField> getUnavailableSourceSteps( Map<TargetStepAttribute, SourceStepField> targetMap, TransMeta sourceTransMeta, StepMeta stepMeta ) { String[] stepNamesArray = sourceTransMeta.getPrevStepNames( stepMeta ); Set<String> existedStepNames = convertToUpperCaseSet( stepNamesArray ); Set<SourceStepField> unavailableSourceSteps = new HashSet<SourceStepField>(); for ( SourceStepField currentSource : targetMap.values() ) { if ( currentSource.getStepname() != null ) { if ( !existedStepNames.contains( currentSource.getStepname().toUpperCase() ) ) { unavailableSourceSteps.add( currentSource ); } } } return Collections.unmodifiableSet( unavailableSourceSteps ); } MetaInject( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
      Trans trans ); boolean processRow( StepMetaInterface smi, StepDataInterface sdi ); boolean init( StepMetaInterface smi, StepDataInterface sdi ); static void removeUnavailableStepsFromMapping( Map<TargetStepAttribute, SourceStepField> targetMap,
      Set<SourceStepField> unavailableSourceSteps, Set<TargetStepAttribute> unavailableTargetSteps ); static Set<TargetStepAttribute> getUnavailableTargetSteps( Map<TargetStepAttribute, SourceStepField> targetMap,
      TransMeta injectedTransMeta ); static Set<TargetStepAttribute> getUnavailableTargetKeys( Map<TargetStepAttribute, SourceStepField> targetMap,
      TransMeta injectedTransMeta, Set<TargetStepAttribute> unavailableTargetSteps ); static Set<SourceStepField> getUnavailableSourceSteps( Map<TargetStepAttribute, SourceStepField> targetMap,
      TransMeta sourceTransMeta, StepMeta stepMeta ); }
MetaInject extends BaseStep implements StepInterface { public static Set<SourceStepField> getUnavailableSourceSteps( Map<TargetStepAttribute, SourceStepField> targetMap, TransMeta sourceTransMeta, StepMeta stepMeta ) { String[] stepNamesArray = sourceTransMeta.getPrevStepNames( stepMeta ); Set<String> existedStepNames = convertToUpperCaseSet( stepNamesArray ); Set<SourceStepField> unavailableSourceSteps = new HashSet<SourceStepField>(); for ( SourceStepField currentSource : targetMap.values() ) { if ( currentSource.getStepname() != null ) { if ( !existedStepNames.contains( currentSource.getStepname().toUpperCase() ) ) { unavailableSourceSteps.add( currentSource ); } } } return Collections.unmodifiableSet( unavailableSourceSteps ); } MetaInject( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
      Trans trans ); boolean processRow( StepMetaInterface smi, StepDataInterface sdi ); boolean init( StepMetaInterface smi, StepDataInterface sdi ); static void removeUnavailableStepsFromMapping( Map<TargetStepAttribute, SourceStepField> targetMap,
      Set<SourceStepField> unavailableSourceSteps, Set<TargetStepAttribute> unavailableTargetSteps ); static Set<TargetStepAttribute> getUnavailableTargetSteps( Map<TargetStepAttribute, SourceStepField> targetMap,
      TransMeta injectedTransMeta ); static Set<TargetStepAttribute> getUnavailableTargetKeys( Map<TargetStepAttribute, SourceStepField> targetMap,
      TransMeta injectedTransMeta, Set<TargetStepAttribute> unavailableTargetSteps ); static Set<SourceStepField> getUnavailableSourceSteps( Map<TargetStepAttribute, SourceStepField> targetMap,
      TransMeta sourceTransMeta, StepMeta stepMeta );  }