C# Class Opc.Ua.ServerTest.TestBase

The base class for all tests.
Mostra file Open project: OPCFoundation/UA-.NET Class Usage Examples

Public Methods

Method Description
Run ( ServerTestCase testcase, int iteration ) : bool

Runs the test case.

TestBase ( string name, Session session, ServerTestConfiguration configuration, ReportMessageEventHandler reportMessage, ReportProgressEventHandler reportProgress, TestBase template ) : System

Initializes the test with session, configuration and logger.

Protected Methods

Method Description
Browse ( Node node, BrowseDescription nodeToBrowse, ReferenceDescriptionCollection references ) : bool

Browses the node and returns the references found.

CalculateInterval ( System.DateTime start, System.DateTime end ) : double

Calculates the difference between the two times in milliseconds.

CheckCoverage ( int &count ) : bool

Returns true if current node should be included in the test.

GetNodesInHierarchy ( ) : bool

Collects all of the nodes in the hierarchies specified in the configuration file.

GetWriteableVariablesInHierarchy ( ) : bool

Collects all of the nodes in the hierarchies specified in the configuration file.

LockServer ( ) : void

Locks the server.

Log ( Exception e, string format ) : void

Logs a message.

Log ( string format ) : void

Logs a message.

ReportProgress ( double position ) : void

Reports progress.

SetAttributeValue ( Node node, uint attributeId, object attributeValue ) : bool

Stores the attribute value in the object.

UnlockServer ( ) : void

Unlocks the server.

VerifyAttributeConsistency ( Node node ) : bool

Verifies that the node attributes are consistent with each other.

VerifyBadAttribute ( Node node, uint attributeId, StatusCode error ) : bool

Verifies an error returned during an attribute read.

VerifyGoodAttribute ( Node node, uint attributeId, DataValue value ) : bool

Verifies the value returned during an attribute read.

VerifyTimestamps ( Node node, uint attributeId, TimestampsToReturn timestampsToReturn, DataValue value ) : bool

Verifies that the timestamps match the requested filter.

Private Methods

Method Description
Browse ( Node node, double start, double range ) : bool

Browses the node and verifies the results.

CollectVariables ( INode parent, List variables ) : void

Recursively collects the child variables.

CoverageToModulus ( uint coverage ) : int

Converts a percentage test converage to a modulus.

VerifyVariableBaseConsistency ( IVariableBase node ) : bool

Verifies that the variable or variable type attributes are consistent with each other.

VerifyVariableConsistency ( IVariable node ) : bool

Verifies that the variable attributes are consistent with each other.

VerifyVariableTypeConsistency ( IVariableType node ) : bool

Verifies that the variable type attributes are consistent with each other.

Method Details

Browse() protected method

Browses the node and returns the references found.
protected Browse ( Node node, BrowseDescription nodeToBrowse, ReferenceDescriptionCollection references ) : bool
node Node
nodeToBrowse BrowseDescription
references ReferenceDescriptionCollection
return bool

CalculateInterval() protected method

Calculates the difference between the two times in milliseconds.
protected CalculateInterval ( System.DateTime start, System.DateTime end ) : double
start System.DateTime
end System.DateTime
return double

CheckCoverage() protected method

Returns true if current node should be included in the test.
protected CheckCoverage ( int &count ) : bool
count int
return bool

GetNodesInHierarchy() protected method

Collects all of the nodes in the hierarchies specified in the configuration file.
protected GetNodesInHierarchy ( ) : bool
return bool

GetWriteableVariablesInHierarchy() protected method

Collects all of the nodes in the hierarchies specified in the configuration file.
protected GetWriteableVariablesInHierarchy ( ) : bool
return bool

LockServer() protected method

Locks the server.
protected LockServer ( ) : void
return void

Log() protected method

Logs a message.
protected Log ( Exception e, string format ) : void
e System.Exception
format string
return void

Log() protected method

Logs a message.
protected Log ( string format ) : void
format string
return void

ReportProgress() protected method

Reports progress.
protected ReportProgress ( double position ) : void
position double
return void

Run() public method

Runs the test case.
public Run ( ServerTestCase testcase, int iteration ) : bool
testcase ServerTestCase
iteration int
return bool

SetAttributeValue() protected method

Stores the attribute value in the object.
protected SetAttributeValue ( Node node, uint attributeId, object attributeValue ) : bool
node Node
attributeId uint
attributeValue object
return bool

TestBase() public method

Initializes the test with session, configuration and logger.
public TestBase ( string name, Session session, ServerTestConfiguration configuration, ReportMessageEventHandler reportMessage, ReportProgressEventHandler reportProgress, TestBase template ) : System
name string
session Opc.Ua.Client.Session
configuration ServerTestConfiguration
reportMessage ReportMessageEventHandler
reportProgress ReportProgressEventHandler
template TestBase
return System

UnlockServer() protected method

Unlocks the server.
protected UnlockServer ( ) : void
return void

VerifyAttributeConsistency() protected method

Verifies that the node attributes are consistent with each other.
protected VerifyAttributeConsistency ( Node node ) : bool
node Node
return bool

VerifyBadAttribute() protected method

Verifies an error returned during an attribute read.
protected VerifyBadAttribute ( Node node, uint attributeId, StatusCode error ) : bool
node Node
attributeId uint
error StatusCode
return bool

VerifyGoodAttribute() protected method

Verifies the value returned during an attribute read.
protected VerifyGoodAttribute ( Node node, uint attributeId, DataValue value ) : bool
node Node
attributeId uint
value DataValue
return bool

VerifyTimestamps() protected method

Verifies that the timestamps match the requested filter.
protected VerifyTimestamps ( Node node, uint attributeId, TimestampsToReturn timestampsToReturn, DataValue value ) : bool
node Node
attributeId uint
timestampsToReturn TimestampsToReturn
value DataValue
return bool