C# Class Telerik.TestStudio.Jira.BugTracking.JiraBugTracker

This is the main Test Studio plug-in class. It ties everything together and provides the main communication between Test Studio and this plug-in. The sequence of events is this: On Project load: 1) ResetSettings is called. Intended to let the plugin clear out old setting in prepartion of new settings being loaded. 2) ApplyPersistableSettings is called. The deserialized JiraConnectionModel object is passed in. It contains the settings loaded from the projects settings.aiis file. On clicking the "Bug Tracking" button in the ribbon bar: 1) GetPersistableSettings is called. The plugin is expected to return a filled out BugTrackerPersistableSettings object. Test Studio uses this data to fill in the Manaege Bug Tracking dialog. On clicking the "Configure the connection" button 1) CanSave is called. Controls whether or not the Save button is enabled. 2) CanClose is called. Controls whether or not the Cancel button is enabled. On clicking Save: 1) OnSave is called. Save the UI settings and make them active. 2) GetPersistableSettings is called. On clicking Cancel: 1) OnClose is called. The plugin can clean up any resources or connections that were being used. 2) ApplyPersistableSettings is called. 3) CanSave is called. On clicking Save in the Manage Bug Tracking dialog 1) Actually nothing in the bug tracker is called On clicking Cancel in the Manage Bug Tracking dialog 1) ApplyPersistableSettings is called 2) CanSave is called On closing the project: 1) ResetSettings is called. The plugin should remove all active settings so that the next project doesn't recieve carried over settings. 2) CanSave is called. On clicking Submit Bug in the Results view 1) SubmitBug is called
Inheritance: IBugTracker, IBugTrackerConnectionUI
Show file Open project: TestStudio/JiraPlugin

Public Methods

Method Description
ApplyPersistableSettings ( BugTrackerPersistableSettings settings ) : bool

Applies the persistable settings upon loading the user settings from the XML file where persisted, or when Cancel is clicked. The settings are persisted so that the user can get the configured bug tracker on the next project load.

GetPersistableSettings ( ) : BugTrackerPersistableSettings

Retrieve the object that implements the BugTrackerPersistableSettings interface. This includes the LoadFrom and SaveTo methods used to serialize and deserialize the the configuration into/out of the current Test Studio project.

OnClose ( ) : void

Optional. Called whenever the bug tracker UI is closed for any reason. Clear the view for the next project to be loaded, which may not have Jira settings.

OnSave ( ) : void

Optional. Called whenever user clicks Save in the UI to save the settings. Enables customizing the save click handling. We'll make the settings in the ViewModel the active settings for submitting bugs.

ResetSettings ( ) : void

Resets bug tracker connection settings to default settings. Called when a project containg Jira settings is first opened, but before settings are loaded. Also called when the project is closed. Useful method to clean up the bug tracker data internally.

SubmitBug ( IBug bug ) : int

Submits a bug to the bug tracking tool. Return an int that represents the newly created bug ID.

SubmitBug ( IBug bug ) : string
jiraConnSettings_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Handle property changes in the ViewModel. For now all we do is bubble up the SelectedProject property change to CanSave which enables/disables the 'Done' button on the Test Studio wrapping WPF window.

Private Methods

Method Description
OnPropertyChanged ( string propertyName ) : void
SettingsControlLoaded ( object sender, System e ) : void

Event handler called when the WPF UserControl is loaded. The wrapping window listens to the CanSave and CanClose property changed events.

WorkerMethod ( ) : void

Worker thread that fetches the list projects from JIRA.

settingsUiControl_OnGetProjects ( object sender, GetProjectsEventArgs e ) : void

Event handler that is called when the user clicks the 'Get Projects' button in the UI. We'll spawn a background thread which will fetch the list of projects the user has access to from JIRA.

Method Details

ApplyPersistableSettings() public method

Applies the persistable settings upon loading the user settings from the XML file where persisted, or when Cancel is clicked. The settings are persisted so that the user can get the configured bug tracker on the next project load.
public ApplyPersistableSettings ( BugTrackerPersistableSettings settings ) : bool
settings BugTrackerPersistableSettings The deserialized settings to make active.
return bool

GetPersistableSettings() public method

Retrieve the object that implements the BugTrackerPersistableSettings interface. This includes the LoadFrom and SaveTo methods used to serialize and deserialize the the configuration into/out of the current Test Studio project.
public GetPersistableSettings ( ) : BugTrackerPersistableSettings
return BugTrackerPersistableSettings

OnClose() public method

Optional. Called whenever the bug tracker UI is closed for any reason. Clear the view for the next project to be loaded, which may not have Jira settings.
public OnClose ( ) : void
return void

OnSave() public method

Optional. Called whenever user clicks Save in the UI to save the settings. Enables customizing the save click handling. We'll make the settings in the ViewModel the active settings for submitting bugs.
public OnSave ( ) : void
return void

ResetSettings() public method

Resets bug tracker connection settings to default settings. Called when a project containg Jira settings is first opened, but before settings are loaded. Also called when the project is closed. Useful method to clean up the bug tracker data internally.
public ResetSettings ( ) : void
return void

SubmitBug() public method

Submits a bug to the bug tracking tool. Return an int that represents the newly created bug ID.
public SubmitBug ( IBug bug ) : int
bug IBug The bug from Test Studio to be created.
return int

SubmitBug() public method

public SubmitBug ( IBug bug ) : string
bug IBug
return string

jiraConnSettings_PropertyChanged() public method

Handle property changes in the ViewModel. For now all we do is bubble up the SelectedProject property change to CanSave which enables/disables the 'Done' button on the Test Studio wrapping WPF window.
public jiraConnSettings_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void
sender object The object that raised the event.
e System.ComponentModel.PropertyChangedEventArgs Event arguments.
return void