public static void Main(string[] args) { //XmlDecoder decoder = new XmlDecoder(); //string path = "../../XMLFile1.xml"; //System.IO.FileStream xml = new System.IO.FileStream(path, System.IO.FileMode.Open); //SWTools.BlockingQueue<TestData> p = new SWTools.BlockingQueue<TestData>(); //decoder.parse(xml, p); //while (p.size() != 0) //{ // TestData td = p.deQ(); // td.show(); //} CommandData cmd = new CommandData(); cmd.from = "localhost"; cmd.to = "localhost"; cmd.testAuthor = "me"; cmd.testName = "test"; cmd.command = "testcmd"; cmd.dateTime = "now"; cmd.url = "localhost"; cmd.dllFiles.Add("1"); cmd.dllFiles.Add("2"); cmd.xmlFile = "testxml"; CommandEncoder cmde = new CommandEncoder(cmd); Console.WriteLine(cmde.encode()); CommandDecoder cmdd = new CommandDecoder(cmde.encode()); cmd = cmdd.parse(); CommandEncoder cmde2 = new CommandEncoder(cmd); Console.WriteLine(cmde2.encode()); }
static void Main(string[] args) { testHarness th = new testHarness(""); th.startRemote(); #if (TEST_TESTHARNESS) CommandData cmd = new CommandData(); cmd.from = "localhost"; cmd.to = "localhost"; cmd.testAuthor = "me"; cmd.testName = "test"; cmd.command = "Test"; DateTime tm = new DateTime(2016, 11, 20, 09, 00, 00); cmd.dateTime = tm.ToString("MM_dd_yyyy_hh_mm_ss"); cmd.url = "http://localhost:8082/"; cmd.dllFiles.Add("tc1.dll"); cmd.dllFiles.Add("tc2.dll"); cmd.dllFiles.Add("td1.dll"); cmd.dllFiles.Add("td2.dll"); cmd.xmlFile = "XMLFile1.xml"; try { stringSender sndr = new stringSender("http://localhost:8080/THStrRcvr"); CommandEncoder cmdEnocoder = new CommandEncoder(cmd); sndr.PostMessage(cmdEnocoder.encode()); cmd.testAuthor = "me1"; cmdEnocoder = new CommandEncoder(cmd); sndr.PostMessage(cmdEnocoder.encode()); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } #endif }
void caseFileNotMatch(CommandData cmdData) { cmdData.from = "th"; cmdData.to = "client"; //then we send it to the client try { sndr = new stringSender(cmdData.url + "/CStrRcvr"); CommandEncoder cmdEnocoder = new CommandEncoder(cmdData); sndr.PostMessage(cmdEnocoder.encode()); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
void caseTest(CommandData cmdData) { cmdData.command = "Request File"; cmdData.from = url; cmdData.to = Repourl; //then we send it to the repository try { //string endpoint = "http://localhost:8080/IStringCommunicator"; sndr = new stringSender(RepoStrRcvr); CommandEncoder cmdEnocoder = new CommandEncoder(cmdData); sndr.PostMessage(cmdEnocoder.encode()); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }