Search in sources :

Example 1 with SnapshotAccessControlException

use of org.apache.hadoop.hdfs.protocol.SnapshotAccessControlException in project hadoop by apache.

the class TestDisallowModifyROSnapshot method testRename.

@Test(timeout = 60000)
public void testRename() throws Exception {
    try {
        fs.rename(objInSnapshot, new Path("/invalid/path"));
        fail("Didn't throw SnapshotAccessControlException");
    } catch (SnapshotAccessControlException e) {
    /* Ignored */
    }
    try {
        fs.rename(sub2, objInSnapshot);
        fail("Didn't throw SnapshotAccessControlException");
    } catch (SnapshotAccessControlException e) {
    /* Ignored */
    }
    try {
        fs.rename(sub2, objInSnapshot, (Options.Rename) null);
        fail("Didn't throw SnapshotAccessControlException");
    } catch (SnapshotAccessControlException e) {
    /* Ignored */
    }
}
Also used : Path(org.apache.hadoop.fs.Path) Options(org.apache.hadoop.fs.Options) SnapshotAccessControlException(org.apache.hadoop.hdfs.protocol.SnapshotAccessControlException) Test(org.junit.Test)

Aggregations

Options (org.apache.hadoop.fs.Options)1 Path (org.apache.hadoop.fs.Path)1 SnapshotAccessControlException (org.apache.hadoop.hdfs.protocol.SnapshotAccessControlException)1 Test (org.junit.Test)1