Message buildTestMessage(string author, string fromEndPoint, string toEndPoint) { Message msg = new Message(); msg.to = toEndPoint; msg.from = fromEndPoint; msg.author = author; testElement te1 = new testElement("test1"); te1.addDriver("testdriver.dll"); te1.addCode("testedcode.dll"); testElement te2 = new testElement("test2"); te2.addDriver("td1.dll"); te2.addCode("tc1.dll"); testElement te3 = new testElement("test3"); te3.addDriver("anothertestdriver.dll"); te3.addCode("anothertestedcode.dll"); testElement tlg = new testElement("loggerTest"); tlg.addDriver("logger.dll"); testRequest tr = new testRequest(); tr.author = "Jim Fawcett"; tr.tests.Add(te1); tr.tests.Add(te2); tr.tests.Add(te3); //tr.tests.Add(tlg); msg.body = tr.ToString(); return(msg); }
//public void getQuery() //{ // Console.Write("\n Results of client query for \"" + "test1" + "\""); // // if (repo_ == null) // // return; // List<string> files = repo_.queryLogs(queryText); // Console.Write("\n first 10 reponses to query \"" + queryText + "\""); // for (int i = 0; i < 10; ++i) // { // if (i == files.Count()) // break; // Console.Write("\n " + files[i]); // } // } public Message buildTestMessage(string FromUri, string ToUri) { Message msg = new Message(); msg.to = ToUri; msg.from = FromUri; msg.author = "Jashwanth"; testElement te1 = new testElement("test1"); te1.addDriver("testdriver.dll"); te1.addCode("testedcode.dll"); testElement te2 = new testElement("test2"); te2.addDriver("td1.dll"); te2.addCode("tc1.dll"); testElement te3 = new testElement("test3"); te3.addDriver("anothertestdriver.dll"); te3.addCode("anothertestedcode.dll"); testElement tlg = new testElement("loggerTest"); tlg.addDriver("logger.dll"); testRequest tr = new testRequest(); tr.author = "Jashwanth Reddy"; tr.tests.Add(te1); tr.tests.Add(te2); tr.tests.Add(te3); //tr.tests.Add(tlg); msg.body = tr.ToString(); return(msg); }
public Message buildTestMessage() { Message msg = new Message(); msg.to = "TH"; msg.from = "CL"; msg.author = "Manjunath"; testElement te1 = new testElement("test1"); te1.addDriver("anothertestdriver.dll"); te1.addCode("anothertestcode.dll"); testElement te2 = new testElement("test2"); te2.addDriver("td1.dll"); te2.addCode("tc1.dll"); testElement te3 = new testElement("test3"); te3.addDriver("testdriver.dll"); te3.addCode("testedcode.dll"); testElement tlg = new testElement("loggerTest"); tlg.addDriver("logger.dll"); testRequest tr = new testRequest(); tr.author = "Manjunath"; tr.tests.Add(te1); tr.tests.Add(te2); tr.tests.Add(te3); tr.tests.Add(tlg); msg.body = tr.ToString(); return(msg); }
//----< define receive thread processing >----------------------- public void rcvThreadProc() { Message msg = new Message(); while (true) { msg = comm.rcvr.GetMessage(); Console.Write("\n getting message on rcvThread {0}", Thread.CurrentThread.ManagedThreadId); if (msg.type == "TestRequest") { testRequest tr = msg.body.FromXml <testRequest>(); if (tr != null) { Console.Write( "\n {0}\n received message from: {1}\n{2}\n deserialized body:\n{3}", msg.to, msg.from, msg.body.shift(), tr.showThis() ); if (msg.body == "quit") { break; } } } else { Console.Write("\n {0}\n received message from: {1}\n{2}", msg.to, msg.from, msg.body.shift()); if (msg.body == "quit") { break; } } } Console.Write("\n receiver {0} shutting down\n", msg.to); }
Message buildTestMessage() { Message msg = new Message(); msg.to = "http://localhost:8080/ICommunicator"; msg.from = "http://localhost:8081/ICommunicator"; msg.author = "Fawcett"; msg.type = "TestRequest"; testElement te1 = new testElement("test1"); te1.addDriver("testdriver.dll"); te1.addCode("testedcode.dll"); testElement te2 = new testElement("test2"); te2.addDriver("td1.dll"); te2.addCode("tc1.dll"); testElement te3 = new testElement("test3"); te3.addDriver("anothertestdriver.dll"); te3.addCode("anothertestedcode.dll"); //testElement tlg = new testElement("loggerTest"); //tlg.addDriver("logger.dll"); testRequest tr = new testRequest(); tr.author = "Jim Fawcett"; tr.tests.Add(te1); tr.tests.Add(te2); tr.tests.Add(te3); //tr.tests.Add(tlg); msg.body = tr.ToString(); return(msg); }
/// <summary> /// build a TestRequest message with a given request /// </summary> public Message buildTestMessage(string name, testRequest tr) { Message msg = new Message(); msg.to = thUrl; msg.from = endPoint; msg.author = name; msg.type = "TestRequest"; msg.body = tr.ToString(); return(msg); }
/// <summary> /// build a demo test request for demo /// </summary> public testRequest buildDemoRequest2() { testRequest tr = new testRequest(); tr.author = "XIN"; testElement te1 = new testElement("ghostTest"); te1.addDriver("td1.dll"); te1.addCode("tc1.dll"); tr.tests.Add(te1); return(tr); }
static void Main(string[] args) { Console.Write("\n Testing Message Class"); Console.Write("\n =======================\n"); Message msg = new Message(); msg.to = "http://localhost:8080/ICommunicator"; msg.from = "http://localhost:8081/ICommunicator"; msg.to = "TH"; msg.from = "CL"; msg.author = "Manjunath"; msg.type = "TestRequest"; Console.Write("\n base message:\n {0}", msg.ToString()); msg.show(); Console.WriteLine(); Console.Write("\n Testing testRequest"); Console.Write("\n ---------------------"); testElement te1 = new testElement("test1"); te1.addDriver("td1.dll"); te1.addCode("tc1.dll"); te1.addCode("tc2.dll"); testElement te2 = new testElement("test2"); te2.addDriver("td2.dll"); te2.addCode("tc3.dll"); te2.addCode("tc4.dll"); testRequest tr = new testRequest(); tr.author = "Manjunath"; tr.tests.Add(te1); tr.tests.Add(te2); msg.body = tr.ToString(); Console.Write("\n TestRequest:"); msg.show(); Console.WriteLine(); Console.Write(msg.body.formatXml()); Console.Write("\n Testing Message.fromString(string)"); Console.Write("\n ------------------------------------"); Message parsed = msg.fromString(msg.ToString()); parsed.show(); }
static void Main(string[] args) { Console.Write("\n Testing Message with Serialized TestRequest"); Console.Write("\n ---------------------------------------------\n"); Message msg = new Message(); msg.to = "http://localhost:8080/ICommunicator"; msg.from = "http://localhost:8081/ICommunicator"; msg.author = "Fawcett"; msg.type = "TestRequest"; Console.Write("\n\n"); Console.Write("\n Testing testRequest"); Console.Write("\n ---------------------"); testElement te1 = new testElement("test1"); te1.addDriver("td1.dll"); te1.addCode("tc1.dll"); te1.addCode("tc2.dll"); testElement te2 = new testElement("test2"); te2.addDriver("td2.dll"); te2.addCode("tc3.dll"); te2.addCode("tc4.dll"); testRequest tr = new testRequest(); tr.author = "Jim Fawcett"; tr.tests.Add(te1); tr.tests.Add(te2); msg.body = tr.ToXml(); Console.Write("\n Serialized TestRequest:"); Console.Write("\n -------------------------\n"); Console.Write(msg.body.shift()); Console.Write("\n TestRequest Message:"); Console.Write("\n ----------------------"); msg.showMsg(); Console.Write("\n Testing Deserialized TestRequest"); Console.Write("\n ----------------------------------\n"); testRequest trDS = msg.body.FromXml <testRequest>(); Console.Write(trDS.showThis()); }
public static string makeTestRequest() { testElement te1 = new testElement("test1"); te1.addDriver("testdriver.dll"); te1.addCode("testedcode.dll"); testElement te2 = new testElement("test2"); te2.addDriver("td1.dll"); te2.addCode("tc1.dll"); testElement te3 = new testElement("test3"); te3.addDriver("anothertestdriver.dll"); te3.addCode("anothertestedcode.dll"); testElement tlg = new testElement("loggerTest"); tlg.addDriver("logger.dll"); testRequest tr = new testRequest(); tr.author = "Yuchang Chen"; tr.tests.Add(te1); tr.tests.Add(te2); tr.tests.Add(te3); return(tr.ToString()); //testElement te1 = new testElement("test1"); //te1.addDriver("testdriver.dll"); //te1.addCode("testedcode.dll"); //testElement te2 = new testElement("test2"); //te2.addDriver("td1.dll"); //te2.addCode("tc1.dll"); //testElement te3 = new testElement("test3"); //te3.addDriver("anothertestdriver.dll"); //te3.addCode("anothertestedcode.dll"); //testElement tlg = new testElement("loggerTest"); //tlg.addDriver("logger.dll"); //testRequest tr = new testRequest(); //tr.author = "Jim Fawcett"; //tr.tests.Add(te1); //tr.tests.Add(te2); //tr.tests.Add(te3); ////tr.tests.Add(tlg); //msg.body = tr.ToString(); //return msg; }
static void Main(string[] args) { Console.Write("\n Testing Message Class"); Console.Write("\n =======================\n"); Message msg = new Message(); msg.to = "TH"; msg.from = "CL"; msg.author = "Yuchang Chen"; Console.Write("\n base message:\n {0}", msg.ToString()); msg.show(); Console.WriteLine(); Console.Write("\n Testing testRequest"); Console.Write("\n ---------------------"); testElement te1 = new testElement("test1"); te1.addDriver("td1.dll"); te1.addCode("tc1.dll"); te1.addCode("tc2.dll"); testElement te2 = new testElement("test2"); te2.addDriver("td2.dll"); te2.addCode("tc3.dll"); te2.addCode("tc4.dll"); testRequest tr = new testRequest(); tr.author = "Jim Fawcett"; tr.tests.Add(te1); tr.tests.Add(te2); msg.body = tr.ToString(); Console.Write("\n TestRequest:"); msg.show(); Console.WriteLine(); Console.Write(msg.body.formatXml()); Console.Write("\n Testing Message.fromString(string)"); Console.Write("\n ------------------------------------"); Message parsed = msg.fromString(msg.ToString()); parsed.show(); }
//----< message creator >---------------------------------------- /* * This is a placeholder using types defined in CommChannelDemo.MessageTest * You need a more efficient mechanism for creating messages. * Here's a suggestion: * - create MessageBody class for each message body type. * - use serializer, as demoed in TestDeserializer, to generate the * body XML. * - On the other end deserialize, using the MessageBody type. */ public string makeTestRequest() { testElement te1 = new testElement("test1"); te1.addDriver("td1.dll"); te1.addCode("t1.dll"); te1.addCode("t2.dll"); testElement te2 = new testElement("test2"); te2.addDriver("td2.dll"); te2.addCode("tc3.dll"); te2.addCode("tc4.dll"); testRequest tr = new testRequest(); tr.author = "Jim Fawcett"; tr.tests.Add(te1); tr.tests.Add(te2); return(tr.ToXml()); }
static void Main(string[] args) { Message msg = new Message(); msg.to = "http://localhost:8080/ICommunicator"; msg.from = "http://localhost:8081/ICommunicator"; msg.author = "Manjunath"; testElement te1 = new testElement("test1"); testElement te2 = new testElement("test2"); testElement te3 = new testElement("test3"); testElement tlg = new testElement("loggerTest"); te2.addDriver("td1.dll"); te2.addCode("tc1.dll"); te1.addDriver("testdriver.dll"); te1.addCode("testedcode.dll"); te3.addDriver("anothertestdriver.dll"); te3.addCode("anothertestedcode.dll"); tlg.addDriver("logger.dll"); testRequest tr = new testRequest(); tr.author = "Manjunath"; tr.tests.Add(te1); tr.tests.Add(te2); tr.tests.Add(te3); tr.tests.Add(tlg); msg.body = tr.ToString(); Console.Write("\n Serialized TestRequest:"); Console.Write("\n -------------------------\n"); Console.Write(msg.body.shift()); Console.Write("\n TestRequest Message:"); Console.Write("\n ----------------------"); msg.showMsg(); Console.Write("\n Testing Deserialized TestRequest"); Console.Write("\n ----------------------------------\n"); TestRequest trDS = msg.body.FromXml <TestRequest>(); Console.Write(trDS.showThis()); }
public static Message getMsg() { Message msg = new Message(); testElement te1 = new testElement("test1"); te1.addDriver("TestDriver.dll"); te1.addCode("TestedCode.dll"); testElement te2 = new testElement("test2"); te2.addDriver("AnotherTestDriver.dll"); te2.addCode("AnotherTestedCode.dll"); testRequest tr = new testRequest(); tr.author = "Jim Fawcett"; tr.tests.Add(te1); tr.tests.Add(te2); msg.tr = tr; msg.body = tr.ToString(); return(msg); }
/// <summary> /// build a demo test request for demo /// </summary> public testRequest buildDemoRequest() { testRequest tr = new testRequest(); tr.author = "XIN"; testElement te1 = new testElement("test1"); te1.addDriver("testdriver.dll"); te1.addCode("testedcode.dll"); testElement te2 = new testElement("test2"); te2.addDriver("testdriver.dll"); te2.addCode("testedcode.dll"); testElement te3 = new testElement("test3"); te3.addDriver("anothertestdriver.dll"); te3.addCode("anothertestedcode.dll"); tr.tests.Add(te1); tr.tests.Add(te2); tr.tests.Add(te3); return(tr); }