예제 #1
0
        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;
        }
예제 #2
0
        public virtual void SetALMConfigurations(string ALMServerUrl, bool UseRest, string ALMUserName, string ALMPassword,
                                                 string ALMDomain, string ALMProject, string ALMProjectKey, GingerCoreNET.ALMLib.ALMIntegrationEnums.eALMType almType,
                                                 string ALMConfigPackageFolderPath, bool UseToken, GingerCoreNET.ALMLib.ALMIntegrationEnums.eTestingALMType jiraTestingALM = GingerCoreNET.ALMLib.ALMIntegrationEnums.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);
            }
            if (CurrentAlmUserConfigurations.ALMServerURL != null)
            {
                AlmConfig.ALMServerURL = CurrentAlmUserConfigurations.ALMServerURL;
            }
            else
            {
                AlmConfig.ALMServerURL = ALMServerUrl;
            }
            AlmConfig.UseRest        = UseRest;
            AlmConfig.ALMUserName    = CurrentAlmUserConfigurations.ALMUserName;
            AlmConfig.ALMPassword    = CurrentAlmUserConfigurations.ALMPassword;
            AlmConfig.UseToken       = UseToken;
            AlmConfig.ALMDomain      = ALMDomain;
            AlmConfig.ALMProjectName = ALMProject;
            AlmConfig.ALMProjectKey  = ALMProjectKey;
            AlmConfig.AlmType        = almType;
            AlmConfig.JiraTestingALM = jiraTestingALM;

            if (CurrentAlmUserConfigurations.ALMConfigPackageFolderPath != null)
            {
                AlmConfig.ALMConfigPackageFolderPath = CurrentAlmUserConfigurations.ALMConfigPackageFolderPath;
            }
            else
            {
                if (!String.IsNullOrEmpty(ALMConfigPackageFolderPath))
                {
                    AlmConfig.ALMConfigPackageFolderPath = ALMConfigPackageFolderPath;
                }
            }
            if (!string.IsNullOrEmpty(AlmConfig.ALMConfigPackageFolderPath))
            {
                AlmConfig.ALMConfigPackageFolderPath = WorkSpace.Instance.SolutionRepository.ConvertFullPathToBeRelative(AlmConfig.ALMConfigPackageFolderPath);
            }
        }
예제 #3
0
        public GingerCoreNET.ALMLib.ALMConfig GetCurrentAlmConfig()
        {
            GingerCoreNET.ALMLib.ALMConfig AlmConfig = null;
            if (this.GetType() == typeof(GingerCore.ALM.QCCore))
            {
                AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == GingerCoreNET.ALMLib.ALMIntegration.eALMType.QC).FirstOrDefault();
            }
            if (this.GetType() == typeof(GingerCore.ALM.QCRestAPICore))
            {
                AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == GingerCoreNET.ALMLib.ALMIntegration.eALMType.QC).FirstOrDefault();
            }
            if (this.GetType() == typeof(GingerCore.ALM.RQMCore))
            {
                AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == GingerCoreNET.ALMLib.ALMIntegration.eALMType.RQM).FirstOrDefault();
            }
            if (this.GetType() == typeof(GingerCore.ALM.JiraCore))
            {
                AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == GingerCoreNET.ALMLib.ALMIntegration.eALMType.Jira).FirstOrDefault();
            }
            if (this.GetType() == typeof(GingerCore.ALM.QtestCore))
            {
                AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == GingerCoreNET.ALMLib.ALMIntegration.eALMType.Qtest).FirstOrDefault();
            }
            if (this.GetType() == typeof(GingerCore.ALM.OctaneCore))
            {
                AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == GingerCoreNET.ALMLib.ALMIntegration.eALMType.Octane).FirstOrDefault();
            }

            if (this.GetType() == typeof(GingerCore.ALM.RallyCore))
            {
                AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == GingerCoreNET.ALMLib.ALMIntegration.eALMType.RALLY).FirstOrDefault();
            }


            if (AlmConfig != null)
            {
                GingerCoreNET.ALMLib.ALMUserConfig AlmUserConfig = WorkSpace.Instance.UserProfile.ALMUserConfigs.FirstOrDefault(x => x.AlmType == AlmConfig.AlmType);
                if (AlmUserConfig == null)
                {
                    AlmUserConfig         = new GingerCoreNET.ALMLib.ALMUserConfig();
                    AlmUserConfig.AlmType = AlmConfig.AlmType;
                    WorkSpace.Instance.UserProfile.ALMUserConfigs.Add(AlmUserConfig);
                }
                AlmConfig.ALMUserName = AlmUserConfig.ALMUserName;
                AlmConfig.ALMPassword = AlmUserConfig.ALMPassword;
            }
            else
            {
                AlmConfig = AlmConfigs.FirstOrDefault();
            }
            DefaultAlmConfig = AlmConfig;
            return(AlmConfig);
        }
예제 #4
0
 public GingerCoreNET.ALMLib.ALMConfig GetCurrentAlmConfig(bool isOperationAlmType = false)
 {
     GingerCoreNET.ALMLib.ALMConfig AlmConfig = null;
     if (isOperationAlmType)
     {
         AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == this.ALMType).FirstOrDefault();
     }
     else
     {
         AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.DefaultAlm).FirstOrDefault();
     }
     if (AlmConfig != null)
     {
         GingerCoreNET.ALMLib.ALMUserConfig AlmUserConfig = WorkSpace.Instance.UserProfile.ALMUserConfigs.FirstOrDefault(x => x.AlmType == AlmConfig.AlmType);
         if (AlmUserConfig == null)
         {
             AlmUserConfig         = new GingerCoreNET.ALMLib.ALMUserConfig();
             AlmUserConfig.AlmType = AlmConfig.AlmType;
             WorkSpace.Instance.UserProfile.ALMUserConfigs.Add(AlmUserConfig);
         }
         if (AlmUserConfig.ALMServerURL != null)
         {
             AlmConfig.ALMServerURL = AlmUserConfig.ALMServerURL;
         }
         if (AlmUserConfig.ALMConfigPackageFolderPath != null)
         {
             AlmConfig.ALMConfigPackageFolderPath = AlmUserConfig.ALMConfigPackageFolderPath;
         }
         if (!string.IsNullOrEmpty(AlmConfig.ALMConfigPackageFolderPath))
         {
             AlmConfig.ALMConfigPackageFolderPath = WorkSpace.Instance.SolutionRepository.ConvertFullPathToBeRelative(AlmConfig.ALMConfigPackageFolderPath);
         }
         AlmConfig.ALMUserName = AlmUserConfig.ALMUserName;
         AlmConfig.ALMPassword = AlmUserConfig.ALMPassword;
     }
     else
     {
         AlmConfig = AlmConfigs.FirstOrDefault();
     }
     DefaultAlmConfig = AlmConfig;
     return(AlmConfig);
 }
예제 #5
0
파일: ALMCore.cs 프로젝트: lyzenliu/Ginger
        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.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;

            if (!String.IsNullOrEmpty(ALMConfigPackageFolderPath))
            {
                AlmConfig.ALMConfigPackageFolderPath = ALMConfigPackageFolderPath;
            }
        }