public void when_inspecting_valid_eventSources() { EventSourceAnalyzer.InspectAll(MultipleTypesEventSource.Log); EventSourceAnalyzer.InspectAll(TestEventSource.Log); EventSourceAnalyzer.InspectAll(MyCompanyEventSource.Log); EventSourceAnalyzer.InspectAll(SemanticLoggingEventSource.Log); }
public void EventSourceConsistencyTest() { var eventSource = new PrivateType("Dealogic.ServiceBus.Azure.Serialization", "Dealogic.ServiceBus.Azure.Serialization.Tracing.ServiceBusSerializationEventSource"); var log = (EventSource)eventSource.GetStaticProperty("Log"); EventSourceAnalyzer.InspectAll(log); }
public void VerifyEventSources() { EventSourceAnalyzer.InspectAll(ExecutorEventSource.Log); EventSourceAnalyzer.InspectAll(ChannelEventSource.Log); EventSourceAnalyzer.InspectAll(BootstrapEventSource.Log); EventSourceAnalyzer.InspectAll(MqttEventSource.Log); }
public void TestWriteWindowsEventListenerSucceeds() { var eventSource = Logger.Log; var analyzer = new EventSourceAnalyzer(); analyzer.Inspect(eventSource); var eventLogParams = new WindowsEventLogParams() { EventLevel = System.Diagnostics.Tracing.EventLevel.LogAlways, EventSource = eventSource, InstanceName = "TestLogger", Keywords = System.Diagnostics.Tracing.EventKeywords.All, SourceName = "TestLogger" }; var listener = new EventLogListenerFactory().CreateEventListener(eventLogParams); Assert.IsInstanceOfType(listener, typeof(WindowsEventLogListener)); Logger.Log.AppStarted(); var testLog = new EventLog(); testLog.Log = "TestLogger"; var entries = testLog.Entries; Assert.IsNotNull(entries); Assert.AreEqual(1, entries.Count); }
public void when_inspecting_event_enum_types_that_generates_invalid_manifest() { //DifferentEnumsEventSource.Log.UsingEnumArguments( // MyLongEnum.Value1, MyIntEnum.Value1, MyShortEnum.Value1 // ); EventSourceAnalyzer.InspectAll(DifferentEnumsEventSource.Log); }
public void StandardLogEventSource_Verify() { var analyzer = new EventSourceAnalyzer { ExcludeWriteEventTypeOrder = true }; analyzer.Inspect(StandardLogEventSource.Log); }
public void PerformanceLogEventSource_Verify() { var analyzer = new EventSourceAnalyzer { ExcludeWriteEventTypeOrder = true }; analyzer.Inspect(PerformanceLogEventSource.Log); }
public void BlueprintEventSource_Verify() { var analyzer = new EventSourceAnalyzer { ExcludeWriteEventTypeOrder = true }; analyzer.Inspect(BlueprintEventSource.Log); }
public void Analyze() { // arrange EventSourceAnalyzer analyzer = new EventSourceAnalyzer(); // act Report report = analyzer.Inspect(ApplicationEventSource.Log); // assert Assert.False(report.HasErrors); }
public void Inspect() { // arrange EventSourceAnalyzer analyzer = new EventSourceAnalyzer(); // act Report report = analyzer.Inspect(RequestActivityEventSource.Log); // assert Assert.False(report.HasErrors); }
public void Inspect_HotChocolateActivityEventSource() { // arrange var analyzer = new EventSourceAnalyzer(); // act Report report = analyzer.Inspect( HotChocolateActivityEventSource.Log); // assert Assert.False(report.HasErrors); }
static void VerifyEventSource() { try { EventSourceAnalyzer.InspectAll(MyCompanyEventSource.Log); Console.WriteLine("No incompatibilities found in MyCompanyEventSource"); } catch (EventSourceAnalyzerException e) { Console.WriteLine("Incompatibilities found in MyCompanyEventSource"); Console.WriteLine(e.Message); } }
public void TestCreateMultipleLogListenersSucceeds() { var eventSource = Logger.Log; var analyzer = new EventSourceAnalyzer(); analyzer.Inspect(eventSource); var windowsEventLogParams = new WindowsEventLogParams() { EventLevel = System.Diagnostics.Tracing.EventLevel.LogAlways, EventSource = eventSource, InstanceName = "TestLogger", Keywords = System.Diagnostics.Tracing.EventKeywords.All, SourceName = "TestLogger" }; var databaseEventLogParams = new DatabaseEventLogParams() { EventLevel = System.Diagnostics.Tracing.EventLevel.LogAlways, EventSource = eventSource, InstanceName = "Logger", ConnectionString = "data source=blah;initial catalog=Logging;User ID='CarePointDMEBetaAdmin';Password='******';MultipleActiveResultSets=True;App=EntityFramework", Keywords = System.Diagnostics.Tracing.EventKeywords.All, TableName = "dbo.Traces" }; var factory = new EventLogListenerFactory(); //var windowsEventListener = factory.CreateEventListener(windowsEventLogParams); var databaseEventListener = factory.CreateEventListener(databaseEventLogParams); Logger.Log.AppStarted(); /* * var testLog = new EventLog(); * testLog.Log = "TestLogger"; * var entries = testLog.Entries; * Assert.IsNotNull(entries); * Assert.AreEqual(1, entries.Count); */ }
public static void Call_from_tests_check_eventsources(Assembly actorOrServiceAssembly) { foreach (var eventSourceType in actorOrServiceAssembly.GetTypes().Where(type => type.IsSubclassOf(typeof(EventSource)))) { var eventSource = GetEventSourceAccessor(eventSourceType, "Current") ?? GetEventSourceAccessor(eventSourceType, "Log"); if (eventSource == null) { throw new NotImplementedException($"Expected EventSource {eventSourceType.Name} to expose a static accessor named 'Current' or 'Log'"); } EventSourceAnalyzer.InspectAll(eventSource); } foreach (var eventSourceType in actorOrServiceAssembly.GetTypes().Where(type => type.IsSubclassOf(typeof(Microsoft.Diagnostics.Tracing.EventSource)))) { var eventSource = GetEventSourceAccessor(eventSourceType, "Current") ?? GetEventSourceAccessor(eventSourceType, "Log"); if (eventSource == null) { throw new NotImplementedException($"Expected EventSource {eventSourceType.Name} to expose a static accessor named 'Current' or 'Log'"); } EventSourceAnalyzer.InspectAll(eventSource); } }
public void Validate_Etw_Manifest() { EventSourceAnalyzer.InspectAll(DeviceSimulator.DeviceSimulatorActorEventSource.Current); }
public void CustomEventSourcePassesValidation() { EventSourceAnalyzer.InspectAll(ColdStorageEventSource.Log); }
public void TestTestRunnerEventSource() { EventSourceAnalyzer.InspectAll(TestRunnerEventSource.Log); }
public void TestStorageBackupUploaderEventSource() { EventSourceAnalyzer.InspectAll(BackupUploaderEventSource.Log); }
public void TestSuggestionWatcherEventSource() { EventSourceAnalyzer.InspectAll(SuggestionWatcherEventSource.Log); }
public void TestHltbScraperEventSource() { EventSourceAnalyzer.InspectAll(HltbScraperEventSource.Log); }
public void ShouldValidateEventSource() { EventSourceAnalyzer.InspectAll(AuditEventSource.Log); }
public void CustomEventSourcePassesValidation() { EventSourceAnalyzer.InspectAll(ScenarioSimulatorEventSource.Log); }
public void VerifyEventSources() { EventSourceAnalyzer.InspectAll(CommonEventSource.Log); EventSourceAnalyzer.InspectAll(BootstrapperEventSource.Log); }
public void TestCommonEventSource() { EventSourceAnalyzer.InspectAll(CommonEventSource.Log); }
public void ValidateEventSource() { EventSourceAnalyzer.InspectAll(AnalyticsEventSource.Log); }
public void TestSiteEventSource() { EventSourceAnalyzer.InspectAll(SiteEventSource.Log); }
public void ShouldValidateEventSource() { EventSourceAnalyzer.InspectAll(SemanticLoggingEventSource.Log); }
public void TestMissingUpdaterEventSource() { EventSourceAnalyzer.InspectAll(MissingUpdaterEventSource.Log); }
public void ValidateEventSource() { //// see https://msdn.microsoft.com/en-us/library/dn774985(v=pandp.20).aspx //// for details about the EventSourceAnalyzer, its coverage and validation checks EventSourceAnalyzer.InspectAll(Logger.Log); }
public void TestUnknownUpdaterEventSource() { EventSourceAnalyzer.InspectAll(UnknownUpdaterEventSource.Log); }