Java 类org.apache.hadoop.fs.viewfs.ChRootedFs 实例源码

项目:hadoop-oss    文件:TestChRootedFs.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  fcTarget = FileContext.getLocalFSFileContext();
  chrootedTo = fileContextTestHelper.getAbsoluteTestRootPath(fcTarget);
  // In case previous test was killed before cleanup
  fcTarget.delete(chrootedTo, true);

  fcTarget.mkdir(chrootedTo, FileContext.DEFAULT_PERM, true);

  Configuration conf = new Configuration();

  // ChRoot to the root of the testDirectory
  fc = FileContext.getFileContext(
      new ChRootedFs(fcTarget.getDefaultFileSystem(), chrootedTo), conf);
}
项目:hadoop-oss    文件:TestChRootedFs.java   
@Test(timeout = 30000)
public void testCreateSnapshot() throws Exception {
  Path snapRootPath = new Path("/snapPath");
  Path chRootedSnapRootPath = new Path(
      Path.getPathWithoutSchemeAndAuthority(chrootedTo), "snapPath");
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, chrootedTo);
  Mockito.doReturn(snapRootPath).when(baseFs)
      .createSnapshot(chRootedSnapRootPath, "snap1");
  Assert.assertEquals(snapRootPath,
      chRootedFs.createSnapshot(snapRootPath, "snap1"));
  Mockito.verify(baseFs).createSnapshot(chRootedSnapRootPath, "snap1");
}
项目:hadoop-oss    文件:TestChRootedFs.java   
@Test(timeout = 30000)
public void testDeleteSnapshot() throws Exception {
  Path snapRootPath = new Path("/snapPath");
  Path chRootedSnapRootPath = new Path(
      Path.getPathWithoutSchemeAndAuthority(chrootedTo), "snapPath");
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, chrootedTo);
  Mockito.doNothing().when(baseFs)
      .deleteSnapshot(chRootedSnapRootPath, "snap1");
  chRootedFs.deleteSnapshot(snapRootPath, "snap1");
  Mockito.verify(baseFs).deleteSnapshot(chRootedSnapRootPath, "snap1");
}
项目:hadoop-oss    文件:TestChRootedFs.java   
@Test(timeout = 30000)
public void testRenameSnapshot() throws Exception {
  Path snapRootPath = new Path("/snapPath");
  Path chRootedSnapRootPath = new Path(
      Path.getPathWithoutSchemeAndAuthority(chrootedTo), "snapPath");
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, chrootedTo);
  Mockito.doNothing().when(baseFs)
      .renameSnapshot(chRootedSnapRootPath, "snapOldName", "snapNewName");
  chRootedFs.renameSnapshot(snapRootPath, "snapOldName", "snapNewName");
  Mockito.verify(baseFs).renameSnapshot(chRootedSnapRootPath, "snapOldName",
      "snapNewName");
}
项目:hadoop    文件:TestChRootedFs.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  fcTarget = FileContext.getLocalFSFileContext();
  chrootedTo = fileContextTestHelper.getAbsoluteTestRootPath(fcTarget);
  // In case previous test was killed before cleanup
  fcTarget.delete(chrootedTo, true);

  fcTarget.mkdir(chrootedTo, FileContext.DEFAULT_PERM, true);

  Configuration conf = new Configuration();

  // ChRoot to the root of the testDirectory
  fc = FileContext.getFileContext(
      new ChRootedFs(fcTarget.getDefaultFileSystem(), chrootedTo), conf);
}
项目:aliyun-oss-hadoop-fs    文件:TestChRootedFs.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  fcTarget = FileContext.getLocalFSFileContext();
  chrootedTo = fileContextTestHelper.getAbsoluteTestRootPath(fcTarget);
  // In case previous test was killed before cleanup
  fcTarget.delete(chrootedTo, true);

  fcTarget.mkdir(chrootedTo, FileContext.DEFAULT_PERM, true);

  Configuration conf = new Configuration();

  // ChRoot to the root of the testDirectory
  fc = FileContext.getFileContext(
      new ChRootedFs(fcTarget.getDefaultFileSystem(), chrootedTo), conf);
}
项目:big-c    文件:TestChRootedFs.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  fcTarget = FileContext.getLocalFSFileContext();
  chrootedTo = fileContextTestHelper.getAbsoluteTestRootPath(fcTarget);
  // In case previous test was killed before cleanup
  fcTarget.delete(chrootedTo, true);

  fcTarget.mkdir(chrootedTo, FileContext.DEFAULT_PERM, true);

  Configuration conf = new Configuration();

  // ChRoot to the root of the testDirectory
  fc = FileContext.getFileContext(
      new ChRootedFs(fcTarget.getDefaultFileSystem(), chrootedTo), conf);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestChRootedFs.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  fcTarget = FileContext.getLocalFSFileContext();
  chrootedTo = fileContextTestHelper.getAbsoluteTestRootPath(fcTarget);
  // In case previous test was killed before cleanup
  fcTarget.delete(chrootedTo, true);

  fcTarget.mkdir(chrootedTo, FileContext.DEFAULT_PERM, true);

  Configuration conf = new Configuration();

  // ChRoot to the root of the testDirectory
  fc = FileContext.getFileContext(
      new ChRootedFs(fcTarget.getDefaultFileSystem(), chrootedTo), conf);
}
项目:hadoop-plus    文件:TestChRootedFs.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  fcTarget = FileContext.getLocalFSFileContext();
  chrootedTo = fileContextTestHelper.getAbsoluteTestRootPath(fcTarget);
  // In case previous test was killed before cleanup
  fcTarget.delete(chrootedTo, true);

  fcTarget.mkdir(chrootedTo, FileContext.DEFAULT_PERM, true);

  Configuration conf = new Configuration();

  // ChRoot to the root of the testDirectory
  fc = FileContext.getFileContext(
      new ChRootedFs(fcTarget.getDefaultFileSystem(), chrootedTo), conf);
}
项目:hops    文件:TestChRootedFs.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  fcTarget = FileContext.getLocalFSFileContext();
  chrootedTo = fileContextTestHelper.getAbsoluteTestRootPath(fcTarget);
  // In case previous test was killed before cleanup
  fcTarget.delete(chrootedTo, true);

  fcTarget.mkdir(chrootedTo, FileContext.DEFAULT_PERM, true);

  Configuration conf = new Configuration();

  // ChRoot to the root of the testDirectory
  fc = FileContext.getFileContext(
      new ChRootedFs(fcTarget.getDefaultFileSystem(), chrootedTo), conf);
}
项目:hadoop-TCP    文件:TestChRootedFs.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  fcTarget = FileContext.getLocalFSFileContext();
  chrootedTo = fileContextTestHelper.getAbsoluteTestRootPath(fcTarget);
  // In case previous test was killed before cleanup
  fcTarget.delete(chrootedTo, true);

  fcTarget.mkdir(chrootedTo, FileContext.DEFAULT_PERM, true);

  Configuration conf = new Configuration();

  // ChRoot to the root of the testDirectory
  fc = FileContext.getFileContext(
      new ChRootedFs(fcTarget.getDefaultFileSystem(), chrootedTo), conf);
}
项目:hardfs    文件:TestChRootedFs.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  fcTarget = FileContext.getLocalFSFileContext();
  chrootedTo = fileContextTestHelper.getAbsoluteTestRootPath(fcTarget);
  // In case previous test was killed before cleanup
  fcTarget.delete(chrootedTo, true);

  fcTarget.mkdir(chrootedTo, FileContext.DEFAULT_PERM, true);

  Configuration conf = new Configuration();

  // ChRoot to the root of the testDirectory
  fc = FileContext.getFileContext(
      new ChRootedFs(fcTarget.getDefaultFileSystem(), chrootedTo), conf);
}
项目:hadoop-on-lustre2    文件:TestChRootedFs.java   
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  fcTarget = FileContext.getLocalFSFileContext();
  chrootedTo = fileContextTestHelper.getAbsoluteTestRootPath(fcTarget);
  // In case previous test was killed before cleanup
  fcTarget.delete(chrootedTo, true);

  fcTarget.mkdir(chrootedTo, FileContext.DEFAULT_PERM, true);

  Configuration conf = new Configuration();

  // ChRoot to the root of the testDirectory
  fc = FileContext.getFileContext(
      new ChRootedFs(fcTarget.getDefaultFileSystem(), chrootedTo), conf);
}
项目:hadoop-oss    文件:TestChRootedFs.java   
@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");
}
项目:hadoop-oss    文件:TestChRootedFs.java   
@Test
public void testIsValidNameInvalidInBaseFs() throws Exception {
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, new Path("/chroot"));
  Mockito.doReturn(false).when(baseFs).isValidName(Mockito.anyString());
  Assert.assertFalse(chRootedFs.isValidName("/test"));
  Mockito.verify(baseFs).isValidName("/chroot/test");
}
项目:hadoop    文件:TestChRootedFs.java   
@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");
}
项目:hadoop    文件:TestChRootedFs.java   
@Test
public void testIsValidNameInvalidInBaseFs() throws Exception {
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, new Path("/chroot"));
  Mockito.doReturn(false).when(baseFs).isValidName(Mockito.anyString());
  Assert.assertFalse(chRootedFs.isValidName("/test"));
  Mockito.verify(baseFs).isValidName("/chroot/test");
}
项目:aliyun-oss-hadoop-fs    文件:TestChRootedFs.java   
@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");
}
项目:aliyun-oss-hadoop-fs    文件:TestChRootedFs.java   
@Test
public void testIsValidNameInvalidInBaseFs() throws Exception {
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, new Path("/chroot"));
  Mockito.doReturn(false).when(baseFs).isValidName(Mockito.anyString());
  Assert.assertFalse(chRootedFs.isValidName("/test"));
  Mockito.verify(baseFs).isValidName("/chroot/test");
}
项目:aliyun-oss-hadoop-fs    文件:TestChRootedFs.java   
@Test(timeout = 30000)
public void testCreateSnapshot() throws Exception {
  Path snapRootPath = new Path("/snapPath");
  Path chRootedSnapRootPath = new Path(
      Path.getPathWithoutSchemeAndAuthority(chrootedTo), "snapPath");
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, chrootedTo);
  Mockito.doReturn(snapRootPath).when(baseFs)
      .createSnapshot(chRootedSnapRootPath, "snap1");
  Assert.assertEquals(snapRootPath,
      chRootedFs.createSnapshot(snapRootPath, "snap1"));
  Mockito.verify(baseFs).createSnapshot(chRootedSnapRootPath, "snap1");
}
项目:aliyun-oss-hadoop-fs    文件:TestChRootedFs.java   
@Test(timeout = 30000)
public void testDeleteSnapshot() throws Exception {
  Path snapRootPath = new Path("/snapPath");
  Path chRootedSnapRootPath = new Path(
      Path.getPathWithoutSchemeAndAuthority(chrootedTo), "snapPath");
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, chrootedTo);
  Mockito.doNothing().when(baseFs)
      .deleteSnapshot(chRootedSnapRootPath, "snap1");
  chRootedFs.deleteSnapshot(snapRootPath, "snap1");
  Mockito.verify(baseFs).deleteSnapshot(chRootedSnapRootPath, "snap1");
}
项目:aliyun-oss-hadoop-fs    文件:TestChRootedFs.java   
@Test(timeout = 30000)
public void testRenameSnapshot() throws Exception {
  Path snapRootPath = new Path("/snapPath");
  Path chRootedSnapRootPath = new Path(
      Path.getPathWithoutSchemeAndAuthority(chrootedTo), "snapPath");
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, chrootedTo);
  Mockito.doNothing().when(baseFs)
      .renameSnapshot(chRootedSnapRootPath, "snapOldName", "snapNewName");
  chRootedFs.renameSnapshot(snapRootPath, "snapOldName", "snapNewName");
  Mockito.verify(baseFs).renameSnapshot(chRootedSnapRootPath, "snapOldName",
      "snapNewName");
}
项目:big-c    文件:TestChRootedFs.java   
@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");
}
项目:big-c    文件:TestChRootedFs.java   
@Test
public void testIsValidNameInvalidInBaseFs() throws Exception {
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, new Path("/chroot"));
  Mockito.doReturn(false).when(baseFs).isValidName(Mockito.anyString());
  Assert.assertFalse(chRootedFs.isValidName("/test"));
  Mockito.verify(baseFs).isValidName("/chroot/test");
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestChRootedFs.java   
@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");
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestChRootedFs.java   
@Test
public void testIsValidNameInvalidInBaseFs() throws Exception {
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, new Path("/chroot"));
  Mockito.doReturn(false).when(baseFs).isValidName(Mockito.anyString());
  Assert.assertFalse(chRootedFs.isValidName("/test"));
  Mockito.verify(baseFs).isValidName("/chroot/test");
}
项目:hadoop-plus    文件:TestChRootedFs.java   
@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");
}
项目:hadoop-plus    文件:TestChRootedFs.java   
@Test
public void testIsValidNameInvalidInBaseFs() throws Exception {
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, new Path("/chroot"));
  Mockito.doReturn(false).when(baseFs).isValidName(Mockito.anyString());
  Assert.assertFalse(chRootedFs.isValidName("/test"));
  Mockito.verify(baseFs).isValidName("/chroot/test");
}
项目:hops    文件:TestChRootedFs.java   
@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");
}
项目:hops    文件:TestChRootedFs.java   
@Test
public void testIsValidNameInvalidInBaseFs() throws Exception {
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, new Path("/chroot"));
  Mockito.doReturn(false).when(baseFs).isValidName(Mockito.anyString());
  Assert.assertFalse(chRootedFs.isValidName("/test"));
  Mockito.verify(baseFs).isValidName("/chroot/test");
}
项目:hops    文件:TestChRootedFs.java   
@Test(timeout = 30000)
public void testCreateSnapshot() throws Exception {
  Path snapRootPath = new Path("/snapPath");
  Path chRootedSnapRootPath = new Path(
      Path.getPathWithoutSchemeAndAuthority(chrootedTo), "snapPath");
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, chrootedTo);
  Mockito.doReturn(snapRootPath).when(baseFs)
      .createSnapshot(chRootedSnapRootPath, "snap1");
  Assert.assertEquals(snapRootPath,
      chRootedFs.createSnapshot(snapRootPath, "snap1"));
  Mockito.verify(baseFs).createSnapshot(chRootedSnapRootPath, "snap1");
}
项目:hops    文件:TestChRootedFs.java   
@Test(timeout = 30000)
public void testDeleteSnapshot() throws Exception {
  Path snapRootPath = new Path("/snapPath");
  Path chRootedSnapRootPath = new Path(
      Path.getPathWithoutSchemeAndAuthority(chrootedTo), "snapPath");
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, chrootedTo);
  Mockito.doNothing().when(baseFs)
      .deleteSnapshot(chRootedSnapRootPath, "snap1");
  chRootedFs.deleteSnapshot(snapRootPath, "snap1");
  Mockito.verify(baseFs).deleteSnapshot(chRootedSnapRootPath, "snap1");
}
项目:hops    文件:TestChRootedFs.java   
@Test(timeout = 30000)
public void testRenameSnapshot() throws Exception {
  Path snapRootPath = new Path("/snapPath");
  Path chRootedSnapRootPath = new Path(
      Path.getPathWithoutSchemeAndAuthority(chrootedTo), "snapPath");
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, chrootedTo);
  Mockito.doNothing().when(baseFs)
      .renameSnapshot(chRootedSnapRootPath, "snapOldName", "snapNewName");
  chRootedFs.renameSnapshot(snapRootPath, "snapOldName", "snapNewName");
  Mockito.verify(baseFs).renameSnapshot(chRootedSnapRootPath, "snapOldName",
      "snapNewName");
}
项目:hadoop-TCP    文件:TestChRootedFs.java   
@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");
}
项目:hadoop-TCP    文件:TestChRootedFs.java   
@Test
public void testIsValidNameInvalidInBaseFs() throws Exception {
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, new Path("/chroot"));
  Mockito.doReturn(false).when(baseFs).isValidName(Mockito.anyString());
  Assert.assertFalse(chRootedFs.isValidName("/test"));
  Mockito.verify(baseFs).isValidName("/chroot/test");
}
项目:hardfs    文件:TestChRootedFs.java   
@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");
}
项目:hardfs    文件:TestChRootedFs.java   
@Test
public void testIsValidNameInvalidInBaseFs() throws Exception {
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, new Path("/chroot"));
  Mockito.doReturn(false).when(baseFs).isValidName(Mockito.anyString());
  Assert.assertFalse(chRootedFs.isValidName("/test"));
  Mockito.verify(baseFs).isValidName("/chroot/test");
}
项目:hadoop-on-lustre2    文件:TestChRootedFs.java   
@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");
}
项目:hadoop-on-lustre2    文件:TestChRootedFs.java   
@Test
public void testIsValidNameInvalidInBaseFs() throws Exception {
  AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem());
  ChRootedFs chRootedFs = new ChRootedFs(baseFs, new Path("/chroot"));
  Mockito.doReturn(false).when(baseFs).isValidName(Mockito.anyString());
  Assert.assertFalse(chRootedFs.isValidName("/test"));
  Mockito.verify(baseFs).isValidName("/chroot/test");
}