/* * test JobHistoryServer protocols.... */ // simple test init/start/stop JobHistoryServer. Status should change. /// <exception cref="System.Exception"/> public virtual void TestStartStopServer() { historyServer = new JobHistoryServer(); Configuration config = new Configuration(); historyServer.Init(config); NUnit.Framework.Assert.AreEqual(Service.STATE.Inited, historyServer.GetServiceState ()); NUnit.Framework.Assert.AreEqual(6, historyServer.GetServices().Count); HistoryClientService historyService = historyServer.GetClientService(); NUnit.Framework.Assert.IsNotNull(historyServer.GetClientService()); NUnit.Framework.Assert.AreEqual(Service.STATE.Inited, historyService.GetServiceState ()); historyServer.Start(); NUnit.Framework.Assert.AreEqual(Service.STATE.Started, historyServer.GetServiceState ()); NUnit.Framework.Assert.AreEqual(Service.STATE.Started, historyService.GetServiceState ()); historyServer.Stop(); NUnit.Framework.Assert.AreEqual(Service.STATE.Stopped, historyServer.GetServiceState ()); NUnit.Framework.Assert.IsNotNull(historyService.GetClientHandler().GetConnectAddress ()); }
public virtual void Stop() { if (historyServer != null) { historyServer.Stop(); } }