public override Document BuildDocument() { Document retVal = new Document { Info = { Title = "EFS Subset-076 Findings report", Author = "ERTMS Solutions", Subject = "Subset-076 findings report" } }; // Apply translation rule to get the spec issues from the translated steps MarkingHistory.PerformMark(() => { foreach (Frame frame in Dictionary.Tests) { frame.Translate(); } }); // Fill the report Report = new Subseet76Report(retVal); Report.AddSubParagraph("Subset-076 Analysis report"); CreateIntroduction(); CreateTestSequenceReport(); CreateFindingsReport(); Report.CloseSubParagraph(); return(retVal); }
/// <summary> /// Executes the tests in the background thread /// </summary> public override void ExecuteWork() { if (Window != null) { SynchronizerList.SuspendSynchronization(); MarkingHistory.PerformMark(() => { SubSequence subSequence = TestCase.Enclosing as SubSequence; if (subSequence != null && TestCase.Steps.Count > 0) { Step step = null; bool found = false; foreach (TestCase current in subSequence.TestCases) { if (found && current.Steps.Count > 0) { step = (Step)current.Steps[0]; break; } found = (current == TestCase); } Runner runner = Window.GetRunner(subSequence); runner.RunUntilStep(step); } }); SynchronizerList.ResumeSynchronization(); } }
/// <summary> /// Perform the work as a background task /// </summary> public override void ExecuteWork() { MarkingHistory.PerformMark(() => { FinderRepository.INSTANCE.ClearCache(); Frame.Translate(); }); RefreshModel.Execute(); }
/// <summary> /// Translates the corresponding test case, according to translation rules /// </summary> /// <param name="sender"></param> /// <param name="args"></param> public void TranslateHandler(object sender, EventArgs args) { MarkingHistory.PerformMark(() => { FinderRepository.INSTANCE.ClearCache(); Item.Translate(true); }); RefreshModel.Execute(); }
/// <summary> /// Checks for dead model /// </summary> public override void ExecuteWork() { MarkingHistory.PerformMark(() => { foreach (Dictionary dictionary in EfsSystem.Instance.Dictionaries) { dictionary.CheckDeadModel(); } }); }
/// <summary> /// Marks the model according to the version changes /// </summary> public void MarkVersionChanges(Dictionary dictionary) { MarkingHistory.PerformMark(() => { foreach (Diff diff in Changes) { diff.markModel(); } }); }
/// <summary> /// Marks all steps that use this translation /// </summary> /// <param name="sender"></param> /// <param name="args"></param> public void MarkUsageHandler(object sender, EventArgs args) { MarkingHistory.PerformMark(() => { MarkUsageVisitor finder = new MarkUsageVisitor(Item); foreach (Dictionary dictionary in EfsSystem.Instance.Dictionaries) { finder.visit(dictionary); } }); }
/// <summary> /// Executes the tests in the background thread /// </summary> public override void ExecuteWork() { if (Window != null) { MarkingHistory.PerformMark(() => { Window.SetSubSequence(SubSequence); EfsSystem.Instance.Runner = new Runner(SubSequence, true, true, Settings.Default.CheckForCompatibleChanges); EfsSystem.Instance.Runner.RunUntilStep(null); }); } }
/// <summary> /// Perform the work as a background task /// </summary> public override void ExecuteWork() { MarkingHistory.PerformMark(() => { FinderRepository.INSTANCE.ClearCache(); foreach (Frame frame in Dictionary.Tests) { frame.Translate(); } }); RefreshModel.Execute(); }
/// <summary> /// Executes the work in the background task /// </summary> public override void ExecuteWork() { SynchronizerList.SuspendSynchronization(); if (Window != null) { Window.SetFrame(Frame); MarkingHistory.PerformMark(() => { try { // Compile everything Frame.EFSSystem.Compiler.Compile_Synchronous(Frame.EFSSystem.ShouldRebuild); Frame.EFSSystem.ShouldRebuild = false; Failed = 0; ArrayList subSequences = Frame.SubSequences; subSequences.Sort(); foreach (SubSequence subSequence in subSequences) { if (subSequence.getCompleted()) { Dialog.UpdateMessage("Executing " + subSequence.Name); const bool explain = false; const bool ensureCompiled = false; Frame.EFSSystem.Runner = new Runner(subSequence, explain, ensureCompiled, Settings.Default.CheckForCompatibleChanges); int testCasesFailed = subSequence.ExecuteAllTestCases(Frame.EFSSystem.Runner); if (testCasesFailed > 0) { subSequence.AddError("Execution failed"); Failed += 1; } } else { subSequence.AddWarning( "Sub sequence not executed because it is not marked as completed"); } } } finally { Frame.EFSSystem.Runner = null; } }); } SynchronizerList.ResumeSynchronization(); }
/// <summary> /// Checks the node /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Check(object sender, EventArgs e) { MarkingHistory.PerformMark(() => { ModelElement modelElement = Model as ModelElement; if (modelElement != null) { RuleCheckerVisitor visitor = new RuleCheckerVisitor(modelElement.Dictionary); visitor.visit(modelElement, true); } }); }
/// <summary> /// Handles a run event on this step /// </summary> /// <param name="sender"></param> /// <param name="args"></param> public void RunHandler(object sender, EventArgs args) { CheckRunner(); Window window = BaseForm as Window; if (window != null) { MarkingHistory.PerformMark(() => { ExecuteTestsHandler executeTestHandler = new ExecuteTestsHandler(window, Item, false); executeTestHandler.ExecuteUsingProgressDialog(GuiUtils.MdiWindow, "Executing test steps"); EfsSystem.Instance.Context.HandleEndOfCycle(); }); window.tabControl1.SelectedTab = window.testExecutionTabPage; } }
/// <summary> /// Searches for all occurences of the search string /// </summary> /// <param name="searchString"></param> private void SearchOccurences(string searchString) { MarkingHistory.PerformMark(() => { List <ModelElement> occurences = new List <ModelElement>(); foreach (Dictionary dictionary in EfsSystem.Instance.Dictionaries) { Comparer.searchDictionary(dictionary, searchString, occurences); } foreach (ModelElement element in occurences) { element.AddInfo("Found " + searchString); } if (occurences.Count == 0) { MessageBox.Show("Cannot find " + searchString, "Search complete", MessageBoxButtons.OK, MessageBoxIcon.Information); } }); Close(); }