예제 #1
0
        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());
        }
예제 #2
0
 protected internal virtual void AddToTeardown(Org.Apache.Hadoop.Service.Service svc
                                               )
 {
     teardown.AddService(svc);
 }
예제 #3
0
 protected internal static void AddToClassTeardown(Org.Apache.Hadoop.Service.Service
                                                   svc)
 {
     classTeardown.AddService(svc);
 }
예제 #4
0
 public virtual void StateChanged(Org.Apache.Hadoop.Service.Service service)
 {
     Log.Fatal("Service " + service.GetName() + " changed state: " + service.GetServiceState
                   ());
     Stop();
 }
예제 #5
0
 protected override bool RemoveService(Org.Apache.Hadoop.Service.Service service)
 {
     return(base.RemoveService(service));
 }
예제 #6
0
 protected override void AddService(Org.Apache.Hadoop.Service.Service service)
 {
     base.AddService(service);
 }