//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");
        }
Exemple #2
0
        static void CallApm(object n)
        {
            Message msg = (Message)n;

            Console.Write("\nThreadname is:" + Thread.CurrentThread.ManagedThreadId + "-----Req 4\n");
            msg.showMsg();

            // stwr.WriteLine(msg.body);
            // stwr.Close();
            XmlCreator.TestRequest tr = msg.body.FromXml <XmlCreator.TestRequest>();

            if (tr != null)
            {
                foreach (XmlCreator.TestElement t in tr.tests)
                {
                    AppDomainManager1 apm             = new AppDomainManager1();
                    string            x               = apm.LoadTests(t, tr.author);
                    string            testreqfilename = msg.author + DateTime.Now.Month + DateTime.Now.Day + DateTime.Now.Year + ".log";
                    StreamWriter      stwr            = new StreamWriter("../../../ServerMemory/" + testreqfilename);
                    stwr.WriteLine(x);
                    msg.body = x;
                    stwr.Close();
                    string remoteEndPoint = null;
                    if (msg.author == "Client2")
                    {
                        remoteEndPoint = Comm <Server> .makeEndPoint("http://localhost", 8085);
                    }
                    else if (msg.author == "Client1")
                    {
                        remoteEndPoint = Comm <Server> .makeEndPoint("http://localhost", 8081);
                    }
                    Sender s = new Sender();
                    s.CreateSendChannel(msg.from);
                    msg.from = msg.to;
                    msg.to   = remoteEndPoint;
                    Console.Write("\n\nSending test results to Client ---req 8\n\n");
                    s.PostMessage(msg);
                    Console.Write("\n\nSending log file to repository----Req 8\n\n");
                    upload("../../../ServerMemory/" + testreqfilename);
                }
            }
        }