Search in sources :

Example 6 with ChRootedFs

use of org.apache.hadoop.fs.viewfs.ChRootedFs in project hadoop by apache.

the class TestChRootedFs method testIsValidNameValidInBaseFs.

@Test
public void testIsValidNameValidInBaseFs() throws Exception {
    AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
    ChRootedFs chRootedFs = new ChRootedFs(baseFs, new Path("/chroot"));
    Mockito.doReturn(true).when(baseFs).isValidName(Mockito.anyString());
    Assert.assertTrue(chRootedFs.isValidName("/test"));
    Mockito.verify(baseFs).isValidName("/chroot/test");
}
Also used : AbstractFileSystem(org.apache.hadoop.fs.AbstractFileSystem) Path(org.apache.hadoop.fs.Path) ChRootedFs(org.apache.hadoop.fs.viewfs.ChRootedFs) Test(org.junit.Test)

Aggregations

ChRootedFs (org.apache.hadoop.fs.viewfs.ChRootedFs)6 AbstractFileSystem (org.apache.hadoop.fs.AbstractFileSystem)5 Path (org.apache.hadoop.fs.Path)5 Test (org.junit.Test)5 Configuration (org.apache.hadoop.conf.Configuration)1 Before (org.junit.Before)1