public virtual void TestIPFailoverProxyProviderLogicalUri()
        {
            // setup the config with the IP failover proxy provider class
            Configuration config = new HdfsConfiguration(conf);
            URI           nnUri  = cluster.GetURI(0);

            config.Set(DFSConfigKeys.DfsClientFailoverProxyProviderKeyPrefix + "." + nnUri.GetHost
                           (), typeof(IPFailoverProxyProvider).FullName);
            NUnit.Framework.Assert.IsFalse("IPFailoverProxyProvider should not use logical URI."
                                           , HAUtil.UseLogicalUri(config, nnUri));
        }
        public virtual void TestWrappedFailoverProxyProvider()
        {
            // setup the config with the dummy provider class
            Configuration config      = new HdfsConfiguration(conf);
            string        logicalName = HATestUtil.GetLogicalHostname(cluster);

            HATestUtil.SetFailoverConfigurations(cluster, config, logicalName);
            config.Set(DFSConfigKeys.DfsClientFailoverProxyProviderKeyPrefix + "." + logicalName
                       , typeof(TestDFSClientFailover.DummyLegacyFailoverProxyProvider).FullName);
            Path p = new Path("hdfs://" + logicalName + "/");

            // not to use IP address for token service
            SecurityUtil.SetTokenServiceUseIp(false);
            // Logical URI should be used.
            NUnit.Framework.Assert.IsTrue("Legacy proxy providers should use logical URI.", HAUtil
                                          .UseLogicalUri(config, p.ToUri()));
        }