using OpenTap;
|
using OpenTap.Addin.Listener;
|
using SeqEditor.Util;
|
using System.IO;
|
|
namespace OpenTapEditor
|
{
|
public class UIListener : RootListener
|
{
|
private LogControl logControl;
|
private IStepRunStatus statusHolder;
|
|
public UIListener(LogControl logControl, IStepRunStatus statusHolder)
|
{
|
this.logControl = logControl;
|
this.statusHolder = statusHolder;
|
}
|
|
public override void Close()
|
{
|
base.Close();
|
statusHolder = null;
|
logControl = null;
|
RootPlanRun = null;
|
}
|
|
public override void OnResultPublished(Guid stepRunID, ResultTable result)
|
{
|
|
}
|
|
public override void OnTestPlanRunCompleted(TestPlanRun planRun, Stream logStream)
|
{
|
if (planRun == RootPlanRun)
|
{
|
logControl.ShowResult(planRun.Verdict);
|
}
|
}
|
|
public override void OnTestStepRunCompleted(TestStepRun stepRun)
|
{
|
statusHolder.ComplatedStepId(stepRun.TestStepId);
|
}
|
|
public override void OnTestStepRunStart(TestStepRun stepRun)
|
{
|
statusHolder.CurrentStepId(stepRun.TestStepId);
|
}
|
|
public override IResultListener CreateChild()
|
{
|
var res = new UIListener(logControl, statusHolder)
|
{
|
RootPlanRun = this.RootPlanRun,
|
Root = this.Root == null ? this : this.Root
|
};
|
return res;
|
}
|
}
|
}
|