@Test
public void testLoadSetsURIs() throws IOException {
ensureCreated();
DatasetDescriptor loaded = provider.load(NAME);
Assert.assertNotNull("Loaded descriptor should have a location",
loaded.getLocation());
if (distributed) {
// purposely call new Configuration() to test that the URI has HDFS info
Assert.assertEquals(
getDFS(),
FileSystem.get(loaded.getLocation(), new Configuration()));
Assert.assertEquals(
"hdfs",
loaded.getLocation().getScheme());
Assert.assertEquals(
getDFS().getUri().getAuthority(),
loaded.getLocation().getAuthority());
} else {
// purposely call new Configuration() to test that the URI has FS info
Assert.assertEquals(
getFS(),
FileSystem.get(loaded.getLocation(), new Configuration()));
Assert.assertEquals(
"file",
loaded.getLocation().getScheme());
Assert.assertEquals(
getFS().getUri().getAuthority(),
loaded.getLocation().getAuthority());
}
}