internal SVNFileSystemSession(SVNFileSystem fs, IFileSystemHandle handle, SVNFileSystemSessionConnectParams cParams) : base(fs, handle, cParams) { m_ServerURL = cParams.ServerURL; var cred = cParams.User.Credentials as IDPasswordCredentials; if (cred == null) m_WebDAV = new WebDAV(cParams.ServerURL, cParams.TimeoutMs); else m_WebDAV = new WebDAV(cParams.ServerURL, cParams.TimeoutMs, cred.ID, cred.Password); }
public void FailedFastTimeout() { using(new NFX.ApplicationModel.ServiceBaseApplication(null, LACONF.AsLaconicConfig())) { using (var fs = new SVNFileSystem("NFX-SVN")) { var session = fs.StartSession(CONN_PARAMS_TIMEOUT); var dir = session[string.Empty] as FileSystemDirectory; } } }
public void GetFileContent() { using(new NFX.ApplicationModel.ServiceBaseApplication(null, LACONF.AsLaconicConfig())) { using (var fs = new SVNFileSystem("NFX-SVN")) { var session = fs.StartSession(CONN_PARAMS); var file = session["/trunk/Source/NFX/LICENSE.txt"] as FileSystemFile; Assert.IsTrue(file.ReadAllText().IsNotNullOrEmpty()); } } }
internal SVNFileSystemSession(SVNFileSystem fs, IFileSystemHandle handle, SVNFileSystemSessionConnectParams cParams) : base(fs, handle, cParams) { m_ServerURL = cParams.ServerURL; var cred = cParams.User.Credentials as IDPasswordCredentials; if (cred == null) { m_WebDAV = new WebDAV(cParams.ServerURL, cParams.TimeoutMs); } else { m_WebDAV = new WebDAV(cParams.ServerURL, cParams.TimeoutMs, cred.ID, cred.Password); } }
public void NavigateRootDir() { using(new NFX.ApplicationModel.ServiceBaseApplication(null, LACONF.AsLaconicConfig())) { using(var fs = new SVNFileSystem("NFX-SVN")) { var session = fs.StartSession(CONN_PARAMS); var dir = session[string.Empty] as FileSystemDirectory; Assert.IsNotNull(dir); Assert.AreEqual("/", dir.Path); } } }
public SVNFileSystemStream(FileSystemFile file, Action <FileSystemStream> disposeAction) : base(file, disposeAction) { m_wdFile = ((SVNFileSystem.SVNFSH)file.Handle).Item as WebDAV.File; SVNFileSystem fs = file.FileSystem as SVNFileSystem; }
public void GetVersionedFiles() { using(new NFX.ApplicationModel.ServiceBaseApplication(null, LACONF.AsLaconicConfig())) { IList<WebDAV.Version> versions = WebDAV.GetVersions(SVN_ROOT, SVN_UNAME, SVN_UPSW).ToList(); WebDAV.Version v1530 = versions.First(v => v.Name == "1530"); WebDAV.Version v1531 = versions.First(v => v.Name == "1531"); using (var fs = new SVNFileSystem("NFX-SVN")) { var session = fs.StartSession(CONN_PARAMS); session.Version = v1530; var file1530 = session["trunk/Source/NFX.Web/IO/FileSystem/SVN/WebDAV.cs"] as FileSystemFile; string content1530 = file1530.ReadAllText(); session.Version = v1531; var file1531 = session["trunk/Source/NFX.Web/IO/FileSystem/SVN/WebDAV.cs"] as FileSystemFile; string content1531 = file1531.ReadAllText(); Assert.AreNotEqual(content1530, content1531); } } }
public void Size() { using(new NFX.ApplicationModel.ServiceBaseApplication(null, LACONF.AsLaconicConfig())) { using (var fs = new SVNFileSystem("NFX-SVN")) { var session = fs.StartSession(CONN_PARAMS); var dir = session["trunk/Source/Testing/NUnit/NFX.NUnit.Integration/IO/FileSystem/SVN/Esc Folder+"] as FileSystemDirectory; var file1 = session["trunk/Source/Testing/NUnit/NFX.NUnit.Integration/IO/FileSystem/SVN/Esc Folder+/Escape.txt"] as FileSystemFile; var file2 = session["trunk/Source/Testing/NUnit/NFX.NUnit.Integration/IO/FileSystem/SVN/Esc Folder+/NestedFolder/Escape.txt"] as FileSystemFile; Assert.AreEqual(19, file1.Size); Assert.AreEqual(11, file2.Size); Assert.AreEqual(30, dir.Size); } } }
public void NavigateChildFile() { using(new NFX.ApplicationModel.ServiceBaseApplication(null, LACONF.AsLaconicConfig())) { using (var fs = new SVNFileSystem("NFX-SVN")) { var session = fs.StartSession(CONN_PARAMS); var file = session["/trunk/Source/NFX/LICENSE.txt"] as FileSystemFile; Assert.IsNotNull(file); Assert.AreEqual("/trunk/Source/NFX/LICENSE.txt", file.Path); } } }
public void NavigateChildDir() { using(new NFX.ApplicationModel.ServiceBaseApplication(null, LACONF.AsLaconicConfig())) { using(var fs = new SVNFileSystem("NFX-SVN")) { var session = fs.StartSession(CONN_PARAMS); { var dir = session["trunk"] as FileSystemDirectory; Assert.IsNotNull(dir); Assert.AreEqual("/trunk", dir.Path); Assert.AreEqual("/", dir.ParentPath); } { var dir = session["trunk/Source"] as FileSystemDirectory; Assert.IsNotNull(dir); Assert.AreEqual("/trunk/Source", dir.Path); Assert.AreEqual("/trunk", dir.ParentPath); } } } }
public void GetVersions() { using(new NFX.ApplicationModel.ServiceBaseApplication(null, LACONF.AsLaconicConfig())) { using (var fs = new SVNFileSystem("NFX-SVN")) { var session = fs.StartSession(CONN_PARAMS); var currentVersion = session.LatestVersion; var preVersions = session.GetVersions(currentVersion, 5); Assert.AreEqual(5, preVersions.Count()); Assert.AreEqual(preVersions.Last().Name.AsInt() + 1, currentVersion.Name.AsInt()); } } }