//send log files to repository
        private void SendLogToRepo(string file, string port)
        {
            Console.Write("\n\n build child send build log {0} to repository ..\\..\\..\\Repository\\LogFilesAfterBuild", Path.GetFileName(file));
            CommMessage sndMsg = new CommMessage(CommMessage.MessageType.request);

            sndMsg.command  = "log";
            sndMsg.author   = "QuanfengDu";
            sndMsg.to       = "http://localhost:" + 8068.ToString() + "/Ibuilder";
            sndMsg.from     = "http://localhost:" + 8068.ToString() + "/Ibuilder";
            sd.WritePath_   = "..\\..\\..\\Repository\\LogFilesAfterBuild";
            sndMsg.filename = file;
            sd.postMessage(sndMsg);
            sd.postFile(file);
        }
        //send dll files to testharness
        private void SendDLLToTS(string file)
        {
            Console.Write("\n\n build child send dll and request file {0} to test harness ..\\..\\..\\TestHarness\\DLL", file);
            CommMessage sndMsg = new CommMessage(CommMessage.MessageType.request);

            sndMsg.command    = "dll";
            sndMsg.author     = "QuanfengDu";
            sndMsg.to         = "http://localhost:" + 8050.ToString() + "/Ibuilder";
            sndMsg.from       = "http://localhost:" + 8050.ToString() + "/Ibuilder";
            sdToTS.WritePath_ = "..\\..\\..\\TestHarness\\DLL";
            sndMsg.filename   = file;
            sdToTS.postMessage(sndMsg);
            sdToTS.postFile(file);
        }
Exemplo n.º 3
0
        //start send test result and test result back to repo
        private void sendTestResultToRepo(Sender sndr)
        {
            string[] file_ = Directory.GetFiles("..\\..\\..\\TestHarness\\TestResult", "*.xml");
            Console.Write("\n\n testHarness send test result {0} to repository ..\\..\\..\\Repository\\TestResult", Path.GetFileName(file_[0]));
            sndr.WritePath_ = "..\\..\\..\\Repository\\TestResult";
            CommMessage sndMsg = new CommMessage(CommMessage.MessageType.request);

            sndMsg.command  = "sendTestResultToRepo";
            sndMsg.author   = "Quanfeng Du";
            sndMsg.to       = "http://localhost:" + 8068.ToString() + "/Ibuilder";
            sndMsg.from     = "http://localhost:" + 8068.ToString() + "/Ibuilder";
            sndMsg.filename = file_[0];
            sndr.postMessage(sndMsg);
            sndr.postFile(file_[0]);
        }
        //build mother sends the sources conresponding the request file to child builder
        private void sendSourceToChild(Sender snd, string XmlFile)
        {
            Sender s = snd;

            ParseXml.Parse parse = new ParseXml.Parse();
            if (parse.loadXml(XmlFile) == false)
            {
                Console.Write("\n Unable parse the Xml file!");
            }
            string dir            = parse.parseDir("test");
            string SourceFilePath = "..\\..\\..\\ProcessMother\\" + dir;

            string[] sourceFiles = Directory.GetFiles(SourceFilePath, "*.*");
            foreach (string file in sourceFiles)
            {
                s.postFile(file);
            }
        }
        /*----< start a send source file and request files by each sender >----------*/
        private void startsend(List <string> requestFiles, int port, int numofProcess, Sender send)
        {
            Sender sndr = send;

            sndr.WritePath_ = "..\\..\\..\\ProcessPool\\Build" + (port - numofProcess);
            sndr.postFile(requestFiles[requestFiles.Count() - 1]);
            sendSourceToChild(sndr, requestFiles[requestFiles.Count() - 1]);
            string fileSendToChild = requestFiles[requestFiles.Count() - 1];

            requestFiles.RemoveAt(requestFiles.Count() - 1);
            CommMessage sndMsg = new CommMessage(CommMessage.MessageType.request);

            sndMsg.command  = "sendfile";
            sndMsg.author   = "Quanfeng Du";
            sndMsg.to       = "http://localhost:" + (port - numofProcess).ToString() + "/Ibuilder";
            sndMsg.from     = "http://localhost:" + (port - numofProcess).ToString() + "/Ibuilder";
            sndMsg.filename = fileSendToChild;
            sndr.postMessage(sndMsg);
        }