The base class for all tests.
Exemple #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>();
            }
        }
 /// <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)
 {
 }
Exemple #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>>();
 }
Exemple #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;
 }
 /// <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;
 }
Exemple #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;
 }
        /// <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>();    
        }
 /// <summary>
 /// Used to log errors during a test run.
 /// </summary>
 private void Report(TestBase test, double current, double final)
 {
     Report(current, final);
 }
 /// <summary>
 /// Used to log errors during a test run.
 /// </summary>
 private void Report(TestBase test, string format, params object[] args)
 {
     Report(format, args);
 }