Beispiel #1
0
 public TestPlansAndSuitsMigrationContext(MigrationEngine me, TestPlansAndSuitsMigrationConfig config) : base(me, config)
 {
     this.engine       = me;
     sourceWitStore    = new WorkItemStoreContext(me.Source, WorkItemStoreFlags.None);
     sourceTestStore   = new TestManagementContext(me.Source);
     targetWitStore    = new WorkItemStoreContext(me.Target, WorkItemStoreFlags.BypassRules);
     targetTestStore   = new TestManagementContext(me.Target);
     targetTestConfigs = targetTestStore.Project.TestConfigurations.Query("Select * From TestConfiguration");
     this.config       = config;
 }
 public TestPlandsAndSuitesMigrationContext(MigrationEngine me, TestPlansAndSuitesMigrationConfig config) : base(me, config)
 {
     this.engine       = me;
     sourceWitStore    = new WorkItemStoreContext(me.Source, WorkItemStoreFlags.None);
     sourceTestStore   = new TestManagementContext(me.Source, config.TestPlanQueryBit);
     targetWitStore    = new WorkItemStoreContext(me.Target, WorkItemStoreFlags.BypassRules);
     targetTestStore   = new TestManagementContext(me.Target);
     sourceTestConfigs = sourceTestStore.Project.TestConfigurations.Query("Select * From TestConfiguration");
     targetTestConfigs = targetTestStore.Project.TestConfigurations.Query("Select * From TestConfiguration");
     sourceIdentityManagementService = me.Source.Collection.GetService <IIdentityManagementService>();
     targetIdentityManagementService = me.Target.Collection.GetService <IIdentityManagementService>();
     this.config = config;
 }
Beispiel #3
0
        internal static int Add_TestConfigurations(Excel.XlLocation insertAt,
                                                   Options_AZDO_TFS options,
                                                   ITestManagementTeamProject testManagementTeamProject)
        {
            Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY);

            int itemCount = 0;

            string query = String.Format(
                "SELECT *"
                + " FROM TestConfiguration");

            ITestConfigurationCollection testConfigurations = testManagementTeamProject.TestConfigurations.Query(query);
            int totalItems = testConfigurations.Count;

            XlHlp.DisplayInWatchWindow($"Processing ({ totalItems } testConfigurations");

            foreach (ITestConfiguration testConfiguration in testConfigurations)
            {
                insertAt.ClearOffsets();
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testManagementTeamProject.TeamProjectName}");

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.Id}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.Name}");

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.AreaPath}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.Description}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.IsDefault}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.LastUpdated}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.LastUpdatedByName}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.Revision}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.State}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.Values.Count}");

                insertAt.IncrementRows();
                itemCount++;

                //ProcessItemDelay(options);
                AZDOHelper.DisplayLoopUpdates(startTicks, options, totalItems, itemCount);
            }

            Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks);

            return(itemCount);
        }
        public static SortedDictionary <string, string> GetConfigurations()
        {
            SortedDictionary <string, string> lsConfigColl = new SortedDictionary <string, string>();

            try
            {
                iTConfigColl = proj.TestConfigurations.Query("Select * from TestConfiguration");
                foreach (ITestConfiguration iTConfig in iTConfigColl)
                {
                    lsConfigColl.Add(iTConfig.Name, iTConfig.Id.ToString());
                }
            }
            catch (Exception ex)
            {
                lsConfigColl.Add("Please Load the Project First", "-1");
            }
            return(lsConfigColl);
        }
Beispiel #5
0
        internal override void InternalExecute()
        {
            WorkItemStoreContext  sourceWisc = new WorkItemStoreContext(me.Source, WorkItemStoreFlags.None);
            TestManagementContext SourceTmc  = new TestManagementContext(me.Source);

            WorkItemStoreContext  targetWisc = new WorkItemStoreContext(me.Target, WorkItemStoreFlags.BypassRules);
            TestManagementContext targetTmc  = new TestManagementContext(me.Target);


            ITestConfigurationCollection tc = SourceTmc.Project.TestConfigurations.Query("Select * From TestConfiguration");

            Trace.WriteLine(string.Format("Plan to copy {0} Configurations?", tc.Count));

            foreach (var sourceTestConf in tc)
            {
                Trace.WriteLine("Copy Configuration {0} - ", sourceTestConf.Name);
                ITestConfiguration targetTc = GetCon(targetTmc.Project.TestConfigurations, sourceTestConf.Name);
                if (targetTc != null)
                {
                    Trace.WriteLine("    Found {0} - ", sourceTestConf.Name);
                    // Move on
                }
                else
                {
                    Trace.WriteLine("    Create new {0} - ", sourceTestConf.Name);
                    targetTc             = targetTmc.Project.TestConfigurations.Create();
                    targetTc.AreaPath    = sourceTestConf.AreaPath.Replace(me.Source.Name, me.Target.Name);
                    targetTc.Description = sourceTestConf.Description;
                    targetTc.IsDefault   = sourceTestConf.IsDefault;
                    targetTc.Name        = sourceTestConf.Name;
                    foreach (var val in targetTc.Values)
                    {
                        if (!targetTc.Values.ContainsKey(val.Key))
                        {
                            targetTc.Values.Add(val);
                        }
                    }
                    targetTc.State = sourceTestConf.State;
                    targetTc.Save();
                    Trace.WriteLine(string.Format("    Saved {0} - ", targetTc.Name));
                }
            }
        }
Beispiel #6
0
        internal override void InternalExecute()
        {
            TestManagementContext SourceTmc = new TestManagementContext(me.Source);
            TestManagementContext targetTmc = new TestManagementContext(me.Target);

            ITestConfigurationCollection tc = SourceTmc.Project.TestConfigurations.Query("Select * From TestConfiguration");

            Trace.WriteLine($"Plan to copy {tc.Count} Configurations", Name);

            foreach (var sourceTestConf in tc)
            {
                Trace.WriteLine($"{sourceTestConf.Name} - Copy Configuration", Name);
                ITestConfiguration targetTc = GetCon(targetTmc.Project.TestConfigurations, sourceTestConf.Name);
                if (targetTc != null)
                {
                    Trace.WriteLine($"{sourceTestConf.Name} - Found", Name);
                    // Move on
                }
                else
                {
                    Trace.WriteLine($"{sourceTestConf.Name} - Create new", Name);
                    targetTc             = targetTmc.Project.TestConfigurations.Create();
                    targetTc.AreaPath    = sourceTestConf.AreaPath.Replace(me.Source.Config.Project, me.Target.Config.Project);
                    targetTc.Description = sourceTestConf.Description;
                    targetTc.IsDefault   = sourceTestConf.IsDefault;
                    targetTc.Name        = sourceTestConf.Name;

                    foreach (var val in sourceTestConf.Values)
                    {
                        if (!targetTc.Values.ContainsKey(val.Key))
                        {
                            targetTc.Values.Add(val);
                        }
                    }

                    targetTc.State = sourceTestConf.State;
                    targetTc.Save();
                    Trace.WriteLine($"{sourceTestConf.Name} - Saved as {targetTc.Name}", Name);
                }
            }
        }