public virtual void TestHftpCustomUriPortWithDefaultPorts() { Configuration conf = new Configuration(); URI uri = URI.Create("hftp://localhost:123"); HftpFileSystem fs = (HftpFileSystem)FileSystem.Get(uri, conf); NUnit.Framework.Assert.AreEqual(DFSConfigKeys.DfsNamenodeHttpPortDefault, fs.GetDefaultPort ()); NUnit.Framework.Assert.AreEqual(uri, fs.GetUri()); NUnit.Framework.Assert.AreEqual("127.0.0.1:123", fs.GetCanonicalServiceName()); }
public virtual void TestHftpCustomDefaultPorts() { Configuration conf = new Configuration(); conf.SetInt(DFSConfigKeys.DfsNamenodeHttpPortKey, 123); URI uri = URI.Create("hftp://localhost"); HftpFileSystem fs = (HftpFileSystem)FileSystem.Get(uri, conf); NUnit.Framework.Assert.AreEqual(123, fs.GetDefaultPort()); NUnit.Framework.Assert.AreEqual(uri, fs.GetUri()); // HFTP uses http to get the token so canonical service name should // return the http port. NUnit.Framework.Assert.AreEqual("127.0.0.1:123", fs.GetCanonicalServiceName()); }