use of alluxio.rest.TestCase in project alluxio by Alluxio.
the class BlockWorkerClientRestApiTest method cancelBlock.
@Test
public void cancelBlock() throws Exception {
mBlockWorker.createBlock(SESSION_ID, BLOCK_ID, TIER_ALIAS, INITIAL_BYTES);
Map<String, String> params = new HashMap<>();
params.put("blockId", Long.toString(BLOCK_ID));
params.put("sessionId", Long.toString(SESSION_ID));
new TestCase(mHostname, mPort, getEndpoint(BlockWorkerClientRestServiceHandler.CANCEL_BLOCK), params, HttpMethod.POST, null).run();
}
use of alluxio.rest.TestCase in project alluxio by Alluxio.
the class BlockWorkerClientRestApiTest method promoteBlock.
@Test
public void promoteBlock() throws Exception {
mBlockWorker.createBlock(SESSION_ID, BLOCK_ID, TIER_ALIAS, INITIAL_BYTES);
mBlockWorker.commitBlock(SESSION_ID, BLOCK_ID);
Map<String, String> params = new HashMap<>();
params.put("blockId", Long.toString(BLOCK_ID));
new TestCase(mHostname, mPort, getEndpoint(BlockWorkerClientRestServiceHandler.PROMOTE_BLOCK), params, HttpMethod.POST, null).run();
}
use of alluxio.rest.TestCase in project alluxio by Alluxio.
the class FileSystemMasterClientRestApiTest method remove.
@Test
public void remove() throws Exception {
AlluxioURI uri = new AlluxioURI("/file");
mFileSystemMaster.createFile(uri, CreateFileOptions.defaults());
mFileSystemMaster.completeFile(uri, CompleteFileOptions.defaults());
Map<String, String> params = new HashMap<>();
params.put("path", uri.toString());
params.put("recursive", "false");
new TestCase(mHostname, mPort, getEndpoint(FileSystemMasterClientRestServiceHandler.REMOVE), params, "POST", null).run();
try {
mFileSystemMaster.getFileInfo(uri);
Assert.fail("file should have been removed");
} catch (FileDoesNotExistException e) {
// Expected
}
}
use of alluxio.rest.TestCase in project alluxio by Alluxio.
the class FileSystemMasterClientRestApiTest method mount.
@Test
public void mount() throws Exception {
AlluxioURI uri = new AlluxioURI("/file");
Map<String, String> params = new HashMap<>();
params.put("path", uri.toString());
params.put("ufsPath", mFolder.newFolder().getAbsolutePath());
new TestCase(mHostname, mPort, getEndpoint(FileSystemMasterClientRestServiceHandler.MOUNT), params, HttpMethod.POST, null).run();
}
use of alluxio.rest.TestCase in project alluxio by Alluxio.
the class FileSystemMasterClientRestApiTest method createFile.
@Test
public void createFile() throws Exception {
AlluxioURI uri = new AlluxioURI("/file");
Map<String, String> params = new HashMap<>();
params.put("path", uri.toString());
params.put("persisted", "false");
params.put("recursive", "false");
params.put("blockSizeBytes", "1");
params.put("blockSizeBytes", "1");
new TestCase(mHostname, mPort, getEndpoint(FileSystemMasterClientRestServiceHandler.CREATE_FILE), params, HttpMethod.POST, null).run();
Assert.assertFalse(mFileSystemMaster.getFileInfo(uri).isCompleted());
}
Aggregations