use of org.apache.hadoop.yarn.util.TrackingUriPlugin in project hadoop by apache.
the class TestProxyUriUtils method testGetProxyUriFromPluginsReturnsNullIfNoPlugins.
@Test
public void testGetProxyUriFromPluginsReturnsNullIfNoPlugins() throws URISyntaxException {
ApplicationId id = BuilderUtils.newApplicationId(6384623l, 5);
List<TrackingUriPlugin> list = Lists.newArrayListWithExpectedSize(0);
assertNull(ProxyUriUtils.getUriFromTrackingPlugins(id, list));
}
use of org.apache.hadoop.yarn.util.TrackingUriPlugin in project hadoop by apache.
the class TestProxyUriUtils method testGetProxyUriFromPluginsReturnsValidUriWhenAble.
@Test
public void testGetProxyUriFromPluginsReturnsValidUriWhenAble() throws URISyntaxException {
ApplicationId id = BuilderUtils.newApplicationId(6384623l, 5);
List<TrackingUriPlugin> list = Lists.newArrayListWithExpectedSize(2);
// Insert a plugin that returns null.
list.add(new TrackingUriPlugin() {
public URI getTrackingUri(ApplicationId id) throws URISyntaxException {
return null;
}
});
// Insert a plugin that returns a valid URI.
list.add(new TrackingUriPlugin() {
public URI getTrackingUri(ApplicationId id) throws URISyntaxException {
return new URI("http://history.server.net/");
}
});
URI result = ProxyUriUtils.getUriFromTrackingPlugins(id, list);
assertNotNull(result);
}
Aggregations