/// <summary> /// Default constructor - initializes all fields to default values /// </summary> public RunPipeResultEventArgs(RunPipe pipe, ReportRun result) : base(pipe) { if (result==null) throw new ArgumentNullException("result"); this.result = result; }
public virtual void VisitRun(ReportRun run) { foreach(ReportInvoker invoker in run.Invokers) this.VisitInvoker(invoker); if (run.Exception!=null) this.VisitException(run.Exception); }
public ReportRunEventArgs(ReportRun run) { if (run == null) { throw new ArgumentNullException("run"); } this.run = run; }
public virtual void VisitRun(ReportRun run) { foreach (ReportInvoker invoker in run.Invokers) { this.VisitInvoker(invoker); } if (run.Exception != null) { this.VisitException(run.Exception); } }
public static ReportRun Skip(RunPipe pipe, Exception ex) { ReportRun run = new ReportRun(); run.Result = ReportRunResult.Skip; run.Name = pipe.Name; run.Duration = 0; run.Memory = 0; run.AssertCount = MbUnit.Framework.Assert.AssertCount; run.Exception = ReportException.FromException(ex); MbUnit.Framework.Assert.FlushWarnings(run); return(run); }
public static ReportRun Success(RunPipe pipe, ReportMonitor monitor) { ReportRun run = new ReportRun(); run.ConsoleOut = monitor.Consoler.Out; run.ConsoleError = monitor.Consoler.Error; run.Result = ReportRunResult.Success; run.Name = pipe.Name; run.AssertCount = MbUnit.Framework.Assert.AssertCount; run.Duration = monitor.Timer.Duration; run.Memory = monitor.Memorizer.Usage; MbUnit.Framework.Assert.FlushWarnings(run); return run; }
public static ReportRun Ignore(RunPipe pipe, ReportMonitor monitor) { ReportRun run = new ReportRun(); run.ConsoleOut = monitor.Consoler.Out; run.ConsoleError = monitor.Consoler.Error; run.Result = ReportRunResult.Ignore; run.Name = pipe.Name; run.AssertCount = MbUnit.Framework.Assert.AssertCount; run.Duration = monitor.Timer.Duration; run.Memory = monitor.Memorizer.Usage; MbUnit.Framework.Assert.FlushWarnings(run); return(run); }
public static ReportRun Failure(RunPipe pipe, ReportMonitor monitor, Exception ex) { ReportRun run = new ReportRun(); run.ConsoleOut = monitor.Consoler.Out; run.ConsoleError = monitor.Consoler.Error; run.Result = ReportRunResult.Failure; run.Name = pipe.Name; run.AssertCount = MbUnit.Framework.Assert.AssertCount; run.Duration = monitor.Timer.Duration; run.Memory = monitor.Memorizer.Usage; run.Exception = ReportException.FromException(ex); MbUnit.Framework.Assert.FlushWarnings(run); return run; }
public void Failure(RunPipe pipe, ReportRun result) { this.OnChanged(pipe.Identifier,TestState.Failure); }
internal static void FlushWarnings(ReportRun run) { if (run != null) { foreach (ReportWarning warning in warnings) run.Warnings.AddReportWarning(warning); } warnings.Clear(); }
void IRunPipeListener.Skip(RunPipe pipe, ReportRun result) { ReportFixture fixture = AddFixture(pipe.Fixture); fixture.Runs.AddReportRun(result); }
public void Ignore(RunPipe pipe, ReportRun result) { Writer.WriteLine("[ignored] {0}", pipe.Name); }
public void Run(Object fixture) { if (fixture == null) throw new ArgumentNullException("fixture"); // create arguments... ArrayList args = new ArrayList(); this.abortPending = false; this.monitor.Start(); this.Start(); Exception testException = null; foreach (RunInvokerVertex v in pipe.Invokers) { if (!v.HasInvoker) continue; // if exception has already been throwed, execute non test only if (testException != null) { if (!v.Invoker.Generator.IsTest) { // we execute tear down code and drop exceptions try { v.Invoker.Execute(fixture, args); } catch (Exception) { } } } else { try { if (this.IsAbortPending) continue; v.Invoker.Execute(fixture, args); } catch (Exception ex) { testException = ex; } } } this.monitor.Stop(); // success if (testException == null) { this.result = ReportRun.Success(this.pipe,this.monitor); this.Success(); } else { // get rid of TargetInvocationException if (testException.GetType() == typeof(TargetInvocationException)) testException = testException.InnerException; // check if ignoreexception if (testException is IgnoreRunException) { this.result = ReportRun.Ignore(this.pipe,this.monitor); this.Ignore(); } // failure else { this.result = ReportRun.Failure(this.pipe,this.monitor,testException); this.Failure(); } } }
void TestEngineFailure(ReportRun run) { this.failureCount++; TestResult summary = new TestResult(); summary.State = TDF.TestState.Failed; summary.TotalTests = this.testCount; summary.Name = run.Name; summary.TimeSpan = new TimeSpan(0, 0, 0, 0, (int)(run.Duration * 1000)); if (run.Exception != null) { ReportException ex = run.Exception; summary.Message = run.Exception.Message; summary.StackTrace = ex.ToString(); } testListener.WriteLine(String.Format("[failure] {0}", run.Name), Category.Info); this.testListener.TestFinished(summary); }
public void ClearResult() { this.result = null; this.abortPending = false; }
public void Skip(RunPipe pipe, ReportRun result) { }
public void Failure(RunPipe pipe, ReportRun result) { Writer.WriteLine("[failure] {0}: {1}", pipe.Name, result.Exception.Message); }
public override void VisitRun(ReportRun run) { this.explorer.runByNames[run.Name] = run; base.VisitRun(run); }
public override void VisitRun(ReportRun run) { this.explorer.runByNames[run.Name]=run; base.VisitRun(run); }
public ReportRunEventArgs(ReportRun run) { if (run == null) throw new ArgumentNullException("run"); this.run = run; }
public void Ignore(RunPipe pipe, ReportRun result) { this.OnChanged(pipe.Identifier,TestState.Ignored); }
void TestEngineIgnore(ReportRun run) { this.ignoreCount++; TestResult summary = new TestResult(); summary.State = TDF.TestState.Ignored; summary.TotalTests = this.testCount; summary.Name = run.Name; summary.TimeSpan = new TimeSpan(0, 0, 0, 0, (int)(run.Duration * 1000)); testListener.WriteLine(String.Format("[ignored] {0}", run.Name), Category.Info); this.testListener.TestFinished(summary); }
public void Skip(RunPipe pipe, ReportRun result) { this.OnChanged(pipe.Identifier, TestState.Skip); }
void IRunPipeListener.Success(RunPipe pipe, ReportRun result) { ReportFixture fixture = AddFixture(pipe.Fixture); fixture.Runs.AddReportRun(result); }
public void Fail(ReportMonitor monitor,Exception ex) { if (monitor == null) throw new ArgumentNullException("monitor"); if (ex == null) throw new ArgumentNullException("ex"); this.Start(); this.result = ReportRun.Failure(this.Pipe, monitor, ex); this.Failure(); }
/// <summary /> /// <remarks /> public bool ContainsReportRun(ReportRun o) { return(this.List.Contains(o)); }
public void Skip(Exception ex) { if (ex == null) throw new ArgumentNullException("ex"); this.Start(); this.result = ReportRun.Skip(this.Pipe, ex); this.Skip(); }
public static ReportRun Skip(RunPipe pipe, Exception ex) { ReportRun run = new ReportRun(); run.Result = ReportRunResult.Skip; run.Name = pipe.Name; run.Duration = 0; run.Memory = 0; run.AssertCount = MbUnit.Framework.Assert.AssertCount; run.Exception = ReportException.FromException(ex); MbUnit.Framework.Assert.FlushWarnings(run); return run; }
void TestEngineSkip(ReportRun run) { this.skipCount++; TestResult summary = new TestResult(); summary.State = TDF.TestState.Ignored; summary.TotalTests = this.testCount; summary.Name = run.Name; summary.TimeSpan = new TimeSpan(0, 0, 0, 0, 0); if (run.Exception != null) { ReportException ex = run.Exception; summary.Message = run.Exception.Message; summary.StackTrace = ex.ToString(); } testListener.WriteLine(String.Format("[skipped] {0}", run.Name), Category.Info); this.testListener.TestFinished(summary); }
/// <summary /> /// <remarks /> public void AddReportRun(ReportRun o) { this.List.Add(o); }
/// <summary /> /// <remarks /> public bool ContainsReportRun(ReportRun o) { return this.List.Contains(o); }
/// <summary /> /// <remarks /> public void RemoveReportRun(ReportRun o) { this.List.Remove(o); }
/// <summary /> /// <remarks /> public void AddReportRun(ReportRun o) { this.List.Add(o); }
public override void VisitRun(ReportRun run) { string pretty = dox.Pretifier.PretifyTest(run.Name); writer.WriteLine("{0} - {1}",this.tab,pretty); base.VisitRun (run); }
/// <summary /> /// <remarks /> public void RemoveReportRun(ReportRun o) { this.List.Remove(o); }
// MLS 12/21/05 - changing some of the messages below to give details more like the AutoRunner, // although it still doesn't show all the details that the AutoRunner does. // TOOD: Refactor so that this is exactly like the AutoRunner, and remove duplicate code. public void Success(RunPipe pipe, ReportRun result) { Writer.WriteLine("[success] {0}", pipe.Name); }