void parsexmlhelper(CommMessage msg1) { try { foreach (string xmlfile in msg1.arguments) { string filepath = Path.Combine(MotherbuilderEnvironment.root, xmlfile); if (!File.Exists(filepath)) { comm1.postFile(xmlfile, RepoEnvironment.root, MotherbuilderEnvironment.root); } } foreach (string xmlfile in msg1.arguments) { string xmlpath = Path.Combine(RepoEnvironment.root, xmlfile); TestReq readxml = new TestReq(); readxml.loadXml(xmlpath); List <string> tstdriver = new List <string>(); List <string> tstfiles = new List <string>(); tstfiles = readxml.parseList("tested"); tstdriver = readxml.parseDriverList("testDriver"); CommMessage reply = new CommMessage(CommMessage.MessageType.request); reply.from = RepoEnvironment.endPoint; reply.to = MotherbuilderEnvironment.endPoint; reply.command = "buildrequest"; foreach (string file in tstfiles) { string filepath = Path.Combine(MotherbuilderEnvironment.root, file); if (!File.Exists(filepath)) { comm1.postFile(file, RepoEnvironment.root, MotherbuilderEnvironment.root); } reply.arguments.Add(file); } foreach (string file in tstdriver) { string filepath = Path.Combine(MotherbuilderEnvironment.root, file); if (!File.Exists(filepath)) { comm1.postFile(file, RepoEnvironment.root, MotherbuilderEnvironment.root); } reply.arguments.Add(file); } reply.show(); comm1.postMessage(reply); } } catch (Exception ex) { Console.WriteLine(ex.Message); } }
void buildaxml(string testdriver1, CommMessage msg1) { TestReq testrequest = new TestReq(); Reqid++; string xmlname = "BuildRequest" + Reqid + ".xml"; xmlname = Path.Combine(RepoEnvironment.root, xmlname); testrequest.author = msg1.author; testrequest.testDriver.Add(testdriver1); List <string> testfiles = filerelation[testdriver1]; foreach (string testfile in msg1.arguments) { if (testfiles.Contains(testfile)) { testrequest.testedFiles.Add(testfile); } } testrequest.makeRequest(); testrequest.saveXml(xmlname); }