Пример #1
0
        public void Start()
        {
            NTrace.Info("Starting");
            this.channel = ServerUtilities.GetTcpChannel();
            NTrace.Debug("Acquired Tcp Channel");

            try
            {
                this.agency = (TestAgency)Activator.GetObject(typeof(TestAgency), agencyUrl);
                NTrace.DebugFormat("Connected to TestAgency at {0}", agencyUrl);
            }
            catch (Exception ex)
            {
                NTrace.ErrorFormat("Unable to connect to test agency at {0}", agencyUrl);
                NTrace.Error(ex.Message);
            }

            try
            {
                this.agency.Register(this, ProcessId);
                NTrace.Debug("Registered with TestAgency");
            }
            catch (Exception ex)
            {
                NTrace.Error("Failed to register with TestAgency", ex);
            }
        }
        public void Register(string path)
        {
            try
            {
                AssemblyName assemblyName = new AssemblyName();
                assemblyName.Name     = Path.GetFileNameWithoutExtension(path);
                assemblyName.CodeBase = path;
                Assembly assembly = Assembly.Load(assemblyName);
                NTrace.Debug("Loaded " + Path.GetFileName(path));

                foreach (Type type in assembly.GetExportedTypes())
                {
                    if (type.GetCustomAttributes(typeof(NUnitAddinAttribute), false).Length == 1)
                    {
                        Addin addin = new Addin(type);
                        addinRegistry.Register(addin);
                        NTrace.Debug("Registered addin: " + addin.Name);
                    }
                }
            }
            catch (Exception ex)
            {
                // NOTE: Since the gui isn't loaded at this point,
                // the trace output will only show up in Visual Studio
                NTrace.Error("Failed to load" + path, ex);
            }
        }
Пример #3
0
        private void UpdateTabPages()
        {
            errorsTabMenuItem.Checked = settings.GetSetting("Gui.ResultTabs.DisplayErrorsTab", true);
            notRunTabMenuItem.Checked = settings.GetSetting("Gui.ResultTabs.DisplayNotRunTab", true);

            NTrace.Debug("Updating tab pages");
            updating = true;

            tabControl.TabPages.Clear();

            if (errorsTabMenuItem.Checked)
            {
                tabControl.TabPages.Add(errorTab);
            }
            if (notRunTabMenuItem.Checked)
            {
                tabControl.TabPages.Add(notRunTab);
            }

            displayController.UpdatePages();

            tabControl.SelectedIndex = settings.GetSetting("Gui.ResultTabs.SelectedTab", 0);

            updating = false;
        }
Пример #4
0
 public void DestroyRunner()
 {
     NTrace.Debug("Destroying ProcessRunner");
     if (myRunner != null)
     {
         myRunner.Dispose();
     }
 }
        public void ReleaseAgent(TestAgent agent)
        {
            AgentRecord r = agentData[agent.Id];

            if (r == null)
            {
                NTrace.Error(string.Format("Unable to release agent {0} - not in database", agent.Id));
            }
            else
            {
                r.Status = AgentStatus.Ready;
                NTrace.Debug("Releasing agent " + agent.Id.ToString());
            }
        }
Пример #6
0
 public void AddService(IService service)
 {
     services.Add(service);
     NTrace.Debug("Added " + service.GetType().Name);
 }
Пример #7
0
 protected override TestRunner CreateRunner(int runnerID)
 {
     myRunner = new ProcessRunner(runnerID);
     NTrace.Debug("Creating ProcessRunner");
     return(myRunner);
 }