public bool SetDefaultAlmConfig(GingerCoreNET.ALMLib.ALMIntegration.eALMType AlmType) { //set default on the solution foreach (GingerCoreNET.ALMLib.ALMConfig alm in WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.DefaultAlm).ToList()) { alm.DefaultAlm = false; } GingerCoreNET.ALMLib.ALMConfig almConfig = GetCurrentAlmConfig(AlmType); almConfig.DefaultAlm = true; //set default on almcore foreach (GingerCoreNET.ALMLib.ALMConfig alm in ALMCore.AlmConfigs.Where(x => x.DefaultAlm).ToList()) { alm.DefaultAlm = false; } GingerCoreNET.ALMLib.ALMConfig DefaultAlm = ALMCore.AlmConfigs.FirstOrDefault(x => x.AlmType == AlmType); if (DefaultAlm == null) { DefaultAlm = new GingerCoreNET.ALMLib.ALMConfig(); DefaultAlm.AlmType = AlmType; ALMCore.AlmConfigs.Add(DefaultAlm); } DefaultAlm.DefaultAlm = true; return(true); }
public void UpdateALMType(GingerCoreNET.ALMLib.ALMIntegration.eALMType AlmType) { GingerCoreNET.ALMLib.ALMConfig CurrentAlmConfigurations = GetCurrentAlmConfig(AlmType); ALMCore.DefaultAlmConfig = CurrentAlmConfigurations; switch (AlmType) { case GingerCoreNET.ALMLib.ALMIntegration.eALMType.QC: if (!CurrentAlmConfigurations.UseRest) { AlmCore = new QCCore(); AlmRepo = new QCRepository(); } else { AlmCore = new QCRestAPICore(); AlmRepo = new QCRestAPIRepository(); } break; case GingerCoreNET.ALMLib.ALMIntegration.eALMType.RQM: AlmCore = new RQMCore(); AlmRepo = new RQMRepository(); break; case GingerCoreNET.ALMLib.ALMIntegration.eALMType.RALLY: AlmCore = new RallyCore(); AlmRepo = new RallyRepository(); break; case GingerCoreNET.ALMLib.ALMIntegration.eALMType.Jira: AlmCore = new JiraCore(); AlmRepo = new JIRA_Repository(AlmCore); break; case GingerCoreNET.ALMLib.ALMIntegration.eALMType.Qtest: AlmCore = new QtestCore(); AlmRepo = new QtestRepository(); break; case GingerCoreNET.ALMLib.ALMIntegration.eALMType.Octane: if (!(AlmCore is OctaneCore && AlmRepo is OctaneRepository)) { AlmCore = new OctaneCore(); AlmRepo = new OctaneRepository(AlmCore); } break; case GingerCoreNET.ALMLib.ALMIntegration.eALMType.ZephyrEnterprise: AlmCore = new ZephyrEntCore(); AlmRepo = new ZephyrEnt_Repository(AlmCore); break; } AlmCore.GetCurrentAlmConfig(); SetALMCoreConfigurations(AlmType); }
public void SetALMCoreConfigurations(GingerCoreNET.ALMLib.ALMIntegration.eALMType almType) { GingerCoreNET.ALMLib.ALMConfig CurrentAlmConfigurations = GetCurrentAlmConfig(almType); ALMCore.SolutionFolder = WorkSpace.Instance.Solution.Folder.ToUpper(); if (CurrentAlmConfigurations != null) { AlmCore.SetALMConfigurations(CurrentAlmConfigurations.ALMServerURL, CurrentAlmConfigurations.UseRest, CurrentAlmConfigurations.ALMUserName, CurrentAlmConfigurations.ALMPassword, CurrentAlmConfigurations.ALMDomain, CurrentAlmConfigurations.ALMProjectName, CurrentAlmConfigurations.ALMProjectKey, CurrentAlmConfigurations.AlmType, CurrentAlmConfigurations.ALMConfigPackageFolderPath); } }
public GingerCoreNET.ALMLib.ALMUserConfig GetCurrentAlmUserConfig(GingerCoreNET.ALMLib.ALMIntegration.eALMType almType) { GingerCoreNET.ALMLib.ALMUserConfig AlmUserConfig = WorkSpace.Instance.UserProfile.ALMUserConfigs.FirstOrDefault(x => x.AlmType == almType); if (AlmUserConfig == null) { AlmUserConfig = new GingerCoreNET.ALMLib.ALMUserConfig(); AlmUserConfig.AlmType = almType; WorkSpace.Instance.UserProfile.ALMUserConfigs.Add(AlmUserConfig); } return(AlmUserConfig); }
ObservableList <ExternalItemFieldBase> FetchDefectFields(GingerCoreNET.ALMLib.ALMIntegration.eALMType AlmType) { try { Mouse.OverrideCursor = Cursors.Wait; ALMIntegration.Instance.UpdateALMType(AlmType); mALMDefectProfileFields = ALMIntegration.Instance.GetALMItemFieldsREST(true, ALM_Common.DataContracts.ResourceType.DEFECT, null); } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, "Error occurred while Fetching Fields", ex); } finally { ALMIntegration.Instance.UpdateALMType(ALMIntegration.Instance.GetDefaultAlmConfig().AlmType); Mouse.OverrideCursor = null; } return(mALMDefectProfileFields); }
public virtual void SetALMConfigurations(string ALMServerUrl, bool UseRest, string ALMUserName, string ALMPassword, string ALMDomain, string ALMProject, string ALMProjectKey, GingerCoreNET.ALMLib.ALMIntegration.eALMType almType, string ALMConfigPackageFolderPath, GingerCoreNET.ALMLib.ALMIntegration.eTestingALMType jiraTestingALM = GingerCoreNET.ALMLib.ALMIntegration.eTestingALMType.None) { GingerCoreNET.ALMLib.ALMConfig AlmConfig = ALMCore.AlmConfigs.FirstOrDefault(x => x.AlmType == almType); if (AlmConfig == null) { AlmConfig = new GingerCoreNET.ALMLib.ALMConfig(); AlmConfigs.Add(AlmConfig); } GingerCoreNET.ALMLib.ALMUserConfig CurrentAlmUserConfigurations = WorkSpace.Instance.UserProfile.ALMUserConfigs.FirstOrDefault(x => x.AlmType == almType); if (CurrentAlmUserConfigurations == null) { CurrentAlmUserConfigurations = new GingerCoreNET.ALMLib.ALMUserConfig(); CurrentAlmUserConfigurations.AlmType = almType; WorkSpace.Instance.UserProfile.ALMUserConfigs.Add(CurrentAlmUserConfigurations); } if (AlmConfig == null) { AlmConfig = new GingerCoreNET.ALMLib.ALMConfig(); AlmConfigs.Add(AlmConfig); } AlmConfig.ALMServerURL = ALMServerUrl; AlmConfig.UseRest = UseRest; AlmConfig.ALMUserName = CurrentAlmUserConfigurations.ALMUserName; AlmConfig.ALMPassword = CurrentAlmUserConfigurations.ALMPassword; AlmConfig.ALMDomain = ALMDomain; AlmConfig.ALMProjectName = ALMProject; AlmConfig.ALMProjectKey = ALMProjectKey; AlmConfig.AlmType = almType; AlmConfig.JiraTestingALM = jiraTestingALM; if (!String.IsNullOrEmpty(ALMConfigPackageFolderPath)) { AlmConfig.ALMConfigPackageFolderPath = ALMConfigPackageFolderPath; } }
public override void SetALMConfigurations(string ALMServerUrl, bool UseRest, string ALMUserName, string ALMPassword, string ALMDomain, string ALMProject, string ALMProjectKey, GingerCoreNET.ALMLib.ALMIntegration.eALMType almType, string ALMConfigPackageFolderPath, GingerCoreNET.ALMLib.ALMIntegration.eTestingALMType testingALMType = GingerCoreNET.ALMLib.ALMIntegration.eTestingALMType.None) { GingerCoreNET.ALMLib.ALMConfig AlmConfig = ALMCore.AlmConfigs.FirstOrDefault(x => x.AlmType == almType); GingerCoreNET.ALMLib.ALMUserConfig CurrentAlmUserConfigurations = amdocs.ginger.GingerCoreNET.WorkSpace.Instance.UserProfile.ALMUserConfigs.FirstOrDefault(x => x.AlmType == almType); //if not exist add otherwise update if (AlmConfig == null) { AlmConfig = new GingerCoreNET.ALMLib.ALMConfig(); AlmConfigs.Add(AlmConfig); } AlmConfig.ALMServerURL = GetServerValueFromDict(GetDynamicServerConfigAndSetPaths()); AlmConfig.UseRest = UseRest; AlmConfig.ALMUserName = CurrentAlmUserConfigurations.ALMUserName; AlmConfig.ALMPassword = CurrentAlmUserConfigurations.ALMPassword; AlmConfig.ALMDomain = ALMDomain; AlmConfig.ALMProjectName = ALMProject; AlmConfig.ALMProjectKey = ALMProjectKey; AlmConfig.AlmType = almType; AlmConfig.ALMConfigPackageFolderPath = ALMConfigPackageFolderPath; AlmConfig.JiraTestingALM = testingALMType; }
private void ALMRadioButton_Checked_Changed(object sender, RoutedEventArgs e) { if (sender == null || ALMSettingsPannel == null) { return; } if (CurrentAlmConfigurations != null) { ALMIntegration.Instance.SetALMCoreConfigurations(CurrentAlmConfigurations.AlmType); } GingerCoreNET.ALMLib.ALMIntegration.eALMType almType = GingerCoreNET.ALMLib.ALMIntegration.eALMType.QC; RadioButton rBtn = sender as RadioButton; if ((bool)rBtn.IsChecked) { switch (rBtn.Name) { case "QCRadioButton": almType = GingerCoreNET.ALMLib.ALMIntegration.eALMType.QC; break; case "RQMRadioButton": almType = GingerCoreNET.ALMLib.ALMIntegration.eALMType.RQM; ALMIntegration.Instance.SetALMCoreConfigurations(almType); //Because RQM need to update the server field from existing package SetLoadPackageButtonContent(); break; case "RallyRadioButton": almType = GingerCoreNET.ALMLib.ALMIntegration.eALMType.RALLY; break; case "JiraRadioButton": almType = GingerCoreNET.ALMLib.ALMIntegration.eALMType.Jira; break; case "qTestRadioButton": almType = GingerCoreNET.ALMLib.ALMIntegration.eALMType.Qtest; break; case "OctaneRadioButton": almType = GingerCoreNET.ALMLib.ALMIntegration.eALMType.Octane; break; default: //Not used break; } //Clear bindings BindingOperations.ClearAllBindings(ServerURLTextBox); BindingOperations.ClearAllBindings(RestAPICheckBox); BindingOperations.ClearAllBindings(UserNameTextBox); BindingOperations.ClearAllBindings(PasswordTextBox); BindingOperations.ClearAllBindings(DomainComboBox); BindingOperations.ClearAllBindings(ProjectComboBox); ALMIntegration.Instance.SetDefaultAlmConfig(almType); ALMIntegration.Instance.UpdateALMType(almType); CurrentAlmConfigurations = ALMIntegration.Instance.GetCurrentAlmConfig(almType); CurrentAlmUserConfigurations = ALMIntegration.Instance.GetCurrentAlmUserConfig(almType); //Bind again as we changed the AlmConfig object Bind(); //Select domain and project based on new AlmConfig LoginServerButton.Content = "Get Projects Details"; GetProjectsDetails(); StyleRadioButtons(); SetControls(); } }
public void CreateNewALMDefects(Dictionary <Guid, Dictionary <string, string> > defectsForOpening, List <ExternalItemFieldBase> defectsFields, GingerCoreNET.ALMLib.ALMIntegration.eALMType almType) { //update alm type to open defect ALMIntegration.Instance.UpdateALMType(almType); Dictionary <Guid, string> defectsOpeningResults; if ((defectsForOpening != null) && (defectsForOpening.Count > 0)) { defectsOpeningResults = ALMIntegration.Instance.CreateNewALMDefects(defectsForOpening, defectsFields); } else { return; } if ((defectsOpeningResults != null) && (defectsOpeningResults.Count > 0)) { foreach (KeyValuePair <Guid, string> defectOpeningResult in defectsOpeningResults) { if ((defectOpeningResult.Value != null) && (defectOpeningResult.Value != "0")) { WorkSpace.Instance.RunsetExecutor.DefectSuggestionsList.Where(x => x.DefectSuggestionGuid == defectOpeningResult.Key).ToList().ForEach(z => { z.ALMDefectID = defectOpeningResult.Value; z.IsOpenDefectFlagEnabled = false; }); } } } //Set back Default Alm ALMIntegration.Instance.UpdateALMType(ALMIntegration.Instance.GetDefaultAlmConfig().AlmType); }