//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);
        }
        //When send all dll to test, send done dll notification to morther
        private void sendDoneDllSendNotification(Sender sndr, string port2)
        {
            CommMessage sndMsg = new CommMessage(CommMessage.MessageType.request);

            sndMsg.command = "doneSendDll";
            sndMsg.author  = "QuanfengDu";
            sndMsg.to      = "http://localhost:" + port2 + "/Ibuilder";
            sndMsg.from    = "http://localhost:" + port2 + "/Ibuilder";
            sndr.postMessage(sndMsg);
        }
        /*----< generate the reply message and send to the mother process >-------------*/
        private void replyMess(Sender sndr, string port)
        {
            CommMessage sndMsg = new CommMessage(CommMessage.MessageType.request);

            sndMsg.command = "ready";
            sndMsg.author  = "QuanfengDu";
            sndMsg.to      = "http://localhost:" + port + "/Ibuilder";
            sndMsg.from    = "http://localhost:" + port + "/Ibuilder";
            sndr.postMessage(sndMsg);
        }
Exemplo n.º 5
0
        //send done test message to build mother
        private void doneTestMsgToBuildMother()
        {
            Sender      s  = new Sender("http://localhost", 8079);
            CommMessage cm = new CommMessage(CommMessage.MessageType.reply);

            cm.command = "DoneTest";
            cm.author  = "Quanfeng Du";
            cm.to      = "http://localhost:" + 8079.ToString() + "/Ibuilder";
            cm.from    = "http://localhost:" + 8079.ToString() + "/Ibuilder";
            s.postMessage(cm);
        }
        /*----< open a sender >----------*/
        private void startsendOpen(List <Sender> sendlist, int i)
        {
            Sender sndr = new Sender("http://localhost", 8080 + i);

            sendlist.Add(sndr);

            CommMessage sndMsg = new CommMessage(CommMessage.MessageType.request);

            sndMsg.command = "open";
            sndMsg.author  = "Quanfeng Du";
            sndMsg.to      = "http://localhost:" + (8080 + i).ToString() + "/Ibuilder";
            sndMsg.from    = "http://localhost:" + (8080 + i).ToString() + "/Ibuilder";
            sndr.postMessage(sndMsg);
        }
Exemplo n.º 7
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]);
        }
        /*----< 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);
        }
        static void Main(string[] args)
        {
            BuildProcess bp   = new BuildProcess();
            Receiver     rcvr = new Receiver();

            rcvr.start("http://localhost", Int32.Parse(args[0]));                    //start child receiver
            Sender      sndr = new Sender("http://localhost", Int32.Parse(args[1])); //start child sender
            CommMessage rcvMsg;

            while (true)
            {
                rcvMsg = rcvr.getMessage();
                if (rcvMsg.command == "open")
                {
                    rcvMsg.show();
                    bp.buildFolder(args[0]);
                    bp.replyMess(sndr, args[1]);
                    continue;
                }
                if (rcvMsg.command == "sendfile")
                {
                    rcvMsg.show();
                    Thread.Sleep(100);
                    bp.startBuild(args[0]);
                    bp.replyMess(sndr, args[1]);
                }
                if (rcvMsg.command == "SendLog")
                {
                    bp.SendLog(sndr, args[0], args[1]);
                }
                if (rcvMsg.type == CommMessage.MessageType.closeReceiver)
                {
                    rcvMsg.show();
                    rcvMsg.type = CommMessage.MessageType.closeSender;
                    sndr.postMessage(rcvMsg);
                    sdToTS.postMessage(rcvMsg);
                    sd.postMessage(rcvMsg);
                    break;
                }
            }
        }
Exemplo n.º 10
0
        static void Main(string[] args)
        {
            Receiver rcvr = new Receiver();

            rcvr.start("http://localhost", 8080);
            Sender sndr = new Sender("http://localhost", 8080);

            CommMessage sndMsg = new CommMessage(CommMessage.MessageType.request);

            sndMsg.command = "show";
            sndMsg.author  = "Jim Fawcett";
            sndMsg.to      = "http://localhost:8080/IPluggableComm";
            sndMsg.from    = "http://localhost:8080/IPluggableComm";
            sndr.postMessage(sndMsg);
            CommMessage rcvMsg;

            // get connection message
            rcvMsg = rcvr.getMessage();
            rcvMsg.show();
            // get first info message
            rcvMsg = rcvr.getMessage();
            rcvMsg.show();
        }