//stub static void main(string[] args) { TestElement te = new TestElement(); te.addCode("abc.dll"); te.addDriver("xyz.dll"); AppDomainManager1 a = new AppDomainManager1(); a.LoadTests(te, "dummyauthor"); }
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 = "Fawcett"; msg.type = "TestRequest"; Console.Write("\n Testing Message with Serialized TestRequest"); Console.Write("\n ---------------------------------------------\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 string LoadTests(TestElement te, string author) { try { string filp = Path.GetDirectoryName("../../../ServerMemory/" + te.testDriver.ToString()); AppDomainSetup domaininfo = new AppDomainSetup(); domaininfo.ApplicationBase = "file:///" + System.Environment.CurrentDirectory; Evidence e = AppDomain.CurrentDomain.Evidence; AppDomain ad = AppDomain.CreateDomain(te.testDriver.ToString()); ad.Load(Path.GetFileNameWithoutExtension(filp + "/" + te.testDriver.ToString())); showAssemblies(ad); ObjectHandle oh = ad.CreateInstance(Path.GetFileNameWithoutExtension(filp + "/" + te.testDriver.ToString()), tnc); object ob = oh.Unwrap(); CommChannel.ITest h = (CommChannel.ITest)ob; // string newlogpath = pathdir + "\\log.log"; // h.logfilepath(newlogpath); h.test(); string l = h.showlog(); Console.Write(l); Console.Write("\n\n Getting Log file from Location\n\n"); Console.Write("\n\n\n"); Console.Write("\nunloading domain :" + ad.FriendlyName); AppDomain.Unload(ad); Console.Write("\ncurrent domain:" + AppDomain.CurrentDomain.FriendlyName); Console.Write("\n\n\n"); return(l); } catch (Exception ex) { Console.Write(ex); return("error"); } }