use of org.apache.hadoop.yarn.api.protocolrecords.impl.pb.UseSharedCacheResourceResponsePBImpl in project hadoop by apache.
the class TestSharedCacheClientImpl method testUseWithResourceName.
@Test
public void testUseWithResourceName() throws Exception {
Path file = new Path("viewfs://test/path");
URI useUri = new URI("viewfs://test/path#linkName");
Path usePath = new Path(useUri);
UseSharedCacheResourceResponse response = new UseSharedCacheResourceResponsePBImpl();
response.setPath(file.toString());
when(cProtocol.use(isA(UseSharedCacheResourceRequest.class))).thenReturn(response);
Path newPath = client.use(mock(ApplicationId.class), "key", "linkName");
assertEquals("The paths are not equal!", usePath, newPath);
}
use of org.apache.hadoop.yarn.api.protocolrecords.impl.pb.UseSharedCacheResourceResponsePBImpl in project hadoop by apache.
the class TestSharedCacheClientImpl method testUseWithSameResourceName.
@Test
public void testUseWithSameResourceName() throws Exception {
Path file = new Path("viewfs://test/path");
URI useUri = new URI("viewfs://test/path");
Path usePath = new Path(useUri);
UseSharedCacheResourceResponse response = new UseSharedCacheResourceResponsePBImpl();
response.setPath(file.toString());
when(cProtocol.use(isA(UseSharedCacheResourceRequest.class))).thenReturn(response);
Path newPath = client.use(mock(ApplicationId.class), "key", "path");
assertEquals("The paths are not equal!", usePath, newPath);
}
use of org.apache.hadoop.yarn.api.protocolrecords.impl.pb.UseSharedCacheResourceResponsePBImpl in project hadoop by apache.
the class TestSharedCacheClientImpl method testUseCacheMiss.
@Test
public void testUseCacheMiss() throws Exception {
UseSharedCacheResourceResponse response = new UseSharedCacheResourceResponsePBImpl();
response.setPath(null);
when(cProtocol.use(isA(UseSharedCacheResourceRequest.class))).thenReturn(response);
Path newPath = client.use(mock(ApplicationId.class), "key", null);
assertNull("The path is not null!", newPath);
}
Aggregations