How to use node-opcua-leak-detector - 7 common examples

To help you get started, we’ve selected a few node-opcua-leak-detector examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua-server / test_to_fix / test_channel_security_token_live_time.js View on Github external
var OPCUAServer = opcua.OPCUAServer;
var OPCUAClient = opcua.OPCUAClient;

var getFixture = require("node-opcua-test-fixtures").getFixture;


var empty_nodeset_filename = getFixture("fixture_empty_nodeset2.xml");


var debugLog = require("node-opcua-debug").make_debugLog(__filename);

var port = 4000;

var describe = require("node-opcua-leak-detector").describeWithLeakDetector;
describe("Testing ChannelSecurityToken lifetime", function () {

    this.timeout(Math.max(100000,this._timeout));

    var server, client;
    var endpointUrl;

    beforeEach(function (done) {

        port += 1;
        server = new OPCUAServer({port: port, nodeset_filename: empty_nodeset_filename});

        // we will connect to first server end point
        endpointUrl = server.endpoints[0].endpointDescriptions()[0].endpointUrl;
        debugLog("endpointUrl", endpointUrl);
        opcua.is_valid_endpointUrl(endpointUrl).should.equal(true);
github node-opcua / node-opcua / packages / node-opcua-address-space / test-to-fix / test_extension_object_array_node.js View on Github external
/* global describe,it,before*/

var should = require("should");

var UADataType = require("../src/ua_data_type").UADataType;
var UAVariable = require("../src/ua_variable").UAVariable;
var Variant = require("node-opcua-variant").Variant;

var get_mini_address_space = require("../test_helpers/get_mini_address_space").get_mini_address_space;

var SubscriptionDiagnostics = require("../_generated_/_auto_generated_SubscriptionDiagnostics").SubscriptionDiagnostics;

var eoan = require("../src/extension_object_array_node");

var describe = require("node-opcua-leak-detector").describeWithLeakDetector;
describe("Extension Object Array Node (or Complex Variable)", function () {


    var addressSpace;
    before(function (done) {
        get_mini_address_space(function (err, __addressSpace__) {
            addressSpace = __addressSpace__;
            done(err);
        });
    });
    after(function (done) {
        if (addressSpace) {
            addressSpace.dispose();
            addressSpace = null;
        }
        done();
    });
github node-opcua / node-opcua / test_compliance / test_ctt_attribute_service.js View on Github external
"use strict";
const path = "../bin/node-opcua";
require(path+"test_compliance/helpers");

const build_server_with_temperature_device = require("../../test_helpers/build_server_with_temperature_device").build_server_with_temperature_device;

function include_test(filename, options) {
    const  test = require("./" + filename);
    test.register_test(options);
}
const describe = require("node-opcua-leak-detector").describeWithLeakDetector;

describe("COMPLIANCE TESTING", function () {

    const options = {
        server: null,
        endpointUrl: null,
        client: null,
        temperatureVariableId: null
    };

    const port = 2234;
    before(function (done) {
        console.log("\n INFO - building the server ".yellow);
        options.server = build_server_with_temperature_device({ port: port, add_simulation: true}, function (err) {
            console.log("\n INFO - server built".yellow);
            options.endpointUrl = options.server.endpoints[0].endpointDescriptions()[0].endpointUrl;
            options.temperatureVariableId = options.server.temperatureVariableId;
github node-opcua / node-opcua / test_compliance / test_ctt_attribute_service.js View on Github external
});

    afterEach(function (done) {
        done();
    });

    after(function (done) {
        options.client = null;
        options.server.shutdown(done);
    });

    describe("Address Space Model", function () {
        include_test("address_space_model/address_space_user_write_access_ERR_001.js", options);
    });

    describe("Attribute_Services", function () {
        include_test("attribute_services/attribute_read/024.js", options);
    });

    describe("Discovery_Services", function () {
        include_test("discovery_services/find_servers_self/001.js", options);
    });
});
github node-opcua / node-opcua / test_compliance / test_ctt_attribute_service.js View on Github external
});
    });
    beforeEach(function (done) {
        done();
    });

    afterEach(function (done) {
        done();
    });

    after(function (done) {
        options.client = null;
        options.server.shutdown(done);
    });

    describe("Address Space Model", function () {
        include_test("address_space_model/address_space_user_write_access_ERR_001.js", options);
    });

    describe("Attribute_Services", function () {
        include_test("attribute_services/attribute_read/024.js", options);
    });

    describe("Discovery_Services", function () {
        include_test("discovery_services/find_servers_self/001.js", options);
    });
});
github node-opcua / node-opcua / test_compliance / test_ctt_attribute_service.js View on Github external
});

    after(function (done) {
        options.client = null;
        options.server.shutdown(done);
    });

    describe("Address Space Model", function () {
        include_test("address_space_model/address_space_user_write_access_ERR_001.js", options);
    });

    describe("Attribute_Services", function () {
        include_test("attribute_services/attribute_read/024.js", options);
    });

    describe("Discovery_Services", function () {
        include_test("discovery_services/find_servers_self/001.js", options);
    });
});
github node-opcua / node-opcua / packages / node-opcua-address-space / test_to_fix / test_address_space_construct_extension_object.js View on Github external
var DataType = require("node-opcua-variant").DataType;
var Variant = require("node-opcua-variant").Variant;

var address_space = require("..");
var UADataType = address_space.UADataType;
var UAVariableType = address_space.UAVariableType;
var UAObject = address_space.UAObject;
var context = address_space.SessionContext.defaultContext;

function debugLog() {
}

var nodesets = require("node-opcua-nodesets");

var describe = require("node-opcua-leak-detector").describeWithLeakDetector;
describe("testing address space namespace loading", function () {

    this.timeout(Math.max(300000, this._timeout));

    var addressSpace;
    before(function (done) {

        addressSpace = new AddressSpace();
        var xml_files = [
            nodesets.standard_nodeset_file,
            path.join(__dirname, "../../../", "modeling/my_data_type.xml")
        ];
        fs.existsSync(xml_files[0]).should.be.eql(true);
        fs.existsSync(xml_files[1]).should.be.eql(true);

        addressSpace.registerNamespace("ServerNamespaceURI");
        addressSpace.getNamespaceArray().length.should.eql(2);

node-opcua-leak-detector

pure nodejs OPCUA SDK - module leak-detector

MIT
Latest version published 3 months ago

Package Health Score

78 / 100
Full package analysis

Popular node-opcua-leak-detector functions