Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("should bind an xml-preloaded Extension Object Variable : ServerStatus ", function (done) {
// in this test, we verify that we can easily bind the Server_ServerStatus object
// the process shall automatically bind variables and substructures recursively
var VariableIds = require("node-opcua-constants").VariableIds;
var makeNodeId = require("node-opcua-nodeid").makeNodeId;
var serverStatus = addressSpace.findNode(makeNodeId(VariableIds.Server_ServerStatus));
serverStatus.browseName.toString().should.eql("ServerStatus");
// before bindExtensionObject is called, startTime property exists but is not bound
serverStatus.should.have.property("startTime");
serverStatus.startTime.readValue().value.dataType.should.eql(DataType.Null);
serverStatus.readValue().value.dataType.should.eql(DataType.Null);
//Xx value.startTime.should.eql(DataType.Null);
//xx debugLog("serverStatus.startTime =",serverStatus.startTime.readValue().value.toString());
serverStatus.bindExtensionObject();
module.exports.NumericRange = require("node-opcua-numeric-range").NumericRange;
module.exports.AccessLevelFlag = require("node-opcua-data-model").AccessLevelFlag;
module.exports.makeAccessLevel = require("node-opcua-data-model").makeAccessLevel;
module.exports.LocalizedText = require("node-opcua-data-model").LocalizedText;
module.exports.coerceLocalizedText = require("node-opcua-data-model").coerceLocalizedText;
module.exports.QualifiedName = require("node-opcua-data-model").QualifiedName;
module.exports.coerceQualifyName = require("node-opcua-data-model").coerceQualifyName;
module.exports.NodeClass = require("node-opcua-data-model").NodeClass;
module.exports.NodeClassMask = require("node-opcua-data-model").NodeClassMask;
module.exports.AttributeIds = require("node-opcua-data-model").AttributeIds;
module.exports.AttributeNameById = require("node-opcua-data-model").AttributeNameById;
module.exports.BrowseDirection = require("node-opcua-data-model").BrowseDirection;
module.exports.VariableTypeIds = require("node-opcua-constants").VariableTypeIds;
module.exports.VariableIds = require("node-opcua-constants").VariableIds;
module.exports.MethodIds = require("node-opcua-constants").MethodIds;
module.exports.ObjectIds = require("node-opcua-constants").ObjectIds;
module.exports.ObjectTypeIds = require("node-opcua-constants").ObjectTypeIds;
module.exports.ReferenceTypeIds = require("node-opcua-constants").ReferenceTypeIds;
module.exports.DataTypeIds = require("node-opcua-constants").DataTypeIds;
// DA
module.exports.standardUnits = require("node-opcua-data-access").standardUnits;
module.exports.makeEUInformation = require("node-opcua-data-access").makeEUInformation;
module.exports.Range = require("node-opcua-data-access").Range;
//
module.exports.get_fully_qualified_domain_name = require("node-opcua-hostname").get_fully_qualified_domain_name;
module.exports.makeApplicationUrn = require("node-opcua-common").makeApplicationUrn;
// services
const LocalizedText = require("node-opcua-data-model").LocalizedText;
const NodeClass = require("node-opcua-data-model").NodeClass;
const BrowseDescription = require("node-opcua-service-browse").BrowseDescription;
const resolveNodeId = require("node-opcua-nodeid").resolveNodeId;
const NodeId = require("node-opcua-nodeid").NodeId;
const sameNodeId = require("node-opcua-nodeid").sameNodeId;
const makeNodeId = require("node-opcua-nodeid").makeNodeId;
const StatusCodes = require("node-opcua-status-code").StatusCodes;
const browse_service = require("node-opcua-service-browse");
const lowerFirstLetter = require("node-opcua-utils").lowerFirstLetter;
const VariableIds = require("node-opcua-constants").VariableIds;
const debugLog = require("node-opcua-debug").make_debugLog(__filename);
//
// some server do not expose the ReferenceType Node in their address space
// ReferenceType are defined by the OPCUA standard and can be prepopulated in the crawler.
// Pre-populating the ReferenceType node in the crawler will also reduce the network traffic.
//
const ReferenceTypeIds = require("node-opcua-constants").ReferenceTypeIds;
/*=
*
* @param arr
* @param maxNode
* @private
* @return {*}
"use strict";
var build_client_server_session = require("$node-opcua/test-helpers/build_client_server_session").build_client_server_session;
var VariableIds = require("node-opcua-constants").VariableIds;
var subscription_service = require("node-opcua-service-subscription");
describe("testing basic Client Server dealing with subscription at low level", function () {
var g_session;
var client_server;
before(function (done) {
client_server = build_client_server_session(function (err) {
if (!err) {
g_session = client_server.g_session;
}
done(err);
});
*/
const _ = require("underscore");
const crypto = require("crypto");
const NodeId = require("node-opcua-nodeid").NodeId;
const sameNodeId = require("node-opcua-nodeid").sameNodeId;
const NodeIdType = require("node-opcua-nodeid").NodeIdType;
const ServerSidePublishEngine = require("./server_publish_engine").ServerSidePublishEngine;
const StatusCodes = require("node-opcua-status-code").StatusCodes;
const NodeClass = require("node-opcua-data-model").NodeClass;
const QualifiedName = require("node-opcua-data-model").QualifiedName;
const DataValue = require("node-opcua-data-value").DataValue;
const VariableIds = require("node-opcua-constants").VariableIds;
const ec = require("node-opcua-basic-types");
const assert = require("node-opcua-assert").assert;
const util = require("util");
const EventEmitter = require("events").EventEmitter;
const eoan = require("node-opcua-address-space");
const makeNodeId = require("node-opcua-nodeid").makeNodeId;
const ObjectIds = require("node-opcua-constants").ObjectIds;
const WatchDog = require("node-opcua-utils").WatchDog;
const theWatchDog = new WatchDog();
const ContinuationPointManager = require("./continuation_point_manager").ContinuationPointManager;
const utils = require("node-opcua-utils");
const debugLog = require("node-opcua-debug").make_debugLog(__filename);
const StatusCodes = require("node-opcua-status-code").StatusCodes;
const StatusCode = require("node-opcua-status-code").StatusCode;
require("node-opcua-common");
const address_space = require("node-opcua-address-space");
const AddressSpace = address_space.AddressSpace;
const generate_address_space = require("node-opcua-address-space").generate_address_space;
const ServerSession = require("./server_session").ServerSession;
const VariableIds = require("node-opcua-constants").VariableIds;
const MethodIds = require("node-opcua-constants").MethodIds;
const ReferenceType = require("node-opcua-address-space").ReferenceType;
const ServerState = require("node-opcua-common").ServerState;
const ServerStatus = require("node-opcua-common").ServerStatus;
const ServerDiagnosticsSummary = require("node-opcua-common").ServerDiagnosticsSummary;
const endpoints_service = require("node-opcua-service-endpoints");
const ApplicationDescription = endpoints_service.ApplicationDescription;
const nodesets = require("node-opcua-nodesets");
exports.standard_nodeset_file = nodesets.standard_nodeset_file;
exports.di_nodeset_filename = nodesets.di_nodeset_filename;
exports.adi_nodeset_filename = nodesets.adi_nodeset_filename;
const assert = require("node-opcua-assert").assert;
const EventEmitter = require("events").EventEmitter;
const util = require("util");
const coerceNodeId = require("node-opcua-nodeid").coerceNodeId;
const VariableIds = require("node-opcua-constants").VariableIds;
const serverStatus_State_Id = coerceNodeId(VariableIds.Server_ServerStatus_State);
const ServerState = require("node-opcua-common").ServerState;
const StatusCodes = require("node-opcua-status-code").StatusCodes;
const debugLog = require("node-opcua-debug").make_debugLog(__filename);
const doDebug = require("node-opcua-debug").checkDebugFlag(__filename);
function ClientSessionKeepAliveManager(session) {
const self = this;
self.session = session;
self.timerId = 0;
}
util.inherits(ClientSessionKeepAliveManager, EventEmitter);
/**