/// <summary>
 /// Default constructor which constructs and starts the life time thread.
 /// </summary>
 public IotServiceController(TestSuiteState testSuiteState)
 {
     this.startTime             = DateTime.Now;
     this.testSuiteState        = testSuiteState;
     this.testAssessor          = new ServiceTestAssessor(testSuiteState);
     this.lifetimeControlThread = new Thread(new ThreadStart(Process));
     this.lifetimeControlThread.Start();
 }
示例#2
0
        public TestSuiteView()
        {
            State = new TestSuiteState();
            TestCasesPresenter = new TestCasesPresenter(new RenameVariableWindow(), new FilterWindow(), new ConnectionStringWindow(), new TestCaseCollectionManager(), State.TestCases, State.Variables, State.ConnectionStringNames);
            TemplatePresenter  = new TemplatePresenter(new TemplateManager(), State.Template);
            SettingsPresenter  = new SettingsPresenter(new SettingsManager(), State.Settings);
            TestListPresenter  = new TestListPresenter(new TestListManager(), State.Tests, State.TestCases, State.Variables, State.Template, State.GlobalVariables);
            TestSuitePresenter = new TestSuitePresenter(new TestSuiteManager(), State.Tests, State.Settings);
            MacroPresenter     = new MacroPresenter();

            InitializeComponent();
            DeclareBindings();
            BindPresenter();
        }
 /// <summary>
 /// Returns service controller or null if it is already reserved.
 /// Service controller is automatically released when test time ends.
 /// </summary>
 /// <param name="testSuiteState">Test suite state of the session reserving the controller.</param>
 /// <returns></returns>
 public static IotServiceController ReserveServiceController(TestSuiteState testSuiteState)
 {
     lock (threadLock)
     {
         if (serviceController != null)
         {
             // Service controller is already existing and reserved by someone else.
             return(null);
         }
         else
         {
             serviceController = new IotServiceController(testSuiteState);
             return(serviceController);
         }
     }
 }
        protected override void Render(HtmlTextWriter writer)
        {
            base.Render(writer);

            TestSuiteState suiteState = IotContext.TestSuiteState;

            writer.WriteLine("<table class=\"grid\">");

            writer.WriteLine("<tr><th></th><th>Test Name</th><th>Error Message</th></tr>");

            foreach (IOT.Model.TestState testState in suiteState.GetTestStates(TestCategory.CandidateClientToReferenceServer))
            {
                WriteResultRow(writer, testState);
            }

            writer.WriteLine("</table>");
        }
示例#5
0
        private void WriteResultRow(HtmlTextWriter writer, TestSuiteState suiteState, TestCategory category)
        {
            int passedCount  = suiteState.GetCategoryPassedCount(category);
            int failedCount  = suiteState.GetCategoryFailedCount(category);
            int testCount    = suiteState.GetCategoryTestCount(category);
            int missingCount = testCount - passedCount - failedCount;

            writer.WriteLine("<tr>");
            writer.WriteLine("<td>" + category + "</td>");

            writer.WriteLine("<td>");
            writer.WriteLine(passedCount);
            writer.WriteLine("</td>");

            writer.WriteLine("<td>");
            writer.WriteLine(failedCount);
            writer.WriteLine("</td>");

            writer.WriteLine("<td>");
            writer.WriteLine(missingCount);
            writer.WriteLine("</td>");

            writer.WriteLine("<td>");
            writer.WriteLine(testCount);
            writer.WriteLine("</td>");


            writer.WriteLine("<td>");
            if (testCount == missingCount)
            {
                writer.WriteLine("<img src=\"Images/missing.png\" />");
            }
            else if (passedCount == testCount)
            {
                writer.WriteLine("<img src=\"Images/passed.png\" />");
            }
            else
            {
                writer.WriteLine("<img src=\"Images/failed.png\" />");
            }
            writer.WriteLine("</td>");
            writer.WriteLine("</tr>");
        }
示例#6
0
        protected override void Render(HtmlTextWriter writer)
        {
            base.Render(writer);

            TestSuiteState suiteState = IotContext.TestSuiteState;

            writer.WriteLine("<table class=\"grid\">");

            writer.WriteLine("<tr><th>Test Category</th>");
            writer.WriteLine("<th><div title=\"Passed \"><u>P</u></div></th>");
            writer.WriteLine("<th><div title=\"Failed\"><u>F</u></div></th>");
            writer.WriteLine("<th><div title=\"Missing\"><u>M</u></div></th>");
            writer.WriteLine("<th><div title=\"Total\"><u>T</u></div></th>");
            writer.WriteLine("<th></th></tr>");

            WriteResultRow(writer, suiteState, TestCategory.MessageSerialization);
            WriteResultRow(writer, suiteState, TestCategory.CandidateClientToReferenceServer);
            WriteResultRow(writer, suiteState, TestCategory.ReferenceClientToCandidateServer);
            WriteResultRow(writer, suiteState, TestCategory.CandidateServerToReferenceServer);
            WriteResultRow(writer, suiteState, TestCategory.ReferenceServerToCandidateServer);

            writer.WriteLine("</table>");
        }
示例#7
0
 public ServiceTestAssessor(TestSuiteState testSuiteState)
 {
     this.testSuiteState = testSuiteState;
 }