HadoopFileInputMeta extends TextFileInputMeta implements HadoopFileMeta { public String getUrlPath( String incomingURL ) { String path = null; FileName fileName = getUrlFileName( incomingURL ); if ( fileName != null ) { String root = fileName.getRootURI(); path = incomingURL.substring( root.length() - 1 ); } return path; } 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 testGetUrl() { final HadoopFileInputMeta meta = Mockito.mock( HadoopFileInputMeta.class ); final URLFileName mockFileName = Mockito.mock( URLFileName.class ); final String scheme = "hdfs"; final String hostName = "svqxbdcn6cdh512n1.pentahoqa.com"; final String rootUrl = scheme + ": final String path = "wordcount/input"; final String url = rootUrl + path; Mockito.doReturn( hostName ).when( mockFileName ).getHostName(); Mockito.doReturn( scheme ).when( mockFileName ).getScheme(); Mockito.doReturn( mockFileName ).when( meta ).getUrlFileName( url ); Mockito.doReturn( rootUrl ).when( mockFileName ).getRootURI(); Mockito.doCallRealMethod().when( meta ).getUrlHostName( url ); Mockito.doCallRealMethod().when( meta ).getUrlPath( url ); Assert.assertEquals( hostName, meta.getUrlHostName( url ) ); Assert.assertEquals( "/" + path, meta.getUrlPath( url ) ); }