static void Main(string[] args) { Console.Title = "Test Harness"; Console.Write("\n start listening \n "); try { testHarness tHServer = new testHarness(); tHServer.OneNewMessage += tHServer.OnNewMessageHandler; tHServer.OneNewTRMessage += tHServer.OneNewTRMessageHandler; tHServer.recvr = new Receiver(); tHServer.recvr.start("http://localhost", tHServer.rcvrport); tHServer.rcvThrd = new Thread(new ThreadStart(tHServer.ThreadProc)); tHServer.rcvThrd.IsBackground = true; tHServer.rcvThrd.Start(); tHServer.THQueue = new testRequestHandler(); tHServer.TRThrd = new Thread(new ThreadStart(tHServer.ThreadProcforTR)); tHServer.TRThrd.IsBackground = true; tHServer.TRThrd.Start(); } catch (Exception ex) { Console.Write("\n\n The error reason in main() is {0}\n\n", ex.Message); } }
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 }