public override string CreateReport(ReportInfo RI, bool statusByGroupActivity) { base.RI = RI; string runSetName = "GingerRunSet"; string runGroupName = "GingerRunGroup"; List <BusinessFlowReport> BizFlows = RI.BusinessFlows; int passCount = 0, failedCount = 0, blockedCount = 0, totalCount = 0; if (BizFlows.Count == 0) { return("There are no " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlows) + " to create report"); } string reportHeader = @"<?xml version=""1.0"" encoding=""UTF-8""?>"; string reportGroups = @" <groups> <group name=""" + runGroupName + @""">"; string reportClasses = ""; string BFNames = ""; foreach (BusinessFlowReport BFR in BizFlows) { string BFResults = ""; BusinessFlow BF = (BusinessFlow)BFR.GetBusinessFlow(); totalCount = totalCount + BF.Activities.Count; reportClasses = reportClasses + @" <class name=""" + BF.Name + @".Ginger Business Flow"">"; if (!statusByGroupActivity) { BFResults = CraeteActivitiesStatusXml(BF, ref passCount, ref failedCount, ref blockedCount); } else { BFResults = CraeteGroupActivitiesStatusXml(BF, ref passCount, ref failedCount, ref blockedCount); } reportClasses = reportClasses + BFResults + @" </class>"; BFNames = BFNames + @" <method signature=""" + General.ConvertInvalidXMLCharacters(BF.Name) + @""" name=""" + General.ConvertInvalidXMLCharacters(BF.Name) + @""" class=""" + General.ConvertInvalidXMLCharacters(BF.Name) + ".Ginger Business Flow" + @"""/>"; } reportHeader = reportHeader + @" <testng-results blocked=""" + blockedCount + @""" failed=""" + failedCount + @""" total=""" + totalCount + @""" passed=""" + passCount + @""">"; reportHeader = reportHeader + @" <suite name=""" + General.ConvertInvalidXMLCharacters(runSetName) + @""">"; reportGroups = reportGroups + BFNames + @" </group> </groups>"; string xml = ""; xml = xml + reportHeader + reportGroups + @" <test name=""GingerTest"">" + reportClasses; xml = xml + @" </test> </suite> </testng-results> "; return(xml); }
private static List <ISpaceCraft> BuildBFRCrew(IMassiveBody planet, MissionConfig config, string craftDirectory) { var ship = new BFS(craftDirectory, planet.Position + new DVector2(0, -planet.SurfaceRadius), planet.Velocity + new DVector2(-400, 0), config.PayloadMass); var booster = new BFR(craftDirectory, DVector2.Zero, DVector2.Zero); ship.AddChild(booster); booster.SetParent(ship); return(new List <ISpaceCraft> { ship, booster }); }
public void ExamineFlight(ExaminerFlightRow cfr) { cfr.ForEachEvent((cfp) => { if (cfp.PropTypeID == (int)CustomPropertyType.KnownProperties.IDPropUASKnowledgeTest10773) { KnowledgeTest.AddRecentFlightEvents(cfr.dtFlight, 1); } if (cfp.PropTypeID == (int)CustomPropertyType.KnownProperties.IDPropUASTrainingCourse10774) { TrainingCourse.AddRecentFlightEvents(cfr.dtFlight, 1); } if (cfp.PropertyType.IsBFR && cfr.fIsRealAircraft) { BFR.AddRecentFlightEvents(cfr.dtFlight, 1); } }); }
public override void Execute(ReportInfo RI) { string result = string.Empty; ObservableList <BusinessFlow> bfs = new ObservableList <BusinessFlow>(); SetExportToALMConfig(); foreach (BusinessFlowReport BFR in RI.BusinessFlows) { bfs.Add((BusinessFlow)BFR.GetBusinessFlow()); } if (!RepositoryItemHelper.RepositoryItemFactory.ExportBusinessFlowsResultToALM(bfs, result, PublishToALMConfig)) { Errors = result; Status = eRunSetActionStatus.Failed; } else { Status = eRunSetActionStatus.Completed; } }
public override void Execute(ReportInfo RI) { string result = string.Empty; ObservableList <BusinessFlow> bfs = new ObservableList <BusinessFlow>(); SetExportToALMConfig(); foreach (BusinessFlowReport BFR in RI.BusinessFlows) { bfs.Add(BFR.GetBusinessFlow()); } if (!ALMIntegration.Instance.ExportBusinessFlowsResultToALM(bfs, ref result, PublishToALMConfig, ALMIntegration.eALMConnectType.Auto, false)) { Errors = result; Status = eRunSetActionStatus.Failed; } else { Status = eRunSetActionStatus.Completed; } }
private void onBFRChanged() { if (String.IsNullOrEmpty(this.tbWaistLine.Text)) { return; } decimal totalWeight; if (!Decimal.TryParse(this.tbTotalWeight.Text, out totalWeight)) { return; } decimal waistLine; if (!Decimal.TryParse(this.tbWaistLine.Text, out waistLine)) { return; } IScale4BFR scale; if (String.Equals(this.cbSex.SelectedItem, "男")) { scale = new Male(); } else if (String.Equals(this.cbSex.SelectedItem, "女")) { scale = new Female(); } else { return; } var bfr = new BFR(scale) { TotalWeight = totalWeight, WaistLine = waistLine }; this.tbBFR.Text = bfr.run().ToString(); }
public void Execute(IReportInfo RI) { string result = string.Empty; ObservableList <BusinessFlow> bfs = new ObservableList <BusinessFlow>(); SetExportToALMConfig(); // ALM Test Set Level: if "Run Set" convert Run Set to Business flow if (PublishToALMConfig.ALMTestSetLevel == eALMTestSetLevel.RunSet) { bfs.Add(ConvertRunSetToBF(RI)); // Export Type: if eExportType.EntitiesAndResults then export Business Flow to ALM. if (PublishToALMConfig.ExportType == eExportType.EntitiesAndResults) { if (bfs.Count > 0) { TargetFrameworkHelper.Helper.ExportVirtualBusinessFlowToALM(bfs[0], PublishToALMConfig, false, eALMConnectType.Silence, PublishToALMConfig.TestSetFolderDestination, PublishToALMConfig.TestCaseFolderDestination); } else { Reporter.ToLog(eLogLevel.WARN, "Export Business Flow to ALM failed while publish results to ALM"); } } } else { foreach (BusinessFlowReport BFR in ((ReportInfo)RI).BusinessFlows) { bfs.Add((BusinessFlow)BFR.GetBusinessFlow()); } } if (!TargetFrameworkHelper.Helper.ExportBusinessFlowsResultToALM(bfs, ref result, PublishToALMConfig)) { RunSetActionPublishToQC.Errors = result; RunSetActionPublishToQC.Status = eRunSetActionStatus.Failed; } else { RunSetActionPublishToQC.Status = eRunSetActionStatus.Completed; } }
public void ExamineFlight(ExaminerFlightRow cfr) { if (cfr == null) { throw new ArgumentNullException(nameof(cfr)); } cfr.FlightProps.ForEachEvent((cfp) => { if (cfp.PropTypeID == (int)CustomPropertyType.KnownProperties.IDPropUASKnowledgeTest10773) { KnowledgeTest.AddRecentFlightEvents(cfr.dtFlight, 1); } if (cfp.PropTypeID == (int)CustomPropertyType.KnownProperties.IDPropUASTrainingCourse10774) { TrainingCourse.AddRecentFlightEvents(cfr.dtFlight, 1); } if (cfp.PropertyType.IsBFR && cfr.fIsRealAircraft) { BFR.AddRecentFlightEvents(cfr.dtFlight, 1); } }); }
public override string CreateReport(ReportInfo RI, bool statusByGroupActivity, ObservableList <ActInputValue> DynamicParameters) { base.RI = RI; string runSetName = WorkSpace.Instance.RunsetExecutor.RunSetConfig.ItemName; string runGroupName = "GingerRunGroup"; string executionTime = RI.DateCreated; string environment = RI.ExecutionEnv; List <BusinessFlowReport> BizFlows = RI.BusinessFlows; int passCount = 0, failedCount = 0, blockedCount = 0, totalCount = 0; if (BizFlows.Count == 0) { return("There are no " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlows) + " to create report"); } string reportHeader = @"<?xml version=""1.0"" encoding=""UTF-8""?>"; string reportGroups = @" <groups> <group name=""" + runGroupName + @""">"; string reportClasses = ""; string BFNames = ""; foreach (BusinessFlowReport BFR in BizFlows) { string BFResults = ""; BusinessFlow BF = (BusinessFlow)BFR.GetBusinessFlow(); totalCount = totalCount + BF.Activities.Count; reportClasses = reportClasses + @" <class name=""" + BF.Name + @".Ginger Business Flow"">"; if (!statusByGroupActivity) { BFResults = CraeteActivitiesStatusXml(BF, ref passCount, ref failedCount, ref blockedCount); } else { BFResults = CraeteGroupActivitiesStatusXml(BF, ref passCount, ref failedCount, ref blockedCount); } reportClasses = reportClasses + BFResults + @" </class>"; BFNames = BFNames + @" <method signature=""" + General.ConvertInvalidXMLCharacters(BF.Name) + @""" name=""" + General.ConvertInvalidXMLCharacters(BF.Name) + @""" class=""" + General.ConvertInvalidXMLCharacters(BF.Name) + ".Ginger Business Flow" + @"""/>"; } reportHeader = reportHeader + @" <testng-results Runset=""" + runSetName + @""" ExecutionTime=""" + executionTime + @""" Environment=""" + environment + @""" blocked=""" + blockedCount + @""" failed=""" + failedCount + @""" total=""" + totalCount + @""" passed=""" + passCount + @""">"; if (DynamicParameters.Count > 0) { reportHeader = reportHeader + @" <dynamic-parameters>"; foreach (ActInputValue actInput in DynamicParameters) { reportHeader = reportHeader + @" <paramter name =""" + actInput.Param + @""" value=""" + actInput.ValueForDriver + @"""/>"; } reportHeader = reportHeader + @" </dynamic-parameters>"; } reportHeader = reportHeader + @" <suite name=""" + General.ConvertInvalidXMLCharacters(runSetName) + @""">"; reportGroups = reportGroups + BFNames + @" </group> </groups>"; string xml = ""; xml = xml + reportHeader + reportGroups + @" <test name=""GingerTest"">" + reportClasses; xml = xml + @" </test> </suite> </testng-results> "; return(xml); }