Пример #1
0
 public void Run(Object obj)
 {
     running = false;
     if (now)
     {
         StandardEngine engine = (StandardEngine)obj;
         engine.TellThreadGroupsToStop();
         Thread.Sleep(10 * engine.CountActiveThreads());
         Boolean stopped = engine.VerifyThreadsStopped();
         if (!stopped)
         {  // we totally failed to stop the test
             // TODO should we call test listeners? That might hang too ...
             log.Fatal(NetMeterUtils.getResString("stopping_test_failed"));
             if (SYSTEM_EXIT_ON_STOP_FAIL)
             { // default is true
                 log.Fatal("Exitting");
                 System.Console.WriteLine("Fatal error, could not stop test, exitting");
             }
             else
             {
                 System.Console.WriteLine("Fatal error, could not stop test");
             }
         } // else will be done by threadFinished()
     }
     else
     {
         engine.StopAllThreadGroups();
     }
 }