// test launch method /// <exception cref="System.Exception"/> public virtual void TestLaunch() { ExitUtil.DisableSystemExit(); ApplicationHistoryServer historyServer = null; try { // Not able to modify the config of this test case, // but others have been customized to avoid conflicts historyServer = ApplicationHistoryServer.LaunchAppHistoryServer(new string[0]); } catch (ExitUtil.ExitException e) { NUnit.Framework.Assert.AreEqual(0, e.status); ExitUtil.ResetFirstExitException(); NUnit.Framework.Assert.Fail(); } finally { if (historyServer != null) { historyServer.Stop(); } } }
//test launch method with -D arguments /// <exception cref="System.Exception"/> public virtual void TestLaunchWithArguments() { ExitUtil.DisableSystemExit(); ApplicationHistoryServer historyServer = null; try { // Not able to modify the config of this test case, // but others have been customized to avoid conflicts string[] args = new string[2]; args[0] = "-D" + YarnConfiguration.TimelineServiceLeveldbTtlIntervalMs + "=4000"; args[1] = "-D" + YarnConfiguration.TimelineServiceTtlMs + "=200"; historyServer = ApplicationHistoryServer.LaunchAppHistoryServer(args); Configuration conf = historyServer.GetConfig(); NUnit.Framework.Assert.AreEqual("4000", conf.Get(YarnConfiguration.TimelineServiceLeveldbTtlIntervalMs )); NUnit.Framework.Assert.AreEqual("200", conf.Get(YarnConfiguration.TimelineServiceTtlMs )); } catch (ExitUtil.ExitException e) { NUnit.Framework.Assert.AreEqual(0, e.status); ExitUtil.ResetFirstExitException(); NUnit.Framework.Assert.Fail(); } finally { if (historyServer != null) { historyServer.Stop(); } } }