using OpenTap.Addin.Listener;
|
using System;
|
using System.IO;
|
|
namespace OpenTap.Addin.Util
|
{
|
public abstract class ReportListener : RootListener
|
{
|
|
public ReportListener(string name)
|
{
|
this.name = name;
|
}
|
|
public override abstract IResultListener CreateChild();
|
|
protected abstract void PlanStarted();
|
protected abstract void StepComplated(TestStepRun stepRun);
|
protected abstract void PlanComplated();
|
|
public override void Close()
|
{
|
base.Close();
|
ResultSettings.Current.Remove(this);
|
}
|
|
public override void OnTestPlanRunCompleted(TestPlanRun planRun, Stream logStream)
|
{
|
lock (this)
|
{
|
if (Root != null)
|
{
|
Root.OnTestPlanRunCompleted(planRun, logStream);
|
}
|
else
|
{
|
if (planRun == RootPlanRun)
|
{
|
PlanComplated();
|
}
|
}
|
}
|
}
|
|
public override void OnTestPlanRunStart(TestPlanRun planRun)
|
{
|
lock (this)
|
{
|
base.OnTestPlanRunStart(planRun);
|
if (planRun == RootPlanRun)
|
{
|
PlanStarted();
|
}
|
}
|
}
|
|
public override void OnTestStepRunCompleted(TestStepRun stepRun)
|
{
|
lock (this)
|
{
|
if (Root != null)
|
{
|
Root.OnTestStepRunCompleted(stepRun);
|
}
|
else
|
{
|
StepComplated(stepRun);
|
}
|
}
|
}
|
|
public override void OnTestStepRunStart(TestStepRun stepRun)
|
{
|
}
|
|
public override void Open()
|
{
|
base.Open();
|
}
|
|
public override void OnResultPublished(Guid stepRunID, ResultTable result)
|
{
|
|
}
|
}
|
}
|