PopulateIterations() публичный Метод

public PopulateIterations ( ) : System.Xml.XmlNode[]
Результат System.Xml.XmlNode[]
Пример #1
0
        public void projectMigration()
        {
            logger.InfoFormat("--------------------------------Migration from '{0}' to '{1}' Start----------------------------------------------", sourceProject.Name, destinationProject.Name);
            CheckTestPlanTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckTestPlanTextBlock.Visibility = Visibility.Hidden;
            }));
            CheckLogTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckLogTextBlock.Visibility = Visibility.Hidden;
            }));
            MigratingLabel.Dispatcher.BeginInvoke(new Action(delegate()
            {
                MigratingLabel.Content = "Migrating...";
            }));

            StatusBar.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusBar.Visibility = Visibility.Visible;
            }));
            WorkItemCollection source = readSource.GetWorkItems(sourceProject.Name, IsNotIncludeClosed, IsNotIncludeRemoved); //Get Workitems from source tfs

            XmlNode[] iterations = readSource.PopulateIterations();                                                           //Get Iterations and Areas from source tfs

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = "Generating Areas...";
            }));
            writeTarget.GenerateAreas(iterations[0], sourceProject.Name); //Copy Areas

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = StatusViwer.Content + "\nGenerating Iterations...";
            }));
            writeTarget.GenerateIterations(iterations[1], sourceProject.Name); //Copy Iterations

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = StatusViwer.Content + "\nCopying Team Queries...";
            }));
            writeTarget.SetTeamQueries(readSource.queryCol, sourceProject.Name); //Copy Queries

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = StatusViwer.Content + "\nCopying Work Items...";
            }));
            writeTarget.writeWorkItems(sourceStore, source, sourceProject.Name, StatusBar, finalFieldMap); //Copy Workitems

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = StatusViwer.Content + "\nCopying Test Plans...";
            }));
            TestPlanMigration tcm = new TestPlanMigration(sourceTFS, destinationTFS, sourceProject.Name, destinationProject.Name, writeTarget.itemMap, StatusBar);

            tcm.CopyTestPlans(); //Copy Test Plans

            MigratingLabel.Dispatcher.BeginInvoke(new Action(delegate()
            {
                MigratingLabel.Content = "Project Migrated";
            }));

            StatusBar.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusBar.Visibility = Visibility.Hidden;
            }));
            CheckTestPlanTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckTestPlanTextBlock.Visibility = Visibility.Visible;
            }));
            CheckLogTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckLogTextBlock.Visibility = Visibility.Visible;
            }));
            logger.Info("--------------------------------Migration END----------------------------------------------");
        }
Пример #2
0
        public void projectMigration()
        {
            logger.Info(String.Format("--------------------------------Migration from {0} to {1} Start----------------------------------------------", sourceProject.Name, destinationProject.Name));
            CheckTestPlanTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckTestPlanTextBlock.Visibility = Visibility.Hidden;
            }));
            CheckLogTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckLogTextBlock.Visibility = Visibility.Hidden;
            }));
            MigratingLabel.Dispatcher.BeginInvoke(new Action(delegate()
            {
                MigratingLabel.Content = "Migrating...";
            }));

            StatusBar.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusBar.Visibility = Visibility.Visible;
            }));

            //WorkItemCollection source =readSource.GetWorkItems(sourceProject.Name).Cast<WorkItem>().Where(x => x.IterationPath.Contains("DevOps")));
            IEnumerable <string> iterationPaths = null;

            WorkItemIterationFilter.Dispatcher.Invoke((Action)(() =>
            {
                iterationPaths = WorkItemIterationFilter.SelectedItems.Cast <string>();
            }
                                                               ));

            WorkItemCollection source = readSource.GetWorkItems(sourceProject.Name, IsNotIncludeClosed, IsNotIncludeRemoved, iterationPaths); //Get Workitems from source tfs

            XmlNode[] iterations = readSource.PopulateIterations();                                                                           //Get Iterations and Areas from source tfs


            //NOTE: Only create areas and iterations that are present in the set of included work items
            var includedIterations = source.Cast <WorkItem>().Select(x => x.IterationPath).Distinct();
            var includedAreas      = source.Cast <WorkItem>().Select(x => x.AreaPath).Distinct();

            var includedAreasNode      = GetElementsWithAttributeValue(iterations[0], includedAreas, attributeCanonicalizationFunction: CanonicolizeAreaPath);
            var includedIterationsNode = GetElementsWithAttributeValue(iterations[1], includedIterations, attributeCanonicalizationFunction: CanonicolizeIterationPath);

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = "Generating Areas...";
            }));
            writeTarget.GenerateAreas(includedAreasNode, sourceProject.Name);             //Copy Areas

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = StatusViwer.Content + "\nGenerating Iterations...";
            }));
            writeTarget.GenerateIterations(includedIterationsNode, sourceProject.Name);             //Copy Iterations

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                //     StatusViwer.Content = StatusViwer.Content + "\nCopying Team Queries...";
            }));
            //  writeTarget.SetTeamQueries(readSource.queryCol, sourceProject.Name); //Copy Queries

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = StatusViwer.Content + "\nCopying Work Items...";
            }));
            writeTarget.writeWorkItems(sourceStore, source, sourceProject.Name, StatusBar, finalFieldMap); //Copy Workitems

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = StatusViwer.Content + "\nCopying Test Plans...";
            }));
            //  TestPlanMigration tcm = new TestPlanMigration(sourceTFS, destinationTFS, sourceProject.Name, destinationProject.Name, writeTarget.itemMap, StatusBar);
            // tcm.CopyTestPlans(); //Copy Test Plans

            MigratingLabel.Dispatcher.BeginInvoke(new Action(delegate()
            {
                MigratingLabel.Content = "Project Migrated";
            }));

            StatusBar.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusBar.Visibility = Visibility.Hidden;
            }));
            CheckTestPlanTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckTestPlanTextBlock.Visibility = Visibility.Visible;
            }));
            CheckLogTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckLogTextBlock.Visibility = Visibility.Visible;
            }));
            logger.Info("--------------------------------Migration END----------------------------------------------");
        }