use of alluxio.rest.TestCase in project alluxio by Alluxio.
the class LineageMasterClientRestApiTest method deleteLineage.
@Test
@Config(confParams = { PropertyKey.Name.USER_LINEAGE_ENABLED, "true" })
public void deleteLineage() throws Exception {
LineageMaster lineageMaster = mMaster.getLineageMaster();
long lineageId = lineageMaster.createLineage(new ArrayList<AlluxioURI>(), new ArrayList<AlluxioURI>(), new CommandLineJob("test", new JobConf("/output")));
Map<String, String> params = new HashMap<>();
params.put("lineageId", Long.toString(lineageId));
params.put("cascade", "false");
new TestCase(mHostname, mPort, getEndpoint(LineageMasterClientRestServiceHandler.DELETE_LINEAGE), params, HttpMethod.POST, true).run();
}
use of alluxio.rest.TestCase in project alluxio by Alluxio.
the class LineageMasterClientRestApiTest method createLineage.
@Test
@Config(confParams = { PropertyKey.Name.USER_LINEAGE_ENABLED, "true" })
public void createLineage() throws Exception {
mLineageClient.createFile(new AlluxioURI("/input")).close();
Map<String, String> params = new HashMap<>();
params.put("inputFiles", "/input");
params.put("outputFiles", "/output");
params.put("command", "test");
params.put("commandOutputFile", "test");
new TestCase(mHostname, mPort, getEndpoint(LineageMasterClientRestServiceHandler.CREATE_LINEAGE), params, HttpMethod.POST, null).call();
}
use of alluxio.rest.TestCase in project alluxio by Alluxio.
the class FileSystemMasterClientRestApiTest method createDirectory.
@Test
public void createDirectory() 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("allowExists", "false");
new TestCase(mHostname, mPort, getEndpoint(FileSystemMasterClientRestServiceHandler.CREATE_DIRECTORY), params, HttpMethod.POST, null).run();
Assert.assertTrue(mFileSystemMaster.listStatus(uri, ListStatusOptions.defaults()).isEmpty());
}
use of alluxio.rest.TestCase in project alluxio by Alluxio.
the class FileSystemMasterClientRestApiTest method unmount.
@Test
public void unmount() throws Exception {
AlluxioURI uri = new AlluxioURI("/mount");
mFileSystemMaster.mount(uri, new AlluxioURI(mFolder.newFolder().getAbsolutePath()), MountOptions.defaults());
Map<String, String> params = new HashMap<>();
params.put("path", uri.toString());
new TestCase(mHostname, mPort, getEndpoint(FileSystemMasterClientRestServiceHandler.UNMOUNT), params, HttpMethod.POST, null).run();
}
use of alluxio.rest.TestCase in project alluxio by Alluxio.
the class FileSystemMasterClientRestApiTest method scheduleAsyncPersist.
@Test
public void scheduleAsyncPersist() 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());
new TestCase(mHostname, mPort, getEndpoint(FileSystemMasterClientRestServiceHandler.SCHEDULE_ASYNC_PERSIST), params, HttpMethod.POST, null).run();
}
Aggregations