public void EventToString() { NameValueCollection signature = new NameValueCollection(); signature.Add("Exception", "0x123456"); signature.Add("Offset", "0x123457"); BugTrackerEvent theEvent = new BugTrackerEvent("Bug 1234", "Plugin bug ref", 12345678, "CLR20 32-Bit", 10000, signature); String result = theEvent.ToString(); Assert.AreEqual("Event: Id=12345678, EventTypeName=CLR20 32-Bit, BugReference=Bug 1234, TotalHits=10000\r\n Exception=0x123456\r\n Offset=0x123457\r\n", result); }
/// <summary> /// This method is called when the processing of an Event has completed. Events have associated Cabs, Scripts and notes which /// may all be reported during a MANUAL Bug Report. This call effectively delimits the reporting of all /// information associated with an event so, if desired, the plug-in can gather all of the information together in one /// go for sending to the fault database. This may improve performance for events with large amounts of stored data. /// /// The plug-in may thus see... /// EventAdded /// EventNoteAdded, EventNoteAdded,... /// CabAdded, CabAdded,... /// CabNoteAdded, CabNoteAdded,... /// ScriptResultAdded, ScriptResultAdded,... /// EventManualUpdateCompleted. /// /// A Plugin Bug Reference is stored with the Event data in the StackHash database. This can be manually changed /// by the StackHash client user. The plug-in can also change the plugin bug reference by returning the desired /// bug reference from this call. /// Return null if you do NOT want to change the bug reference stored in the StackHash database. /// Return any other string (including an empty string) and this value will be used to overwrite the /// plugin bug reference in the StackHash database. /// Note that there are 2 bug references: /// The BugReference can be set by the StackHash client user manually. This cannot be changed by the plugin. /// The PlugInBugReference can be set by the StackHash client user manually AND/OR set by the plugin. /// /// Automatic reports may arrived interleaved with manual reports. This may happen when, say a WinQual sync /// is happening at the same time as a manual report is requested. /// </summary> /// <param name="reportType">Manual or automatic. If manual identifies what level of report is taking place.</param> /// <param name="product">The product to which the file belongs.</param> /// <param name="file">The file to which the event belongs.</param> /// <param name="theEvent">The event whose details have now been reported.</param> /// <returns>Null - if the plugin bug reference in the StackHash database should not be changed, Otherwise the new value for the plugin bug reference.</returns> public string EventManualUpdateCompleted(BugTrackerReportType reportType, BugTrackerProduct product, BugTrackerFile file, BugTrackerEvent theEvent) { if (product == null) { throw new ArgumentNullException("product"); } if (file == null) { throw new ArgumentNullException("file"); } if (theEvent == null) { throw new ArgumentNullException("theEvent"); } // Don't change the bug reference. Setting this to any other value will update the bug reference in the // StackHash database. String plugInBugId = null; // Note that all of the interface objects have a built in ToString() which formats the fields suitably. BugTrackerTrace.LogMessage(BugTrackerTraceSeverity.Information, m_Control.PlugInName, "Event Completed: " + theEvent.ToString()); return(plugInBugId); }
public string EventAdded(BugTrackerReportType reportType, BugTrackerProduct product, BugTrackerFile file, BugTrackerEvent theEvent) { if (product == null) { throw new ArgumentNullException("product"); } if (file == null) { throw new ArgumentNullException("file"); } if (theEvent == null) { throw new ArgumentNullException("theEvent"); } m_EventAddedCount++; String bugId = theEvent.BugReference; if (m_Properties["SetBugId"] == "True") { bugId = "TestPlugInBugId" + theEvent.EventId.ToString(CultureInfo.InvariantCulture); } BugTrackerTrace.LogMessage(BugTrackerTraceSeverity.Information, s_PlugInName, "Event Added: " + theEvent.ToString()); return(bugId); }
public string EventManualUpdateCompleted(BugTrackerReportType reportType, BugTrackerProduct product, BugTrackerFile file, BugTrackerEvent theEvent) { if (product == null) { throw new ArgumentNullException("product"); } if (file == null) { throw new ArgumentNullException("file"); } if (theEvent == null) { throw new ArgumentNullException("theEvent"); } BugTrackerTrace.LogMessage(BugTrackerTraceSeverity.Information, s_PlugInName, "Event Manual Update Completed: " + theEvent.ToString()); m_EventCompleteCount++; return(theEvent.BugReference); }