HadoopFileInputMeta extends TextFileInputMeta implements HadoopFileMeta { @Override public FileInputList getFileInputList( VariableSpace space ) { inputFiles.normalizeAllocation( inputFiles.fileName.length ); for ( int i = 0; i < environment.length; i++ ) { if ( inputFiles.fileName[ i ].contains( ": continue; } String sourceNc = environment[ i ]; sourceNc = sourceNc.equals( LOCAL_ENVIRONMENT ) ? HadoopFileInputMeta.LOCAL_SOURCE_FILE + i : sourceNc; sourceNc = sourceNc.equals( STATIC_ENVIRONMENT ) ? HadoopFileInputMeta.STATIC_SOURCE_FILE + i : sourceNc; sourceNc = sourceNc.equals( S3_ENVIRONMENT ) ? HadoopFileInputMeta.S3_SOURCE_FILE + i : sourceNc; String source = inputFiles.fileName[ i ]; if ( !Utils.isEmpty( source ) ) { inputFiles.fileName[ i ] = loadUrl( source, sourceNc, getParentStepMeta().getParentTransMeta().getMetaStore(), null ); } else { inputFiles.fileName[ i ] = ""; } } return createFileList( space ); } HadoopFileInputMeta();  HadoopFileInputMeta( NamedClusterService namedClusterService ); String loadUrl( String url, String ncName, IMetaStore metastore, Map<String, String> mappings ); void setNamedClusterURLMapping( Map<String, String> mappings ); Map<String, String> getNamedClusterURLMapping(); @Override String getClusterName( final String url ); String getClusterNameBy( String url ); String getUrlPath( String incomingURL ); void setVariableSpace( VariableSpace variableSpace ); NamedClusterService getNamedClusterService(); @Override FileInputList getFileInputList( VariableSpace space ); static final String SOURCE_CONFIGURATION_NAME; static final String LOCAL_SOURCE_FILE; static final String STATIC_SOURCE_FILE; static final String S3_SOURCE_FILE; static final String S3_DEST_FILE; @Injection( name = "ENVIRONMENT", group = "FILENAME_LINES" )
  public String[] environment; }
@Test public void testGetFileInputList() { final String URL_FROM_CLUSTER = "urlFromCluster"; StepMeta parentStepMeta = mock( StepMeta.class ); IMetaStore mockMetaStore = mock( IMetaStore.class ); NamedCluster mockNamedCluster = mock( NamedCluster.class ); TransMeta parentTransMeta = mock( TransMeta.class ); when( parentStepMeta.getParentTransMeta() ).thenReturn( parentTransMeta ); when( parentTransMeta.getMetaStore() ).thenReturn( mockMetaStore ); when( mockNamedCluster.processURLsubstitution( any(), eq( mockMetaStore ), any() ) ).thenReturn( URL_FROM_CLUSTER ); when( namedClusterService.getNamedClusterByName( TEST_CLUSTER_NAME, mockMetaStore ) ).thenReturn( mockNamedCluster ); HadoopFileInputMeta hadoopFileInputMetaSpy = initHadoopMetaInput( new HadoopFileInputMeta( namedClusterService ) ); hadoopFileInputMetaSpy.environment = new String[] { TEST_CLUSTER_NAME }; hadoopFileInputMetaSpy.setParentStepMeta( parentStepMeta ); doReturn( new FileInputList() ).when( hadoopFileInputMetaSpy ).createFileList( any( VariableSpace.class ) ); hadoopFileInputMetaSpy.getFileInputList( new Variables() ); assertEquals( "urlFromCluster", hadoopFileInputMetaSpy.inputFiles.fileName[0] ); }