use of alluxio.testutils.underfs.ConfExpectingUnderFileSystemFactory in project alluxio by Alluxio.
the class MountCommandTest method mountWithMultipleOptions.
@Test
public void mountWithMultipleOptions() throws Exception {
ConfExpectingUnderFileSystemFactory factory = new ConfExpectingUnderFileSystemFactory("ufs", ImmutableMap.of("k1", "v1", "k2", "v2"));
try (Closeable closeable = new UnderFileSystemFactoryRegistryRule(factory).toResource()) {
AlluxioURI mountPoint = new AlluxioURI("/mnt");
String ufsPath = "ufs://" + mFolder.getRoot().getAbsolutePath();
Assert.assertEquals(0, sFsShell.run("mount", "--option", "k1=v1", "--option", "k2=v2", mountPoint.toString(), ufsPath));
FileSystemTestUtils.createByteFile(sFileSystem, "/mnt/testFile1", WritePType.CACHE_THROUGH, 20);
Assert.assertTrue(sFileSystem.exists(new AlluxioURI("/mnt/testFile1")));
URIStatus status = sFileSystem.getStatus(new AlluxioURI("/mnt/testFile1"));
Assert.assertTrue(status.isPersisted());
}
}
use of alluxio.testutils.underfs.ConfExpectingUnderFileSystemFactory in project alluxio by Alluxio.
the class UpdateMountCommandTest method updateMountWithMultipleOptions.
@Test
public void updateMountWithMultipleOptions() throws Exception {
ConfExpectingUnderFileSystemFactory factory = new ConfExpectingUnderFileSystemFactory("ufs", ImmutableMap.of("k1", "v1", "k2", "v2"));
AlluxioURI mountPoint = new AlluxioURI("/mnt");
String ufsPath = "ufs://" + mFolder.getRoot().getAbsolutePath();
try (Closeable closeable = new UnderFileSystemFactoryRegistryRule(factory).toResource()) {
Assert.assertEquals(0, sFsShell.run("mount", "--option", "k1=v1", "--option", "k2=v2", mountPoint.toString(), ufsPath));
FileSystemTestUtils.createByteFile(sFileSystem, "/mnt/testFile1", WritePType.CACHE_THROUGH, 20);
Assert.assertTrue(sFileSystem.exists(new AlluxioURI("/mnt/testFile1")));
URIStatus status = sFileSystem.getStatus(new AlluxioURI("/mnt/testFile1"));
Assert.assertTrue(status.isPersisted());
}
ConfExpectingUnderFileSystemFactory newFactory = new ConfExpectingUnderFileSystemFactory("ufs", ImmutableMap.of("k1", "v3", "k2", "v4"));
try (Closeable closeable = new UnderFileSystemFactoryRegistryRule(newFactory).toResource()) {
Assert.assertEquals(0, sFsShell.run("updateMount", "--option", "k1=v3", "--option", "k2=v4", mountPoint.toString()));
FileSystemTestUtils.createByteFile(sFileSystem, "/mnt/testFile2", WritePType.CACHE_THROUGH, 20);
Assert.assertTrue(sFileSystem.exists(new AlluxioURI("/mnt/testFile2")));
URIStatus status = sFileSystem.getStatus(new AlluxioURI("/mnt/testFile2"));
Assert.assertTrue(status.isPersisted());
}
}
Aggregations