コード例 #1
0
        public virtual void TestValidPathsDirHandlerService()
        {
            Configuration conf      = new YarnConfiguration();
            string        localDir1 = new FilePath("file:///" + testDir, "localDir1").GetPath();
            string        localDir2 = new FilePath("hdfs:///" + testDir, "localDir2").GetPath();

            conf.Set(YarnConfiguration.NmLocalDirs, localDir1 + "," + localDir2);
            string logDir1 = new FilePath("file:///" + testDir, "logDir1").GetPath();

            conf.Set(YarnConfiguration.NmLogDirs, logDir1);
            LocalDirsHandlerService dirSvc = new LocalDirsHandlerService();

            try
            {
                dirSvc.Init(conf);
                NUnit.Framework.Assert.Fail("Service should have thrown an exception due to wrong URI"
                                            );
            }
            catch (YarnRuntimeException)
            {
            }
            NUnit.Framework.Assert.AreEqual("Service should not be inited", Service.STATE.Stopped
                                            , dirSvc.GetServiceState());
            dirSvc.Close();
        }