use of alluxio.cli.fs.FileSystemShell in project alluxio by Alluxio.
the class CpCommandIntegrationTest method copyAfterWorkersNotAvailableMustCache.
@Test
public void copyAfterWorkersNotAvailableMustCache() throws Exception {
InstancedConfiguration conf = new InstancedConfiguration(ServerConfiguration.global());
conf.set(PropertyKey.USER_FILE_WRITE_TYPE_DEFAULT, "MUST_CACHE");
try (FileSystemShell fsShell = new FileSystemShell(conf)) {
File testFile = new File(sLocalAlluxioCluster.getAlluxioHome() + "/testFile");
testFile.createNewFile();
FileOutputStream fos = new FileOutputStream(testFile);
byte[] toWrite = BufferUtils.getIncreasingByteArray(100);
fos.write(toWrite);
fos.close();
fsShell.run("copyFromLocal", testFile.getPath(), "/");
Assert.assertTrue(sFileSystem.exists(new AlluxioURI("/testFile")));
sLocalAlluxioCluster.stopWorkers();
fsShell.run("cp", "/testFile", "/testFile2");
Assert.assertFalse(sFileSystem.exists(new AlluxioURI("/testFile2")));
}
}
Aggregations