Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

access to id, service and subservice in jexl context for functional test #1636

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions test/functional/functional-tests-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,17 @@ describe('FUNCTIONAL TESTS AUTO', function () {
if (testCase.loglevel) {
logger.setLevel(testCase.loglevel);
}
let type = testUtils.groupToIoTAConfigType(
let confType = testUtils.groupToIoTAConfigType(
testCase.provision.json.services[0],
testCase.provision.headers.fiwareService,
testCase.provision.headers.fiwareServicepath
testCase.provision.headers['fiware-service'],
testCase.provision.headers['fiware-servicepath']
);
config.iota.types[type.name] = type.type;
// Inject device id into config as real typeInformation
if (testCase.should[0] && testCase.should[0].measure.qs.i) {
confType.type['id'] = testCase.should[0].measure.qs.i;
}
config.iota.types[confType.name] = confType.type;

iotAgentLib.activate(config.iota, function (error) {
done(error);
});
Expand Down
8 changes: 4 additions & 4 deletions test/functional/functional-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ describe('FUNCTIONAL TESTS', function () {
beforeEach(function (done) {
let type = testUtils.groupToIoTAConfigType(
provision.json.services[0],
provision.headers.fiwareService,
provision.headers.fiwareServicepath
provision.headers['fiware-service'],
provision.headers['fiware-servicepath']
);
config.iota.types[type.name] = type.type;
iotAgentLib.activate(config.iota, function (error) {
Expand Down Expand Up @@ -214,8 +214,8 @@ describe('FUNCTIONAL TESTS', function () {
beforeEach(function (done) {
let type = testUtils.groupToIoTAConfigType(
provision.json.services[0],
provision.headers.fiwareService,
provision.headers.fiwareServicepath
provision.headers['fiware-service'],
provision.headers['fiware-servicepath']
);
config.iota.types[type.name] = type.type;
iotAgentLib.activate(config.iota, function (error) {
Expand Down
6 changes: 2 additions & 4 deletions test/functional/testCases.js
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,6 @@ const testCases = [
},
{
describeName: '0170 - Simple group with active attribute + JEXL expression referencing context attributes',
skip: 'lib', // Explanation in #1523
provision: {
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
method: 'POST',
Expand Down Expand Up @@ -1830,7 +1829,6 @@ const testCases = [
},
{
describeName: '0180 - Simple group with active attributes + JEXL multiples expressions at same time',
skip: 'lib', // Explanation in #1523
provision: {
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
method: 'POST',
Expand Down Expand Up @@ -4203,7 +4201,7 @@ const testCases = [
type: 'Number',
entity_name: 'TestType:TestDevice2',
entity_type: 'TestType',
expression: 'type+":"+(t*2*static_a)' // Only type is used as JEXL context attr due to #1523
expression: 'type+":"+(t*2*static_a)'
}
],
static_attributes: [
Expand Down Expand Up @@ -4289,7 +4287,7 @@ const testCases = [
object_id: 't',
name: 'temperature',
type: 'Number',
entity_name: 'type+":"+(t*2*static_a)', // Only type is used as JEXL context attr due to #1523
entity_name: 'type+":"+(t*2*static_a)',
entity_type: 'TestType'
}
],
Expand Down
Loading