Пример #1
0
        public virtual void TestStartStopStart()
        {
            DefaultMetricsSystem.Shutdown();
            // Clear pre-existing source names.
            MetricsSystemImpl ms = new MetricsSystemImpl("test");

            TestMetricsSystemImpl.TestSource ts = new TestMetricsSystemImpl.TestSource("ts");
            ms.Start();
            ms.Register("ts", string.Empty, ts);
            MetricsSourceAdapter sa = ms.GetSourceAdapter("ts");

            NUnit.Framework.Assert.IsNotNull(sa);
            NUnit.Framework.Assert.IsNotNull(sa.GetMBeanName());
            ms.Stop();
            ms.Shutdown();
            ms.Start();
            sa = ms.GetSourceAdapter("ts");
            NUnit.Framework.Assert.IsNotNull(sa);
            NUnit.Framework.Assert.IsNotNull(sa.GetMBeanName());
            ms.Stop();
            ms.Shutdown();
        }