示例#1
0
        public virtual void TestMultipleNamespacesConfigured()
        {
            Configuration     conf    = DFSTestUtil.NewHAConfiguration(LogicalName);
            MiniDFSCluster    cluster = null;
            WebHdfsFileSystem fs      = null;

            try
            {
                cluster = new MiniDFSCluster.Builder(conf).NnTopology(topo).NumDataNodes(1).Build
                              ();
                HATestUtil.SetFailoverConfigurations(cluster, conf, LogicalName);
                cluster.WaitActive();
                DFSTestUtil.AddHAConfiguration(conf, LogicalName + "remote");
                DFSTestUtil.SetFakeHttpAddresses(conf, LogicalName + "remote");
                fs = (WebHdfsFileSystem)FileSystem.Get(WebhdfsUri, conf);
                NUnit.Framework.Assert.AreEqual(2, fs.GetResolvedNNAddr().Length);
            }
            finally
            {
                IOUtils.Cleanup(null, fs);
                if (cluster != null)
                {
                    cluster.Shutdown();
                }
            }
        }