public virtual void TestAuxUnexpectedStop() { Configuration conf = new Configuration(); conf.SetStrings(YarnConfiguration.NmAuxServices, new string[] { "Asrv", "Bsrv" }); conf.SetClass(string.Format(YarnConfiguration.NmAuxServiceFmt, "Asrv"), typeof(TestAuxServices.ServiceA ), typeof(Org.Apache.Hadoop.Service.Service)); conf.SetClass(string.Format(YarnConfiguration.NmAuxServiceFmt, "Bsrv"), typeof(TestAuxServices.ServiceB ), typeof(Org.Apache.Hadoop.Service.Service)); AuxServices aux = new AuxServices(); aux.Init(conf); aux.Start(); Org.Apache.Hadoop.Service.Service s = aux.GetServices().GetEnumerator().Next(); s.Stop(); NUnit.Framework.Assert.AreEqual("Auxiliary service stopped, but AuxService unaffected." , Service.STATE.Stopped, aux.GetServiceState()); NUnit.Framework.Assert.IsTrue(aux.GetServices().IsEmpty()); }
protected internal virtual void AddToTeardown(Org.Apache.Hadoop.Service.Service svc ) { teardown.AddService(svc); }
protected internal static void AddToClassTeardown(Org.Apache.Hadoop.Service.Service svc) { classTeardown.AddService(svc); }
public virtual void StateChanged(Org.Apache.Hadoop.Service.Service service) { Log.Fatal("Service " + service.GetName() + " changed state: " + service.GetServiceState ()); Stop(); }
protected override bool RemoveService(Org.Apache.Hadoop.Service.Service service) { return(base.RemoveService(service)); }
protected override void AddService(Org.Apache.Hadoop.Service.Service service) { base.AddService(service); }