The base class for all tests.
Exemplo n.º 1
0
        /// <summary>
        /// Initializes the test with session, configuration and logger.
        /// </summary>
        public TestBase(
            string name,
            Session session,
            ServerTestConfiguration configuration,
            ReportMessageEventHandler reportMessage,
            ReportProgressEventHandler reportProgress,
            TestBase template)
        {
            m_name = name;
            m_session = session;
            m_configuration = configuration;
            m_reportMessage = reportMessage;
            m_reportProgress = reportProgress;

            if (template != null && Object.ReferenceEquals(session, template.m_session))
            {
                m_blockSize = template.BlockSize;
                m_availableNodes = template.m_availableNodes;
                m_writeableVariables = template.m_writeableVariables;
            }
            else
            {
                m_blockSize = 1000;
                m_availableNodes = new NodeIdDictionary<Node>();
                m_writeableVariables = new List<VariableNode>();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates the test object.
 /// </summary>
 public TranslatePathTest(
     Session session,
     ServerTestConfiguration configuration,
     ReportMessageEventHandler reportMessage,
     ReportProgressEventHandler reportProgress,
     TestBase template)
 : 
     base("TranslatePath", session, configuration, reportMessage, reportProgress, template)
 {
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates the test object.
 /// </summary>
 public SessionTest(
     Session session,
     ServerTestConfiguration configuration,
     ReportMessageEventHandler reportMessage,
     ReportProgressEventHandler reportProgress,
     TestBase template)
 : 
     base("Activate", session, configuration, reportMessage, reportProgress, template)
 {
     m_errorEvent = new ManualResetEvent(false);
     m_messages = new Dictionary<uint,List<uint>>();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Creates the test object.
 /// </summary>
 public BrowseTest(
     Session session,
     ServerTestConfiguration configuration,
     ReportMessageEventHandler reportMessage,
     ReportProgressEventHandler reportProgress,
     TestBase template)
 : 
     base("Browse", session, configuration, reportMessage, reportProgress, template)
 {
     m_view = new ViewDescription();
     m_view.ViewId = null;
     m_view.Timestamp = DateTime.MinValue;
     m_view.ViewVersion = 0;
     m_maxReferencesPerNode = 0;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Creates the test object.
 /// </summary>
 public SubscribeTest(
     Session session,
     ServerTestConfiguration configuration,
     ReportMessageEventHandler reportMessage,
     ReportProgressEventHandler reportProgress,
     TestBase template)
 : 
     base("Subscribe", session, configuration, reportMessage, reportProgress, template)
 {
     m_subscriptions = new List<Subscription>();
     m_errorEvent = new ManualResetEvent(false);
     m_acknowledgements = new SubscriptionAcknowledgementCollection();
     m_publishPipelineDepth = 10;
     m_idealTimingError = 400;
     m_maximumTimingError = 500;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Creates the test object.
 /// </summary>
 public CallTest(
     Session session,
     ServerTestConfiguration configuration,
     ReportMessageEventHandler reportMessage,
     ReportProgressEventHandler reportProgress,
     TestBase template)
 : 
     base("Call", session, configuration, reportMessage, reportProgress, template)
 {
     m_generator = new Opc.Ua.Test.DataGenerator(new Opc.Ua.Test.RandomSource(configuration.Seed));
     m_generator.NamespaceUris = Session.NamespaceUris;
     m_generator.ServerUris = Session.ServerUris;
     m_generator.MaxArrayLength = 3;
     m_generator.MaxStringLength = 10;
     m_generator.MaxXmlElementCount = 3;
     m_generator.MaxXmlAttributeCount = 3;
 }
Exemplo n.º 7
0
        /// <summary>
        /// Creates the test object.
        /// </summary>
        public MonitoredItemTest(
            Session session,
            ServerTestConfiguration configuration,
            ReportMessageEventHandler reportMessage,
            ReportProgressEventHandler reportProgress,
            TestBase template)
        : 
            base("MonitoredItem", session, configuration, reportMessage, reportProgress, template)
        {
            m_generator = new Opc.Ua.Test.DataGenerator(new Opc.Ua.Test.RandomSource(configuration.Seed));
            m_generator.NamespaceUris = Session.NamespaceUris;
            m_generator.ServerUris = Session.ServerUris;
            m_generator.MaxArrayLength = 3;
            m_generator.MaxStringLength = 10;
            m_generator.MaxXmlElementCount = 3;
            m_generator.MaxXmlAttributeCount = 3;
            m_comparer = new Opc.Ua.Test.DataComparer(Session.MessageContext);
            m_comparer.ThrowOnError = false;
            
            m_errorEvent = new ManualResetEvent(false);
            m_maximumTimingError = 300;

            m_variables = new List<TestVariable>();    
        }
Exemplo n.º 8
0
 /// <summary>
 /// Used to log errors during a test run.
 /// </summary>
 private void Report(TestBase test, double current, double final)
 {
     Report(current, final);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Used to log errors during a test run.
 /// </summary>
 private void Report(TestBase test, string format, params object[] args)
 {
     Report(format, args);
 }