From 73a5d12799030a32d323fdf2870ab961ad02e7f2 Mon Sep 17 00:00:00 2001 From: Sam Raeburn Date: Wed, 2 Sep 2020 13:38:40 +0200 Subject: [PATCH 1/2] CON-163: Added test for CON-163 --- test/nodejs/test_rticonnextdds_connector.js | 14 ++++++++ test/xml/TestConnector3.xml | 39 +++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 test/xml/TestConnector3.xml diff --git a/test/nodejs/test_rticonnextdds_connector.js b/test/nodejs/test_rticonnextdds_connector.js index f458c23c..5b613f0e 100644 --- a/test/nodejs/test_rticonnextdds_connector.js +++ b/test/nodejs/test_rticonnextdds_connector.js @@ -63,6 +63,20 @@ describe('Connector Tests', function () { }) }) + // Test for CON-163 + it('Multiple Connector obejcts can be instantiated without participant QoS', function () { + const participantProfile = 'MyParticipantLibrary::MyParticipant' + const xmlProfile = path.join(__dirname, '/../xml/TestConnector3.xml') + const connectors = [] + for (var i = 0; i < 3; i++) { + connectors.push(new rti.Connector(participantProfile, xmlProfile)) + } + connectors.forEach((connector) => { + expect(connector).to.exist + expect(connector).to.be.instanceOf(rti.Connector) + }) + }) + describe('Connector callback test', function () { let connector diff --git a/test/xml/TestConnector3.xml b/test/xml/TestConnector3.xml new file mode 100644 index 00000000..86ae995d --- /dev/null +++ b/test/xml/TestConnector3.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 4483edc9450abcb26330fa845a73d27986f556e2 Mon Sep 17 00:00:00 2001 From: Sam Raeburn Date: Wed, 2 Sep 2020 13:48:28 +0200 Subject: [PATCH 2/2] CON-209: Added unit test for CON-209 --- test/nodejs/test_rticonnextdds_connector.js | 25 ++++++++++++++++----- test/xml/TestConnector2.xml | 22 ++++++++++++++++++ 2 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 test/xml/TestConnector2.xml diff --git a/test/nodejs/test_rticonnextdds_connector.js b/test/nodejs/test_rticonnextdds_connector.js index 5b613f0e..a5d777d1 100644 --- a/test/nodejs/test_rticonnextdds_connector.js +++ b/test/nodejs/test_rticonnextdds_connector.js @@ -48,35 +48,50 @@ describe('Connector Tests', function () { const connector = new rti.Connector(participantProfile, xmlProfile) expect(connector).to.exist expect(connector).to.be.instanceOf(rti.Connector) + connector.close() }) - it('Multiple Connector objects can be instantiated', function () { + it('Multiple Connector objects can be instantiated', () => { const participantProfile = 'MyParticipantLibrary::Zero' const xmlProfile = path.join(__dirname, '/../xml/TestConnector.xml') const connectors = [] - for (var i = 0; i < 5; i++) { + for (var i = 0; i < 3; i++) { connectors.push(new rti.Connector(participantProfile, xmlProfile)) } connectors.forEach((connector) => { expect(connector).to.exist expect(connector).to.be.instanceOf(rti.Connector) + connector.close() }) }) // Test for CON-163 - it('Multiple Connector obejcts can be instantiated without participant QoS', function () { + it('Multiple Connector obejcts can be instantiated without participant QoS', () => { const participantProfile = 'MyParticipantLibrary::MyParticipant' const xmlProfile = path.join(__dirname, '/../xml/TestConnector3.xml') const connectors = [] - for (var i = 0; i < 3; i++) { + for (var i = 0; i < 2; i++) { connectors.push(new rti.Connector(participantProfile, xmlProfile)) } - connectors.forEach((connector) => { + connectors.forEach((connector) => { expect(connector).to.exist expect(connector).to.be.instanceOf(rti.Connector) + connector.close() }) }) + it('Load two XML files using the url group syntax', function () { + const xmlProfile1 = path.join(__dirname, '/../xml/TestConnector.xml') + const xmlProfile2 = path.join(__dirname, '/../xml/TestConnector2.xml') + const fullXmlPath = xmlProfile1 + ';' + xmlProfile2 + const connector = new rti.Connector('MyParticipantLibrary2::MyParticipant2', fullXmlPath) + expect(connector).to.exist + expect(connector).to.be.instanceOf(rti.Connector) + const output = connector.getOutput('MyPublisher2::MySquareWriter2') + expect(output).to.exist + connector.close() + }) + describe('Connector callback test', function () { let connector diff --git a/test/xml/TestConnector2.xml b/test/xml/TestConnector2.xml new file mode 100644 index 00000000..7e527661 --- /dev/null +++ b/test/xml/TestConnector2.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + +