From 9f97fef17e35a7d6956a7799512b0a08ef6265ca Mon Sep 17 00:00:00 2001 From: liulinna Date: Mon, 28 Mar 2022 16:43:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0xts=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: guduhanyan --- .../default/test/SystemTimeJsunit.Pertest.js | 12 +++-- .../js/default/test/SystemTimeJsunit.test.js | 52 +++++++++---------- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.Pertest.js b/miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.Pertest.js index c935195d6..d52ec50df 100644 --- a/miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.Pertest.js +++ b/miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.Pertest.js @@ -31,13 +31,16 @@ describe('TimeTest', function() { it('systemTime_setTime_test1', 0, async function (done) { console.log("SUB_systemTime_setTime_JS_API_0100 start"); systemTime.setTime(152600, (err, data) => { // callback形式调用异步接口 - if (err) { + if ((typeof err !== 'undefined') && (err.code !== 0)) { console.error('SetTime failed because ' + JSON.stringify(err)); expect().assertFail(); done(); return; } console.info('SetTime success data : ' + JSON.stringify(data)); + expect(true).assertTrue(); + done(); + return; }); console.log('SUB_systemTime_setTime_JS_API_0100 end'); }) @@ -52,14 +55,17 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test1', 0, async function (done) { console.log("SUB_systemTime_setTimezone_JS_API_0100 start"); - systemTime.setTimezone('Anadyr, Russia', (err, data) => { // callback形式调用异步接口 - if (err) { + systemTime.setTimezone('Asia/Shanghai', (err, data) => { // callback形式调用异步接口 + if ((typeof err !== 'undefined') && (err.code !== 0)) { console.error('setTimezone failed because ' + JSON.stringify(err)); expect().assertFail(); done(); return; } console.info('setTimezone success data : ' + JSON.stringify(data)); + expect(true).assertTrue(); + done(); + return; }); console.log('SUB_systemTime_setTimezone_JS_API_0100 end'); }) diff --git a/miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.test.js b/miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.test.js index 0fe58e304..b338a53b3 100644 --- a/miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.test.js +++ b/miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.test.js @@ -29,7 +29,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test1',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_0100 start') - var timezone = 'Anadyr, Russia' + var timezone = 'Antarctica/McMurdo' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -51,7 +51,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test2',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_0200 start') - var timezone = 'Honiara, SolomonIslands' + var timezone = 'Africa/Kinshasa' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -73,7 +73,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test3',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_0300 start') - var timezone = 'Melbourne, Australia' + var timezone = 'Asia/Nicosia' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -95,7 +95,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test4',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_0400 start') - var timezone = 'Tokyo, Japan' + var timezone = 'America/Guayaquil' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -117,7 +117,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test5',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_0500 start') - var timezone = 'Beijing, China' + var timezone = 'Pacific/Pohnpei' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -139,7 +139,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test6',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_0600 start') - var timezone = 'Jakarta, Indonesia' + var timezone = 'Asia/Almaty' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -161,7 +161,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test7',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_0700 start') - var timezone = 'Dhaka, Bangladesh' + var timezone = 'America/Godthab' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -183,7 +183,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test8',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_0800 start') - var timezone = 'Tashkent, Uzbekistan' + var timezone = 'Pacific/Majuro' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -205,7 +205,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test9',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_0900 start') - var timezone = 'Dubai, U.A.E.' + var timezone = 'Asia/Kuala_Lumpur' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -227,7 +227,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test10',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_1000 start') - var timezone = 'Moscow, Russia' + var timezone = 'Asia/Gaza' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -249,7 +249,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test11',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_1100 start') - var timezone = 'Brussels, Belgium' + var timezone = 'Europe/Kiev' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -271,7 +271,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test12',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_1200 start') - var timezone = 'London, England' + var timezone = 'America/New_York' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -293,7 +293,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test13',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_1300 start') - var timezone = 'Accra, Ghana' + var timezone = 'Pacific/Pohnpei' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -315,7 +315,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test14',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_1400 start') - var timezone = 'Praia, CaboVerde' + var timezone = 'America/Guayaquil' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -337,7 +337,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test15',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_1500 start') - var timezone = 'Nuuk, Greenland' + var timezone = 'Pacific/Auckland' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -359,7 +359,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test16',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_1600 start') - var timezone = 'Buenos Aires, Argentina' + var timezone = 'Pacific/Auckland' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -381,7 +381,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test17',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_1700 start') - var timezone = 'New York, U.S.A.' + var timezone = 'America/Godthab' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -403,7 +403,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test18',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_1800 start') - var timezone = 'Mexico City, Mexico' + var timezone = 'Europe/Berlin' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -425,7 +425,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test19',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_1900 start') - var timezone = 'Guatemala City, Guatemala' + var timezone = 'Asia/Jakarta' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -447,7 +447,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test20',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_2000 start') - var timezone = 'Los Angeles, U.S.A.' + var timezone = 'Asia/Tashkent' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -469,7 +469,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test20',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_2000 start') - var timezone = 'Anchorage, U.S.A.' + var timezone = 'Asia/Tashkent' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -491,7 +491,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test22',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_2200 start') - var timezone = 'Adak, U.S.A.' + var timezone = 'Asia/Tashkent' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -513,7 +513,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test23',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_2300 start') - var timezone = 'Honolulu, U.S.A.' + var timezone = 'Pacific/Pohnpei' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -535,7 +535,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test24',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_2400 start') - var timezone = 'Alofi, Niue' + var timezone = 'Pacific/Pohnpei' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -557,7 +557,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test25',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_2500 start') - var timezone = 'Baker Island, U.S.A.' + var timezone = 'Asia/Nicosia' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) @@ -579,7 +579,7 @@ describe('TimeTest', function() { */ it('systemTime_setTimezone_test26',0, async () => { console.log('SUB_systemTime_setTimezone_JS_API_2600 start') - var timezone = 'Baker Island, U.S.A.' + var timezone = 'Asia/Nicosia' console.log('setTimezone = ' + timezone) systemTime.setTimezone(timezone) -- GitLab