public virtual void Before()
        {
            mgr = new DummyCommonNodeLabelsManager();
            Configuration conf = new YarnConfiguration();

            conf.SetBoolean(YarnConfiguration.NodeLabelsEnabled, true);
            mgr.Init(conf);
            mgr.Start();
        }
        /// <exception cref="System.IO.IOException"/>
        public virtual void TestNodeLabelsDisabled()
        {
            DummyCommonNodeLabelsManager mgr = new DummyCommonNodeLabelsManager();
            Configuration conf = new YarnConfiguration();

            conf.SetBoolean(YarnConfiguration.NodeLabelsEnabled, false);
            mgr.Init(conf);
            mgr.Start();
            bool caught = false;

            // add labels
            try
            {
                mgr.AddToCluserNodeLabels(ImmutableSet.Of("x"));
            }
            catch (IOException e)
            {
                AssertNodeLabelsDisabledErrorMessage(e);
                caught = true;
            }
            // check exception caught
            NUnit.Framework.Assert.IsTrue(caught);
            caught = false;
            // remove labels
            try
            {
                mgr.RemoveFromClusterNodeLabels(ImmutableSet.Of("x"));
            }
            catch (IOException e)
            {
                AssertNodeLabelsDisabledErrorMessage(e);
                caught = true;
            }
            // check exception caught
            NUnit.Framework.Assert.IsTrue(caught);
            caught = false;
            // add labels to node
            try
            {
                mgr.AddLabelsToNode(ImmutableMap.Of(NodeId.NewInstance("host", 0), CommonNodeLabelsManager
                                                    .EmptyStringSet));
            }
            catch (IOException e)
            {
                AssertNodeLabelsDisabledErrorMessage(e);
                caught = true;
            }
            // check exception caught
            NUnit.Framework.Assert.IsTrue(caught);
            caught = false;
            // remove labels from node
            try
            {
                mgr.RemoveLabelsFromNode(ImmutableMap.Of(NodeId.NewInstance("host", 0), CommonNodeLabelsManager
                                                         .EmptyStringSet));
            }
            catch (IOException e)
            {
                AssertNodeLabelsDisabledErrorMessage(e);
                caught = true;
            }
            // check exception caught
            NUnit.Framework.Assert.IsTrue(caught);
            caught = false;
            // replace labels on node
            try
            {
                mgr.ReplaceLabelsOnNode(ImmutableMap.Of(NodeId.NewInstance("host", 0), CommonNodeLabelsManager
                                                        .EmptyStringSet));
            }
            catch (IOException e)
            {
                AssertNodeLabelsDisabledErrorMessage(e);
                caught = true;
            }
            // check exception caught
            NUnit.Framework.Assert.IsTrue(caught);
            caught = false;
            mgr.Close();
        }