From 0d66f4a29f5abe84bae1bac8c385324ec1c1fd66 Mon Sep 17 00:00:00 2001 From: sunjiakun Date: Sat, 19 Oct 2024 10:16:05 +0800 Subject: [PATCH] Add TDD Signed-off-by: sunjiakun --- .../unittest/json/module_json_test/BUILD.gn | 27 +- .../module_json_stage_test.cpp | 433 ++++++ .../module_json_test/module_json_stage_test.h | 1339 +++++++++++++++++ 3 files changed, 1798 insertions(+), 1 deletion(-) create mode 100644 packing_tool/frameworks/test/unittest/json/module_json_test/module_json_stage_test.cpp create mode 100644 packing_tool/frameworks/test/unittest/json/module_json_test/module_json_stage_test.h diff --git a/packing_tool/frameworks/test/unittest/json/module_json_test/BUILD.gn b/packing_tool/frameworks/test/unittest/json/module_json_test/BUILD.gn index 5c45a9c7..838b1f68 100644 --- a/packing_tool/frameworks/test/unittest/json/module_json_test/BUILD.gn +++ b/packing_tool/frameworks/test/unittest/json/module_json_test/BUILD.gn @@ -49,7 +49,32 @@ ohos_unittest("module_json_test") { ] } +ohos_unittest("module_json_stage_test") { + module_out_path = module_output_path + public_configs = [ ":module_json_test_config" ] + sources = [ + "../../../../src/json/distro_filter.cpp", + "../../../../src/json/hap_verify_info.cpp", + "../../../../src/json/module_json.cpp", + "../../../../src/json/module_json_fa.cpp", + "../../../../src/json/module_json_stage.cpp", + "../../../../src/json/pt_json.cpp", + "../../../../src/log.cpp", + "../../../../src/utils.cpp", + "module_json_stage_test.cpp", + ] + external_deps = [ + "bounds_checking_function:libsec_static", + "cJSON:cjson_static", + "hilog:libhilog", + "openssl:libcrypto_shared", + "zlib:libz", + ] +} + group("unittest") { testonly = true - deps = [ ":module_json_test" ] + deps = [ ":module_json_test", + ":module_json_stage_test" + ] } diff --git a/packing_tool/frameworks/test/unittest/json/module_json_test/module_json_stage_test.cpp b/packing_tool/frameworks/test/unittest/json/module_json_test/module_json_stage_test.cpp new file mode 100644 index 00000000..6005e094 --- /dev/null +++ b/packing_tool/frameworks/test/unittest/json/module_json_test/module_json_stage_test.cpp @@ -0,0 +1,433 @@ +/* + * Copyright (c) 2024 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. + */ + +#include +#include +#include +#include + +#define private public +#define protected public +#include "module_json.h" +#include "pt_json.h" +#include "log.h" +#include "module_json_stage_test.h" +#undef private +#undef protected + +using namespace testing; +using namespace testing::ext; +using namespace std; +using namespace OHOS::AppPackingTool; + +namespace OHOS { +class ModuleJsonTest : public testing::Test { +public: + ModuleJsonTest() {} + virtual ~ModuleJsonTest() {} + + static void SetUpTestCase(); + + static void TearDownTestCase(); + + void SetUp(); + + void TearDown(); +}; + +void ModuleJsonTest::SetUpTestCase() {} + +void ModuleJsonTest::TearDownTestCase() {} + +void ModuleJsonTest::SetUp() {} + +void ModuleJsonTest::TearDown() {} + +/* + * @tc.name: SetStageVersionCode + * @tc.desc: test set stage version code + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, SetStageVersionCode_0300, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_TEST_STRING)); + int32_t versionCode = 99; + EXPECT_FALSE(moduleJson.SetStageVersionCode(versionCode)); +} + +/* + * @tc.name: SetStageVersionName + * @tc.desc: test set stage version name + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, SetStageVersionName_0300, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_TEST_STRING)); + std::string versionName = "1.0.0"; + EXPECT_FALSE(moduleJson.SetStageVersionName(versionName)); +} + +/* + * @tc.name: GetStageVersionByAppObj + * @tc.desc: test get stage version by obj + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageVersionByAppObj_0200, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::unique_ptr appObj; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_TEST_STRING)); + moduleJson.GetAppObject(appObj); + Version version; + EXPECT_FALSE(moduleJson.GetStageVersionByAppObj(appObj, version)); +} + +/* + * @tc.name: GetStageVersionByAppObj + * @tc.desc: test get stage version by obj + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageVersionByAppObj_0300, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::unique_ptr appObj; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_VERSIONBYAPPOBJ_VERSIONCODE_TEST_STRING)); + moduleJson.GetAppObject(appObj); + Version version; + EXPECT_FALSE(moduleJson.GetStageVersionByAppObj(appObj, version)); +} + +/* + * @tc.name: GetStageVersionByAppObj + * @tc.desc: test get stage version by obj + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageVersionByAppObj_0400, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::unique_ptr appObj; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_VERSIONBYAPPOBJ_VERSIONNAME_TEST_STRING)); + moduleJson.GetAppObject(appObj); + Version version; + EXPECT_FALSE(moduleJson.GetStageVersionByAppObj(appObj, version)); +} + +/* + * @tc.name: GetStageVersionByAppObj + * @tc.desc: test get stage version by obj + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageVersionByAppObj_0500, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::unique_ptr appObj; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_VERSIONBYAPPOBJ_MINIVERSIONCODE_TEST_STRING)); + moduleJson.GetAppObject(appObj); + Version version; + EXPECT_FALSE(moduleJson.GetStageVersionByAppObj(appObj, version)); +} + +/* + * @tc.name: GetStageInstallationFree + * @tc.desc: test get stage installation free + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageInstallationFree_0200, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_TEST_STRING_NOTHING)); + bool installationFree = true; + EXPECT_FALSE(moduleJson.GetStageInstallationFree(installationFree)); + EXPECT_EQ(installationFree, true); +} + +/* + * @tc.name: GetStageInstallationFreeByModuleObj + * @tc.desc: test get stage installation free + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageInstallationFreeByModuleObj_0200, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::unique_ptr moduleObj = nullptr; + bool installationFree = true; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_VERSIONBYAPPOBJ_MINIVERSIONCODE_TEST_STRING)); + EXPECT_TRUE(moduleJson.GetModuleObject(moduleObj)); + EXPECT_FALSE(moduleJson.GetStageInstallationFreeByModuleObj(moduleObj, installationFree)); + EXPECT_EQ(installationFree, false); +} + +/* + * @tc.name: GetStageModuleApiVersion + * @tc.desc: test get stage module api version + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageModuleApiVersion_0300, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_TEST_STRING_NOTHING)); + ModuleApiVersion moduleApiVersion; + EXPECT_FALSE(moduleJson.GetStageModuleApiVersion(moduleApiVersion)); +} + +/* + * @tc.name: GetStageModuleApiVersionByAppObj + * @tc.desc: test get stage module api version + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageModuleApiVersionByAppObj_0200, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::unique_ptr appObj = nullptr; + ModuleApiVersion moduleApiVersion; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_VERSIONBYAPPOBJ_MINIVERSIONCODE_TEST_STRING)); + EXPECT_TRUE(moduleJson.GetAppObject(appObj)); + EXPECT_FALSE(moduleJson.GetStageModuleApiVersionByAppObj(appObj, moduleApiVersion)); +} + +/* + * @tc.name: GetStageModuleApiVersionByAppObj + * @tc.desc: test get stage module api version + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageModuleApiVersionByAppObj_0300, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::unique_ptr appObj = nullptr; + ModuleApiVersion moduleApiVersion; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_VERSIONBYAPPOBJ_MINIVERSIONCODE_TEST_STRING)); + EXPECT_TRUE(moduleJson.GetAppObject(appObj)); + EXPECT_FALSE(moduleJson.GetStageModuleApiVersionByAppObj(appObj, moduleApiVersion)); +} + +/* + * @tc.name: GetStageModuleApiVersionByAppObj + * @tc.desc: test get stage module api version + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageModuleApiVersionByAppObj_0400, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::unique_ptr appObj = nullptr; + ModuleApiVersion moduleApiVersion; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_VERSIONBYAPPOBJ_VERSIONNAME_TEST_STRING)); + EXPECT_TRUE(moduleJson.GetAppObject(appObj)); + EXPECT_FALSE(moduleJson.GetStageModuleApiVersionByAppObj(appObj, moduleApiVersion)); +} + +/* + * @tc.name: GetStageModuleApiVersionByAppObj + * @tc.desc: test get stage module api version + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageModuleApiVersionByAppObj_0500, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::unique_ptr appObj = nullptr; + ModuleApiVersion moduleApiVersion; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_VERSIONBYAPPOBJ_VERSIONCODE_TEST_STRING)); + EXPECT_TRUE(moduleJson.GetAppObject(appObj)); + EXPECT_FALSE(moduleJson.GetStageModuleApiVersionByAppObj(appObj, moduleApiVersion)); +} + +/* + * @tc.name: GetStageModuleName + * @tc.desc: test get stage module name + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageModuleName_0200, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::string stageModuleName = ""; + moduleJson.Release(); + EXPECT_FALSE(moduleJson.GetStageModuleName(stageModuleName)); +} + +/* + * @tc.name: GetStageModuleNameByModuleObj + * @tc.desc: test get stage module name + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageModuleNameByModuleObj_0200, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::unique_ptr moduleObj = nullptr; + std::string stageModuleName = ""; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_VERSIONBYAPPOBJ_VERSIONNAME_TEST_STRING)); + EXPECT_TRUE(moduleJson.GetModuleObject(moduleObj)); + EXPECT_FALSE(moduleJson.GetStageModuleNameByModuleObj(moduleObj, stageModuleName)); +} + +/* + * @tc.name: GetStageCompileSdkTypeByAppObj + * @tc.desc: test get stage compile sdk type + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageCompileSdkTypeByAppObj_0200, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::unique_ptr appObj = nullptr; + std::string compileSdkType = ""; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_VERSIONBYAPPOBJ_VERSIONCODE_TEST_STRING)); + EXPECT_TRUE(moduleJson.GetAppObject(appObj)); + EXPECT_FALSE(moduleJson.GetStageCompileSdkTypeByAppObj(appObj, compileSdkType)); +} + +/* + * @tc.name: GetStageCompileSdkVersionByAppObj + * @tc.desc: test get stage compile sdk version + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageCompileSdkVersionByAppObj_0200, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::unique_ptr appObj = nullptr; + std::string compileSdkVersion = ""; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_VERSIONBYAPPOBJ_VERSIONCODE_TEST_STRING)); + EXPECT_TRUE(moduleJson.GetAppObject(appObj)); + EXPECT_FALSE(moduleJson.GetStageCompileSdkVersionByAppObj(appObj, compileSdkVersion)); +} + +/* + * @tc.name: GetStageDebugByAppObj + * @tc.desc: test get stage debug + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageDebugByAppObj_0200, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::unique_ptr appObj = nullptr; + bool debug = true; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_VERSIONBYAPPOBJ_VERSIONCODE_TEST_STRING)); + EXPECT_FALSE(moduleJson.GetStageDebugByAppObj(appObj, debug)); + EXPECT_EQ(debug, true); +} + +/* + * @tc.name: GetStageEntry + * @tc.desc: test get stage entry + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageEntry_0200, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::list deviceTypes; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_TEST_STRING_NOTHING)); + EXPECT_FALSE(moduleJson.GetStageEntry(deviceTypes)); + EXPECT_EQ(deviceTypes.size(), 0); +} + +/* + * @tc.name: GetStageEntry + * @tc.desc: test get stage entry + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageEntry_0300, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::list deviceTypes; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_VERSIONBYAPPOBJ_VERSIONCODE_TEST_STRING)); + EXPECT_FALSE(moduleJson.GetStageEntry(deviceTypes)); + EXPECT_EQ(deviceTypes.size(), 0); +} + +/* + * @tc.name: GetStageEntry + * @tc.desc: test get stage entry + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageEntry_0400, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::list deviceTypes; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_VERSIONBYAPPOBJ_VERSIONNAME_TEST_STRING)); + EXPECT_FALSE(moduleJson.GetStageEntry(deviceTypes)); + EXPECT_EQ(deviceTypes.size(), 0); +} + +/* + * @tc.name: GetStageEntry + * @tc.desc: test get stage entry + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageEntry_0500, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::list deviceTypes; + moduleJson.Release(); + EXPECT_TRUE(moduleJson.ParseFromString(MODULE_JSON_VERSIONBYAPPOBJ_MINIVERSIONCODE_TEST_STRING)); + EXPECT_FALSE(moduleJson.GetStageEntry(deviceTypes)); + EXPECT_EQ(deviceTypes.size(), 0); +} + +/* + * @tc.name: GetStageDeviceTypes + * @tc.desc: test get stage device types + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ModuleJsonTest, GetStageDeviceTypes_0200, Function | MediumTest | Level1) +{ + OHOS::AppPackingTool::ModuleJson moduleJson; + std::list deviceTypes; + moduleJson.Release(); + EXPECT_FALSE(moduleJson.GetStageDeviceTypes(deviceTypes)); + EXPECT_EQ(deviceTypes.size(), 0); +} +} \ No newline at end of file diff --git a/packing_tool/frameworks/test/unittest/json/module_json_test/module_json_stage_test.h b/packing_tool/frameworks/test/unittest/json/module_json_test/module_json_stage_test.h new file mode 100644 index 00000000..a0bce609 --- /dev/null +++ b/packing_tool/frameworks/test/unittest/json/module_json_test/module_json_stage_test.h @@ -0,0 +1,1339 @@ +/* + * Copyright (c) 2024 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. + */ + +#ifndef DEVELOPTOOLS_PACKING_TOOL_APT_FRAMEWORKS_INCLUDE_MODULE_JSON_STAGE_TEST_H +#define DEVELOPTOOLS_PACKING_TOOL_APT_FRAMEWORKS_INCLUDE_MODULE_JSON_STAGE_TEST_H + +#include +#include +#include +#include + +#define private public +#define protected public +#undef private +#undef protected + +namespace OHOS { +namespace AppPackingTool { +const std::string MODULE_JSON_STRING = "{" + "\"app\": {" + "\"bundleName\": \"test_bundle_name\"," + "\"bundleType\": \"atomicService\"," + "\"vendor\": \"\"," + "\"versionCode\": 1000000," + "\"versionName\": \"test_version_name\"," + "\"icon\": \"media:app_icon\"," + "\"label\": \"string:app_name\"," + "\"apiReleaseType\": \"Canary\"," + "\"compileSdkVersion\": \"test_compileSdkVersion\"," + "\"targetAPIVersion\": 10," + "\"minAPIVersion\": 10," + "\"compileSdkType\": \"OpenHarmony\"," + "\"debug\": true," + "\"iconId\": 16777217," + "\"labelId\": 16777216," + "\"version\": {" + "\"code\": 666," + "\"name\": \"test_version\"," + "\"minCompatibleVersionCode\": 555" + "}," + "\"apiVersion\": {" + "\"compileSdkType\": \"OpenHarmony\"," + "\"compileSdkVersion\": \"test_apiVersion_compileSdkVersion\"," + "\"releaseType\": \"test_apiVersion_release\"," + "\"compatible\": 7," + "\"target\": 10" + "}," + "\"targetBundleName\": \"test_app_targetBundleName\"," + "\"multiAppMode\": {" + "\"multiAppModeType\": \"test_multiAppMode\"," + "\"maxCount\": 9" + "}," + "\"generateBuildHash\": true," + "\"minCompatibleVersionCode\": 99," + "\"asanEnabled\": true," + "\"tsanEnabled\": false," + "\"compressNativeLibs\": true," + "\"targetPriority\": 5" + "}," + "\"module\": {" + "\"name\": \"entry\"," + "\"type\": \"entry\"," + "\"description\": \"string:module_desc\"," + "\"mainElement\": \"EntryAbility\"," + "\"deviceTypes\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"deliveryWithInstall\": true," + "\"installationFree\": true," + "\"pages\": \"profile:main_pages\"," + "\"abilities\": [" + "{" + "\"name\": \"EntryAbility\"," + "\"moduleName\": \"test_module_name\"," + "\"srcEntry\": \"./ets/entryability/EntryAbility.ts\"," + "\"description\": \"string:EntryAbility_desc\"," + "\"icon\": \"media:icon\"," + "\"label\": \"string:EntryAbility_label\"," + "\"startWindowIcon\": \"media:icon\"," + "\"startWindowBackground\": \"color:start_window_background\"," + "\"exported\": true," + "\"skills\": [" + "{" + "\"entities\": [\"entity.system.home\"]," + "\"actions\": [\"action.system.home\"]" + "}" + "]," + "\"descriptionId\": 16777218," + "\"iconId\": 16777222," + "\"labelId\": 16777219," + "\"startWindowIconId\": 16777222," + "\"startWindowBackgroundId\": 16777221," + "\"continueType\":[]" + "}" + "]," + "\"virtualMachine\": \"test_virtualMachine\"," + "\"compileMode\": \"esmodule\"," + "\"dependencies\": [" + "{" + "\"bundleName\": \"test_modules_dependency_1\"," + "\"moduleName\": \"entry_1\"" + "}," + "{" + "\"bundleName\": \"test_modules_dependency_2\"," + "\"moduleName\": \"entry_1\"" + "}" + "]," + "\"descriptionId\": 16777220," + "\"distro\": {" + "\"installationFree\": false," + "\"moduleType\": \"entry\"," + "\"moduleName\": \"test_module_name\"" + "}," + "\"preloads\": [" + "{" + "\"name\": \"test_name_1\"," + "\"moduleName\": \"test_module_name_1\"" + "}" + "]," + "\"package\": \"test_package\"," + "\"deviceType\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"targetModuleName\": \"test_module_targetBundleName\"," + "\"targetPriority\": 6," + "\"proxyDatas\": [" + "{" + "\"uri\": \"test_uri1\"" + "}," + "{" + "\"uri\": \"test_uri2\"" + "}" + "]," + "\"atomicService\": {" + "\"preloads\": [" + "{" + "\"atomicServiceObj\": \"test_atomicService\"" + "}" + "]" + + "}," + "\"metadata\": [" + "{" + "\"name\": \"test_metadata\"," + "\"value\": \"test_value\"," + "\"resource\": \"test_resource\"" + "}" + "]," + "\"extensionAbilities\": [" + "{" + "\"name\": \"test_extension_abilities\"" + "}" + "]" + "}," + "\"deviceConfig\": {" + "\"default\": {\"debug\": true}" + "}" +"}"; + +const std::string MODULE_JSON_TEST_STRING = "{" + "\"app\": {" + "\"apiVersion\": {" + "}" + "}," + "\"module\": {" + "\"requestPermissions\": true," + "\"proxyData\": [" + "{" + "\"uri\": \"test_uri1\"" + "}," + "{" + "\"uri\": \"test_uri2\"" + "}" + "]," + "\"generateBuildHash\": true" + "}" +"}"; + +const std::string MODULE_JSON_TEST_STRING_NOTHING = "{" +"}"; + +const std::string MODULE_JSON_TEST_STRING_ERROR = "{" + "\"app\": {" + "\"bundleType\": \"atomicService\"," + "\"versionCode\": 1000000," + "\"versionName\": \"test_version_name\"," + "\"icon\": \"media:app_icon\"," + "\"label\": \"string:app_name\"," + "\"apiReleaseType\": \"Canary\"," + "\"compileSdkVersion\": \"test_compileSdkVersion\"," + "\"targetAPIVersion\": 10," + "\"minAPIVersion\": 10," + "\"compileSdkType\": \"OpenHarmony\"," + "\"debug\": true," + "\"iconId\": 16777217," + "\"labelId\": 16777216," + "\"version\": {" + "\"code\": 666," + "\"name\": \"test_version\"," + "\"minCompatibleVersionCode\": 555" + "}," + "\"multiAppMode\": {" + "\"multiAppModeType\": \"test_multiAppMode\"," + "\"maxCount\": 9" + "}," + "\"generateBuildHash\": true," + "\"minCompatibleVersionCode\": 99," + "\"asanEnabled\": true," + "\"tsanEnabled\": false," + "\"compressNativeLibs\": true," + "\"targetPriority\": 5" + "}," + "\"module\": {" + "\"type\": \"entry\"," + "\"description\": \"string:module_desc\"," + "\"mainElement\": \"EntryAbility\"," + "\"deviceTypes\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"deliveryWithInstall\": true," + "\"installationFree\": true," + "\"pages\": \"profile:main_pages\"," + "\"abilities\": [" + "{" + "\"name\": \"EntryAbility\"," + "\"moduleName\": \"test_module_name\"," + "\"srcEntry\": \"./ets/entryability/EntryAbility.ts\"," + "\"description\": \"string:EntryAbility_desc\"," + "\"icon\": \"media:icon\"," + "\"label\": \"string:EntryAbility_label\"," + "\"startWindowIcon\": \"media:icon\"," + "\"startWindowBackground\": \"color:start_window_background\"," + "\"exported\": true," + "\"skills\": [" + "{" + "\"entities\": [\"entity.system.home\"]," + "\"actions\": [\"action.system.home\"]" + "}" + "]," + "\"descriptionId\": 16777218," + "\"iconId\": 16777222," + "\"labelId\": 16777219," + "\"startWindowIconId\": 16777222," + "\"startWindowBackgroundId\": 16777221," + "\"continueType\":[]" + "}" + "]," + "\"virtualMachine\": \"test_virtualMachine\"," + "\"compileMode\": \"esmodule\"," + "\"dependencies\": [" + "{" + "\"bundleName\": \"test_modules_dependency_1\"," + "\"moduleName\": \"entry_1\"" + "}," + "{" + "\"bundleName\": \"test_modules_dependency_2\"," + "\"moduleName\": \"entry_1\"" + "}" + "]," + "\"descriptionId\": 16777220," + "\"preloads\": [" + "{" + "\"name\": \"test_name_1\"," + "\"moduleName\": \"test_module_name_1\"" + "}" + "]," + "\"package\": \"test_package\"," + "\"deviceType\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"targetModuleName\": \"test_module_targetBundleName\"," + "\"targetPriority\": 6," + "\"proxyDatas\": [" + "{" + "\"uri\": \"test_uri1\"" + "}," + "{" + "\"uri\": \"test_uri2\"" + "}" + "]," + "\"atomicService\": {" + "\"preloads\": [" + "{" + "\"atomicServiceObj\": \"test_atomicService\"" + "}" + "]" + + "}," + "\"metadata\": [" + "{" + "\"name\": \"test_metadata\"," + "\"value\": \"test_value\"," + "\"resource\": \"test_resource\"" + "}" + "]," + "\"extensionAbilities\": [" + "{" + "\"name\": \"test_extension_abilities\"" + "}" + "]" + "}," + "\"deviceConfig\": {" + "\"default\": {\"debug\": true}" + "}" +"}"; + +const std::string MODULE_JSON_VERSIONBYAPPOBJ_VERSIONCODE_TEST_STRING = "{" + "\"app\": {" + "\"vendor\": \"\"," + "\"versionCode\": \"test\"," + "\"versionName\": \"test_version_name\"," + "\"icon\": \"media:app_icon\"," + "\"label\": \"string:app_name\"," + "\"apiReleaseType\": true," + "\"compileSdkVersion\": true," + "\"targetAPIVersion\": 10," + "\"minAPIVersion\": 10," + "\"compileSdkType\": true," + "\"debug\": \"test_bundle_name\"," + "\"iconId\": 16777217," + "\"labelId\": 16777216," + "\"version\": {" + "\"code\": 666," + "\"name\": \"test_version\"," + "\"minCompatibleVersionCode\": 555" + "}," + "\"apiVersion\": {" + "\"compileSdkType\": true," + "\"compileSdkVersion\": \"test_apiVersion_compileSdkVersion\"," + "\"releaseType\": \"test_apiVersion_release\"," + "\"compatible\": 7," + "\"target\": 10" + "}," + "\"targetBundleName\": \"test_app_targetBundleName\"," + "\"multiAppMode\": {" + "\"multiAppModeType\": \"test_multiAppMode\"," + "\"maxCount\": 9" + "}," + "\"generateBuildHash\": true," + "\"minCompatibleVersionCode\": 99," + "\"asanEnabled\": \"test_multiAppMode\"," + "\"tsanEnabled\": \"test_multiAppMode\"," + "\"compressNativeLibs\": \"test_multiAppMode\"," + "\"targetPriority\": 5" + "}," + "\"module\": {" + "\"description\": \"string:module_desc\"," + "\"mainElement\": \"EntryAbility\"," + "\"deviceTypes\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"deliveryWithInstall\": true," + "\"installationFree\": true," + "\"pages\": \"profile:main_pages\"," + "\"abilities\": [" + "{" + "\"name\": \"EntryAbility\"," + "\"moduleName\": \"test_module_name\"," + "\"srcEntry\": \"./ets/entryability/EntryAbility.ts\"," + "\"description\": \"string:EntryAbility_desc\"," + "\"icon\": \"media:icon\"," + "\"label\": \"string:EntryAbility_label\"," + "\"startWindowIcon\": \"media:icon\"," + "\"startWindowBackground\": \"color:start_window_background\"," + "\"exported\": true," + "\"skills\": [" + "{" + "\"entities\": [\"entity.system.home\"]," + "\"actions\": [\"action.system.home\"]" + "}" + "]," + "\"descriptionId\": 16777218," + "\"iconId\": 16777222," + "\"labelId\": 16777219," + "\"startWindowIconId\": 16777222," + "\"startWindowBackgroundId\": 16777221," + "\"continueType\":[]" + "}" + "]," + "\"virtualMachine\": \"test_virtualMachine\"," + "\"compileMode\": \"esmodule\"," + "\"dependencies\": [" + "{" + "\"bundleName\": \"test_modules_dependency_1\"," + "\"moduleName\": \"entry_1\"" + "}," + "{" + "\"bundleName\": \"test_modules_dependency_2\"," + "\"moduleName\": \"entry_1\"" + "}" + "]," + "\"descriptionId\": 16777220," + "\"distro\": {" + "\"installationFree\": false," + "\"moduleType\": \"entry\"," + "\"moduleName\": \"test_module_name\"" + "}," + "\"preloads\": [" + "{" + "\"name\": \"test_name_1\"," + "\"moduleName\": \"test_module_name_1\"" + "}" + "]," + "\"package\": \"test_package\"," + "\"deviceType\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"targetModuleName\": \"test_module_targetBundleName\"," + "\"targetPriority\": 6," + "\"proxyDatas\": [" + "{" + "\"uri\": \"test_uri1\"" + "}," + "{" + "\"uri\": \"test_uri2\"" + "}" + "]," + "\"atomicService\": {" + "\"preloads\": [" + "{" + "\"atomicServiceObj\": \"test_atomicService\"" + "}" + "]" + + "}," + "\"metadata\": [" + "{" + "\"name\": \"test_metadata\"," + "\"value\": \"test_value\"," + "\"resource\": \"test_resource\"" + "}" + "]," + "\"extensionAbilities\": [" + "{" + "\"name\": \"test_extension_abilities\"" + "}" + "]" + "}," + "\"deviceConfig\": {" + "\"default\": {\"debug\": true}" + "}" +"}"; + +const std::string MODULE_JSON_VERSIONBYAPPOBJ_VERSIONNAME_TEST_STRING = "{" + "\"app\": {" + "\"bundleName\": \"test_bundle_name\"," + "\"bundleType\": \"atomicService\"," + "\"vendor\": \"\"," + "\"versionCode\": 1000000," + "\"versionName\": 1000000," + "\"icon\": \"media:app_icon\"," + "\"label\": \"string:app_name\"," + "\"apiReleaseType\": \"Canary\"," + "\"compileSdkVersion\": \"test_compileSdkVersion\"," + "\"targetAPIVersion\": \"test_compileSdkVersion\"," + "\"minAPIVersion\": 10," + "\"compileSdkType\": \"OpenHarmony\"," + "\"debug\": true," + "\"iconId\": 16777217," + "\"labelId\": 16777216," + "\"version\": {" + "\"code\": 666," + "\"name\": \"test_version\"," + "\"minCompatibleVersionCode\": 555" + "}," + "\"apiVersion\": {" + "\"compileSdkType\": \"OpenHarmony\"," + "\"compileSdkVersion\": \"test_apiVersion_compileSdkVersion\"," + "\"releaseType\": \"test_apiVersion_release\"," + "\"compatible\": 7," + "\"target\": 10" + "}," + "\"targetBundleName\": \"test_app_targetBundleName\"," + "\"multiAppMode\": {" + "\"multiAppModeType\": \"test_multiAppMode\"," + "\"maxCount\": 9" + "}," + "\"generateBuildHash\": true," + "\"minCompatibleVersionCode\": 99," + "\"asanEnabled\": true," + "\"tsanEnabled\": false," + "\"compressNativeLibs\": true," + "\"targetPriority\": 5" + "}," + "\"module\": {" + "\"name\": true," + "\"type\": true," + "\"description\": \"string:module_desc\"," + "\"mainElement\": \"EntryAbility\"," + "\"deviceTypes\": true," + "\"deliveryWithInstall\": true," + "\"installationFree\": true," + "\"pages\": \"profile:main_pages\"," + "\"abilities\": [" + "{" + "\"name\": \"EntryAbility\"," + "\"moduleName\": \"test_module_name\"," + "\"srcEntry\": \"./ets/entryability/EntryAbility.ts\"," + "\"description\": \"string:EntryAbility_desc\"," + "\"icon\": \"media:icon\"," + "\"label\": \"string:EntryAbility_label\"," + "\"startWindowIcon\": \"media:icon\"," + "\"startWindowBackground\": \"color:start_window_background\"," + "\"exported\": true," + "\"skills\": [" + "{" + "\"entities\": [\"entity.system.home\"]," + "\"actions\": [\"action.system.home\"]" + "}" + "]," + "\"descriptionId\": 16777218," + "\"iconId\": 16777222," + "\"labelId\": 16777219," + "\"startWindowIconId\": 16777222," + "\"startWindowBackgroundId\": 16777221," + "\"continueType\":[]" + "}" + "]," + "\"virtualMachine\": \"test_virtualMachine\"," + "\"compileMode\": \"esmodule\"," + "\"dependencies\": [" + "{" + "\"bundleName\": \"test_modules_dependency_1\"," + "\"moduleName\": \"entry_1\"" + "}," + "{" + "\"bundleName\": \"test_modules_dependency_2\"," + "\"moduleName\": \"entry_1\"" + "}" + "]," + "\"descriptionId\": 16777220," + "\"distro\": {" + "\"installationFree\": false," + "\"moduleType\": \"entry\"," + "\"moduleName\": \"test_module_name\"" + "}," + "\"preloads\": [" + "{" + "\"name\": \"test_name_1\"," + "\"moduleName\": \"test_module_name_1\"" + "}" + "]," + "\"package\": \"test_package\"," + "\"deviceType\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"targetModuleName\": \"test_module_targetBundleName\"," + "\"targetPriority\": 6," + "\"proxyDatas\": [" + "{" + "\"uri\": \"test_uri1\"" + "}," + "{" + "\"uri\": \"test_uri2\"" + "}" + "]," + "\"atomicService\": {" + "\"preloads\": [" + "{" + "\"atomicServiceObj\": \"test_atomicService\"" + "}" + "]" + + "}," + "\"metadata\": [" + "{" + "\"name\": \"test_metadata\"," + "\"value\": \"test_value\"," + "\"resource\": \"test_resource\"" + "}" + "]," + "\"extensionAbilities\": [" + "{" + "\"name\": \"test_extension_abilities\"" + "}" + "]" + "}," + "\"deviceConfig\": {" + "\"default\": {\"debug\": true}" + "}" +"}"; + +const std::string MODULE_JSON_VERSIONBYAPPOBJ_MINIVERSIONCODE_TEST_STRING = "{" + "\"app\": {" + "\"bundleName\": \"test_bundle_name\"," + "\"bundleType\": \"atomicService\"," + "\"vendor\": \"\"," + "\"versionCode\": 1000000," + "\"versionName\": \"test_version_name\"," + "\"icon\": \"media:app_icon\"," + "\"label\": \"string:app_name\"," + "\"apiReleaseType\": \"Canary\"," + "\"compileSdkVersion\": \"test_compileSdkVersion\"," + "\"targetAPIVersion\": 10," + "\"minAPIVersion\": \"test_compileSdkVersion\"," + "\"compileSdkType\": \"OpenHarmony\"," + "\"debug\": true," + "\"iconId\": 16777217," + "\"labelId\": 16777216," + "\"version\": {" + "\"code\": 666," + "\"name\": \"test_version\"," + "\"minCompatibleVersionCode\": \"test_bundle_name\"" + "}," + "\"apiVersion\": {" + "\"compileSdkType\": \"OpenHarmony\"," + "\"compileSdkVersion\": \"test_apiVersion_compileSdkVersion\"," + "\"releaseType\": \"test_apiVersion_release\"," + "\"compatible\": 7," + "\"target\": 10" + "}," + "\"targetBundleName\": \"test_app_targetBundleName\"," + "\"multiAppMode\": {" + "\"multiAppModeType\": \"test_multiAppMode\"," + "\"maxCount\": 9" + "}," + "\"generateBuildHash\": true," + "\"minCompatibleVersionCode\": \"test_bundle_name\"," + "\"asanEnabled\": true," + "\"tsanEnabled\": false," + "\"compressNativeLibs\": true," + "\"targetPriority\": 5" + "}," + "\"module\": {" + "\"name\": \"entry\"," + "\"type\": \"entry\"," + "\"description\": \"string:module_desc\"," + "\"mainElement\": \"EntryAbility\"," + "\"deliveryWithInstall\": true," + "\"installationFree\": \"test_version_name\"," + "\"pages\": \"profile:main_pages\"," + "\"abilities\": [" + "{" + "\"name\": \"EntryAbility\"," + "\"moduleName\": \"test_module_name\"," + "\"srcEntry\": \"./ets/entryability/EntryAbility.ts\"," + "\"description\": \"string:EntryAbility_desc\"," + "\"icon\": \"media:icon\"," + "\"label\": \"string:EntryAbility_label\"," + "\"startWindowIcon\": \"media:icon\"," + "\"startWindowBackground\": \"color:start_window_background\"," + "\"exported\": true," + "\"skills\": [" + "{" + "\"entities\": [\"entity.system.home\"]," + "\"actions\": [\"action.system.home\"]" + "}" + "]," + "\"descriptionId\": 16777218," + "\"iconId\": 16777222," + "\"labelId\": 16777219," + "\"startWindowIconId\": 16777222," + "\"startWindowBackgroundId\": 16777221," + "\"continueType\":[]" + "}" + "]," + "\"virtualMachine\": \"test_virtualMachine\"," + "\"compileMode\": \"esmodule\"," + "\"dependencies\": false," + "\"descriptionId\": 16777220," + "\"distro\": {" + "\"installationFree\": false," + "\"moduleType\": \"entry\"," + "\"moduleName\": \"test_module_name\"" + "}," + "\"preloads\": [" + "{" + "\"name\": \"test_name_1\"," + "\"moduleName\": \"test_module_name_1\"" + "}" + "]," + "\"package\": \"test_package\"," + "\"deviceType\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"targetModuleName\": \"test_module_targetBundleName\"," + "\"targetPriority\": 6," + "\"proxyDatas\": [" + "{" + "\"uri\": \"test_uri1\"" + "}," + "{" + "\"uri\": \"test_uri2\"" + "}" + "]," + "\"atomicService\": {" + "\"preloads\": [" + "{" + "\"atomicServiceObj\": \"test_atomicService\"" + "}" + "]" + + "}," + "\"metadata\": [" + "{" + "\"name\": \"test_metadata\"," + "\"value\": \"test_value\"," + "\"resource\": \"test_resource\"" + "}" + "]," + "\"extensionAbilities\": [" + "{" + "\"name\": \"test_extension_abilities\"" + "}" + "]" + "}," + "\"deviceConfig\": {" + "\"default\": {\"debug\": true}" + "}" +"}"; + +const std::string MODULE_JSON_TEST_ONLYAPP = "{" +"\"app\": {" + "\"bundleName\": \"test_bundle_name\"," + "\"bundleType\": \"atomicService\"," + "\"vendor\": \"\"," + "\"versionCode\": 1000000," + "\"versionName\": \"test_version_name\"," + "\"icon\": \"media:app_icon\"," + "\"label\": \"string:app_name\"," + "\"apiReleaseType\": \"Canary\"," + "\"compileSdkVersion\": \"test_compileSdkVersion\"," + "\"targetAPIVersion\": 10," + "\"minAPIVersion\": 10," + "\"compileSdkType\": \"OpenHarmony\"," + "\"debug\": true," + "\"iconId\": 16777217," + "\"labelId\": 16777216," + "\"version\": {" + "\"code\": 666," + "\"name\": \"test_version\"," + "\"minCompatibleVersionCode\": 555" + "}," + "\"apiVersion\": {" + "\"compileSdkType\": \"OpenHarmony\"," + "\"compileSdkVersion\": \"test_apiVersion_compileSdkVersion\"," + "\"releaseType\": \"test_apiVersion_release\"," + "\"compatible\": 7," + "\"target\": 10" + "}," + "\"targetBundleName\": \"test_app_targetBundleName\"," + "\"multiAppMode\": {" + "\"multiAppModeType\": \"test_multiAppMode\"," + "\"maxCount\": 9" + "}," + "\"generateBuildHash\": true," + "\"minCompatibleVersionCode\": 99," + "\"asanEnabled\": true," + "\"tsanEnabled\": false," + "\"compressNativeLibs\": true," + "\"targetPriority\": 5" + "}" +"}"; + +const std::string MODULE_JSON_TEST_NOMODULETYPE = "{" + "\"app\": {" + "\"bundleName\": \"test_bundle_name\"," + "\"bundleType\": \"atomicService\"," + "\"vendor\": \"\"," + "\"versionCode\": 1000000," + "\"versionName\": \"test_version_name\"," + "\"icon\": \"media:app_icon\"," + "\"label\": \"string:app_name\"," + "\"apiReleaseType\": \"Canary\"," + "\"compileSdkVersion\": \"test_compileSdkVersion\"," + "\"targetAPIVersion\": 10," + "\"minAPIVersion\": 10," + "\"compileSdkType\": \"OpenHarmony\"," + "\"debug\": true," + "\"iconId\": 16777217," + "\"labelId\": 16777216," + "\"version\": {" + "\"code\": 666," + "\"name\": \"test_version\"," + "\"minCompatibleVersionCode\": 555" + "}," + "\"apiVersion\": {" + "\"compileSdkType\": \"OpenHarmony\"," + "\"compileSdkVersion\": \"test_apiVersion_compileSdkVersion\"," + "\"releaseType\": \"test_apiVersion_release\"," + "\"compatible\": 7," + "\"target\": 10" + "}," + "\"targetBundleName\": \"test_app_targetBundleName\"," + "\"multiAppMode\": {" + "\"multiAppModeType\": \"test_multiAppMode\"," + "\"maxCount\": 9" + "}," + "\"generateBuildHash\": true," + "\"minCompatibleVersionCode\": 99," + "\"asanEnabled\": true," + "\"tsanEnabled\": false," + "\"compressNativeLibs\": true," + "\"targetPriority\": 5" + "}," + "\"module\": {" + "\"name\": \"entry\"," + "\"description\": \"string:module_desc\"," + "\"mainElement\": \"EntryAbility\"," + "\"deviceTypes\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"deliveryWithInstall\": true," + "\"installationFree\": true," + "\"pages\": \"profile:main_pages\"," + "\"abilities\": [" + "{" + "\"name\": \"EntryAbility\"," + "\"moduleName\": \"test_module_name\"," + "\"srcEntry\": \"./ets/entryability/EntryAbility.ts\"," + "\"description\": \"string:EntryAbility_desc\"," + "\"icon\": \"media:icon\"," + "\"label\": \"string:EntryAbility_label\"," + "\"startWindowIcon\": \"media:icon\"," + "\"startWindowBackground\": \"color:start_window_background\"," + "\"exported\": true," + "\"skills\": [" + "{" + "\"entities\": [\"entity.system.home\"]," + "\"actions\": [\"action.system.home\"]" + "}" + "]," + "\"descriptionId\": 16777218," + "\"iconId\": 16777222," + "\"labelId\": 16777219," + "\"startWindowIconId\": 16777222," + "\"startWindowBackgroundId\": 16777221," + "\"continueType\":[]" + "}" + "]," + "\"virtualMachine\": \"test_virtualMachine\"," + "\"compileMode\": \"esmodule\"," + "\"dependencies\": [" + "{" + "\"bundleName\": \"test_modules_dependency_1\"," + "\"moduleName\": \"entry_1\"" + "}," + "{" + "\"bundleName\": \"test_modules_dependency_2\"," + "\"moduleName\": \"entry_1\"" + "}" + "]," + "\"descriptionId\": 16777220," + "\"distro\": {" + "\"installationFree\": false," + "\"moduleType\": \"entry\"," + "\"moduleName\": \"test_module_name\"" + "}," + "\"preloads\": [" + "{" + "\"name\": \"test_name_1\"," + "\"moduleName\": \"test_module_name_1\"" + "}" + "]," + "\"package\": \"test_package\"," + "\"deviceType\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"targetModuleName\": \"test_module_targetBundleName\"," + "\"targetPriority\": 6," + "\"proxyDatas\": [" + "{" + "\"uri\": \"test_uri1\"" + "}," + "{" + "\"uri\": \"test_uri2\"" + "}" + "]," + "\"atomicService\": {" + "\"preloads\": [" + "{" + "\"atomicServiceObj\": \"test_atomicService\"" + "}" + "]" + + "}," + "\"metadata\": [" + "{" + "\"name\": \"test_metadata\"," + "\"value\": \"test_value\"," + "\"resource\": \"test_resource\"" + "}" + "]," + "\"extensionAbilities\": [" + "{" + "\"name\": \"test_extension_abilities\"" + "}" + "]" + "}," + "\"deviceConfig\": {" + "\"default\": {\"debug\": true}" + "}" +"}"; + +const std::string MODULE_JSON_STRING_NOVENDOR = "{" + "\"app\": {" + "\"bundleName\": \"test_bundle_name\"," + "\"bundleType\": \"atomicService\"," + "\"vendor\": false," + "\"versionCode\": 1000000," + "\"versionName\": \"test_version_name\"," + "\"icon\": \"media:app_icon\"," + "\"label\": \"string:app_name\"," + "\"apiReleaseType\": \"Canary\"," + "\"compileSdkVersion\": \"test_compileSdkVersion\"," + "\"targetAPIVersion\": 10," + "\"minAPIVersion\": 10," + "\"compileSdkType\": \"OpenHarmony\"," + "\"debug\": true," + "\"iconId\": 16777217," + "\"labelId\": 16777216," + "\"version\": {" + "\"code\": 666," + "\"name\": \"test_version\"," + "\"minCompatibleVersionCode\": 555" + "}," + "\"apiVersion\": {" + "\"compileSdkType\": \"OpenHarmony\"," + "\"compileSdkVersion\": \"test_apiVersion_compileSdkVersion\"," + "\"releaseType\": \"test_apiVersion_release\"," + "\"compatible\": 7," + "\"target\": 10" + "}," + "\"targetBundleName\": \"test_app_targetBundleName\"," + "\"multiAppMode\": {" + "\"multiAppModeType\": \"test_multiAppMode\"," + "\"maxCount\": 9" + "}," + "\"generateBuildHash\": true," + "\"minCompatibleVersionCode\": 99," + "\"asanEnabled\": true," + "\"tsanEnabled\": false," + "\"compressNativeLibs\": true," + "\"targetPriority\": 5" + "}," + "\"module\": {" + "\"name\": \"entry\"," + "\"type\": \"entry\"," + "\"description\": \"string:module_desc\"," + "\"mainElement\": \"EntryAbility\"," + "\"deviceTypes\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"deliveryWithInstall\": true," + "\"installationFree\": true," + "\"pages\": \"profile:main_pages\"," + "\"abilities\": [" + "{" + "\"name\": \"EntryAbility\"," + "\"moduleName\": \"test_module_name\"," + "\"srcEntry\": \"./ets/entryability/EntryAbility.ts\"," + "\"description\": \"string:EntryAbility_desc\"," + "\"icon\": \"media:icon\"," + "\"label\": \"string:EntryAbility_label\"," + "\"startWindowIcon\": \"media:icon\"," + "\"startWindowBackground\": \"color:start_window_background\"," + "\"exported\": true," + "\"skills\": [" + "{" + "\"entities\": [\"entity.system.home\"]," + "\"actions\": [\"action.system.home\"]" + "}" + "]," + "\"descriptionId\": 16777218," + "\"iconId\": 16777222," + "\"labelId\": 16777219," + "\"startWindowIconId\": 16777222," + "\"startWindowBackgroundId\": 16777221," + "\"continueType\":[]" + "}" + "]," + "\"virtualMachine\": \"test_virtualMachine\"," + "\"compileMode\": \"esmodule\"," + "\"dependencies\": [" + "{" + "\"bundleName\": \"test_modules_dependency_1\"," + "\"moduleName\": \"entry_1\"" + "}," + "{" + "\"bundleName\": \"test_modules_dependency_2\"," + "\"moduleName\": \"entry_1\"" + "}" + "]," + "\"descriptionId\": 16777220," + "\"distro\": {" + "\"installationFree\": false," + "\"moduleType\": \"entry\"," + "\"moduleName\": \"test_module_name\"" + "}," + "\"preloads\": [" + "{" + "\"name\": \"test_name_1\"," + "\"moduleName\": \"test_module_name_1\"" + "}" + "]," + "\"package\": \"test_package\"," + "\"deviceType\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"targetModuleName\": \"test_module_targetBundleName\"," + "\"targetPriority\": 6," + "\"proxyDatas\": [" + "{" + "\"uri\": \"test_uri1\"" + "}," + "{" + "\"uri\": \"test_uri2\"" + "}" + "]," + "\"atomicService\": {" + "\"preloads\": [" + "{" + "\"atomicServiceObj\": \"test_atomicService\"" + "}" + "]" + + "}," + "\"metadata\": [" + "{" + "\"name\": \"test_metadata\"," + "\"value\": \"test_value\"," + "\"resource\": \"test_resource\"" + "}" + "]," + "\"extensionAbilities\": [" + "{" + "\"name\": \"test_extension_abilities\"" + "}" + "]" + "}," + "\"deviceConfig\": {" + "\"default\": {\"debug\": true}" + "}" +"}"; + +const std::string MODULE_JSON_STRING_NOMODULENAME = "{" + "\"app\": {" + "\"bundleName\": \"test_bundle_name\"," + "\"bundleType\": \"atomicService\"," + "\"vendor\": \"\"," + "\"versionCode\": 1000000," + "\"versionName\": \"test_version_name\"," + "\"icon\": \"media:app_icon\"," + "\"label\": \"string:app_name\"," + "\"apiReleaseType\": \"Canary\"," + "\"compileSdkVersion\": \"test_compileSdkVersion\"," + "\"targetAPIVersion\": 10," + "\"minAPIVersion\": 10," + "\"compileSdkType\": \"OpenHarmony\"," + "\"debug\": true," + "\"iconId\": 16777217," + "\"labelId\": 16777216," + "\"version\": {" + "\"code\": 666," + "\"name\": \"test_version\"," + "\"minCompatibleVersionCode\": 555" + "}," + "\"apiVersion\": {" + "\"compileSdkType\": \"OpenHarmony\"," + "\"compileSdkVersion\": \"test_apiVersion_compileSdkVersion\"," + "\"releaseType\": \"test_apiVersion_release\"," + "\"compatible\": 7," + "\"target\": 10" + "}," + "\"targetBundleName\": \"test_app_targetBundleName\"," + "\"multiAppMode\": {" + "\"multiAppModeType\": \"test_multiAppMode\"," + "\"maxCount\": 9" + "}," + "\"generateBuildHash\": true," + "\"minCompatibleVersionCode\": 99," + "\"asanEnabled\": true," + "\"tsanEnabled\": false," + "\"compressNativeLibs\": true," + "\"targetPriority\": 5" + "}," + "\"module\": {" + "\"type\": \"entry\"," + "\"description\": \"string:module_desc\"," + "\"mainElement\": \"EntryAbility\"," + "\"deviceTypes\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"deliveryWithInstall\": true," + "\"installationFree\": true," + "\"pages\": \"profile:main_pages\"," + "\"abilities\": [" + "{" + "\"name\": \"EntryAbility\"," + "\"moduleName\": \"test_module_name\"," + "\"srcEntry\": \"./ets/entryability/EntryAbility.ts\"," + "\"description\": \"string:EntryAbility_desc\"," + "\"icon\": \"media:icon\"," + "\"label\": \"string:EntryAbility_label\"," + "\"startWindowIcon\": \"media:icon\"," + "\"startWindowBackground\": \"color:start_window_background\"," + "\"exported\": true," + "\"skills\": [" + "{" + "\"entities\": [\"entity.system.home\"]," + "\"actions\": [\"action.system.home\"]" + "}" + "]," + "\"descriptionId\": 16777218," + "\"iconId\": 16777222," + "\"labelId\": 16777219," + "\"startWindowIconId\": 16777222," + "\"startWindowBackgroundId\": 16777221," + "\"continueType\":[]" + "}" + "]," + "\"virtualMachine\": \"test_virtualMachine\"," + "\"compileMode\": \"esmodule\"," + "\"dependencies\": [" + "{" + "\"bundleName\": \"test_modules_dependency_1\"," + "\"moduleName\": \"entry_1\"" + "}," + "{" + "\"bundleName\": \"test_modules_dependency_2\"," + "\"moduleName\": \"entry_1\"" + "}" + "]," + "\"descriptionId\": 16777220," + "\"distro\": {" + "\"installationFree\": false," + "\"moduleType\": \"entry\"," + "\"moduleName\": \"test_module_name\"" + "}," + "\"preloads\": [" + "{" + "\"name\": \"test_name_1\"," + "\"moduleName\": \"test_module_name_1\"" + "}" + "]," + "\"package\": \"test_package\"," + "\"deviceType\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"targetModuleName\": \"test_module_targetBundleName\"," + "\"targetPriority\": 6," + "\"proxyDatas\": [" + "{" + "\"uri\": \"test_uri1\"" + "}," + "{" + "\"uri\": \"test_uri2\"" + "}" + "]," + "\"atomicService\": {" + "\"preloads\": [" + "{" + "\"atomicServiceObj\": \"test_atomicService\"" + "}" + "]" + + "}," + "\"metadata\": [" + "{" + "\"name\": \"test_metadata\"," + "\"value\": \"test_value\"," + "\"resource\": \"test_resource\"" + "}" + "]," + "\"extensionAbilities\": [" + "{" + "\"name\": \"test_extension_abilities\"" + "}" + "]" + "}," + "\"deviceConfig\": {" + "\"default\": {\"debug\": true}" + "}" +"}"; + +const std::string MODULE_JSON_STRING_NOPROXY_DATAS = "{" + "\"app\": {" + "\"bundleName\": \"test_bundle_name\"," + "\"bundleType\": \"atomicService\"," + "\"vendor\": \"\"," + "\"versionCode\": 1000000," + "\"versionName\": \"test_version_name\"," + "\"icon\": \"media:app_icon\"," + "\"label\": \"string:app_name\"," + "\"apiReleaseType\": \"Canary\"," + "\"compileSdkVersion\": \"test_compileSdkVersion\"," + "\"targetAPIVersion\": 10," + "\"minAPIVersion\": 10," + "\"compileSdkType\": \"OpenHarmony\"," + "\"debug\": true," + "\"iconId\": 16777217," + "\"labelId\": 16777216," + "\"version\": {" + "\"code\": 666," + "\"name\": \"test_version\"," + "\"minCompatibleVersionCode\": 555" + "}," + "\"apiVersion\": {" + "\"compileSdkType\": \"OpenHarmony\"," + "\"compileSdkVersion\": \"test_apiVersion_compileSdkVersion\"," + "\"releaseType\": \"test_apiVersion_release\"," + "\"compatible\": 7," + "\"target\": 10" + "}," + "\"targetBundleName\": \"test_app_targetBundleName\"," + "\"multiAppMode\": {" + "\"multiAppModeType\": \"test_multiAppMode\"," + "\"maxCount\": 9" + "}," + "\"generateBuildHash\": true," + "\"minCompatibleVersionCode\": 99," + "\"asanEnabled\": true," + "\"tsanEnabled\": false," + "\"compressNativeLibs\": true," + "\"targetPriority\": 5" + "}," + "\"module\": {" + "\"name\": \"entry\"," + "\"type\": \"entry\"," + "\"description\": \"string:module_desc\"," + "\"mainElement\": \"EntryAbility\"," + "\"deviceTypes\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"deliveryWithInstall\": true," + "\"installationFree\": true," + "\"pages\": \"profile:main_pages\"," + "\"abilities\": [" + "{" + "\"name\": \"EntryAbility\"," + "\"moduleName\": \"test_module_name\"," + "\"srcEntry\": \"./ets/entryability/EntryAbility.ts\"," + "\"description\": \"string:EntryAbility_desc\"," + "\"icon\": \"media:icon\"," + "\"label\": \"string:EntryAbility_label\"," + "\"startWindowIcon\": \"media:icon\"," + "\"startWindowBackground\": \"color:start_window_background\"," + "\"exported\": true," + "\"skills\": [" + "{" + "\"entities\": [\"entity.system.home\"]," + "\"actions\": [\"action.system.home\"]" + "}" + "]," + "\"descriptionId\": 16777218," + "\"iconId\": 16777222," + "\"labelId\": 16777219," + "\"startWindowIconId\": 16777222," + "\"startWindowBackgroundId\": 16777221," + "\"continueType\":[]" + "}" + "]," + "\"virtualMachine\": \"test_virtualMachine\"," + "\"compileMode\": \"esmodule\"," + "\"dependencies\": [" + "{" + "\"bundleName\": \"test_modules_dependency_1\"," + "\"moduleName\": \"entry_1\"" + "}," + "{" + "\"bundleName\": \"test_modules_dependency_2\"," + "\"moduleName\": \"entry_1\"" + "}" + "]," + "\"descriptionId\": 16777220," + "\"distro\": {" + "\"installationFree\": false," + "\"moduleType\": \"entry\"," + "\"moduleName\": \"test_module_name\"" + "}," + "\"preloads\": [" + "{" + "\"name\": \"test_name_1\"," + "\"moduleName\": \"test_module_name_1\"" + "}" + "]," + "\"package\": \"test_package\"," + "\"deviceType\": [" + "\"default\"," + "\"tablet\"" + "]," + "\"targetModuleName\": \"test_module_targetBundleName\"," + "\"targetPriority\": 6," + "\"proxyDatas\": false," + "\"atomicService\": {" + "\"preloads\": [" + "{" + "\"atomicServiceObj\": \"test_atomicService\"" + "}" + "]" + + "}," + "\"metadata\": [" + "{" + "\"name\": \"test_metadata\"," + "\"value\": \"test_value\"," + "\"resource\": \"test_resource\"" + "}" + "]," + "\"extensionAbilities\": [" + "{" + "\"name\": \"test_extension_abilities\"" + "}" + "]" + "}," + "\"deviceConfig\": {" + "\"default\": {\"debug\": true}" + "}" +"}"; +} +} +#endif // DEVELOPTOOLS_PACKING_TOOL_APT_FRAMEWORKS_INCLUDE_MODULE_JSON_STAGE_TEST_H \ No newline at end of file -- Gitee