public void TearDown() { configurationSource = null; MockTraceListener.Reset(); MockBlockingCustomTraceListener.Reset(); LogWriter.ResetLockTimeouts(); }
public void SetUp() { configurationSource = new DictionaryConfigurationSourceWithHandlersQuery(); InstrumentationConfigurationSection instrumentationConfig = new InstrumentationConfigurationSection(true, true, true); configurationSource.Add(InstrumentationConfigurationSection.SectionName, instrumentationConfig); settings = new LoggingSettings(); configurationSource.Add(LoggingSettings.SectionName, settings); settings.SpecialTraceSources.ErrorsTraceSource = new TraceSourceData("error", SourceLevels.Off); TraceSourceData traceSourceData = new TraceSourceData("blocking", SourceLevels.All); traceSourceData.TraceListeners.Add(new TraceListenerReferenceData("listener1")); settings.TraceSources.Add(traceSourceData); traceSourceData = new TraceSourceData("nonblocking", SourceLevels.All); traceSourceData.TraceListeners.Add(new TraceListenerReferenceData("listener2")); settings.TraceSources.Add(traceSourceData); TraceListenerData traceListenerData = new CustomTraceListenerData("listener1", typeof(MockBlockingCustomTraceListener), "init 1"); settings.TraceListeners.Add(traceListenerData); traceListenerData = new MockTraceListenerData("listener2"); settings.TraceListeners.Add(traceListenerData); reflectionCache = new ConfigurationReflectionCache(); MockTraceListener.Reset(); MockBlockingCustomTraceListener.Reset(); }
public void SetUp() { configurationSource = new DictionaryConfigurationSourceWithHandlersQuery(); InstrumentationConfigurationSection instrumentationConfig = new InstrumentationConfigurationSection(true, true, false); configurationSource.Add(InstrumentationConfigurationSection.SectionName, instrumentationConfig); settings = new LoggingSettings(); configurationSource.Add(LoggingSettings.SectionName, settings); settings.SpecialTraceSources.ErrorsTraceSource = new TraceSourceData("error", SourceLevels.Off); TraceSourceData traceSourceData = new TraceSourceData("blocking", SourceLevels.All); traceSourceData.TraceListeners.Add(new TraceListenerReferenceData("listener1")); settings.TraceSources.Add(traceSourceData); traceSourceData = new TraceSourceData("nonblocking", SourceLevels.All); traceSourceData.TraceListeners.Add(new TraceListenerReferenceData("listener2")); settings.TraceSources.Add(traceSourceData); TraceListenerData traceListenerData = new CustomTraceListenerData("listener1", typeof(MockBlockingCustomTraceListener), "init 1"); settings.TraceListeners.Add(traceListenerData); traceListenerData = new MockTraceListenerData("listener2"); settings.TraceListeners.Add(traceListenerData); reflectionCache = new ConfigurationReflectionCache(); MockTraceListener.Reset(); MockBlockingCustomTraceListener.Reset(); }