Esempio n. 1
0
        public void QListner(object sender, RoutedEventArgs e)
        {
            Console.WriteLine("Inside QueryListner button");
            ClientWPF c2 = new ClientWPF();

            repochannel = "http://localhost:8080/ClientIService" + count++;
            string Repostr = "http://localhost:8080/RepoIService";

            c2.CreateClientRecvChannel(repochannel);
            string queryToBeQueried = RemotePortTextBox.Text;

            c2.makeQuery(queryToBeQueried, repochannel, Repostr);
        }
Esempio n. 2
0
        public void BuildMessage(string messagebody)
        {
            Console.WriteLine("The Message submitted to TestHarness is: ");
            Console.WriteLine(XMLMessage);

            ClientWPF cl1     = new ClientWPF();
            string    Repostr = "http://localhost:8080/RepoIService";



            Message msg = new Message();

            msg.body = messagebody;

            Console.WriteLine("The Message body which is being sent to TestHarness: ");
            Console.WriteLine(msg.body);
            string frommessage = "http://localhost:8080/ClientIService" + count++;

            //count++;
            msg.author = "Jashwanth";
            msg.to     = "TH";
            msg.from   = frommessage;
            cl1.CreateClientRecvChannel(msg.from);

            /* Send all the code to be tested to the Repository */
            string filepath = System.IO.Path.GetFullPath(cl1.ToSendPath);

            Console.WriteLine("\n  retrieving files from\n {0}\n", filepath);
            string[] files = Directory.GetFiles(filepath);
            hrt.Start();
            foreach (string file in files)
            {
                string filename = System.IO.Path.GetFileName(file);
                Console.WriteLine("\nfile retrieved is {0} \n", filename);
                cl1.uploadFile(filename, Repostr);
            }
            /* this sleep ensures that client copies code before  sending the request*/
            Thread.Sleep(10000);
            cl1.sendTestRequest(msg);
            hrt.Stop();
            ulong  time        = hrt.ElapsedMicroseconds;
            double millisecond = time / 1000.0;

            TimerTextBox.Text = millisecond.ToString() + "ms";
            string timetaken = "Total time to get the response in milli seconds is " + millisecond.ToString() + " - Req 12";

            timetaken.title();
            Thread.Sleep(20000);
        }