Search in sources :

Example 11 with TestCase

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();
}
Also used : HashMap(java.util.HashMap) TestCase(alluxio.rest.TestCase) CommandLineJob(alluxio.job.CommandLineJob) JobConf(alluxio.job.JobConf) AlluxioURI(alluxio.AlluxioURI) Test(org.junit.Test) RestApiTest(alluxio.rest.RestApiTest) Config(alluxio.LocalAlluxioClusterResource.Config)

Example 12 with TestCase

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();
}
Also used : HashMap(java.util.HashMap) TestCase(alluxio.rest.TestCase) AlluxioURI(alluxio.AlluxioURI) Test(org.junit.Test) RestApiTest(alluxio.rest.RestApiTest) Config(alluxio.LocalAlluxioClusterResource.Config)

Example 13 with TestCase

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());
}
Also used : HashMap(java.util.HashMap) TestCase(alluxio.rest.TestCase) AlluxioURI(alluxio.AlluxioURI) Test(org.junit.Test) RestApiTest(alluxio.rest.RestApiTest)

Example 14 with TestCase

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();
}
Also used : HashMap(java.util.HashMap) TestCase(alluxio.rest.TestCase) AlluxioURI(alluxio.AlluxioURI) Test(org.junit.Test) RestApiTest(alluxio.rest.RestApiTest)

Example 15 with TestCase

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();
}
Also used : HashMap(java.util.HashMap) TestCase(alluxio.rest.TestCase) AlluxioURI(alluxio.AlluxioURI) Test(org.junit.Test) RestApiTest(alluxio.rest.RestApiTest)

Aggregations

TestCase (alluxio.rest.TestCase)44 RestApiTest (alluxio.rest.RestApiTest)40 Test (org.junit.Test)40 HashMap (java.util.HashMap)30 AlluxioURI (alluxio.AlluxioURI)29 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)12 FileInfo (alluxio.wire.FileInfo)7 Config (alluxio.LocalAlluxioClusterResource.Config)5 FileDoesNotExistException (alluxio.exception.FileDoesNotExistException)4 List (java.util.List)3 CommandLineJob (alluxio.job.CommandLineJob)2 JobConf (alluxio.job.JobConf)2 BlockWriter (alluxio.worker.block.io.BlockWriter)2 HttpURLConnection (java.net.HttpURLConnection)2 TestCaseOptions (alluxio.rest.TestCaseOptions)1 AlluxioMasterInfo (alluxio.wire.AlluxioMasterInfo)1 AlluxioWorkerInfo (alluxio.wire.AlluxioWorkerInfo)1 BlockInfo (alluxio.wire.BlockInfo)1 LineageInfo (alluxio.wire.LineageInfo)1 LockBlockResult (alluxio.wire.LockBlockResult)1