2015-08-11 06:50:32 +00:00
|
|
|
|
///
|
2021-07-28 12:47:05 +00:00
|
|
|
|
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
|
2015-08-11 06:50:32 +00:00
|
|
|
|
///
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Xml.Serialization;
|
2015-12-04 16:17:20 +00:00
|
|
|
|
using Config.Entities;
|
2021-10-26 09:23:57 +00:00
|
|
|
|
using TBF.Rig.Generic;
|
2015-08-11 06:50:32 +00:00
|
|
|
|
|
2021-10-26 09:23:57 +00:00
|
|
|
|
namespace TBF.Rig.TestMethods.iPerlCommunication
|
2015-08-11 06:50:32 +00:00
|
|
|
|
{
|
|
|
|
|
|
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
|
|
|
|
|
|
{
|
2017-06-21 21:39:34 +00:00
|
|
|
|
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
|
2018-06-18 10:44:37 +00:00
|
|
|
|
public override XmlSerializer GetSerializer() { return Serializer; }
|
2017-06-21 21:39:34 +00:00
|
|
|
|
|
2021-08-29 11:01:34 +00:00
|
|
|
|
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new TestMethodCfgCtrl(); }
|
2015-08-11 06:50:32 +00:00
|
|
|
|
|
2015-08-21 18:52:10 +00:00
|
|
|
|
///
|
|
|
|
|
|
/// Serialized parameters
|
|
|
|
|
|
///
|
2017-08-04 15:37:39 +00:00
|
|
|
|
public int CommTimeout; /// Communication timeout in ms (500 .. 5000)
|
2019-10-25 10:53:11 +00:00
|
|
|
|
public int DelayBetweenRetries; /// Delay between communication retries in ms (0 .. 5000)
|
2017-08-04 15:37:39 +00:00
|
|
|
|
public int MaxCommRetries; /// Max. number of retries (1 .. 10)
|
|
|
|
|
|
public int NrThreads; /// Numbwr of parallel threads (1, 2 or 4)
|
2019-03-11 12:39:11 +00:00
|
|
|
|
public int IperlCheckErrorsToStop;
|
2021-07-28 12:47:05 +00:00
|
|
|
|
|
|
|
|
|
|
public int DfltQ2c_15_rl;
|
|
|
|
|
|
public int DfltQ2c_15_lr;
|
|
|
|
|
|
public int DfltQ2c_20_rl;
|
|
|
|
|
|
public int DfltQ2c_20_lr;
|
|
|
|
|
|
public int DfltQ2c_25_63_rl;
|
|
|
|
|
|
public int DfltQ2c_25_63_lr;
|
|
|
|
|
|
public int DfltQ2c_25_10_rl;
|
|
|
|
|
|
public int DfltQ2c_25_10_lr;
|
|
|
|
|
|
public int DfltQ2c_32_rl;
|
|
|
|
|
|
public int DfltQ2c_32_lr;
|
|
|
|
|
|
public int DfltQ2c_40_rl;
|
|
|
|
|
|
public int DfltQ2c_40_lr;
|
|
|
|
|
|
|
2020-04-27 10:24:54 +00:00
|
|
|
|
public bool UseWebService;
|
|
|
|
|
|
public string BaseUrl;
|
|
|
|
|
|
public string RelativeUrl;
|
2015-08-21 18:52:10 +00:00
|
|
|
|
|
2015-08-11 06:50:32 +00:00
|
|
|
|
/// <summary> Test parameters </summary>
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
public iPerlCommunicationParams TestParams;
|
2018-05-10 11:25:46 +00:00
|
|
|
|
public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
|
|
|
|
|
|
public override IParamsProvider CreateTestParamsProvider() { return new iPerlCommunicationParams(true); }
|
2018-05-22 13:33:07 +00:00
|
|
|
|
public override IParamsProvider GetUITestParamsProvider(Test test)
|
|
|
|
|
|
{
|
|
|
|
|
|
return (test.Method == Name) ? base.GetUITestParamsProvider(test) : null;
|
|
|
|
|
|
}
|
2015-08-11 06:50:32 +00:00
|
|
|
|
|
|
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
|
|
|
|
TestMethodCfg()
|
|
|
|
|
|
{
|
|
|
|
|
|
Name = "iPerlCommunication";
|
|
|
|
|
|
ParentName = string.Empty;
|
2015-09-06 21:36:14 +00:00
|
|
|
|
CommTimeout = 1800; /// ms
|
|
|
|
|
|
MaxCommRetries = 4;
|
|
|
|
|
|
NrThreads = 2; /// 1, 2 or 4 threads
|
2019-03-11 12:39:11 +00:00
|
|
|
|
IperlCheckErrorsToStop = 10;
|
2015-09-06 21:36:14 +00:00
|
|
|
|
|
2018-05-10 11:25:46 +00:00
|
|
|
|
TestParams = CreateTestParamsProvider() as iPerlCommunicationParams;
|
2015-08-11 06:50:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public TestMethodCfg(IComponentFactory factory)
|
|
|
|
|
|
: this()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Factory = factory;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string ToString(int i)
|
|
|
|
|
|
{
|
2021-07-28 12:47:05 +00:00
|
|
|
|
return string.Format("Name={0}, CommTimeout={1}, MaxRetries={2}, NrThreads={3}", Name, CommTimeout, MaxCommRetries, NrThreads);
|
2015-08-11 06:50:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|