diff --git a/services/distributeddataservice/service/test/testCloud/AppScope/app.json b/services/distributeddataservice/service/test/testCloud/AppScope/app.json deleted file mode 100644 index 3bbd52d9937fa31936884fe5bf0cf388ca8a970a..0000000000000000000000000000000000000000 --- a/services/distributeddataservice/service/test/testCloud/AppScope/app.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "app": { - "bundleName": "com.example.testCloud", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "distributedNotificationEnabled": true, - "minAPIVersion": 9, - "targetAPIVersion": 9 - } -} diff --git a/services/distributeddataservice/service/test/testCloud/AppScope/app.json5 b/services/distributeddataservice/service/test/testCloud/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f11df9555be62529784e0a297d7fbf05a2c86e95 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/AppScope/app.json5 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2025 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. +*/ +{ + "app": { + "bundleName": "com.example.testCloud", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_layered_image", + "label": "$string:app_name" + } +} diff --git a/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/element/string.json b/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/element/string.json index 771eddc83c25bfc4545e549e8a5a7c350f8a5a2b..1080233f01384411ec684b58955cb8808746fdd3 100644 --- a/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/element/string.json +++ b/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/element/string.json @@ -2,7 +2,7 @@ "string": [ { "name": "app_name", - "value": "Extension" + "value": "MyApplication" } ] } diff --git a/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/media/app_background.png b/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/media/app_background.png new file mode 100644 index 0000000000000000000000000000000000000000..923f2b3f27e915d6871871deea0420eb45ce102f Binary files /dev/null and b/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/media/app_background.png differ diff --git a/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/media/app_foreground.png b/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/media/app_foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..eb9427585b36d14b12477435b6419d1f07b3e0bb Binary files /dev/null and b/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/media/app_foreground.png differ diff --git a/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/media/app_icon.png b/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/media/app_layered_image.json b/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/media/app_layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..b71c16122943f248ace0f5fa26da38b71dbdbdde --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/AppScope/resources/base/media/app_layered_image.json @@ -0,0 +1,7 @@ +{ + "layered-image": + { + "background" : "$media:app_background", + "foreground" : "$media:app_foreground" + } +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/BUILD.gn b/services/distributeddataservice/service/test/testCloud/BUILD.gn index db1355d58ddfb37cbde8928aa48dfb5ec9cdf1c0..9e38d94b96b968449770d26a06c4eed96e59e88d 100644 --- a/services/distributeddataservice/service/test/testCloud/BUILD.gn +++ b/services/distributeddataservice/service/test/testCloud/BUILD.gn @@ -12,28 +12,35 @@ # limitations under the License. import("//build/ohos.gni") +import("./signature/portallogin.gni") -ohos_hap("testCloud") { - hap_profile = "entry/src/main/module.json" +ohos_app("testCloud") { + build_profile = "build-profile.json5" hap_name = "testCloud" subsystem_name = "distributeddatamgr" part_name = "datamgr_service" - final_hap_path = "$root_out_dir/tests/unittest/datamgr_service/datamgr_service/resource/${hap_name}.hap" + hap_out_dir = "$root_out_dir/tests/unittest/datamgr_service/datamgr_service/resource/" testonly = true deps = [ ":testCloud_ets_assets", ":testCloud_ets_resources", ] certificate_profile = "signature/openharmony_sx.p7b" + if (defined(sign_hap_py_path)) { + certificate_profile = "${certificate_profile_path}" + key_alias = "CaptivePortalLoginHm Release" + private_key_path = "CaptivePortalLoginHm Release" + compatible_version = "14" + } } ohos_js_assets("testCloud_ets_assets") { source_dir = "entry/src/main/ets" - hap_profile = "entry/src/main/module.json" + hap_profile = "entry/src/main/module.json5" } ohos_app_scope("testCloud_app_profile") { - app_profile = "AppScope/app.json" + app_profile = "AppScope/app.json5" sources = [ "AppScope/resources" ] } diff --git a/services/distributeddataservice/service/test/testCloud/build-profile.json5 b/services/distributeddataservice/service/test/testCloud/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..4fcf1605943eab74b77dad9b00f44bd199f28cde --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/build-profile.json5 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2025 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. +*/ +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compileSdkVersion": "20", + "targetSdkVersion": "20", + "compatibleSdkVersion": "20", + "runtimeOS": "HarmonyOS", + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/build-profile.json5 b/services/distributeddataservice/service/test/testCloud/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b17b5346ac4e3173aff9c9af618cd011a1ca0268 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/build-profile.json5 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2025 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. +*/ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": false, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/hvigorfile.ts b/services/distributeddataservice/service/test/testCloud/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..d1f89981d60f9342185f6a3370c4ba4ed421f643 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/hvigorfile.ts @@ -0,0 +1,20 @@ +/* +* Copyright (c) 2025 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 { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins: [] /* Custom plugin to extend the functionality of Hvigor. */ +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/obfuscation-rules.txt b/services/distributeddataservice/service/test/testCloud/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..0d39f7d6b5e876bbb07a46ac6452d17ebc89d252 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/obfuscation-rules.txt @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2025 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. +*/ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/oh-package.json5 b/services/distributeddataservice/service/test/testCloud/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..94af4743adc4fd7bc64ced3219d14d65cdae0dea --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/oh-package.json5 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2025 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. +*/ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/Application/MyAbilityStage.ts b/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/Application/MyAbilityStage.ts deleted file mode 100644 index 19d67bae85fa2bd4f42362759c98a97718c6195e..0000000000000000000000000000000000000000 --- a/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/Application/MyAbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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 AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/MainAbility/MainAbility.ts b/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index f1a7bf8fb1af00b5bd000c714f06b6c0d692325c..0000000000000000000000000000000000000000 --- a/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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 Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - - windowStage.loadContent("pages/index", (err, data) => { - if (err.code) { - console.error('Failed to load the content. Cause:' + JSON.stringify(err)); - return; - } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)) - }); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/entryability/EntryAbility.ets b/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..e75437ea229e74ec85d647ddb04aa17b20ca6495 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2025 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 { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +const DOMAIN = 0x0000; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); + return; + } + hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); + } +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..3f466fc32534e49b3b55a94e244ceaafb722ea90 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2025 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 { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +const DOMAIN = 0x0000; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(DOMAIN, 'testTag', 'onBackup ok'); + await Promise.resolve(); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + await Promise.resolve(); + } +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/pages/index.ets b/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/pages/index.ets index 33bf2fafb560ca599e45b0dd7e4b52a98dea65fd..7609bb723f9a27004ee48ad6c76345964ced31a8 100644 --- a/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/pages/index.ets +++ b/services/distributeddataservice/service/test/testCloud/entry/src/main/ets/pages/index.ets @@ -1,31 +1,37 @@ /* - * Copyright (c) 2025 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. - */ - +* Copyright (c) 2025 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. +*/ @Entry @Component struct Index { - @State message: string = 'StartAbility Success' + @State message: string = 'Hello World'; build() { - Row() { - Column() { - Text(this.message) - .fontSize(30) - } - .width('100%') + RelativeContainer() { + Text(this.message) + .id('HelloWorld') + .fontSize($r('app.float.page_text_font_size')) + .fontWeight(FontWeight.Bold) + .alignRules({ + center: { anchor: '__container__', align: VerticalAlign.Center }, + middle: { anchor: '__container__', align: HorizontalAlign.Center } + }) + .onClick(() => { + this.message = 'Welcome'; + }) } .height('100%') + .width('100%') } } \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/module.json b/services/distributeddataservice/service/test/testCloud/entry/src/main/module.json index 352fc3e154f7b5138f86186ea2a3a01fd68b8ba6..bb7212ba407b1a486a4738a973240a4d0301d69c 100644 --- a/services/distributeddataservice/service/test/testCloud/entry/src/main/module.json +++ b/services/distributeddataservice/service/test/testCloud/entry/src/main/module.json @@ -2,9 +2,8 @@ "module": { "name": "entry", "type": "entry", - "srcEntrance": "./ets/Application/MyAbilityStage.ts", - "description": "$string:entry_desc", - "mainElement": "MainAbility", + "description": "$string:module_desc", + "mainElement": "EntryAbility", "deviceTypes": [ "default", "tablet", @@ -13,17 +12,16 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", - "uiSyntax": "ets", "abilities": [ { - "name": "MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", - "icon": "$media:icon", - "label": "$string:MainAbility_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:white", - "visible": true, + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:layered_image", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, "skills": [ { "entities": [ @@ -35,6 +33,20 @@ } ] } + ], + "extensionAbilities": [ + { + "name": "EntryBackupAbility", + "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", + "type": "backup", + "exported": false, + "metadata": [ + { + "name": "ohos.extension.backup", + "resource": "$profile:backup_config" + } + ] + } ] } } \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/module.json5 b/services/distributeddataservice/service/test/testCloud/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..01f1676ebea2a1211908a02bebe5a95e0840e0c9 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/src/main/module.json5 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2025 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. +*/ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default", + "tablet", + "2in1" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:layered_image", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "name": "EntryBackupAbility", + "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", + "type": "backup", + "exported": false, + "metadata": [ + { + "name": "ohos.extension.backup", + "resource": "$profile:backup_config" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/element/color.json b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/element/color.json index 1bbc9aa9617e97c45440e1d3d66afc1154837012..3c712962da3c2751c2b9ddb53559afcbd2b54a02 100644 --- a/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/element/color.json +++ b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/element/color.json @@ -1,7 +1,7 @@ { "color": [ { - "name": "white", + "name": "start_window_background", "value": "#FFFFFF" } ] diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/element/float.json b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..33ea22304f9b1485b5f22d811023701b5d4e35b6 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/element/float.json @@ -0,0 +1,8 @@ +{ + "float": [ + { + "name": "page_text_font_size", + "value": "50fp" + } + ] +} diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/element/string.json b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/element/string.json index 496f24f73704a62e0100d427ad898950983a99d4..098d182af2e76f4b46b6ec420b8d78c32b0a5d50 100644 --- a/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/element/string.json +++ b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/element/string.json @@ -1,15 +1,15 @@ { "string": [ { - "name": "entry_desc", + "name": "module_desc", "value": "testCloud" }, { - "name": "MainAbility_desc", + "name": "EntryAbility_desc", "value": "testCloud" }, { - "name": "MainAbility_label", + "name": "EntryAbility_label", "value": "testCloud" } ] diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/media/background.png b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..923f2b3f27e915d6871871deea0420eb45ce102f Binary files /dev/null and b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/media/background.png differ diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/media/foreground.png b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..97014d3e10e5ff511409c378cd4255713aecd85f Binary files /dev/null and b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/media/foreground.png differ diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/media/icon.png b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/media/layered_image.json b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/media/layered_image.json @@ -0,0 +1,7 @@ +{ + "layered-image": + { + "background" : "$media:background", + "foreground" : "$media:foreground" + } +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/media/startIcon.png b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/media/startIcon.png differ diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/profile/backup_config.json b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/profile/main_pages.json b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/profile/main_pages.json index feec276e105eeb8d621c20aaf838f318b0a94150..1898d94f58d6128ab712be2c68acc7c98e9ab9ce 100644 --- a/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/profile/main_pages.json +++ b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/base/profile/main_pages.json @@ -1,5 +1,5 @@ { "src": [ - "pages/index" + "pages/Index" ] } diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/dark/element/color.json b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/dark/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..79b11c2747aec33e710fd3a7b2b3c94dd9965499 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/src/main/resources/dark/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#000000" + } + ] +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/mock/mock-config.json5 b/services/distributeddataservice/service/test/testCloud/entry/src/mock/mock-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..1862977b4c8986b7c16e6971c6dceef5a5df7241 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/src/mock/mock-config.json5 @@ -0,0 +1,16 @@ +/* +* Copyright (c) 2025 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. +*/ +{ +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/ohosTest/ets/test/Ability.test.ets b/services/distributeddataservice/service/test/testCloud/entry/src/ohosTest/ets/test/Ability.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..1b0a43daa600f5ef89d5ee947f93bf5445ad3424 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/src/ohosTest/ets/test/Ability.test.ets @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2025 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 { hilog } from '@kit.PerformanceAnalysisKit'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; + +export default function abilityTest() { + describe('ActsAbilityTest', () => { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(() => { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }) + beforeEach(() => { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }) + afterEach(() => { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }) + afterAll(() => { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }) + it('assertContain', 0, () => { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); + let a = 'abc'; + let b = 'b'; + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b); + expect(a).assertEqual(a); + }) + }) +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/ohosTest/ets/test/List.test.ets b/services/distributeddataservice/service/test/testCloud/entry/src/ohosTest/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..afd592f1d51932b6158ec085fd972c624ad44ca9 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/src/ohosTest/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* +* Copyright (c) 2025 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 abilityTest from './Ability.test'; + +export default function testsuite() { + abilityTest(); +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/ohosTest/module.json5 b/services/distributeddataservice/service/test/testCloud/entry/src/ohosTest/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..9b809c6cee67a2706e9032c4bd66c37050761b79 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/src/ohosTest/module.json5 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2025 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. +*/ +{ + "module": { + "name": "entry_test", + "type": "feature", + "deviceTypes": [ + "phone", + "tablet", + "2in1", + "wearable" + ], + "deliveryWithInstall": true, + "installationFree": false + } +} diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/test/List.test.ets b/services/distributeddataservice/service/test/testCloud/entry/src/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..e9031ce21e87f6a6c47fd5d15499e8d1d15e5efe --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/src/test/List.test.ets @@ -0,0 +1,19 @@ +/* +* Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; + +export default function testsuite() { + localUnitTest(); +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/entry/src/test/LocalUnit.test.ets b/services/distributeddataservice/service/test/testCloud/entry/src/test/LocalUnit.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..74783abed1873909d16461e6f1701576b3d2632b --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/entry/src/test/LocalUnit.test.ets @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; + +export default function localUnitTest() { + describe('localUnitTest', () => { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(() => { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }); + beforeEach(() => { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }); + afterEach(() => { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }); + afterAll(() => { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }); + it('assertContain', 0, () => { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + let a = 'abc'; + let b = 'b'; + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b); + expect(a).assertEqual(a); + }); + }); +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/hvigor/hvigor-config.json5 b/services/distributeddataservice/service/test/testCloud/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..6b7477303d6960322eb981a4f4758061d5c2a126 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/hvigor/hvigor-config.json5 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2025 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. +*/ +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */ + // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */ + // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */ + // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */ + }, + "nodeOptions": { + // "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/ + // "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/ + } +} diff --git a/services/distributeddataservice/service/test/testCloud/hvigorfile.ts b/services/distributeddataservice/service/test/testCloud/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..3e8a731f141a2f8ab2caa8394c10484169d46e9d --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/hvigorfile.ts @@ -0,0 +1,21 @@ +/* +* Copyright (c) 2025 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 { appTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins: [] /* Custom plugin to extend the functionality of Hvigor. */ +} \ No newline at end of file diff --git a/services/distributeddataservice/service/test/testCloud/hvigorw b/services/distributeddataservice/service/test/testCloud/hvigorw new file mode 100644 index 0000000000000000000000000000000000000000..30fc35b378b6a4b99bcd42a9f2122e4e88f491b1 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/hvigorw @@ -0,0 +1,60 @@ +# Copyright (C) 2025 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. +#!/bin/bash + +# ---------------------------------------------------------------------------- +# Hvigor startup script, version 1.0.0 +# +# Required ENV vars: +# ------------------ +# NODE_HOME - location of a Node home dir +# or +# Add /usr/local/nodejs/bin to the PATH environment variable +# ---------------------------------------------------------------------------- + +HVIGOR_APP_HOME=$(dirname $(readlink -f $0)) +HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js +warn() { + echo "" + echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" +} + +error() { + echo "" + echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" +} + +fail() { + error "$@" + exit 1 +} + +# Determine node to start hvigor wrapper script +if [ -n "${NODE_HOME}" ];then + EXECUTABLE_NODE="${NODE_HOME}/bin/node" + if [ ! -x "$EXECUTABLE_NODE" ];then + fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed" + fi +else + EXECUTABLE_NODE="node" + which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path" +fi + +# Check hvigor wrapper script +if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then + fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}" +fi + +# start hvigor-wrapper script +exec "${EXECUTABLE_NODE}" \ + "${HVIGOR_WRAPPER_SCRIPT}" "$@" diff --git a/services/distributeddataservice/service/test/testCloud/hvigorw.bat b/services/distributeddataservice/service/test/testCloud/hvigorw.bat new file mode 100644 index 0000000000000000000000000000000000000000..d77138670c41fdd9e06419d1f07ddbd010d72d4e --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/hvigorw.bat @@ -0,0 +1,63 @@ +@rem Copyright (C) 2025 Huawei Device Co., Ltd. +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@echo off +@rem +@rem ------------------------------------------------------------------- +@rem Hvigor startup script for Windows, version 1.0.0 +@rem +@rem Required ENV vars: +@rem ------------------ +@rem NODE_HOME - location of a Node home dir +@rem or +@rem Add %NODE_HOME%/bin to the PATH environment variable +@rem ------------------------------------------------------------------- +@rem + +set DIRNAME=%~dp0 +set APP_BASE_NAME=%~n0 +set NODE_EXE_PATH="" +set APP_HOME=. +set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js +set NODE_EXE=node.exe +@rem set NODE_OPTS="--max-old-space-size=4096" + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +if not defined NODE_OPTS set NODE_OPTS="--" + +@rem Find node.exe +if defined NODE_HOME ( + set NODE_HOME=%NODE_HOME:"=% + set "PATH=%PATH%;%NODE_HOME%" + set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE% +) + +%NODE_EXE% --version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" ( + "%NODE_EXE%" "%NODE_OPTS%" "%WRAPPER_MODULE_PATH%" %* +) else if exist "%NODE_EXE_PATH%" ( + "%NODE_EXE_PATH%" "%NODE_OPTS%" "%WRAPPER_MODULE_PATH%" %* +) else ( + echo. + echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. + echo. + echo Please set the NODE_HOME variable in your environment to match the + echo location of your NodeJs installation. +) + +if "%ERRORLEVEL%" == "0"( + if "%OS%" == "Windows_NT" endlocal +) else ( + exit /b %ERRORLEVEL% +) diff --git a/services/distributeddataservice/service/test/testCloud/local.properties b/services/distributeddataservice/service/test/testCloud/local.properties new file mode 100644 index 0000000000000000000000000000000000000000..70c3e8e314b3b90a95927818a4a8ecf8affb1fde --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/local.properties @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2025 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. +*/ +# This file is automatically generated by DevEco Studio. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file should *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# For customization when using a Version Control System, please read the header note. + + diff --git a/services/distributeddataservice/service/test/testCloud/oh-package.json5 b/services/distributeddataservice/service/test/testCloud/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b24e8e4d66b41045c2415e28b1dd9cf0c4c0ccf4 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/oh-package.json5 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2025 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. +*/ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + } +} diff --git a/services/distributeddataservice/service/test/testCloud/signature/portallogin.gni b/services/distributeddataservice/service/test/testCloud/signature/portallogin.gni new file mode 100644 index 0000000000000000000000000000000000000000..dea7ef2e1ecf4f80346bffb03e78b59c08a8df87 --- /dev/null +++ b/services/distributeddataservice/service/test/testCloud/signature/portallogin.gni @@ -0,0 +1,14 @@ +# Copyright (c) 2025 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. + +certificate_profile_path = "//vendor/tools/hap_sign_conf/wifi/portal_login/portallogin.p7b" \ No newline at end of file