// Copyright Keysight Technologies 2012-2019
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at http://mozilla.org/MPL/2.0/.
using System.Linq;
namespace OpenTap
{
///
/// Interface for use in pre/post test plan (for example, it can be used to lock a remote setup). Only supported on types.
///
public interface ITestPlanRunMonitor : ITapPlugin
{
///
/// Called before Test Plan is executed.
///
///
void EnterTestPlanRun(TestPlanRun plan);
///
/// Called after Test Plan is executed.
///
void ExitTestPlanRun(TestPlanRun plan);
}
static class TestPlanRunMonitors
{
///
/// Returns a list of the current access controllers.
/// These are ComponentSettings instances that inherits from ITestPlanRunMonitor.
///
///
public static ITestPlanRunMonitor[] GetCurrent()
{
return TypeData.GetDerivedTypes()
.Select(ComponentSettings.GetCurrent)
.OfType()
.ToArray();
}
}
}