コード例 #1
0
        //----< demonstrate Test Harness Prototype >---------------------

        static void Main(string[] args)
        {
            Console.WriteLine("============================this is the testharness====================");
            Console.WriteLine("\nthe testharness can load and test the libraries, meet the requirement 9");
            Receiver testreceiver = new Receiver();

            testreceiver.CreateHost("http://localhost:3000");
            while (true)
            {
                try
                {
                    CommMessage msg = testreceiver.GetMessage();
                    Console.WriteLine("\n=================start new test========================");
                    Console.WriteLine("\nreceive test request from the child builder");
                    Console.WriteLine("\nthe library need to be test is:{0}", msg.Body);
                    Tester tstr = new Tester();
                    Thread t    = tstr.SelectConfigAndRun("TestLibraries", msg.Body);
                    Console.WriteLine();
                    t.Join();
                    Sender logsender = new Sender();
                    logsender.CreateChannel("http://localhost:2017");
                    logsender.postFile(msg.Body + "testlog.txt", TestharnessEnvironment.testlogpath, 1024, RepoEnvironment.testlogpath);//send log to the repository
                    tstr.ShowTestResults();
                    tstr.UnloadTestDomain();
                }
                catch
                {
                    continue;
                }
            }
        }
コード例 #2
0
        //----< demonstrate Test Harness Prototype >---------------------

        static void Main(string[] args)
        {
            Console.Write(
                "\n  Tester, ver 1.1 - Demonstrates Prototype TestHarness"
                );
            Console.Write(
                "\n ======================================================"
                );
            Tester tstr = new Tester();
            Thread t    = tstr.SelectConfigAndRun("TestLibraries");

            t.Join();
            tstr.ShowTestResults();
            tstr.UnloadTestDomain();
//      Console.ReadLine();
        }
コード例 #3
0
 void OneNewTRMessageHandler(CommMessage msg)
 {
     try
     {
         Tester tst = new Tester();
         Thread t   = tst.SelectConfigAndRun(THStorage);
         t.Join();
         tst.ShowTestResults();
         tst.UnloadTestDomain();
         string output = tst.results_;
         sendToRepo(output, msg.command);
         DelectDir(THStorage);
         Console.WriteLine("\n");
         Console.Write(output);
     }
     catch (Exception ex)
     {
         Console.Write("\n\n The error reason in OnNewTRMessageHandler is {0}\n\n", ex.Message);
     }
 }