Esempio n. 1
0
 public virtual void TestFileStatusOnMountLink()
 {
     Assert.True("Slash should appear as dir", fcView.GetFileStatus(
                     new Path("/")).IsDirectory());
     FileContextTestHelper.CheckFileStatus(fcView, "/", FileContextTestHelper.FileType
                                           .isDir);
     FileContextTestHelper.CheckFileStatus(fcView, "/user", FileContextTestHelper.FileType
                                           .isDir);
     FileContextTestHelper.CheckFileStatus(fcView, "/data", FileContextTestHelper.FileType
                                           .isDir);
     FileContextTestHelper.CheckFileStatus(fcView, "/internalDir", FileContextTestHelper.FileType
                                           .isDir);
     FileContextTestHelper.CheckFileStatus(fcView, "/internalDir/linkToDir2", FileContextTestHelper.FileType
                                           .isDir);
     FileContextTestHelper.CheckFileStatus(fcView, "/internalDir/internalDir2/linkToDir3"
                                           , FileContextTestHelper.FileType.isDir);
     FileContextTestHelper.CheckFileStatus(fcView, "/linkToAFile", FileContextTestHelper.FileType
                                           .isFile);
     try
     {
         fcView.GetFileStatus(new Path("/danglingLink"));
         NUnit.Framework.Assert.Fail("Excepted a not found exception here");
     }
     catch (FileNotFoundException)
     {
     }
 }
Esempio n. 2
0
        public virtual void TestGetBlockLocations()
        {
            Path targetFilePath = new Path(targetTestRoot, "data/largeFile");

            FileContextTestHelper.CreateFile(fcTarget, targetFilePath, 10, 1024);
            Path viewFilePath = new Path("/data/largeFile");

            FileContextTestHelper.CheckFileStatus(fcView, viewFilePath.ToString(), FileContextTestHelper.FileType
                                                  .isFile);
            BlockLocation[] viewBL = fcView.GetFileBlockLocations(viewFilePath, 0, 10240 + 100
                                                                  );
            Assert.Equal(SupportsBlocks ? 10 : 1, viewBL.Length);
            BlockLocation[] targetBL = fcTarget.GetFileBlockLocations(targetFilePath, 0, 10240
                                                                      + 100);
            CompareBLs(viewBL, targetBL);
            // Same test but now get it via the FileStatus Parameter
            fcView.GetFileBlockLocations(viewFilePath, 0, 10240 + 100);
            targetBL = fcTarget.GetFileBlockLocations(targetFilePath, 0, 10240 + 100);
            CompareBLs(viewBL, targetBL);
        }