Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
a15c5059
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
a15c5059
编写于
5月 17, 2022
作者:
O
openharmony_ci
提交者:
Gitee
5月 17, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3205 [startup_standard][master]modify systemparameter cases name
Merge pull request !3205 from leiyuqian/20220517_xts_1
上级
55bdbb89
29bd3fa8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
222 addition
and
222 deletion
+222
-222
startup/startup_standard/deviceinfo/src/main/js/default/test/ParametersJsUnit.test.js
...iceinfo/src/main/js/default/test/ParametersJsUnit.test.js
+171
-171
startup/startup_standard/systemparamter/src/main/js/default/test/SysParametersJs.test.js
...paramter/src/main/js/default/test/SysParametersJs.test.js
+51
-51
未找到文件。
startup/startup_standard/deviceinfo/src/main/js/default/test/ParametersJsUnit.test.js
浏览文件 @
a15c5059
...
...
@@ -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
(
'
testSet
0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testSet
0100 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
(
'
testSet
0100 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
(
'
testSet
0100 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
(
'
testSet
0100 set callback hw_sc.build.os.version unexpect err:
'
+
err
);
}
console
.
info
(
'
system_parameter_test_
0100 : end
'
);
console
.
info
(
'
testSet
0100 : 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
(
'
testSet
0110
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testSet
0110 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
(
'
testSet
0110 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
(
'
testSet
0110 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
(
'
testSet
0110 set callback hw_sc.build.os.version unexpect err:
'
+
err
);
expect
(
ret
).
assertTrue
();
done
();
}
console
.
info
(
'
system_parameter_test_
0110 : end
'
);
console
.
info
(
'
testSet
0110 : 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
(
'
testSet
0120
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testSet
0120 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
(
'
testSet
0120 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
(
'
testSet
0120 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
(
'
testSet
0120 set callback hw_sc.build.os.version unexpect err:
'
+
err
);
}
console
.
info
(
'
system_parameter_test_
0120 : end
'
);
console
.
info
(
'
testSet
0120 : 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
(
'
testSet
0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testSet
0200 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
(
'
testSet
0200 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
(
'
testSet
0200 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
(
'
testSet
0200 set callback hw_sc.build.os.version unexpect err:
'
+
err
)
}
console
.
info
(
'
system_parameter_test_
0200 : end
'
);
console
.
info
(
'
testSet
0200 : 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
(
'
testSet
0220
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testSet
0220 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
(
'
testSet
0220 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
(
'
testSet
0220 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
(
'
testSet
0220 set callback hw_sc.build.os.version unexpect err:
'
+
err
);
}
console
.
info
(
'
system_parameter_test_
0220 : end
'
);
console
.
info
(
'
testSet
0220 : 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
(
'
testSet
0230
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testSet
0230 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
(
'
testSet
0230 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
(
'
testSet
0230 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
(
'
testSet
0230 set callback hw_sc.build.os.version unexpect err:
'
+
err
);
expect
(
ret
).
assertTrue
();
done
();
}
console
.
info
(
'
system_parameter_test_
0230 : end
'
);
console
.
info
(
'
testSet
0230 : 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
(
'
testSetSync
0300
'
,
0
,
function
()
{
console
.
info
(
'
testSetSync
0300 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
(
'
testSetSync
0300 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
(
'
testSetSync
0300 promise setSync hw_sc.build.os.version:
'
+
err
);
}
expect
(
ret
).
assertTrue
();
console
.
info
(
'
system_parameter_test_
0300 : end
'
);
console
.
info
(
'
testSetSync
0300 : 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
(
'
testSetSync
0310
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testSetSync
0310 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
(
'
testSetSync
0310 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
(
'
testSetSync
0310 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
(
'
testSetSync
0310 promise setSync hw_sc.build.os.version:
'
+
err
);
}
console
.
info
(
'
system_parameter_test_
0310 : end
'
);
console
.
info
(
'
testSetSync
0310 : 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
(
'
testSetSync
0320
'
,
0
,
function
()
{
console
.
info
(
'
testSetSync
0320 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
(
'
testSetSync
0320 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
(
'
testSetSync
0320 promise setSync hw_sc.build.os.version error:
'
+
err
);
ret
=
true
;
}
expect
(
ret
).
assertTrue
();
console
.
info
(
'
system_parameter_test_
0320 : end
'
);
console
.
info
(
'
testSetSync
0320 : 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
(
'
testSetSync
0340
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testSetSync
0340 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 test
cast
0340 system version :
'
+
value
);
console
.
info
(
'
get test
SetSync
0340 system version :
'
+
value
);
sysValue
=
value
;
if
(
sysValue
===
'
'
)
{
console
.
info
(
'
system_parameter_test_
0340 promise get rhw_sc.build.os.version :
'
+
sysValue
);
console
.
info
(
'
testSetSync
0340 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
(
'
testSetSync
0340 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
(
'
testSetSync
0340 : 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
(
'
testGet
0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testGet
0400 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
(
'
testGet
0400 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
(
'
testGet
0400 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
(
'
testGet
0400 promise setSync hw_sc.build.os.version error:
'
+
err
);
}
console
.
info
(
'
system_parameter_test_
0400 : end
'
);
console
.
info
(
'
testGet
0400 : 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
(
'
testGet
0410
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testGet
0410 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
(
'
testGet
0410 set sucess :
'
+
data
);
}
else
{
console
.
info
(
'
system_parameter_test_
0410 set failed :
'
+
err
.
code
());
console
.
info
(
'
testGet
0410 set failed :
'
+
err
.
code
());
}
return
p
;
})
...
...
@@ -337,9 +337,9 @@ describe('SystemParameterTest', function () {
});
},
'
1000
'
);
}
catch
(
err
)
{
console
.
info
(
'
system_parameter_test_040
0 promise get shw_sc.build.os.version error:
'
+
err
);
console
.
info
(
'
testGet041
0 promise get shw_sc.build.os.version error:
'
+
err
);
}
console
.
info
(
'
system_parameter_test_040
0 : end
'
);
console
.
info
(
'
testGet041
0 : 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
(
'
testGet
0420
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testGet
0420 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
(
'
testGet
0420 set sucess :
'
+
data
);
}
else
{
console
.
info
(
'
system_parameter_test_
0420 set failed :
'
+
err
.
code
());
console
.
info
(
'
testGet
0420 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
(
'
testGet
0420 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
(
'
testGet
0420 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
(
'
testGet
0420 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
(
'
testGet
0420 promise get hw_sc.build.os.version error:
'
+
err
);
}
console
.
info
(
'
system_parameter_test_
0420 : end
'
);
console
.
info
(
'
testGet
0420 : 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
(
'
testGet
0430
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testGet
0430 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
(
'
testGet
0430 promise success:
'
+
data
);
ret
=
true
;
expect
(
ret
).
assertTrue
();
}
else
{
console
.
info
(
'
system_parameter_test_
0430 promise get faile
'
+
err
);
console
.
info
(
'
testGet
0430 promise get faile
'
+
err
);
}
})
}
catch
(
err
)
{
console
.
info
(
'
system_parameter_test_
0430 promise catch get failed
'
+
err
);
console
.
info
(
'
testGet
0430 promise catch get failed
'
+
err
);
}
setTimeout
(
function
()
{
expect
(
ret
).
assertTrue
();
done
();
},
'
1000
'
);
console
.
info
(
'
system_parameter_test_
0430 : end
'
);
console
.
info
(
'
testGet
0430 : 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
(
'
testGet
0440
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testGet
0440 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
(
'
testGet
0440 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
(
'
testGet
0440 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
(
'
testGet
0440 promise setSync hw_sc.build.os.version:
'
+
err
);
}
setTimeout
(
function
()
{
expect
(
ret
).
assertTrue
();
done
();
},
'
1000
'
);
console
.
info
(
'
system_parameter_test_
0440 : end
'
);
console
.
info
(
'
testGet
0440 : 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
(
'
testGet
0450
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testGet
0450 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
(
'
testGet
0450 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
(
'
testGet
0450 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
(
'
testGet
0450 promise setSync a.b.b.c error:
'
+
err
);
}
setTimeout
(
function
()
{
expect
(
ret
).
assertTrue
();
done
();
},
'
1000
'
);
console
.
info
(
'
system_parameter_test_
0450 : end
'
);
console
.
info
(
'
testGet
0450 : 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
(
'
testGet
0500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testGet
0500 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
(
'
testGet
0500 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
(
'
testGet
0500 get test.parameter.key value err:
'
+
err
.
code
)
}
});
}
catch
(
err
)
{
console
.
log
(
'
system_parameter_test_
0500 get unexpected error:
'
+
err
);
console
.
log
(
'
testGet
0500 get unexpected error:
'
+
err
);
}
setTimeout
(
function
()
{
expect
(
ret
).
assertTrue
();
done
();
},
'
1000
'
);
console
.
info
(
'
system_parameter_test_
0500 : end
'
);
console
.
info
(
'
testGet
0500 : 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
(
'
testGet
0510
'
,
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
(
'
testGet
0510 set aaaaa sucess :
'
+
data
);
}
else
{
console
.
info
(
'
system_parameter_test_
0510 set aaaaa failed :
'
+
err
);
console
.
info
(
'
testGet
0510 set aaaaa failed :
'
+
err
);
}
})
systemparameter
.
get
(
'
aaaaaa
'
,
(
err
,
data
)
=>
{
if
(
err
==
undefined
)
{
console
.
info
(
'
system_parameter_test_
0510 get aaaaa sucess :
'
+
data
);
console
.
info
(
'
testGet
0510 get aaaaa sucess :
'
+
data
);
ret
=
true
;
expect
(
ret
).
assertTrue
();
}
else
{
console
.
info
(
'
system_parameter_test_
0510 get aaaaa failed :
'
+
err
.
code
);
console
.
info
(
'
testGet
0510 get aaaaa failed :
'
+
err
.
code
);
}
})
}
catch
(
err
)
{
console
.
info
(
'
system_parameter_test_
0510 promise get input error:
'
+
err
);
console
.
info
(
'
testGet
0510 promise get input error:
'
+
err
);
}
setTimeout
(
function
()
{
expect
(
ret
).
assertTrue
();
done
();
},
'
1000
'
);
console
.
info
(
'
system_parameter_test_
0510 : end
'
);
console
.
info
(
'
testGet
0510 : 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
(
'
testGet
0520
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testGet
0520 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
(
'
testGet
0520 get systemparameter sucess:
'
+
data
);
ret
=
true
;
expect
(
ret
).
assertTrue
();
}
else
{
console
.
info
(
'
system_parameter_test_
0520 get systemparameter sucess:
'
+
err
.
code
);
console
.
info
(
'
testGet
0520 get systemparameter sucess:
'
+
err
.
code
);
}
})
}
catch
(
err
)
{
console
.
info
(
'
system_parameter_test_
0520 promise get input error:
'
+
err
);
console
.
info
(
'
testGet
0520 promise get input error:
'
+
err
);
}
setTimeout
(
function
()
{
expect
(
ret
).
assertTrue
();
done
();
},
'
1000
'
);
console
.
info
(
'
system_parameter_test_
0520 : end
'
);
console
.
info
(
'
testGet
0520 : 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
(
'
testGet
0530
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testGet
0530 start
'
);
let
ret
=
false
;
try
{
systemparameter
.
get
(
'
'
,
(
err
,
data
)
=>
{
if
(
err
==
undefined
)
{
console
.
info
(
'
system_parameter_test_
0530 get systemparameter sucess:
'
+
data
);
console
.
info
(
'
testGet
0530 get systemparameter sucess:
'
+
data
);
ret
=
true
;
expect
(
ret
).
assertTrue
();
}
else
{
console
.
info
(
'
system_parameter_test_
0530 get systemparameter sucess:
'
+
err
.
code
);
console
.
info
(
'
testGet
0530 get systemparameter sucess:
'
+
err
.
code
);
}
})
}
catch
(
err
)
{
console
.
info
(
'
system_parameter_test_
0530 promise get input error:
'
+
err
);
console
.
info
(
'
testGet
0530 promise get input error:
'
+
err
);
}
setTimeout
(
function
()
{
expect
(
ret
).
assertTrue
();
done
();
},
'
1000
'
);
console
.
info
(
'
system_parameter_test_
0530 : end
'
);
console
.
info
(
'
testGet
0530 : 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
(
'
testGet
0600
'
,
0
,
function
(
done
)
{
console
.
info
(
'
testGet
0600 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
(
'
testGet
0600 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
(
'
testGet
0600 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
(
'
testGet
0600 get systemparameter hw_sc.build.os.version abnormal:
'
,
err
);
}
setTimeout
(
function
()
{
expect
(
ret
).
assertTrue
();
done
();
},
'
1000
'
);
console
.
info
(
'
system_parameter_test_061
0 : end
'
);
console
.
info
(
'
testGet060
0 : 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
(
'
testGet
0610
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testGet
0610 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
(
'
testGet
0610 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
(
'
testGet
0610 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
(
'
testGet
0610 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
(
'
testGet
0610 : 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
(
'
testGet
0620
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testGet
0620 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
(
'
testGet
0620 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
(
'
testGet
0620 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
(
'
testGet
0620 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
(
'
testGet
0620 : 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
(
'
testGet
0640
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testGet
0640 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
(
'
testGet
0640 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
(
'
testGet
0640 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
(
'
testGet
0640 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
(
'
testGet
0640 : 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
(
'
testGetSync
0700
'
,
0
,
function
(
done
)
{
console
.
info
(
'
testGetSync
0700 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
(
'
testGetSync
0700 promise get input error:
'
+
err
);
done
();
}
expect
(
ret
).
assertTrue
();
console
.
info
(
'
system_parameter_test_
0700 : end
'
);
console
.
info
(
'
testGetSync
0700 : 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
(
'
testGetSync
0710
'
,
0
,
function
(
done
)
{
console
.
info
(
'
testGetSync
0710 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
(
'
testGetSync
0710 promise get input sucess:
'
,
parameterInfo
);
done
();
}
catch
(
err
)
{
console
.
info
(
'
system_parameter_test_
0710 promise get input error:
'
+
err
);
console
.
info
(
'
testGetSync
0710 promise get input error:
'
+
err
);
}
expect
(
ret
).
assertTrue
();
console
.
info
(
'
system_parameter_test_
0710 : end
'
);
console
.
info
(
'
testGetSync
0710 : 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
(
'
testGetSync
0720
'
,
0
,
function
(
done
)
{
console
.
info
(
'
testGetSync
0720 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
(
'
testGetSync
0720 promise get input sucess:
'
,
parameterInfo
);
done
();
}
catch
(
err
)
{
console
.
info
(
'
system_parameter_test_
0720 promise get input error:
'
+
err
);
console
.
info
(
'
testGetSync
0720 promise get input error:
'
+
err
);
}
expect
(
ret
).
assertTrue
();
console
.
info
(
'
system_parameter_test_
0720: end
'
);
console
.
info
(
'
testGetSync
0720: 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
(
'
testGetSync
0730
'
,
0
,
function
(
done
)
{
console
.
info
(
'
testGetSync
0730 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
(
'
testGetSync
0730 get parameter =
'
,
parameterInfo
);
ret
=
true
;
console
.
info
(
'
system_parameter_test_
0730 promise get input sucess:
'
,
parameterInfo
);
console
.
info
(
'
testGetSync
0730 promise get input sucess:
'
,
parameterInfo
);
done
();
}
catch
(
err
)
{
console
.
info
(
'
system_parameter_test_
0730 promise get input error:
'
+
err
);
console
.
info
(
'
testGetSync
0730 promise get input error:
'
+
err
);
}
expect
(
ret
).
assertTrue
();
console
.
info
(
'
system_parameter_test_
0730: end
'
);
console
.
info
(
'
testGetSync
0730: 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
(
'
testGetSync
0740
'
,
0
,
function
(
done
)
{
console
.
info
(
'
testGetSync
0740 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
(
'
testGetSync
0740 promise get input sucess:
'
,
parameterInfo
);
done
();
}
catch
(
err
)
{
console
.
info
(
'
system_parameter_test_
0740 promise get input error:
'
+
err
);
console
.
info
(
'
testGetSync
0740 promise get input error:
'
+
err
);
}
expect
(
ret
).
assertTrue
();
console
.
info
(
'
system_parameter_test_
0740 : end
'
);
console
.
info
(
'
testGetSync
0740 : end
'
);
})
})
\ No newline at end of file
startup/startup_standard/systemparamter/src/main/js/default/test/SysParametersJs.test.js
浏览文件 @
a15c5059
...
...
@@ -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_08
01
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
system_parameter_test_08
01 start
'
);
it
(
'
testWaitPromise
01
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testWaitPromise
01 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_08
01 test.wait_param.101 success:
"
+
result
);
console
.
info
(
"
testWaitPromise
01 test.wait_param.101 success:
"
+
result
);
expect
(
ret
).
assertTrue
();
}).
catch
(
function
(
err
)
{
ret
=
true
;
console
.
info
(
"
system_parameter_test_08
01 test.wait_param.101 error:
"
+
err
.
code
);
console
.
info
(
"
testWaitPromise
01 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_08
01 end
'
);
console
.
info
(
'
testWaitPromise
01 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_08
02
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
system_parameter_test_08
02 start
'
);
it
(
'
testWaitPromise
02
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testWaitPromise
02 start
'
);
let
ret
=
false
;
try
{
var
parameterInfo
=
systemparameter
.
wait
(
"
test.wait_param.102
"
,
""
,
1
);
parameterInfo
.
then
(
function
(
result
)
{
// timeout
console
.
info
(
"
system_parameter_test_08
02 test.wait_param.102 success:
"
);
console
.
info
(
"
testWaitPromise
02 test.wait_param.102 success:
"
);
expect
(
ret
).
assertTrue
();
done
();
}).
catch
(
function
(
err
)
{
ret
=
true
;
console
.
info
(
"
system_parameter_test_08
02 test.wait_param.102 error:
"
+
err
.
code
);
console
.
info
(
"
testWaitPromise
02 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_08
02 end
'
);
console
.
info
(
'
testWaitPromise
02 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_08
03
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
system_parameter_test_08
03 start
'
);
it
(
'
testWaitPromise
03
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testWaitPromise
03 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_08
03 test.wait_param.103 success:
"
);
console
.
info
(
"
testWaitPromise
03 test.wait_param.103 success:
"
);
expect
(
ret
).
assertTrue
();
done
();
}).
catch
(
function
(
err
)
{
expect
(
ret
).
assertTrue
();
console
.
info
(
"
system_parameter_test_08
03 test.wait_param.103 error:
"
+
err
.
code
);
console
.
info
(
"
testWaitPromise
03 test.wait_param.103 error:
"
+
err
.
code
);
});
}
catch
(
e
)
{
expect
(
ret
).
assertTrue
();
console
.
info
(
"
promise get input error:
"
+
e
);
}
console
.
info
(
'
system_parameter_test_08
03 end
'
);
console
.
info
(
'
testWaitPromise
03 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_08
04
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
system_parameter_test_08
04 start
'
);
it
(
'
testWaitPromise
04
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testWaitPromise
04 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_08
04 test.wait_param.104 success
"
);
console
.
info
(
"
testWaitPromise
04 test.wait_param.104 success
"
);
expect
(
ret
).
assertTrue
();
done
();
}).
catch
(
function
(
err
)
{
console
.
info
(
"
system_parameter_test_08
04 test.wait_param.104 error:
"
+
err
.
code
);
console
.
info
(
"
testWaitPromise
04 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_08
04 end
'
);
console
.
info
(
'
testWaitPromise
04 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_08
05
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
system_parameter_test_08
05 start
'
);
it
(
'
testWaitPromise
05
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testWaitPromise
05 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_08
05 test.wait_param.105 success
"
);
console
.
info
(
"
testWaitPromise
05 test.wait_param.105 success
"
);
expect
(
ret
).
assertTrue
();
done
();
}).
catch
(
function
(
err
)
{
console
.
info
(
"
system_parameter_test_08
05 test.wait_param.105 error:
"
+
err
.
code
);
console
.
info
(
"
testWaitPromise
05 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_08
05 end
'
);
console
.
info
(
'
testWaitPromise
05 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录