From 9bcb4d715346b5aab93888cfa6b62272f4263160 Mon Sep 17 00:00:00 2001 From: yuxiaoya2 Date: Wed, 24 Aug 2022 16:14:32 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90xts=5Facts=E3=80=91=E3=80=90monthly=5F?= =?UTF-8?q?0816=E3=80=91ability/dmsfwk=20=E6=B5=8B=E8=AF=95=E5=A5=97?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiaoya2 --- ability/BUILD.gn | 5 +- .../dmsfwk/BUILD.gn | 2 +- .../dmsfwk/continuationmanagertest/BUILD.gn | 2 + .../dmsfwk/continuationmanagertest/Test.json | 0 .../signature/openharmony_sx.p7b | Bin .../src/main/config.json | 0 .../src/main/js/MainAbility/app.js | 0 .../src/main/js/MainAbility/i18n/en-US.json | 0 .../src/main/js/MainAbility/i18n/zh-CN.json | 0 .../main/js/MainAbility/pages/index/index.css | 0 .../main/js/MainAbility/pages/index/index.hml | 0 .../main/js/MainAbility/pages/index/index.js | 0 .../src/main/js/TestAbility/app.js | 0 .../src/main/js/TestAbility/i18n/en-US.json | 0 .../src/main/js/TestAbility/i18n/zh-CN.json | 0 .../main/js/TestAbility/pages/index/index.css | 0 .../main/js/TestAbility/pages/index/index.hml | 0 .../main/js/TestAbility/pages/index/index.js | 0 .../js/TestRunner/OpenHarmonyTestRunner.js | 0 .../js/test/ContinuationManagerJsunit.test.js | 325 +++++++++++++++++- .../src/main/js/test/List.test.js | 4 +- .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin distributedschedule/BUILD.gn | 21 -- 24 files changed, 328 insertions(+), 31 deletions(-) rename {distributedschedule => ability}/dmsfwk/BUILD.gn (99%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/BUILD.gn (95%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/Test.json (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/signature/openharmony_sx.p7b (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/config.json (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/js/MainAbility/app.js (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/js/MainAbility/i18n/en-US.json (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/js/MainAbility/i18n/zh-CN.json (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/js/MainAbility/pages/index/index.css (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/js/MainAbility/pages/index/index.hml (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/js/MainAbility/pages/index/index.js (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/js/TestAbility/app.js (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/js/TestAbility/i18n/en-US.json (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/js/TestAbility/i18n/zh-CN.json (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/js/TestAbility/pages/index/index.css (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/js/TestAbility/pages/index/index.hml (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/js/TestAbility/pages/index/index.js (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/js/TestRunner/OpenHarmonyTestRunner.js (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js (62%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/js/test/List.test.js (85%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/resources/base/element/string.json (100%) rename {distributedschedule => ability}/dmsfwk/continuationmanagertest/src/main/resources/base/media/icon.png (100%) delete mode 100644 distributedschedule/BUILD.gn diff --git a/ability/BUILD.gn b/ability/BUILD.gn index 5a4809d95..d0cd55395 100644 --- a/ability/BUILD.gn +++ b/ability/BUILD.gn @@ -16,6 +16,9 @@ import("//build/ohos_var.gni") group("ability") { testonly = true if (is_standard_system) { - deps = [ "ability_runtime:ability_runtime" ] + deps = [ + "ability_runtime:ability_runtime", + "dmsfwk:dmsfwk", + ] } } diff --git a/distributedschedule/dmsfwk/BUILD.gn b/ability/dmsfwk/BUILD.gn similarity index 99% rename from distributedschedule/dmsfwk/BUILD.gn rename to ability/dmsfwk/BUILD.gn index bf5ae7cc6..44cc84825 100644 --- a/distributedschedule/dmsfwk/BUILD.gn +++ b/ability/dmsfwk/BUILD.gn @@ -9,7 +9,7 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations under the License. +# limitations under the License. import("//build/ohos_var.gni") diff --git a/distributedschedule/dmsfwk/continuationmanagertest/BUILD.gn b/ability/dmsfwk/continuationmanagertest/BUILD.gn similarity index 95% rename from distributedschedule/dmsfwk/continuationmanagertest/BUILD.gn rename to ability/dmsfwk/continuationmanagertest/BUILD.gn index 2ce221458..b3d2e5dff 100644 --- a/distributedschedule/dmsfwk/continuationmanagertest/BUILD.gn +++ b/ability/dmsfwk/continuationmanagertest/BUILD.gn @@ -21,6 +21,8 @@ ohos_js_hap_suite("continuationmanager_js_test") { ] certificate_profile = "./signature/openharmony_sx.p7b" hap_name = "ActsContinuationManagerJsTest" + subsystem_name = "ability" + part_name = "dmsfwk" } ohos_js_assets("continuationmanager_js_assets") { js2abc = true diff --git a/distributedschedule/dmsfwk/continuationmanagertest/Test.json b/ability/dmsfwk/continuationmanagertest/Test.json similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/Test.json rename to ability/dmsfwk/continuationmanagertest/Test.json diff --git a/distributedschedule/dmsfwk/continuationmanagertest/signature/openharmony_sx.p7b b/ability/dmsfwk/continuationmanagertest/signature/openharmony_sx.p7b similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/signature/openharmony_sx.p7b rename to ability/dmsfwk/continuationmanagertest/signature/openharmony_sx.p7b diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/config.json b/ability/dmsfwk/continuationmanagertest/src/main/config.json similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/config.json rename to ability/dmsfwk/continuationmanagertest/src/main/config.json diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/MainAbility/app.js b/ability/dmsfwk/continuationmanagertest/src/main/js/MainAbility/app.js similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/js/MainAbility/app.js rename to ability/dmsfwk/continuationmanagertest/src/main/js/MainAbility/app.js diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/MainAbility/i18n/en-US.json b/ability/dmsfwk/continuationmanagertest/src/main/js/MainAbility/i18n/en-US.json similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/js/MainAbility/i18n/en-US.json rename to ability/dmsfwk/continuationmanagertest/src/main/js/MainAbility/i18n/en-US.json diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/MainAbility/i18n/zh-CN.json b/ability/dmsfwk/continuationmanagertest/src/main/js/MainAbility/i18n/zh-CN.json similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/js/MainAbility/i18n/zh-CN.json rename to ability/dmsfwk/continuationmanagertest/src/main/js/MainAbility/i18n/zh-CN.json diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/MainAbility/pages/index/index.css b/ability/dmsfwk/continuationmanagertest/src/main/js/MainAbility/pages/index/index.css similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/js/MainAbility/pages/index/index.css rename to ability/dmsfwk/continuationmanagertest/src/main/js/MainAbility/pages/index/index.css diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/MainAbility/pages/index/index.hml b/ability/dmsfwk/continuationmanagertest/src/main/js/MainAbility/pages/index/index.hml similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/js/MainAbility/pages/index/index.hml rename to ability/dmsfwk/continuationmanagertest/src/main/js/MainAbility/pages/index/index.hml diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/MainAbility/pages/index/index.js b/ability/dmsfwk/continuationmanagertest/src/main/js/MainAbility/pages/index/index.js similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/js/MainAbility/pages/index/index.js rename to ability/dmsfwk/continuationmanagertest/src/main/js/MainAbility/pages/index/index.js diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/TestAbility/app.js b/ability/dmsfwk/continuationmanagertest/src/main/js/TestAbility/app.js similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/js/TestAbility/app.js rename to ability/dmsfwk/continuationmanagertest/src/main/js/TestAbility/app.js diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/TestAbility/i18n/en-US.json b/ability/dmsfwk/continuationmanagertest/src/main/js/TestAbility/i18n/en-US.json similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/js/TestAbility/i18n/en-US.json rename to ability/dmsfwk/continuationmanagertest/src/main/js/TestAbility/i18n/en-US.json diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/TestAbility/i18n/zh-CN.json b/ability/dmsfwk/continuationmanagertest/src/main/js/TestAbility/i18n/zh-CN.json similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/js/TestAbility/i18n/zh-CN.json rename to ability/dmsfwk/continuationmanagertest/src/main/js/TestAbility/i18n/zh-CN.json diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/TestAbility/pages/index/index.css b/ability/dmsfwk/continuationmanagertest/src/main/js/TestAbility/pages/index/index.css similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/js/TestAbility/pages/index/index.css rename to ability/dmsfwk/continuationmanagertest/src/main/js/TestAbility/pages/index/index.css diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/TestAbility/pages/index/index.hml b/ability/dmsfwk/continuationmanagertest/src/main/js/TestAbility/pages/index/index.hml similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/js/TestAbility/pages/index/index.hml rename to ability/dmsfwk/continuationmanagertest/src/main/js/TestAbility/pages/index/index.hml diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/TestAbility/pages/index/index.js b/ability/dmsfwk/continuationmanagertest/src/main/js/TestAbility/pages/index/index.js similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/js/TestAbility/pages/index/index.js rename to ability/dmsfwk/continuationmanagertest/src/main/js/TestAbility/pages/index/index.js diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/ability/dmsfwk/continuationmanagertest/src/main/js/TestRunner/OpenHarmonyTestRunner.js similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/js/TestRunner/OpenHarmonyTestRunner.js rename to ability/dmsfwk/continuationmanagertest/src/main/js/TestRunner/OpenHarmonyTestRunner.js diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js b/ability/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js similarity index 62% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js rename to ability/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js index f068b50c8..b2d4b262e 100644 --- a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js +++ b/ability/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js @@ -19,8 +19,8 @@ const TEST_DEVICE_ID = "test_deviceId"; const TEST_CONNECT_STATUS = continuationManager.DeviceConnectState.CONNECTED; let token = -1; -export default function ContinuationManagerTest() { -describe('ContinuationManagerTest', function() { +export default function continuationManagerTest() { +describe('continuationManagerTest', function() { beforeAll(async function (done) { console.info('beforeAll'); @@ -58,6 +58,7 @@ describe('ContinuationManagerTest', function() { */ it('testRegister001', 0, async function(done) { try { + console.info("testRegister001Begin "); continuationManager.register(function (err, data) { expect(err.code == 0).assertTrue(); expect(data - token == 1).assertTrue(); @@ -85,7 +86,7 @@ describe('ContinuationManagerTest', function() { authInfo: {} }; continuationManager.register(continuationExtraParams, function(err, data){ - console.info("testRegister002 " + err.message) + console.info("testRegister002 " + err.message); expect(err.message == "Invalidate params.").assertTrue(); done(); }); @@ -133,7 +134,7 @@ describe('ContinuationManagerTest', function() { deviceType: ["00E"], description: "description", filter: {"name": "authInfo","length": 8}, - continuationMode: continuationManager.ContinuationMode.COLLABORATION_MUTIPLE, + continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE, authInfo: {"name": "authInfo","length": 8} }; continuationManager.register(continuationExtraParams, function(err, data) { @@ -149,6 +150,160 @@ describe('ContinuationManagerTest', function() { }) + /** + * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0500 + * @tc.name [JS-API8]ContinuationManager.register(). + * @tc.desc Test Js Api ContinuationManager.register() testcase 005 + */ + it('testRegister005', 0, async function(done) { + try { + let continuationExtraParams = { + deviceType: ["00E"], + description: "description", + filter: {"name": "authInfo","length": 8}, + continuationMode: continuationManager.ContinuationMode.COLLABORATION_SINGLE, + authInfo: {"name": "authInfo","length": 8} + }; + continuationManager.register(continuationExtraParams, function(err, data) { + expect(err.code == 0).assertTrue(); + expect(data - token == 1).assertTrue(); + done(); + }); + } catch (e) { + console.info("testRegister005 " + e); + expect(null).assertFail(); + done(); + } + }) + + /** + * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0600 + * @tc.name [JS-API8]ContinuationManager.register(). + * @tc.desc Test Js Api ContinuationManager.register() testcase 006 + */ + it('testRegister006', 0, async function(done) { + try { + let continuationExtraParams = { + deviceType: ["00E"], + description: "description", + filter: {"name": "authInfo","length": 8}, + continuationMode: continuationManager.ContinuationMode.COLLABORATION_SINGLE, + authInfo: {"name": "authInfo","length": 8} + }; + continuationManager.register(continuationExtraParams).then((data) => { + expect(data - token == 1).assertTrue(); + }).catch((err) => { + expect(err.code == 29360210).assertTrue(); + }); + } catch (e) { + console.info("testRegister006 " + e); + expect(null).assertFail(); + } + done(); + }) + + + /** + * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0700 + * @tc.name [JS-API8]ContinuationManager.register(). + * @tc.desc Test Js Api ContinuationManager.register() testcase 007 + */ + it('testRegister007', 0, async function(done) { + try { + let continuationExtraParams = { + deviceType: ["00E"], + description: "description", + filter: {"name": "authInfo","length": 8}, + continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE, + authInfo: {"name": "authInfo","length": 8} + }; + continuationManager.register(continuationExtraParams).then((data) => { + expect(data - token == 1).assertTrue(); + }).catch((err) => { + expect(err.code == 29360210).assertTrue(); + }); + } catch (e) { + console.info("testRegister007 " + e); + expect(null).assertFail(); + } + done(); + }) + + + /** + * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0800 + * @tc.name [JS-API8]ContinuationManager.register(). + * @tc.desc Test Js Api ContinuationManager.register() testcase 008 + */ + it('testRegister008', 0, async function(done) { + try { + let continuationExtraParams = { + deviceType: [], + description: "", + filter: "", + continuationMode: null, + authInfo: {} + }; + continuationManager.register(continuationExtraParams).then((data) => { + expect(data - token != 1).assertTrue(); + }).catch((err) => { + expect(err.code == 29360210).assertTrue(); + }); + } catch (e) { + console.info("testRegister008 " + e); + expect(null).assertFail(); + } + done(); + }) + + + /** + * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0900 + * @tc.name [JS-API8]ContinuationManager.register(). + * @tc.desc Test Js Api ContinuationManager.register() testcase 009 + */ + it('testRegister009', 0, async function(done) { + try { + let continuationExtraParams = { + deviceType: ["00E"], + description: "description", + filter: {"name": "authInfo","length": 8}, + continuationMode: 10, + authInfo: {"name": "authInfo","length": 8} + }; + continuationManager.register(continuationExtraParams).then((data) => { + expect(data - token != 1).assertTrue(); + }).catch((err) => { + expect(err.code == 29360210).assertTrue(); + }); + done(); + } catch (e) { + console.info("testRegister009 " + e); + expect(null).assertFail(); + done(); + } + }) + + + /** + * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_1000 + * @tc.name [JS-API8]ContinuationManager.register(). + * @tc.desc Test Js Api ContinuationManager.register() testcase 010 + */ + it('testRegister010', 0, async function(done) { + try { + continuationManager.register().then((data) => { + expect(data - token == 1).assertTrue(); + }).catch((err) => { + expect(err.code == 29360210).assertTrue(); + }); + } catch (e) { + console.info("testRegister010 " + e); + expect(null).assertFail(); + } + done(); + }) + /** * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0100 * @tc.name [JS-API8]ContinuationManager.unregister(). @@ -208,6 +363,46 @@ describe('ContinuationManagerTest', function() { } }) + + /** + * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0400 + * @tc.name [JS-API8]ContinuationManager.unregister(). + * @tc.desc Test Js Api ContinuationManager.unregister() testcase 004 + */ + it('testUnregister004', 0, async function(done) { + try { + continuationManager.unregister(300, function (data) { + expect(data.code == 29360208).assertTrue(); + }) + done(); + } catch (e) { + console.info("testUnregister004 " + e); + expect(null).assertFail(); + done(); + } + }) + + + /** + * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0500 + * @tc.name [JS-API8]ContinuationManager.unregister(). + * @tc.desc Test Js Api ContinuationManager.unregister() testcase 005 + */ + it('testUnregister005', 0, async function(done) { + try { + continuationManager.unregister(token, function (data) { + console.info("testUnregister005 " + JSON.stringify(data)); + expect(data.code == 0).assertTrue(); + }) + done(); + } catch (e) { + console.info("testUnregister005 " + e); + expect(null).assertFail(); + done(); + } + }) + + /** * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_ON_0100 * @tc.name [JS-API8]ContinuationManager.on(). @@ -397,7 +592,7 @@ describe('ContinuationManagerTest', function() { deviceType: ["00E"], description: "description", filter: {"name": "authInfo","length": 8}, - continuationMode: continuationManager.ContinuationMode.COLLABORATION_MUTIPLE, + continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE, authInfo: {"name": "authInfo","length": 8} }; continuationManager.startDeviceManager(null, continuationExtraParams, function (err, data) { @@ -423,7 +618,7 @@ describe('ContinuationManagerTest', function() { deviceType: ["00E"], description: "description", filter: {"name": "authInfo","length": 8}, - continuationMode: continuationManager.ContinuationMode.COLLABORATION_MUTIPLE, + continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE, authInfo: {"name": "authInfo","length": 8} }; continuationManager.startDeviceManager(52, continuationExtraParams, function (err, data) { @@ -513,6 +708,54 @@ describe('ContinuationManagerTest', function() { done(); } }) + + /** + * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0800 + * @tc.name [JS-API8]ContinuationManager.startDeviceManager(). + * @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 008 + */ + it('testStartDeviceManager008', 0, async function(done) { + try { + let continuationExtraParams = { + deviceType: ["00E"], + description: "description", + filter: {"name": "authInfo","length": 8}, + continuationMode: continuationManager.ContinuationMode.COLLABORATION_SINGLE, + authInfo: {"name": "authInfo","length": 8} + }; + continuationManager.startDeviceManager(token, continuationExtraParams).then((data) => { + expect(data == undefined).assertTrue(); + }).catch((err) => { + expect(err.code == 29360210).assertTrue(); + }); + done(); + } catch (e) { + console.info("testStartDeviceManager008 " + e); + expect(null).assertFail(); + done(); + } + }) + + + /** + * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0900 + * @tc.name [JS-API8]ContinuationManager.startDeviceManager(). + * @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 009 + */ + it('testStartDeviceManager009', 0, async function(done) { + try { + continuationManager.startDeviceManager(token).then((data) => { + expect(data == undefined).assertTrue(); + }).catch((err) => { + expect(err.code == 29360210).assertTrue(); + }); + done(); + } catch (e) { + console.info("testStartDeviceManager009 " + e); + expect(null).assertFail(); + done(); + } + }) /** * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0100 @@ -572,4 +815,74 @@ describe('ContinuationManagerTest', function() { done(); } }) + + + /** + * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0400 + * @tc.name [JS-API8]ContinuationManager.updateConnectStatus(). + * @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 004 + */ + it('testUpdateConnectStatus004', 0, async function(done) { + try { + console.info('testUpdateConnectStatus004 begin'); + continuationManager.updateConnectStatus(token, TEST_DEVICE_ID, + continuationManager.DeviceConnectState.IDLE).then((data) => { + expect(data == undefined).assertTrue(); + }).catch((err) => { + expect(err.code == 29360210).assertTrue(); + }); + done(); + } catch (e) { + console.info("testUpdateConnectStatus004 " + e); + expect(null).assertFail(); + done(); + } + }) + + + /** + * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0500 + * @tc.name [JS-API8]ContinuationManager.updateConnectStatus(). + * @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 005 + */ + it('testUpdateConnectStatus005', 0, async function(done) { + try { + console.info('testUpdateConnectStatus005 begin'); + continuationManager.updateConnectStatus(token, TEST_DEVICE_ID, + continuationManager.DeviceConnectState.CONNECTING).then((data) => { + expect(data == undefined).assertTrue(); + }).catch((err) => { + expect(err.code == 29360210).assertTrue(); + }); + done(); + } catch (e) { + console.info("testUpdateConnectStatus005 " + e); + expect(null).assertFail(); + done(); + } + }) + + + /** + * @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0600 + * @tc.name [JS-API8]ContinuationManager.updateConnectStatus(). + * @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 006 + */ + it('testUpdateConnectStatus006', 0, async function(done) { + try { + continuationManager.updateConnectStatus(token, TEST_DEVICE_ID, + continuationManager.DeviceConnectState.DISCONNECTING).then((data) => { + expect(data == undefined).assertTrue(); + }).catch((err) => { + expect(err.code == 29360210).assertTrue(); + }); + done(); + } catch (e) { + console.info("testUpdateConnectStatus006 " + e); + expect(null).assertFail(); + done(); + } + }) + + })} diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/test/List.test.js b/ability/dmsfwk/continuationmanagertest/src/main/js/test/List.test.js similarity index 85% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/js/test/List.test.js rename to ability/dmsfwk/continuationmanagertest/src/main/js/test/List.test.js index a6a82ae64..8e6e45d23 100644 --- a/distributedschedule/dmsfwk/continuationmanagertest/src/main/js/test/List.test.js +++ b/ability/dmsfwk/continuationmanagertest/src/main/js/test/List.test.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import ContinuationManagerTest from './ContinuationManagerJsunit.test.js' +import continuationManagerTest from './ContinuationManagerJsunit.test.js' export default function testsuite() { -ContinuationManagerTest() +continuationManagerTest() } diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/resources/base/element/string.json b/ability/dmsfwk/continuationmanagertest/src/main/resources/base/element/string.json similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/resources/base/element/string.json rename to ability/dmsfwk/continuationmanagertest/src/main/resources/base/element/string.json diff --git a/distributedschedule/dmsfwk/continuationmanagertest/src/main/resources/base/media/icon.png b/ability/dmsfwk/continuationmanagertest/src/main/resources/base/media/icon.png similarity index 100% rename from distributedschedule/dmsfwk/continuationmanagertest/src/main/resources/base/media/icon.png rename to ability/dmsfwk/continuationmanagertest/src/main/resources/base/media/icon.png diff --git a/distributedschedule/BUILD.gn b/distributedschedule/BUILD.gn deleted file mode 100644 index 414d8ff9a..000000000 --- a/distributedschedule/BUILD.gn +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/ohos_var.gni") - -group("systemabilitymgr") { - testonly = true - if (is_standard_system) { - deps = [ "dmsfwk:dmsfwk" ] - } -} -- GitLab