//----< load assemblies from testersLocation and run their tests >-----

        string loadAndExerciseTesters()
        {
            AppDomain currentDomain = AppDomain.CurrentDomain;

            currentDomain.AssemblyResolve += new ResolveEventHandler(LoadFromComponentLibFolder);
            try
            {
                TestHarness loader = new TestHarness();
                // load each assembly found in testersLocation
                string[] files = Directory.GetFiles(testersLocation, "*.dll");
                if (files.Count() > 0)
                {
                    foreach (string file in files)
                    {
                        Assembly asm      = Assembly.Load(File.ReadAllBytes(file));
                        string   fileName = Path.GetFileName(file);
                        Console.Write("\n  loaded {0}", fileName);
                        notifyclient("Loaded " + fileName);
                        Type[] types = asm.GetTypes();
                        foreach (Type t in types)
                        {
                            if (t.GetInterface("Test.IDriver", true) != null)
                            {
                                if (!loader.runSimulatedTest(t, asm))
                                {
                                    Console.Write("\n  test {0} failed to run", t.ToString());
                                    notifyclient("Test " + t.ToString() + "failed to run");
                                }
                            }
                        }
                    }
                }
                else
                {
                    Console.WriteLine("\nNo test libraries generated for testing\n");
                }
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
            return("Simulated Testing completed");
        }
        // start testing first dll
        static void processlisten()
        {
            TestHarness loader = new TestHarness();

            while (true)
            {
                if (isDllReceived)
                {
                    isHarnessAvailable          = false;
                    TestHarness.testersLocation = Path.GetFullPath(TestHarness.testersLocation);
                    Console.Write("\n  Loading Test Modules from:\n    {0}\n", TestHarness.testersLocation);
                    // run load and tests
                    string result = loader.loadAndExerciseTesters();
                    if (result.Equals("Simulated Testing completed"))
                    {
                        sendTestlog();
                    }
                    isDllReceived = false;
                }
                Thread.Sleep(1000);
            }
        }
        static void Main(string[] args)
        {
            Console.Title           = "TestHarness";
            Console.BackgroundColor = ConsoleColor.White;
            Console.ForegroundColor = ConsoleColor.DarkBlue;
            Thread listenTrd  = null;
            Thread PlistenTrd = null;

            Console.Write("\n  Demonstrating Robust Test Loader");
            Console.Write("\n ==================================\n");

            TestHarness loader = new TestHarness();

            comm      = new Comm("http://localhost", 8077);
            listenTrd = new Thread(listen);
            listenTrd.Start();
            PlistenTrd = new Thread(processlisten);
            PlistenTrd.IsBackground = true;
            PlistenTrd.Start();
            TestTrd = new Thread(allocateprocess);
            TestTrd.Start();
            TestHarness.testersLocation = Path.GetFullPath(TestHarness.testersLocation);
        }