Пример #1
0
        /*----< parse request to get filenames of all requested files >-----*/

        private List <string> getFileList(TestRequest request)
        {
            List <string> files = new List <string>();

            foreach (TestElement te in request.tests)
            {
                if (te.buildConfig != null)
                {
                    files.Add(te.buildConfig);
                }
                if (te.testDriver != null)
                {
                    files.Add(te.testDriver);
                }
                foreach (string testCode in te.testCodes)
                {
                    files.Add(testCode);
                }
            }
            return(files);
        }
Пример #2
0
        /*----< request files from repo and do build >----------------------*/

        void processTestRequest(Msg msg)
        {
            Console.Write("\n" + msg.argument);

            // parse test request
            TestRequest request = msg.argument.FromXml <TestRequest>();

            if (request != null) // valid test request got
            {
                // get files from repo
                List <string> files  = getFileList(request);
                Msg           reqMsg = new Msg(Msg.MessageType.request);
                reqMsg.to       = "http://localhost:8082/IPluggableComm";
                reqMsg.from     = msg.to;
                reqMsg.command  = Msg.Command.sendFile;
                reqMsg.argument = msg.argument; // append test request in file request
                foreach (string file in files)
                {
                    reqMsg.arguments.Add(file);
                }
                comm_.postMessage(reqMsg);
            }
        }