/
test_rticonnextdds_input.js
42 lines (37 loc) · 1.59 KB
/
test_rticonnextdds_input.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/******************************************************************************
* (c) 2005-2015 Copyright, Real-Time Innovations. All rights reserved. *
* No duplications, whole or partial, manual or electronic, may be made *
* without express written permission. Any such copies, or revisions thereof, *
* must display this notice unaltered. *
* This code contains trade secrets of Real-Time Innovations, Inc. *
******************************************************************************/
var expect=require('chai').expect
var rti= require(__dirname+ '/../../rticonnextdds-connector')
describe('Input Tests',function() {
var connector=null
//Initialization before all tests are executed
before(function(){
var participant_profile = "MyParticipantLibrary::Zero"
var xml_profile = __dirname + "/../xml/ShapeExample.xml"
connector = new rti.Connector(participant_profile,xml_profile)
})
//cleanup after all tests have executed
after(function() {
this.timeout(0)
connector.delete()
})
it('Input object should not get instantiated for invalid DataReader',function(){
var invalid_DR = "invalidDR"
expect(function(){
connector.getInput(invalid_DR)
}).to.throw(Error)
})
it('Input object should get instantiated for valid ' +
'Subscription::DataReader name',function (){
var valid_DR = "MySubscriber::MySquareReader"
var input = connector.getInput(valid_DR)
expect(input).to.exist
expect(input.name).to.equal(valid_DR)
expect(input.connector).to.equal(connector)
})
})