Example #1
0
 public static void CacheTeamData(IOutputable output)
 {
     //get all TMS tasks from SD database
     sw.StartStopwatchAndPrintMessage("Caching of team data started...", output);
     CacheTeamData();
     sw.StopStopwatchAndPrintDoneMessageWithElapsedTime(output);
 }
        public static TMSTaskSynchronizer GetInstance(string client, IOutputable outp)
        {
            TMSTaskSynchronizer instance = null;

            if (!instancesDict.TryGetValue(client, out instance))
            {
                instance = new TMSTaskSynchronizer(client, outp);
                instancesDict.Add(client, instance);
            }
            return(instance);
        }
        private static TMSDictionary GetTMSDataFromRedMine(IOutputable output)
        {
            //Stopwatch sw = new Stopwatch();
            //sw.StartStopwatchAndPrintMessage("Getting TMS data from RedMine...", output);
            NameValueCollection parameters = new NameValueCollection {
                { "status_id", "*" }
            };
            //List<TMSItem> redMineTMSList = new List<TMSItem>();

            TMSDictionary dict = new TMSDictionary();

            if (!Consts.TEST_MODE)
            {
                foreach (var issue in RMManegerService.RMManager.GetObjects <Issue>(parameters).Where(issue => issue.Project.Id == Consts.PROJECT_NAMES.TMS.MACBI.PROBLEMS))
                {
                    /*string subject = issue.Subject;
                     *
                     * TMSItem itemFromRM = new TMSItem();
                     * itemFromRM.Source = Consts.SRC_RM;
                     * itemFromRM.AssignedTo = issue.AssignedTo.TryGetName();
                     * itemFromRM.Desctiption = issue.Description;
                     *
                     * string[] subjectSplitted = issue.Subject.Split('-');
                     * itemFromRM.TMS = issue.Subject.Split('-')[0].Trim() + "-" + issue.Subject.Split('-')[1].Trim();
                     * itemFromRM.Status = issue.Status.TryGetName();
                     *
                     * //redMineTMSList.Add(itemFromRM);
                     */
                    dict.Add(new TMSItem(issue));
                }

                //redMineTMSList.SerializeTMSItemData();
                dict.SerializeTMSItemData(Consts.FILE_NAMES.RM_TMS_CACHE);
            }
            else
            {
                dict = TMSDictionary.DeserializeTMSItemData(Consts.FILE_NAMES.RM_TMS_CACHE);
            }

            // sw.StopStopwatchAndPrintDoneMessageWithElapsedTime("Getting TMS data from RedMine...done", output);
            return(dict);
        }
        public static void CreateTMSCache(IOutputable output)
        {
            output.Write("Cache creation...");
            //NameValueCollection parameters = new NameValueCollection { { "status_id", "*" } };

//            Task<List<Issue>> issuesListFromRemineTask = CommonTools.GetIssuesFromRedmine(Consts.PROJECT_NAMES.TMS.MACBI.PROBLEMS);
            List <Issue> issuesListFromRemine = CommonTools.GetIssuesFromRedmine(Consts.PROJECT_NAMES.TMS.MACBI.PROBLEMS);

            foreach (var issue in issuesListFromRemine)
            {
                string subject = issue.Subject;

                TMSItem itemFromRM = new TMSItem();
                itemFromRM.Source      = Consts.SRC_RM;
                itemFromRM.AssignedTo  = issue.AssignedTo.TryGetName();
                itemFromRM.Desctiption = issue.Description;

                string[] subjectSplitted = issue.Subject.Split('-');
                itemFromRM.TMS    = issue.Subject.Split('-')[0].Trim() + "-" + issue.Subject.Split('-')[1].Trim();
                itemFromRM.Status = issue.Status.TryGetName();
            }

            output.WriteLine("Cache creation...done!");
        }
Example #5
0
 /// <summary>
 /// 取消监听一个IOutputable
 /// </summary>
 /// <param name="sender"></param>
 public void Unregister(IOutputable sender)
 {
     sender.OutputReceived -= Sender_OutputReceived;
 }
Example #6
0
 /// <summary>
 /// 监听一个IOutputable的输出并记录
 /// </summary>
 /// <param name="sender"></param>
 public void Register(IOutputable sender)
 {
     sender.OutputReceived += Sender_OutputReceived;
 }
        public static void CreateMOMCache(List <IssueItem> issuesInRedmineProject, List <IssueItem> problematicIssuesInRedmineProject, int project_id, IOutputable output)
        {
            output.Write("Cache creation...");

            List <Issue> issuesListFromRemine = CommonTools.GetIssuesFromRedmine(project_id);

            if (output.GetIsRedisUse())
            {
                cache = RedisConnectorHelper.Connection.GetDatabase();
            }

            foreach (var issue in issuesListFromRemine.Where(issue => issue.Project.Id == project_id))
            {
                string subject = issue.Subject;

                //split subject to get env and problem id
                string[] subjectSplitted = subject.Split('-');

                //get env
                string env = subjectSplitted[0].Trim();

                IssueItem item = new IssueItem();
                item.Id     = issue.Id;
                item.Status = issue.Status.Name;
                item.Desc   = subject;
                item.Env    = env;

                if (subjectSplitted.Length >= 4)
                {
                    //get MOM problem is from subject
                    item.ProblemId = subjectSplitted[1].Trim();

                    //look for sender code
                    if (subjectSplitted.Length >= 5)
                    {
                        item.SenderCode = subjectSplitted[4].Trim();
                    }
                    issuesInRedmineProject.Add(item);

                    //cache.HashSetAsync("dd", "ddd", "ddd");
                }
                else
                {
                    problematicIssuesInRedmineProject.Add(item);
                }
            }

            output.WriteLine("done!");
        }
        /*
         * private static Dictionary<string, MOMEnvSettings> MOM_ENV_SETTINGS = new Dictionary<string, MOMEnvSettings>() {
         *  { "L058@MACBI", new MOMEnvSettings("lxc058.softsystem.pl:7701") },
         *  { "L094@MACBI", new MOMEnvSettings("lxc094.softsystem.pl:8702") },
         *  { "Q167@Generic", new MOMEnvSettings("wp167.softsystem.pl:7700") },
         *  { "Q18@Generic", new MOMEnvSettings("wp18.softsystem.pl:7700") },
         *  { "Q311@AON", new MOMEnvSettings("wp311.softsystem.pl:7700") },
         *  { "Q337@MAYO", new MOMEnvSettings("wp337.softsystem.pl:7700") },
         *  { "Q397@UMICH", new MOMEnvSettings("wp397.softsystem.pl:7700") },
         *  { "Q486@MAYO", new MOMEnvSettings("wp486.softsystem.pl:7700") },
         *  { "Q501@Generic", new MOMEnvSettings("wp501.softsystem.pl:7700") },
         *  { "Q507@FCS", new MOMEnvSettings("wp507.softsystem.pl:7700") },
         *  { "Q26@Generic", new MOMEnvSettings("wp26.softsystem.pl:7700") },
         *  { "Q336@MACBI", new MOMEnvSettings("wp336.softsystem.pl:7700") },
         *  { "Q508@AON", new MOMEnvSettings("wp508.softsystem.pl:7700") },
         *  { "L071@VIBRA", new MOMEnvSettings("lxc071.softsystem.pl:7701") } ,
         *  { "L081@SCPMG", new MOMEnvSettings("lxc081.softsystem.pl:8265") } ,
         *  { "Q16@MAYO", new MOMEnvSettings("wp16.softsystem.pl:7700") } ,
         *  { "Q448@Generic", new MOMEnvSettings("wp448.softsystem.pl:7700") } ,
         *  { "L014@MACBI", new MOMEnvSettings("lxc014.softsystem.pl:8425") },
         *  { "Q414@CHUR", new MOMEnvSettings("wp414.softsystem.pl:7700") }
         * };
         */

        public MOMActionsManager(IOutputable out1)
        {
            output = out1;
        }
Example #9
0
 public void Output(IOutputable iout)
 {
     iout.Output(list);
 }
Example #10
0
 public RM2XLSManager(IOutputable o)
 {
     output = o;
 }
Example #11
0
        public static void UpdateDictionary(this Dictionary <string, List <TMS_TP> > dict, string key, TMS_TP newValue, IOutputable ouotput = null)
        {
            List <TMS_TP> existingList;

            if (!dict.TryGetValue(key, out existingList))
            {
                existingList = new List <TMS_TP>();
                dict.Add(key, existingList);
            }
            existingList.Add(newValue);

            if (Consts.VERBOSE && ouotput != null)
            {
                ouotput.WriteLine("{0}: {1}", key, newValue);
            }
        }
Example #12
0
 public static void StopStopwatchAndPrintDoneMessageWithElapsedTime(this Stopwatch sw, string msg, IOutputable output)
 {
     sw.Stop();
     output.WriteLine("{0} ({1}s)", msg, sw.Elapsed.TotalSeconds);
 }
Example #13
0
 public static void StopStopwatchAndPrintDoneMessageWithElapsedTime(this Stopwatch sw, IOutputable output)
 {
     StopStopwatchAndPrintDoneMessageWithElapsedTime(sw, "done! ({0}s)", output);
 }
Example #14
0
 public static void StartStopwatchAndPrintMessage(this Stopwatch sw, string message, IOutputable output)
 {
     output.Write(message);
     sw.Restart();
 }
 private TMSTaskSynchronizer(string client, IOutputable outp)
 {
     this.client = client;
     this.output = outp;
 }
Example #16
0
        private int successCount = 0; // Counter for successful tests.

        #endregion Fields

        #region Constructors

        /// <summary>Constructor.</summary>
        /// <param name="info">The metadata to create the data logging.</param>
        public Log(LogInfo info)
        {
            this.logInfo    = info;
            this.output     = OutputFactory.Create(this.logInfo);
            this.summaryLog = LogFactory.Create(this.logInfo.SummaryLogInfo);
        }