static void Main(string[] args)
        {
            RLog.attach(RLog.makeConsoleStream());
            RLog.start();
            DLog.attach(DLog.makeConsoleStream());
            DLog.start();
            RLog.write("\n  Demonstrating TestHarness - Project #4");
            RLog.write("\n ========================================");
            TestExec te   = new TestExec();
            Message  msg_ = te.comm.rcvr.GetMessage();
            Message  msg  = te.buildTestMessage();

            te.testHarness.processMessages(msg_);
            te.comm.sndr.PostMessage(msg_);
            ServiceHost Shost = CreateChannel("http://localhost:8080/FileService1");

            Shost.Open();
            Console.Write("\n  Press key to terminate service:\n");
            Shost.Close();
            Console.Write("\n Requirement #9 ");
            te.client.makeQuery("test1");
            DLog.flush();
            RLog.flush();
            Console.Write("\n  press key to exit");
            Console.ReadKey();
            DLog.stop();
            RLog.stop();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            try
            {
                Console.Write("\n  Demonstrating TestHarness - Project #2 with Threading");
                Console.Write("\n =======================================================");

                TestExec te  = new TestExec();
                Message  msg = te.buildTestMessage();
                Console.Write("\nCreated message: \n {0}", msg.ToString());
                te.sendTestRequest(msg);
                te.sendTestRequest(msg);
                msg      = msg.copy();
                msg.body = "quit";
                te.sendTestRequest(msg);
                te.testHarness.processMessages();
                te.testHarness.wait();
                te.client.makeQuery("test1");
                Console.Write("\n\n");
            }
            catch (Exception ex)
            {
                Console.Write("\n\n  {0}\n\n", ex.Message);
            }
        }