HadoopBaseStepAnalyzer extends ExternalResourceStepAnalyzer<M> { @Override public IMetaverseNode createResourceNode( final IExternalResourceInfo resource ) throws MetaverseException { return createFileNode( resource.getName(), descriptor ); }  @Override String getResourceInputNodeType(); @Override String getResourceOutputNodeType(); @Override Set<Class<? extends BaseStepMeta>> getSupportedSteps(); abstract Class<M> getMetaClass(); @Override IMetaverseNode createResourceNode( final IExternalResourceInfo resource ); @Override IMetaverseNode createResourceNode( final M meta, final IExternalResourceInfo resource );  }
@Test public void testCreateResourceNode() throws Exception { IExternalResourceInfo localResource = mock( IExternalResourceInfo.class ); when( localResource.getName() ).thenReturn( "file: IMetaverseNode resourceNode = analyzer.createResourceNode( getMetaMock(), localResource ); assertNotNull( resourceNode ); assertEquals( DictionaryConst.NODE_TYPE_FILE, resourceNode.getType() ); final HadoopFileMeta hMeta = (HadoopFileMeta) getMetaMock(); IExternalResourceInfo remoteResource = mock( IExternalResourceInfo.class ); final String hostName = "foo.com"; final String filePath = "hdfs: when( remoteResource.getName() ).thenReturn( filePath ); when( hMeta.getUrlHostName( filePath ) ).thenReturn( hostName ); resourceNode = analyzer.createResourceNode( getMetaMock(), remoteResource ); assertNotNull( resourceNode ); assertEquals( DictionaryConst.NODE_TYPE_FILE, resourceNode.getType() ); }