提交 29bd3fa8 编写于 作者: L leiyuqian

[startup_standard][master]modify systemparameter cases name

Signed-off-by: Nleiyuqian <leiyuqian1@huawei.com>
Change-Id: I36af30ee06338488defc8ed39770742d2c185a88
上级 f78121ab
......@@ -31,25 +31,25 @@ describe('SystemParameterTest', function () {
* @tc.name testSet0100
* @tc.desc Set the value for the given key with parameter callback.
*/
it('system_parameter_test_0100', 0, async function (done) {
console.info('system_parameter_test_0100 start');
it('testSet0100', 0, async function (done) {
console.info('testSet0100 start');
let ret = false;
try {
systemparameter.set('hw_sc.build.os.version', '10.20.30.4', function (err) {
if (err == undefined) {
ret = true;
console.info('system_parameter_test_0100 set callback hw_sc.build.os.version value success ');
console.info('testSet0100 set callback hw_sc.build.os.version value success ');
expect(ret).assertTrue();
} else {
console.info('system_parameter_test_0100 set callback hw_sc.build.os.version value err:'
console.info('testSet0100 set callback hw_sc.build.os.version value err:'
+ err.code);
}
});
done();
} catch (err) {
console.info('system_parameter_test_0100 set callback hw_sc.build.os.version unexpect err:' + err);
console.info('testSet0100 set callback hw_sc.build.os.version unexpect err:' + err);
}
console.info('system_parameter_test_0100 : end');
console.info('testSet0100 : end');
})
/**
......@@ -57,26 +57,26 @@ describe('SystemParameterTest', function () {
* @tc.name testSet0110
* @tc.desc Set a value that is not a string to the property value
*/
it('system_parameter_test_0110', 0, async function (done) {
console.info('system_parameter_test_0110 start');
it('testSet0110', 0, async function (done) {
console.info('testSet0110 start');
let ret = false;
try {
systemparameter.set('hw_sc.build.os.version', 111, function (err) {
if (err == undefined) {
console.info('system_parameter_test_0110 set callback hw_sc.build.os.version value success');
console.info('testSet0110 set callback hw_sc.build.os.version value success');
} else {
console.info('system_parameter_test_0110 set callback hw_sc.build.os.version value err:'
console.info('testSet0110 set callback hw_sc.build.os.version value err:'
+ err.code)
}
});
} catch (err) {
ret = true;
console.info('system_parameter_test_0110 set callback hw_sc.build.os.version unexpect err:' + err);
console.info('testSet0110 set callback hw_sc.build.os.version unexpect err:' + err);
expect(ret).assertTrue();
done();
}
console.info('system_parameter_test_0110 : end');
console.info('testSet0110 : end');
})
/**
......@@ -84,16 +84,16 @@ describe('SystemParameterTest', function () {
* @tc.name testSet0120
* @tc.desc Set the property value to an extra long string
*/
it('system_parameter_test_0120', 0, async function (done) {
console.info('system_parameter_test_0120 start');
it('testSet0120', 0, async function (done) {
console.info('testSet0120 start');
let ret = false;
try {
systemparameter.set('hw_sc.build.os.version', PROPERTY_MAX_VALUE, function (err) {
if (err == undefined) {
console.info('system_parameter_test_0120 set callback hw_sc.build.os.version value success');
console.info('testSet0120 set callback hw_sc.build.os.version value success');
} else {
ret = true;
console.info('system_parameter_test_0120 set callback hw_sc.build.os.version value err:' +
console.info('testSet0120 set callback hw_sc.build.os.version value err:' +
err.code);
expect(ret).assertTrue();
done();
......@@ -101,9 +101,9 @@ describe('SystemParameterTest', function () {
});
} catch (err) {
console.info('system_parameter_test_0120 set callback hw_sc.build.os.version unexpect err:' + err);
console.info('testSet0120 set callback hw_sc.build.os.version unexpect err:' + err);
}
console.info('system_parameter_test_0120 : end');
console.info('testSet0120 : end');
})
/**
......@@ -111,23 +111,23 @@ describe('SystemParameterTest', function () {
* @tc.name testSet0200
* @tc.desc Set the value for the given key.
*/
it('system_parameter_test_0200', 0, async function (done) {
console.info('system_parameter_test_0200 start');
it('testSet0200', 0, async function (done) {
console.info('testSet0200 start');
let parameterInfo = systemparameter.set('hw_sc.build.os.version', '1.5.3.6');
let ret = false;
try {
parameterInfo.then(function (value) {
console.info('system_parameter_test_0200 promise set hw_sc.build.os.version success: ' + value);
console.info('testSet0200 promise set hw_sc.build.os.version success: ' + value);
ret = true;
expect(ret).assertTrue();
done();
}).catch(function (err) {
console.info('system_parameter_test_0200 promise set hw_sc.build.os.version error: ' + err.code);
console.info('testSet0200 promise set hw_sc.build.os.version error: ' + err.code);
});
} catch (err) {
console.info('system_parameter_test_0200 set callback hw_sc.build.os.version unexpect err:' + err)
console.info('testSet0200 set callback hw_sc.build.os.version unexpect err:' + err)
}
console.info('system_parameter_test_0200 : end');
console.info('testSet0200 : end');
})
/**
......@@ -135,23 +135,23 @@ describe('SystemParameterTest', function () {
* @tc.name testSet0220
* @tc.desc Set the property value to an extra long string
*/
it('system_parameter_test_0220', 0, async function (done) {
console.info('system_parameter_test_0220 start');
it('testSet0220', 0, async function (done) {
console.info('testSet0220 start');
let ret = false;
try {
let parameterInfo = systemparameter.set('hw_sc.build.os.version', PROPERTY_MAX_VALUE);
parameterInfo.then(function (value) {
console.info('system_parameter_test_0220 promise set hw_sc.build.os.version success: ' + value);
console.info('testSet0220 promise set hw_sc.build.os.version success: ' + value);
}).catch(function (err) {
ret = true;
console.info('system_parameter_test_0220 promise set hw_sc.build.os.version error: ' + err.code);
console.info('testSet0220 promise set hw_sc.build.os.version error: ' + err.code);
expect(ret).assertTrue();
done();
});
} catch (err) {
console.info('system_parameter_test_0220 set callback hw_sc.build.os.version unexpect err:' + err);
console.info('testSet0220 set callback hw_sc.build.os.version unexpect err:' + err);
}
console.info('system_parameter_test_0220 : end');
console.info('testSet0220 : end');
})
/**
......@@ -159,23 +159,23 @@ describe('SystemParameterTest', function () {
* @tc.name testSet0230
* @tc.desc Set a value that is not a string to the property value
*/
it('system_parameter_test_0230', 0, async function (done) {
console.info('system_parameter_test_0230 start');
it('testSet0230', 0, async function (done) {
console.info('testSet0230 start');
let ret = false;
try {
let parameterInfo = systemparameter.set('hw_sc.build.os.version', 111);
parameterInfo.then(function (value) {
console.info('system_parameter_test_0230 promise set hw_sc.build.os.version success: ' + value);
console.info('testSet0230 promise set hw_sc.build.os.version success: ' + value);
}).catch(function (err) {
console.info('system_parameter_test_0230 promise set hw_sc.build.os.version error: ' + err.code);
console.info('testSet0230 promise set hw_sc.build.os.version error: ' + err.code);
});
} catch (err) {
ret = true;
console.info('system_parameter_test_0230 set callback hw_sc.build.os.version unexpect err:' + err);
console.info('testSet0230 set callback hw_sc.build.os.version unexpect err:' + err);
expect(ret).assertTrue();
done();
}
console.info('system_parameter_test_0230 : end');
console.info('testSet0230 : end');
})
/**
......@@ -183,18 +183,18 @@ describe('SystemParameterTest', function () {
* @tc.name testSetSync0300
* @tc.desc Set the value for the given key.
*/
it('system_parameter_test_0300', 0, function () {
console.info('system_parameter_test_0300 start');
it('testSetSync0300', 0, function () {
console.info('testSetSync0300 start');
let ret = false;
try {
systemparameter.setSync('hw_sc.build.os.version', '2.5.3.10');
console.info('system_parameter_test_0300 promise setSync hw_sc.build.os.version success');
console.info('testSetSync0300 promise setSync hw_sc.build.os.version success');
ret = true;
} catch (err) {
console.info('system_parameter_test_0300 promise setSync hw_sc.build.os.version: ' + err);
console.info('testSetSync0300 promise setSync hw_sc.build.os.version: ' + err);
}
expect(ret).assertTrue();
console.info('system_parameter_test_0300 : end');
console.info('testSetSync0300 : end');
})
/**
......@@ -202,8 +202,8 @@ describe('SystemParameterTest', function () {
* @tc.name testSetSync0310
* @tc.desc Set the property value to an extra long string
*/
it('system_parameter_test_0310', 0, async function (done) {
console.info('system_parameter_test_0310 start');
it('testSetSync0310', 0, async function (done) {
console.info('testSetSync0310 start');
let ret = false;
let sysValue = null;
try {
......@@ -214,19 +214,19 @@ describe('SystemParameterTest', function () {
console.info(' get testcast0310 system version : ' + value);
sysValue = value;
if (sysValue === PROPERTY_MAX_VALUE) {
console.info('system_parameter_test_0310 promise setSynchw_sc.build.os.version failed :'
console.info('testSetSync0310 promise setSynchw_sc.build.os.version failed :'
+ sysValue);
} else {
console.info('system_parameter_test_0310 promise setSync hw_sc.build.os.version: ' + sysValue);
console.info('testSetSync0310 promise setSync hw_sc.build.os.version: ' + sysValue);
ret = true;
expect(ret).assertTrue();
done();
}
})
} catch (err) {
console.info('system_parameter_test_0310 promise setSync hw_sc.build.os.version: ' + err);
console.info('testSetSync0310 promise setSync hw_sc.build.os.version: ' + err);
}
console.info('system_parameter_test_0310 : end');
console.info('testSetSync0310 : end');
})
/**
......@@ -234,19 +234,19 @@ describe('SystemParameterTest', function () {
* @tc.name testSetSync0320
* @tc.desc Set a value that is not a string to the property value
*/
it('system_parameter_test_0320', 0, function () {
console.info('system_parameter_test_0320 start');
it('testSetSync0320', 0, function () {
console.info('testSetSync0320 start');
let ret = false;
try {
systemparameter.setSync('hw_sc.build.os.version', 111);
console.info('system_parameter_test_0320 promise setSync hw_sc.build.os.version success: ');
console.info('testSetSync0320 promise setSync hw_sc.build.os.version success: ');
} catch (err) {
console.info('system_parameter_test_0320 promise setSync hw_sc.build.os.version error: ' + err);
console.info('testSetSync0320 promise setSync hw_sc.build.os.version error: ' + err);
ret = true;
}
expect(ret).assertTrue();
console.info('system_parameter_test_0320 : end');
console.info('testSetSync0320 : end');
})
/**
......@@ -254,8 +254,8 @@ describe('SystemParameterTest', function () {
* @tc.name testSetSync0340
* @tc.desc Set parameter value ' '
*/
it('system_parameter_test_0340', 0, async function (done) {
console.info('system_parameter_test_0340 start');
it('testSetSync0340', 0, async function (done) {
console.info('testSetSync0340 start');
let ret = false;
let sysValue = 0;
try {
......@@ -263,22 +263,22 @@ describe('SystemParameterTest', function () {
let parameterInfo = systemparameter.get('hw_sc.build.os.version');
parameterInfo.then(function (value) {
ret = true;
console.info(' get testcast0340 system version : ' + value);
console.info(' get testSetSync0340 system version : ' + value);
sysValue = value;
if (sysValue === ' ') {
console.info('system_parameter_test_0340 promise get rhw_sc.build.os.version :' + sysValue);
console.info('testSetSync0340 promise get rhw_sc.build.os.version :' + sysValue);
ret = true;
expect(ret).assertTrue();
done();
} else {
console.info('system_parameter_test_0340 promise get hw_sc.build.os.version: ' + sysValue);
console.info('testSetSync0340 promise get hw_sc.build.os.version: ' + sysValue);
}
})
} catch (err) {
ret = true;
console.info('promise get hw_sc.build.os.version: ' + err);
}
console.info('system_parameter_test_0340 : end');
console.info('testSetSync0340 : end');
})
/**
......@@ -286,24 +286,24 @@ describe('SystemParameterTest', function () {
* @tc.name testGet0400
* @tc.desc get systemparameter value
*/
it('system_parameter_test_0400', 0, async function (done) {
console.info('system_parameter_test_0400 start');
it('testGet0400', 0, async function (done) {
console.info('testGet0400 start');
let ret = false;
try {
let parameterInfo = systemparameter.get('hw_sc.build.os.version');
parameterInfo.then(function (value) {
ret = true;
console.info(' system_parameter_test_0400 promise get hw_sc.build.os.version success: ' + value);
console.info(' testGet0400 promise get hw_sc.build.os.version success: ' + value);
expect(ret).assertTrue();
done();
}).catch(function (err) {
console.info(' system_parameter_test_0400 promise get hw_sc.build.os.version error: ' + err.code);
console.info(' testGet0400 promise get hw_sc.build.os.version error: ' + err.code);
});
} catch (err) {
console.info('system_parameter_test_0400 promise setSync hw_sc.build.os.version error: ' + err);
console.info('testGet0400 promise setSync hw_sc.build.os.version error: ' + err);
}
console.info('system_parameter_test_0400 : end');
console.info('testGet0400 : end');
})
/**
......@@ -311,15 +311,15 @@ describe('SystemParameterTest', function () {
* @tc.name testGet0410
* @tc.desc Get an attribute key that successfully sets value
*/
it('system_parameter_test_0410', 0, async function (done) {
console.info('system_parameter_test_0410 start');
it('testGet0410', 0, async function (done) {
console.info('testGet0410 start');
let ret = false;
try {
systemparameter.set('hw_sc.build.os.version', '1.1.1.1').then((data, err) => {
if (err == undefined) {
console.info('system_parameter_test_0410 set sucess :' + data);
console.info('testGet0410 set sucess :' + data);
} else {
console.info('system_parameter_test_0410 set failed :' + err.code());
console.info('testGet0410 set failed :' + err.code());
}
return p;
})
......@@ -337,9 +337,9 @@ describe('SystemParameterTest', function () {
});
}, '1000');
} catch (err) {
console.info('system_parameter_test_0400 promise get shw_sc.build.os.version error: ' + err);
console.info('testGet0410 promise get shw_sc.build.os.version error: ' + err);
}
console.info('system_parameter_test_0400 : end');
console.info('testGet0410 : end');
})
/**
......@@ -347,16 +347,16 @@ describe('SystemParameterTest', function () {
* @tc.name testGet0420
* @tc.desc Get an attribute key value that sets the qualified value
*/
it('system_parameter_test_0420', 0, async function (done) {
console.info('system_parameter_test_0420 start');
it('testGet0420', 0, async function (done) {
console.info('testGet0420 start');
let ret = false;
let sysValue = 0;
try {
systemparameter.set('hw_sc.build.os.version', '1.1.1.1').then((data, err) => {
if (err == undefined) {
console.info('system_parameter_test_0420 set sucess :' + data);
console.info('testGet0420 set sucess :' + data);
} else {
console.info('system_parameter_test_0420 set failed :' + err.code());
console.info('testGet0420 set failed :' + err.code());
}
})
let parameter = systemparameter.get('hw_sc.build.os.version', '10.3.4.5.63');
......@@ -364,19 +364,19 @@ describe('SystemParameterTest', function () {
sysValue = value;
if (sysValue === '1.1.1.1') {
ret = true;
console.info(' system_parameter_test_0420 promise get hw_sc.build.os.version success: ' + value);
console.info(' testGet0420 promise get hw_sc.build.os.version success: ' + value);
expect(ret).assertTrue();
done();
} else {
console.info(' system_parameter_test_0420 promise get hw_sc.build.os.version faile ' + value);
console.info(' testGet0420 promise get hw_sc.build.os.version faile ' + value);
}
}).catch(function (err) {
console.info(' system_parameter_test_0420 promise get hw_sc.build.os.version error: ' + err.code);
console.info(' testGet0420 promise get hw_sc.build.os.version error: ' + err.code);
});
} catch (err) {
console.info('system_parameter_test_0420 promise get hw_sc.build.os.version error: ' + err);
console.info('testGet0420 promise get hw_sc.build.os.version error: ' + err);
}
console.info('system_parameter_test_0420 : end');
console.info('testGet0420 : end');
})
/**
......@@ -384,28 +384,28 @@ describe('SystemParameterTest', function () {
* @tc.name testGet0430
* @tc.desc Get a value without attribute key
*/
it('system_parameter_test_0430', 0, async function (done) {
console.info('system_parameter_test_0430 start');
it('testGet0430', 0, async function (done) {
console.info('testGet0430 start');
let ret = false;
try {
systemparameter.get(' ', '0.0.0.0').then((data, err) => {
if (err == undefined) {
console.info('system_parameter_test_0430 promise success: ' + data);
console.info('testGet0430 promise success: ' + data);
ret = true;
expect(ret).assertTrue();
} else {
console.info(' system_parameter_test_0430 promise get faile ' + err);
console.info(' testGet0430 promise get faile ' + err);
}
})
} catch (err) {
console.info('system_parameter_test_0430 promise catch get failed ' + err);
console.info('testGet0430 promise catch get failed ' + err);
}
setTimeout(function () {
expect(ret).assertTrue();
done();
}, '1000');
console.info('system_parameter_test_0430 : end');
console.info('testGet0430 : end');
})
/**
......@@ -413,26 +413,26 @@ describe('SystemParameterTest', function () {
* @tc.name testGet0440
* @tc.desc Directly obtain the key value of a normal setting attribute
*/
it('system_parameter_test_0440', 0, async function (done) {
console.info('system_parameter_test_0440 start');
it('testGet0440', 0, async function (done) {
console.info('testGet0440 start');
let ret = false;
try {
let parameter = systemparameter.get('c.c.c.c', '10.3.4.5.63');
parameter.then(function (value) {
ret = true;
console.info(' system_parameter_test_0440 promise get hw_sc.build.os.version success: ' + value);
console.info(' testGet0440 promise get hw_sc.build.os.version success: ' + value);
expect(ret).assertTrue();
}).catch(function (err) {
console.info(' system_parameter_test_0440 promise get hw_sc.build.os.version error: ' + err.code);
console.info(' testGet0440 promise get hw_sc.build.os.version error: ' + err.code);
});
} catch (err) {
console.info('system_parameter_test_0440 promise setSync hw_sc.build.os.version: ' + err);
console.info('testGet0440 promise setSync hw_sc.build.os.version: ' + err);
}
setTimeout(function () {
expect(ret).assertTrue();
done();
}, '1000');
console.info('system_parameter_test_0440 : end');
console.info('testGet0440 : end');
})
/**
......@@ -440,26 +440,26 @@ describe('SystemParameterTest', function () {
* @tc.name testGet0450
* @tc.desc Set the property value to an extra long string
*/
it('system_parameter_test_0450', 0, async function (done) {
console.info('system_parameter_test_0450 start');
it('testGet0450', 0, async function (done) {
console.info('testGet0450 start');
let ret = false;
try {
let parameter = systemparameter.get('a.b.b.c', PROPERTY_MAX_VALUE);
parameter.then(function (value) {
console.info(' system_parameter_test_0450 promise get a.b.b.c success: ' + value);
console.info(' testGet0450 promise get a.b.b.c success: ' + value);
}).catch(function (err) {
ret = true;
console.info(' system_parameter_test_0450 promise get a.b.b.c error: ' + err.code);
console.info(' testGet0450 promise get a.b.b.c error: ' + err.code);
expect(ret).assertTrue();
});
} catch (err) {
console.info('system_parameter_test_0450 promise setSync a.b.b.c error: ' + err);
console.info('testGet0450 promise setSync a.b.b.c error: ' + err);
}
setTimeout(function () {
expect(ret).assertTrue();
done();
}, '1000');
console.info('system_parameter_test_0450 : end');
console.info('testGet0450 : end');
})
/**
......@@ -467,27 +467,27 @@ describe('SystemParameterTest', function () {
* @tc.name testGet0500
* @tc.desc Get a property key value
*/
it('system_parameter_test_0500', 0, async function (done) {
console.info('system_parameter_test_0500 start');
it('testGet0500', 0, async function (done) {
console.info('testGet0500 start');
let ret = false;
try {
systemparameter.get('hw_sc.build.os.version', (err, data) => {
if (err == undefined) {
console.log('system_parameter_test_0500 get test.parameter.key value success:' + data);
console.log('testGet0500 get test.parameter.key value success:' + data);
ret = true;
expect(ret).assertTrue();
} else {
console.log('system_parameter_test_0500 get test.parameter.key value err:' + err.code)
console.log('testGet0500 get test.parameter.key value err:' + err.code)
}
});
} catch (err) {
console.log('system_parameter_test_0500 get unexpected error: ' + err);
console.log('testGet0500 get unexpected error: ' + err);
}
setTimeout(function () {
expect(ret).assertTrue();
done();
}, '1000');
console.info('system_parameter_test_0500 : end');
console.info('testGet0500 : end');
})
/**
......@@ -495,33 +495,33 @@ describe('SystemParameterTest', function () {
* @tc.name testGet0510
* @tc.desc Get a set successful attribute key value
*/
it('system_parameter_test_0510', 0, async function (done) {
it('testGet0510', 0, async function (done) {
let ret = false;
try {
systemparameter.set('aaaaaa', '2.2.2.2').then((data, err) => {
if (err == undefined) {
console.info('system_parameter_test_0510 set aaaaa sucess :' + data);
console.info('testGet0510 set aaaaa sucess :' + data);
} else {
console.info('system_parameter_test_0510 set aaaaa failed :' + err);
console.info('testGet0510 set aaaaa failed :' + err);
}
})
systemparameter.get('aaaaaa', (err, data) => {
if (err == undefined) {
console.info('system_parameter_test_0510 get aaaaa sucess :' + data);
console.info('testGet0510 get aaaaa sucess :' + data);
ret = true;
expect(ret).assertTrue();
} else {
console.info('system_parameter_test_0510 get aaaaa failed :' + err.code);
console.info('testGet0510 get aaaaa failed :' + err.code);
}
})
} catch (err) {
console.info('system_parameter_test_0510 promise get input error: ' + err);
console.info('testGet0510 promise get input error: ' + err);
}
setTimeout(function () {
expect(ret).assertTrue();
done();
}, '1000');
console.info('system_parameter_test_0510 : end');
console.info('testGet0510 : end');
})
/**
......@@ -529,27 +529,27 @@ describe('SystemParameterTest', function () {
* @tc.name testGet0520
* @tc.desc Get a property key value directly
*/
it('system_parameter_test_0520', 0, async function (done) {
console.info('system_parameter_test_0520 start');
it('testGet0520', 0, async function (done) {
console.info('testGet0520 start');
let ret = false;
try {
systemparameter.get('a.a.a.a ', (err, data) => {
if (err == undefined) {
console.info('system_parameter_test_0520 get systemparameter sucess: ' + data);
console.info('testGet0520 get systemparameter sucess: ' + data);
ret = true;
expect(ret).assertTrue();
} else {
console.info('system_parameter_test_0520 get systemparameter sucess: ' + err.code);
console.info('testGet0520 get systemparameter sucess: ' + err.code);
}
})
} catch (err) {
console.info('system_parameter_test_0520 promise get input error: ' + err);
console.info('testGet0520 promise get input error: ' + err);
}
setTimeout(function () {
expect(ret).assertTrue();
done();
}, '1000');
console.info('system_parameter_test_0520 : end');
console.info('testGet0520 : end');
})
/**
......@@ -557,27 +557,27 @@ describe('SystemParameterTest', function () {
* @tc.name testGet0530
* @tc.desc Gets the value of an empty string
*/
it('system_parameter_test_0530', 0, async function (done) {
console.info('system_parameter_test_0530 start');
it('testGet0530', 0, async function (done) {
console.info('testGet0530 start');
let ret = false;
try {
systemparameter.get(' ', (err, data) => {
if (err == undefined) {
console.info('system_parameter_test_0530 get systemparameter sucess: ' + data);
console.info('testGet0530 get systemparameter sucess: ' + data);
ret = true;
expect(ret).assertTrue();
} else {
console.info('system_parameter_test_0530 get systemparameter sucess: ' + err.code);
console.info('testGet0530 get systemparameter sucess: ' + err.code);
}
})
} catch (err) {
console.info('system_parameter_test_0530 promise get input error: ' + err);
console.info('testGet0530 promise get input error: ' + err);
}
setTimeout(function () {
expect(ret).assertTrue();
done();
}, '1000');
console.info('system_parameter_test_0530 : end');
console.info('testGet0530 : end');
})
/**
......@@ -585,29 +585,29 @@ describe('SystemParameterTest', function () {
* @tc.name testGet0600
* @tc.desc Set the value for the given key.
*/
it('system_parameter_test_0600', 0, function (done) {
console.info('system_parameter_test_0600 start');
it('testGet0600', 0, function (done) {
console.info('testGet0600 start');
let ret = false;
try {
systemparameter.get('hw_sc.build.os.version', '1.1.1.1', async (err, data) => {
if (err == undefined && data === '1.1.1.1') {
ret = true;
console.info('system_parameter_test_0600 get systemparameter hw_sc.build.os.version sucess: '
console.info('testGet0600 get systemparameter hw_sc.build.os.version sucess: '
+ data);
expect(ret).assertTrue();
} else {
console.info('system_parameter_test_0600 get systemparameter hw_sc.build.os.version failed: '
console.info('testGet0600 get systemparameter hw_sc.build.os.version failed: '
+ err.code);
}
})
} catch (err) {
console.info('system_parameter_test_0600 get systemparameter hw_sc.build.os.version abnormal: ', err);
console.info('testGet0600 get systemparameter hw_sc.build.os.version abnormal: ', err);
}
setTimeout(function () {
expect(ret).assertTrue();
done();
}, '1000');
console.info('system_parameter_test_0610 : end');
console.info('testGet0600 : end');
})
/**
......@@ -615,28 +615,28 @@ describe('SystemParameterTest', function () {
* @tc.name testGet0610
* @tc.desc Gets an attribute key value whose value is not a string
*/
it('system_parameter_test_0610', 0, async function (done) {
console.info('system_parameter_test_0610 start');
it('testGet0610', 0, async function (done) {
console.info('testGet0610 start');
let ret = false;
try {
systemparameter.get('hw_sc.build.os.version', 111, (err, data) => {
if (err == undefined && data === 111) {
console.info('system_parameter_test_0610 get systemparameter hw_sc.build.os.version sucess: '
console.info('testGet0610 get systemparameter hw_sc.build.os.version sucess: '
+ data);
} else {
console.info('system_parameter_test_0610 get systemparameter hw_sc.build.os.version failed: '
console.info('testGet0610 get systemparameter hw_sc.build.os.version failed: '
+ err.code);
}
})
} catch (err) {
ret = true;
console.info('system_parameter_test_0610 get systemparameter hw_sc.build.os.version abnormal: ', err);
console.info('testGet0610 get systemparameter hw_sc.build.os.version abnormal: ', err);
done();
setTimeout(function () {
expect(ret).assertTrue();
}, '1000');
}
console.info('system_parameter_test_0610 : end');
console.info('testGet0610 : end');
})
/**
......@@ -644,28 +644,28 @@ describe('SystemParameterTest', function () {
* @tc.name testGet0620
* @tc.desc Get an attribute key value whose value is empty
*/
it('system_parameter_test_0620', 0, async function (done) {
console.info('system_parameter_test_0620 start');
it('testGet0620', 0, async function (done) {
console.info('testGet0620 start');
let ret = false;
try {
systemparameter.get('hw_sc.build.os.version', ' ', (err, data) => {
if (err == undefined) {
ret = true;
console.info('system_parameter_test_0620 get systemparameter hw_sc.build.os.version sucess: '
console.info('testGet0620 get systemparameter hw_sc.build.os.version sucess: '
+ data);
} else {
console.info('system_parameter_test_0620 get systemparameter hw_sc.build.os.version failed: '
console.info('testGet0620 get systemparameter hw_sc.build.os.version failed: '
+ err.code);
}
})
} catch (err) {
console.info('system_parameter_test_0620 get systemparameter hw_sc.build.os.version abnormal: ', err);
console.info('testGet0620 get systemparameter hw_sc.build.os.version abnormal: ', err);
}
setTimeout(function () {
expect(ret).assertTrue();
done();
}, '1000');
console.info('system_parameter_test_0620 : end');
console.info('testGet0620 : end');
})
/**
......@@ -676,27 +676,27 @@ describe('SystemParameterTest', function () {
* @tc.type : Function
* @tc.level : Level 0
*/
it('system_parameter_test_0640', 0, async function (done) {
console.info('system_parameter_test_0640 start');
it('testGet0640', 0, async function (done) {
console.info('testGet0640 start');
let ret = false;
try {
systemparameter.get('b.b.b.b.b', PROPERTY_MAX_VALUE, (err, data) => {
if (err == undefined) {
console.info('system_parameter_test_0640 get systemparameter b.b.b.b.b sucess: '
console.info('testGet0640 get systemparameter b.b.b.b.b sucess: '
+ data);
} else {
ret = true;
console.info('system_parameter_test_0640 get systemparameter b.b.b.b.b failed: ' + err.code);
console.info('testGet0640 get systemparameter b.b.b.b.b failed: ' + err.code);
}
})
} catch (err) {
console.info('system_parameter_test_0640 get systemparameter b.b.b.b.b abnormal: ', err);
console.info('testGet0640 get systemparameter b.b.b.b.b abnormal: ', err);
}
setTimeout(function () {
expect(ret).assertTrue();
done();
}, '1000');
console.info('system_parameter_test_0640 : end');
console.info('testGet0640 : end');
})
/**
......@@ -704,19 +704,19 @@ describe('SystemParameterTest', function () {
* @tc.name testGetSync0700
* @tc.desc Gets an attribute key value whose attribute value is not a string
*/
it('system_parameter_test_0700', 0, function (done) {
console.info('system_parameter_test_0700 start');
it('testGetSync0700', 0, function (done) {
console.info('testGetSync0700 start');
let ret = false;
try {
let parameterInfo = systemparameter.getSync('hw_sc.build.os.version', 496);
console.info(JSON.stringify(parameterInfo));
} catch (err) {
ret = true;
console.info('system_parameter_test_0700 promise get input error: ' + err);
console.info('testGetSync0700 promise get input error: ' + err);
done();
}
expect(ret).assertTrue();
console.info('system_parameter_test_0700 : end');
console.info('testGetSync0700 : end');
})
/**
......@@ -724,19 +724,19 @@ describe('SystemParameterTest', function () {
* @tc.name testGetSync0710
* @tc.desc Get a property key value that sets the correct value
*/
it('system_parameter_test_0710', 0, function (done) {
console.info('system_parameter_test_0710 start');
it('testGetSync0710', 0, function (done) {
console.info('testGetSync0710 start');
let ret = false;
try {
let parameterInfo = systemparameter.getSync('hw_sc.build.os.version', '0.0.0.0');
ret = true;
console.info('system_parameter_test_0710 promise get input sucess: ', parameterInfo);
console.info('testGetSync0710 promise get input sucess: ', parameterInfo);
done();
} catch (err) {
console.info('system_parameter_test_0710 promise get input error: ' + err);
console.info('testGetSync0710 promise get input error: ' + err);
}
expect(ret).assertTrue();
console.info('system_parameter_test_0710 : end');
console.info('testGetSync0710 : end');
})
/**
......@@ -744,19 +744,19 @@ describe('SystemParameterTest', function () {
* @tc.name testGetSync0720
* @tc.desc Get the value of the attribute key directly
*/
it('system_parameter_test_0720', 0, function (done) {
console.info('system_parameter_test_0720 start');
it('testGetSync0720', 0, function (done) {
console.info('testGetSync0720 start');
let ret = false;
try {
let parameterInfo = systemparameter.getSync('hw_sc.build.os.version');
ret = true;
console.info('system_parameter_test_0720 promise get input sucess: ', parameterInfo);
console.info('testGetSync0720 promise get input sucess: ', parameterInfo);
done();
} catch (err) {
console.info('system_parameter_test_0720 promise get input error: ' + err);
console.info('testGetSync0720 promise get input error: ' + err);
}
expect(ret).assertTrue();
console.info('system_parameter_test_0720: end');
console.info('testGetSync0720: end');
})
/**
......@@ -764,20 +764,20 @@ describe('SystemParameterTest', function () {
* @tc.name testGetSync0730
* @tc.desc Get the value of the attribute key directly
*/
it('system_parameter_test_0730', 0, function (done) {
console.info('system_parameter_test_0730 start');
it('testGetSync0730', 0, function (done) {
console.info('testGetSync0730 start');
let ret = false;
try {
let parameterInfo = systemparameter.getSync('a.b.c.d.1.2.3.4', '1.2.3.4');
console.info('system_parameter_test_0730 get parameter = ', parameterInfo);
console.info('testGetSync0730 get parameter = ', parameterInfo);
ret = true;
console.info('system_parameter_test_0730 promise get input sucess: ', parameterInfo);
console.info('testGetSync0730 promise get input sucess: ', parameterInfo);
done();
} catch (err) {
console.info('system_parameter_test_0730 promise get input error: ' + err);
console.info('testGetSync0730 promise get input error: ' + err);
}
expect(ret).assertTrue();
console.info('system_parameter_test_0730: end');
console.info('testGetSync0730: end');
})
/**
......@@ -785,19 +785,19 @@ describe('SystemParameterTest', function () {
* @tc.name testGetSync0740
* @tc.desc Gets the value of the attribute with the specified key.
*/
it('system_parameter_test_0740', 0, function (done) {
console.info('system_parameter_test_0740 start');
it('testGetSync0740', 0, function (done) {
console.info('testGetSync0740 start');
let ret = false;
try {
systemparameter.setSync('hw_sc.build.os.version', '9.8.7.6');
let parameterInfo = systemparameter.getSync('hw_sc.build.os.version', '0.0.0.0');
ret = true;
console.info('system_parameter_test_0740 promise get input sucess: ', parameterInfo);
console.info('testGetSync0740 promise get input sucess: ', parameterInfo);
done();
} catch (err) {
console.info('system_parameter_test_0740 promise get input error: ' + err);
console.info('testGetSync0740 promise get input error: ' + err);
}
expect(ret).assertTrue();
console.info('system_parameter_test_0740 : end');
console.info('testGetSync0740 : end');
})
})
\ No newline at end of file
......@@ -45,17 +45,17 @@ describe('SystemParameterTest', function () {
* @tc.name testWaitPromise01
* @tc.desc Waits the value of the attribute with the specified key.
*/
it('system_parameter_test_0801', 0, async function (done) {
console.info('system_parameter_test_0801 start');
it('testWaitPromise01', 0, async function (done) {
console.info('testWaitPromise01 start');
let ret = false;
try {
var parameterInfo = systemparameter.wait("test.wait_param.101", "100", 1);
parameterInfo.then(function (result) { // timeout
console.info("system_parameter_test_0801 test.wait_param.101 success: " + result);
console.info("testWaitPromise01 test.wait_param.101 success: " + result);
expect(ret).assertTrue();
}).catch(function (err) {
ret = true;
console.info("system_parameter_test_0801 test.wait_param.101 error: " + err.code);
console.info("testWaitPromise01 test.wait_param.101 error: " + err.code);
expect(ret).assertTrue();
done();
});
......@@ -63,7 +63,7 @@ describe('SystemParameterTest', function () {
expect(ret).assertTrue();
console.info("promise get input error: " + e);
}
console.info('system_parameter_test_0801 end');
console.info('testWaitPromise01 end');
})
/**
......@@ -71,18 +71,18 @@ describe('SystemParameterTest', function () {
* @tc.name testWaitPromise02
* @tc.desc Waits the value of the attribute with the specified key.
*/
it('system_parameter_test_0802', 0, async function (done) {
console.info('system_parameter_test_0802 start');
it('testWaitPromise02', 0, async function (done) {
console.info('testWaitPromise02 start');
let ret = false;
try {
var parameterInfo = systemparameter.wait("test.wait_param.102", "", 1);
parameterInfo.then(function (result) { // timeout
console.info("system_parameter_test_0802 test.wait_param.102 success: ");
console.info("testWaitPromise02 test.wait_param.102 success: ");
expect(ret).assertTrue();
done();
}).catch(function (err) {
ret = true;
console.info("system_parameter_test_0802 test.wait_param.102 error: " + err.code);
console.info("testWaitPromise02 test.wait_param.102 error: " + err.code);
expect(ret).assertTrue();
done();
});
......@@ -90,7 +90,7 @@ describe('SystemParameterTest', function () {
expect(ret).assertTrue();
console.info("promise get input error: " + e);
}
console.info('system_parameter_test_0802 end');
console.info('testWaitPromise02 end');
})
/**
......@@ -98,26 +98,26 @@ describe('SystemParameterTest', function () {
* @tc.name testWaitPromise03
* @tc.desc Waits the value of the attribute with the specified key.
*/
it('system_parameter_test_0803', 0, async function (done) {
console.info('system_parameter_test_0803 start');
it('testWaitPromise03', 0, async function (done) {
console.info('testWaitPromise03 start');
let ret = false;
SetParameter("test.wait_param.103", "103");
try {
var parameterInfo = systemparameter.wait("test.wait_param.103", "103", 1);
parameterInfo.then(function (result) { // ok
ret = true;
console.info("system_parameter_test_0803 test.wait_param.103 success: ");
console.info("testWaitPromise03 test.wait_param.103 success: ");
expect(ret).assertTrue();
done();
}).catch(function (err) {
expect(ret).assertTrue();
console.info("system_parameter_test_0803 test.wait_param.103 error: " + err.code);
console.info("testWaitPromise03 test.wait_param.103 error: " + err.code);
});
} catch (e) {
expect(ret).assertTrue();
console.info("promise get input error: " + e);
}
console.info('system_parameter_test_0803 end');
console.info('testWaitPromise03 end');
})
/**
......@@ -125,26 +125,26 @@ describe('SystemParameterTest', function () {
* @tc.name testWaitPromise04
* @tc.desc Waits the value of the attribute with the specified key.
*/
it('system_parameter_test_0804', 0, async function (done) {
console.info('system_parameter_test_0804 start');
it('testWaitPromise04', 0, async function (done) {
console.info('testWaitPromise04 start');
let ret = false;
SetParameter("test.wait_param.104", "104");
try {
var parameterInfo = systemparameter.wait("test.wait_param.104", "*", 1);
parameterInfo.then(function (result) { // ok
ret = true;
console.info("system_parameter_test_0804 test.wait_param.104 success");
console.info("testWaitPromise04 test.wait_param.104 success");
expect(ret).assertTrue();
done();
}).catch(function (err) {
console.info("system_parameter_test_0804 test.wait_param.104 error: " + err.code);
console.info("testWaitPromise04 test.wait_param.104 error: " + err.code);
expect(ret).assertTrue();
});
} catch (e) {
expect(ret).assertTrue();
console.info("promise get input error: " + e);
}
console.info('system_parameter_test_0804 end');
console.info('testWaitPromise04 end');
})
/**
......@@ -152,26 +152,26 @@ describe('SystemParameterTest', function () {
* @tc.name testWaitPromise05
* @tc.desc Waits the value of the attribute with the specified key.
*/
it('system_parameter_test_0805', 0, async function (done) {
console.info('system_parameter_test_0805 start');
it('testWaitPromise05', 0, async function (done) {
console.info('testWaitPromise05 start');
let ret = false;
SetParameter("test.wait_param.105", "105");
try {
var parameterInfo = systemparameter.wait("test.wait_param.105", "*", -1);
parameterInfo.then(function (result) {
ret = true;
console.info("system_parameter_test_0805 test.wait_param.105 success");
console.info("testWaitPromise05 test.wait_param.105 success");
expect(ret).assertTrue();
done();
}).catch(function (err) {
console.info("system_parameter_test_0805 test.wait_param.105 error: " + err.code);
console.info("testWaitPromise05 test.wait_param.105 error: " + err.code);
expect(ret).assertTrue();
});
} catch (e) {
expect(ret).assertTrue();
console.info("promise get input error: " + e);
}
console.info('system_parameter_test_0805 end');
console.info('testWaitPromise05 end');
})
/**
......@@ -179,28 +179,28 @@ describe('SystemParameterTest', function () {
* @tc.name testWait01
* @tc.desc Waits the value of the attribute with the specified key.
*/
it('system_parameter_test_0806', 0, async function (done) {
console.info('system_parameter_test_0806 start');
it('testWait01', 0, async function (done) {
console.info('testWait01 start');
let ret = false;
try {
systemparameter.wait("test.wait_param.201", "100", 1, function (err, data) {
if (err == undefined || err.code === 0) {
console.info("system_parameter_test_0806 test.wait_param.201 success")
console.info("testWait01 test.wait_param.201 success")
} else {
ret = true; // wait timeout
console.info("system_parameter_test_0806 test.wait_param.201 err:" + err.code);
console.info("testWait01 test.wait_param.201 err:" + err.code);
expect(ret).assertTrue();
}
});
} catch (e) {
expect(ret).assertTrue();
console.info("system_parameter_test_0806 get input error: " + e);
console.info("testWait01 get input error: " + e);
}
setTimeout(function () {
expect(ret).assertTrue();
done();
}, '2000');
console.info('system_parameter_test_0806 end');
console.info('testWait01 end');
})
/**
......@@ -208,17 +208,17 @@ describe('SystemParameterTest', function () {
* @tc.name testWait02
* @tc.desc Waits the value of the attribute with the specified key.
*/
it('system_parameter_test_0807', 0, async function (done) {
console.info('system_parameter_test_0807 start');
it('testWait02', 0, async function (done) {
console.info('testWait02 start');
let ret = false;
try {
ret = true;
systemparameter.wait("test.wait_param.202", "", 1, function (err, data) {
if (err == undefined || err.code === 0) { // timeout
ret = false;
console.info("system_parameter_test_0807 test.wait_param.202 success");
console.info("testWait02 test.wait_param.202 success");
} else {
console.info("system_parameter_test_0807 callback test.wait_param.202 err:" + err.code);
console.info("testWait02 callback test.wait_param.202 err:" + err.code);
}
expect(ret).assertTrue();
done();
......@@ -228,7 +228,7 @@ describe('SystemParameterTest', function () {
console.info("get input error: " + e);
}
expect(ret).assertTrue();
console.info('system_parameter_test_0807 end');
console.info('testWait02 end');
})
/**
......@@ -236,17 +236,17 @@ describe('SystemParameterTest', function () {
* @tc.name testWait03
* @tc.desc Waits the value of the attribute with the specified key.
*/
it('system_parameter_test_0808', 0, async function (done) {
console.info('system_parameter_test_0808 start');
it('testWait03', 0, async function (done) {
console.info('testWait03 start');
let ret = false;
SetParameter("test.wait_param.203", "103");
try {
systemparameter.wait("test.wait_param.203", "103", 1, function (err, data) {
if (err == undefined || err.code === 0) {
ret = true;
console.info("system_parameter_test_0808 test.wait_param.203 success")
console.info("testWait03 test.wait_param.203 success")
} else {
console.info("system_parameter_test_0808 test.wait_param.203 err:" + err.code)
console.info("testWait03 test.wait_param.203 err:" + err.code)
}
expect(ret).assertTrue();
});
......@@ -258,7 +258,7 @@ describe('SystemParameterTest', function () {
expect(ret).assertTrue();
done();
}, '1000');
console.info('system_parameter_test_0808 end');
console.info('testWait03 end');
})
/**
......@@ -266,18 +266,18 @@ describe('SystemParameterTest', function () {
* @tc.name testWait04
* @tc.desc Waits the value of the attribute with the specified key.
*/
it('system_parameter_test_0809', 0, async function (done) {
console.info('system_parameter_test_0809 start');
it('testWait04', 0, async function (done) {
console.info('testWait04 start');
let ret = false;
SetParameter("test.wait_param.204", "104");
try {
systemparameter.wait("test.wait_param.204", "*", 1, function (err, data) {
if (err == undefined || err.code === 0) {
ret = true;
console.info("system_parameter_test_0809 test.wait_param.204 success")
console.info("testWait04 test.wait_param.204 success")
} else {
ret = false;
console.info("system_parameter_test_0809 callback test.wait_param.204 err:" + err.code)
console.info("testWait04 callback test.wait_param.204 err:" + err.code)
}
expect(ret).assertTrue();
});
......@@ -289,7 +289,7 @@ describe('SystemParameterTest', function () {
expect(ret).assertTrue();
done();
}, '1000');
console.info('system_parameter_test_0809 end');
console.info('testWait04 end');
})
/**
......@@ -297,17 +297,17 @@ describe('SystemParameterTest', function () {
* @tc.name testWait05
* @tc.desc Waits the value of the attribute with the specified key.
*/
it('system_parameter_test_0810', 0, async function (done) {
console.info('system_parameter_test_0810 start');
it('testWait05', 0, async function (done) {
console.info('testWait05 start');
let ret = false;
SetParameter("test.wait_param.205", "105");
try {
systemparameter.wait("test.wait_param.205", "*", 1, function (err, data) {
if (err == undefined || err.code === 0) {
ret = true;
console.info("system_parameter_test_0810 test.wait_param.205 success:" + data)
console.info("testWait05 test.wait_param.205 success:" + data)
} else {
console.info("system_parameter_test_0810 test.wait_param.205 err:" + err.code)
console.info("testWait05 test.wait_param.205 err:" + err.code)
}
expect(ret).assertTrue();
});
......@@ -319,6 +319,6 @@ describe('SystemParameterTest', function () {
expect(ret).assertTrue();
done();
}, '1000');
console.info('system_parameter_test_0810 end');
console.info('testWait05 end');
})
})
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册