From 88c9356edc18cc63fb96c848a603d565ac3d40a5 Mon Sep 17 00:00:00 2001 From: nan-xiansen Date: Thu, 27 Jan 2022 14:59:58 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90startup=5Fstandard=E3=80=91=E3=80=90ma?= =?UTF-8?q?ster=E3=80=91=E4=BF=AE=E5=A4=8D=E4=B8=8D=E7=A8=B3=E5=AE=9A?= =?UTF-8?q?=E7=9A=84=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nan-xiansen Change-Id: I37dab2e052f7a3911069d2510b182af1c8a08ce4 --- .../src/main/js/default/test/List.test.js | 2 +- .../js/default/test/SysParametersJs.test.js | 328 ------------------ 2 files changed, 1 insertion(+), 329 deletions(-) diff --git a/startup/startup_standard/systemparamter/src/main/js/default/test/List.test.js b/startup/startup_standard/systemparamter/src/main/js/default/test/List.test.js index 3539e473f..febf35778 100644 --- a/startup/startup_standard/systemparamter/src/main/js/default/test/List.test.js +++ b/startup/startup_standard/systemparamter/src/main/js/default/test/List.test.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// require('./SysParametersJs.test.js') +require('./SysParametersJs.test.js') diff --git a/startup/startup_standard/systemparamter/src/main/js/default/test/SysParametersJs.test.js b/startup/startup_standard/systemparamter/src/main/js/default/test/SysParametersJs.test.js index 134754a7b..7eb44a449 100644 --- a/startup/startup_standard/systemparamter/src/main/js/default/test/SysParametersJs.test.js +++ b/startup/startup_standard/systemparamter/src/main/js/default/test/SysParametersJs.test.js @@ -431,332 +431,4 @@ describe('SystemParameterTest', function () { expect(ret).assertTrue(); console.info('system_parameter_test_0815 end'); }) - - /** - * @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0816 - * @tc.name testWatcherOn01 - * @tc.desc Watch the value of the attribute with the specified key. - */ - it('system_parameter_test_0816', 0, function () { - console.info('system_parameter_test_0816 start'); - var ret = true; - let key = "test.watcher.401"; - try { - let watcher = systemparameter.getWatcher(key); - if (watcher === undefined) { - ret = false; - expect(ret).assertTrue(); - } else { - watcher.on("valueChange", function (key, value) { - ret = true; - console.info("system_parameter_test_0816 callback key: " + key); - console.info("system_parameter_test_0816 callback value: " + value); - }); - SetParameter(key); - } - } catch (e) { - ret = true; - console.info("input error: " + e); - } - expect(ret).assertTrue(); - console.info('system_parameter_test_0816 end'); - }) - - /** - * @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0817 - * @tc.name testWatcherOn02 - * @tc.desc Watch the value of the attribute with the specified key. - */ - it('system_parameter_test_0817', 0, async function (done) { - console.info('system_parameter_test_0817 start'); - var ret = true; - let key = "test.watcher.402"; - try { - let watcher = systemparameter.getWatcher(key); - if (watcher === undefined) { - ret = false; - } else { - watcher.on("valueChange", function (key, value) { // no callback - ret = true; - console.info("system_parameter_test_0817 callback key: " + key); - console.info("system_parameter_test_0817 callback value: " + value); - }); - } - } catch (e) { - ret = false; - console.info("input error: " + e); - } - expect(ret).assertTrue(); - done(); - console.info('system_parameter_test_0817 end'); - }) - - /** - * @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0818 - * @tc.name testWatcherOn03 - * @tc.desc Watch the value of the attribute with the specified key. - */ - it('system_parameter_test_0818', 0, function () { - console.info('system_parameter_test_0818 start'); - var ret = true; - let key = "test.watcher.403"; - try { - let watcher = systemparameter.getWatcher(key + "*"); - if (watcher === undefined) { - ret = false; - } else { - watcher.on("valueChange", function (key, value) { - ret = true; - console.info("system_parameter_test_0818 callback key: " + key); - console.info("system_parameter_test_0818 callback value: " + value); - }); - SetParameter("test.watcher.403.404"); - } - } catch (e) { - ret = false; - console.info("input error: " + e); - } - expect(ret).assertTrue(); - console.info('system_parameter_test_0818 end'); - }) - - /** - * @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0819 - * @tc.name testWatcherOn04 - * @tc.desc Watch the value of the attribute with the specified key. - */ - it('system_parameter_test_0819', 0, async function (done) { - console.info('system_parameter_test_0819 start'); - var ret = false; - try { - let watcher = systemparameter.getWatcher("*"); - if (watcher != undefined) { - let code = watcher.on("valueChange", function (key, value) { // fail - ret = true; - console.info("system_parameter_test_0819 callback key: " + key); - console.info("system_parameter_test_0819 callback value: " + value); - }); - console.info("system_parameter_test_0819 code: " + code); - } else { - ret = true; - } - } catch (e) { - ret = true; - console.info("system_parameter_test_0819 error: " + e); - } - expect(ret).assertTrue(); - done(); - console.info('system_parameter_test_0819 end'); - }) - - function callback1(key, value) { - console.info("callback1 Watch callback key: " + key); - console.info("callback1 Watch callback value: " + value); - } - - /** - * @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0820 - * @tc.name testWatcherOn05 - * @tc.desc Watch the value of the attribute with the specified key. - */ - it('system_parameter_test_0820', 0, async function (done) { - console.info('system_parameter_test_0820 start'); - var ret = true; - let key = "test.watcher.405"; - try { - let watcher = systemparameter.getWatcher(key); - if (watcher === undefined) { - ret = false; - } else { - ret = false; - let code = watcher.on("valueChange", callback1); - if (code === 0) { - ret = true; - } - code = watcher.on("valueChange", callback1); - if (code === 0) { - ret = true; - } - } - } catch (e) { - ret = true; - console.info("system_parameter_test_0820 input error: " + e); - } - expect(ret).assertTrue(); - done(); - console.info('system_parameter_test_0820 end'); - }) - - /** - * @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0821 - * @tc.name testWatcherOff01 - * @tc.desc Watch the value of the attribute with the specified key. - */ - it('system_parameter_test_0821', 0, async function (done) { - console.info('system_parameter_test_0821 start'); - var ret = false; - let key = "test.watcher.501"; - try { - let watcher = systemparameter.getWatcher(key); - if (watcher === undefined) { - ret = false; - } else { - ret = true; - let code = watcher.on("valueChange", callback1); - SetParameter(key); - code = watcher.off("valueChange", callback1); - if (code === 0) { - ret = true; - } - } - } catch (e) { - ret = false; - console.info("input error: " + e); - } - setTimeout(function () { - expect(ret).assertTrue(); - done(); - }, '1000'); - console.info('system_parameter_test_0821 end '); - }) - - /** - * @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0822 - * @tc.name testWatcherOff02 - * @tc.desc Watch the value of the attribute with the specified key. - */ - it('system_parameter_test_0822', 0, function () { - console.info('system_parameter_test_0822 start'); - var ret = true; - let key = "test.watcher.502"; - try { - let watcher = systemparameter.getWatcher(key); - if (watcher === undefined) { - ret = false; - } else { - let code = watcher.on("valueChange222", callback1); - if (code === 0) { - ret = false; - } - code = watcher.off("valueChange222", callback1); - if (code === 0) { - ret = false; - } - } - } catch (e) { - ret = false; - console.info("input error: " + e); - } - expect(ret).assertTrue(); - console.info('system_parameter_test_0822 end'); - }) - - /** - * @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0823 - * @tc.name testWatcherOff03 - * @tc.desc Watch the value of the attribute with the specified key. - */ - it('system_parameter_test_0823', 0, function () { - console.info('system_parameter_test_0823 start'); - var ret = false; - let key = "test.watcher.503"; - try { - let watcher = systemparameter.getWatcher(key); - if (watcher === undefined) { - ret = false; - } else { - ret = false; - let code = watcher.on("valueChange", function (key, value) { - console.info("system_parameter_test_0823 callback key: " + key); - console.info("system_parameter_test_0823 callback value: " + value); - let code = watcher.off("valueChange"); - if (code === 0) { - ret = true; - } - }); - if (code === 0) { - ret = true; - } - SetParameter(key); - } - } catch (e) { - ret = false; - console.info("input error: " + e); - } - expect(ret).assertTrue(); - console.info('system_parameter_test_0823 end'); - }) - - /** - * @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0824 - * @tc.name testWatcherOff04 - * @tc.desc Watch the value of the attribute with the specified key. - */ - it('system_parameter_test_0824', 0, function () { - console.info('system_parameter_test_0824 start'); - var ret = false; - let key = "test.watcher.504"; - try { - let watcher = systemparameter.getWatcher(key); - if (watcher === undefined) { - ret = false; - } else { - ret = false; - let code = watcher.on("valueChange", callback1); - if (code === 0) { - ret = true; - } - code = watcher.off("valueChange", callback1); - console.info("system_parameter_test_0824 " + code); - if (code === 0) { - ret = true; - } - code = watcher.off("valueChange", callback1); - console.info("system_parameter_test_0824 " + code); - if (code != 0) { - ret = true; - } - } - } catch (e) { - ret = false; - console.info("input error: " + e); - } - expect(ret).assertTrue(); - console.info('system_parameter_test_0824 end'); - }) - - function callback3(key, value) { - console.info("system_parameter_test_0825 callback key: " + key); - console.info("system_parameter_test_0825 callback value: " + value); - } - - /** - * @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0825 - * @tc.name testWatcherOff05 - * @tc.desc Watch the value of the attribute with the specified key. - */ - it('system_parameter_test_0825', 0, async function (done) { - console.info('system_parameter_test_0825 start'); - var ret = false; - let key = "test.watcher.505"; - try { - let watcher = systemparameter.getWatcher(key); - if (watcher === undefined) { - ret = false; - } else { - ret = false; - let code = watcher.on("valueChange", callback3); - if (code === 0) { - ret = true; - } - SetParameter(key); - } - } catch (e) { - ret = false; - console.info("input error: " + e); - } - expect(ret).assertTrue(); - done(); - console.info('system_parameter_test_0825 end'); - }) }) \ No newline at end of file -- GitLab