Пример #1
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);
                    }
                });
            });
        }
Пример #2
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();
            });
        }