Esempio n. 1
0
        static AnalyzeGingerRunner CreateNewIssue(List <AnalyzerItemBase> IssuesList, GingerRunner GR)
        {
            AnalyzeGingerRunner AGR = new AnalyzeGingerRunner();

            AGR.Status       = AnalyzerItemBase.eStatus.NeedFix;
            AGR.GingerRunner = GR;
            AGR.ItemName     = GR.Name;
            AGR.ItemClass    = "Runner";
            IssuesList.Add(AGR);
            return(AGR);
        }
Esempio n. 2
0
        public void RunRunSetConfigAnalyzer(RunSetConfig mRunSetConfig, ObservableList <AnalyzerItemBase> issuesList)
        {
            foreach (AnalyzerItemBase issue in RunSetConfigAnalyzer.Analyze(mRunSetConfig))
            {
                AddIssue(issuesList, issue);
            }

            // Check all GRs BFS
            //foreach (GingerRunner GR in mRunSetConfig.GingerRunners)
            Parallel.ForEach(mRunSetConfig.GingerRunners, new ParallelOptions {
                MaxDegreeOfParallelism = 5
            }, GR =>
            {
                foreach (AnalyzerItemBase issue in AnalyzeGingerRunner.Analyze(GR, WorkSpace.Instance.Solution.ApplicationPlatforms))
                {
                    AddIssue(issuesList, issue);
                }

                //Code to analyze Runner Unique Businessflow with Source BF
                List <Guid> checkedGuidList = new List <Guid>();
                //foreach (BusinessFlow BF in GR.BusinessFlows)
                Parallel.ForEach(GR.BusinessFlows, new ParallelOptions {
                    MaxDegreeOfParallelism = 5
                }, BF =>
                {
                    if (!checkedGuidList.Contains(BF.Guid))//check if it already was analyzed
                    {
                        checkedGuidList.Add(BF.Guid);
                        BusinessFlow actualBf = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <BusinessFlow>().Where(x => x.Guid == BF.Guid).FirstOrDefault();
                        if (actualBf != null)
                        {
                            RunBusinessFlowAnalyzer(actualBf, issuesList);
                        }
                    }
                });

                //Code to analyze Runner BF i.e. BFFlowControls
                //foreach (BusinessFlow BF in GR.BusinessFlows)
                Parallel.ForEach(GR.BusinessFlows, new ParallelOptions {
                    MaxDegreeOfParallelism = 5
                }, BF =>
                {
                    foreach (AnalyzerItemBase issue in AnalyzeRunnerBusinessFlow.Analyze(GR, BF))
                    {
                        AddIssue(issuesList, issue);
                    }
                });
            });
        }
Esempio n. 3
0
        public static List <AnalyzerItemBase> Analyze(GingerRunner GR, ObservableList <ApplicationPlatform> solutionApplicationPlatforms)
        {
            List <AnalyzerItemBase> IssuesList = new List <AnalyzerItemBase>();

            // check that we have BFs
            if (GR.BusinessFlows.Count() == 0)
            {
                AnalyzeGingerRunner AGR = CreateNewIssue(IssuesList, GR);
                AGR.Description = "Runner is missing " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlows);
                AGR.Details     = "Nothing to run";
                AGR.HowToFix    = "Add " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlows) + "to the Runner or delete the Runner";
                AGR.CanAutoFix  = AnalyzerItemBase.eCanFix.No;
                AGR.IssueType   = eType.Warning;
                AGR.Impact      = "Waste of resources";
                AGR.Severity    = eSeverity.Medium;
                AGR.Selected    = false;
            }

            //check all Agents are configured
            foreach (ApplicationAgent AA in GR.ApplicationAgents)
            {
                if (string.IsNullOrEmpty(AA.AgentName))
                {
                    if (GR.SolutionApplications.Where(x => (x.AppName == AA.AppName && x.Platform == ePlatformType.NA)).FirstOrDefault() != null)
                    {
                        continue;
                    }
                    //create error
                    AnalyzeGingerRunner AGR = CreateNewIssue(IssuesList, GR);
                    AGR.ItemParent  = GR.Name;
                    AGR.Description = "Target Application is not mapped to an Agent";
                    AGR.Details     = string.Format("The '{0}' Runner '{1}' Target Application is not mapped to any Agent", GR.Name, AA.AppName);
                    AGR.HowToFix    = "Map the Target Application to an Agent";
                    AGR.CanAutoFix  = AnalyzerItemBase.eCanFix.No;
                    AGR.IssueType   = eType.Error;
                    AGR.Impact      = "Execution will fail.";
                    AGR.Severity    = eSeverity.Critical;
                    AGR.Selected    = false;
                }
            }
            return(IssuesList);
        }
Esempio n. 4
0
        private void RunRunSetConfigAnalyzer(RunSetConfig mRunSetConfig)
        {
            Task t = Task.Factory.StartNew(() =>
            {
                List <AnalyzerItemBase> issues = RunSetConfigAnalyzer.Analyze(mRunSetConfig);
                AddIssues(issues);
                //TODO: check agents is not dup in different GR


                // Check all GRs BFS
                foreach (GingerRunner GR in mRunSetConfig.GingerRunners)
                {
                    issues = AnalyzeGingerRunner.Analyze(GR, App.UserProfile.Solution.ApplicationPlatforms);
                    AddIssues(issues);

                    //Code to analyze Runner Unique Busines flow with Source BF
                    List <Guid> checkedGuidList = new List <Guid>();
                    foreach (BusinessFlow BF in GR.BusinessFlows)
                    {
                        if (!checkedGuidList.Contains(BF.Guid))//check if it already was analyzed
                        {
                            checkedGuidList.Add(BF.Guid);
                            BusinessFlow actualBf = App.LocalRepository.GetSolutionBusinessFlows().Where(x => x.Guid == BF.Guid).FirstOrDefault();
                            if (actualBf != null)
                            {
                                RunBusinessFlowAnalyzer(actualBf, false);
                            }
                        }
                    }
                    //Code to analyze Runner BF i.e. BFFlowControls
                    foreach (BusinessFlow BF in GR.BusinessFlows)
                    {
                        List <AnalyzerItemBase> fcIssues = AnalyzeRunnerBusinessFlow.Analyze(GR, BF);
                        AddIssues(fcIssues);
                    }
                }

                SetAnalayzeProceesAsCompleted();
            });
        }