Beispiel #1
0
            /// <exception cref="System.IO.IOException"/>
            public object Run()
            {
                FileContext myfc    = FileContext.GetFileContext(TestPermissionSymlinks.conf);
                Path        newlink = new Path(TestPermissionSymlinks.linkParent, "newlink");

                myfc.Rename(TestPermissionSymlinks.link, newlink, Options.Rename.None);
                Path linkTarget = myfc.GetLinkTarget(newlink);

                NUnit.Framework.Assert.AreEqual("Expected link's target to match target!", TestPermissionSymlinks
                                                .target, linkTarget);
                return(null);
            }
Beispiel #2
0
            /// <exception cref="System.IO.IOException"/>
            public object Run()
            {
                FileContext myfc = FileContext.GetFileContext(TestPermissionSymlinks.conf);
                FileStatus  stat = myfc.GetFileLinkStatus(TestPermissionSymlinks.link);

                NUnit.Framework.Assert.AreEqual("Expected link's FileStatus path to match link!",
                                                TestPermissionSymlinks.link.MakeQualified(TestPermissionSymlinks.fs.GetUri(), TestPermissionSymlinks
                                                                                          .fs.GetWorkingDirectory()), stat.GetPath());
                Path linkTarget = myfc.GetLinkTarget(TestPermissionSymlinks.link);

                NUnit.Framework.Assert.AreEqual("Expected link's target to match target!", TestPermissionSymlinks
                                                .target, linkTarget);
                return(null);
            }
Beispiel #3
0
 public virtual void TestSymlinkTarget()
 {
     // get link target`
     Assert.Equal(fcView.GetLinkTarget(new Path("/user")), (new Path
                                                                (targetTestRoot, "user")));
     Assert.Equal(fcView.GetLinkTarget(new Path("/data")), (new Path
                                                                (targetTestRoot, "data")));
     Assert.Equal(fcView.GetLinkTarget(new Path("/internalDir/linkToDir2"
                                                )), (new Path(targetTestRoot, "dir2")));
     Assert.Equal(fcView.GetLinkTarget(new Path("/internalDir/internalDir2/linkToDir3"
                                                )), (new Path(targetTestRoot, "dir3")));
     Assert.Equal(fcView.GetLinkTarget(new Path("/linkToAFile")), (
                      new Path(targetTestRoot, "aFile")));
 }
 /// <exception cref="Org.Apache.Hadoop.Security.AccessControlException"/>
 /// <exception cref="System.IO.FileNotFoundException"/>
 /// <exception cref="Org.Apache.Hadoop.FS.UnsupportedFileSystemException"/>
 /// <exception cref="System.IO.IOException"/>
 public override Path GetLinkTarget(Path f)
 {
     return(fc.GetLinkTarget(f));
 }