Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c2ef1d94
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
c2ef1d94
编写于
7月 25, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 25, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9427 【Distributeddatamgr】【Master】接口用例补充
Merge pull request !9427 from yanglifeng/master
上级
842cbcb4
a256c9b2
变更
38
显示空白变更内容
内联
并排
Showing
38 changed file
with
1681 addition
and
1 deletion
+1681
-1
distributeddatamgr/BUILD.gn
distributeddatamgr/BUILD.gn
+2
-0
distributeddatamgr/preferencesdatagroupidtest/AppScope/app.json
...buteddatamgr/preferencesdatagroupidtest/AppScope/app.json
+16
-0
distributeddatamgr/preferencesdatagroupidtest/AppScope/resources/base/element/string.json
...tagroupidtest/AppScope/resources/base/element/string.json
+8
-0
distributeddatamgr/preferencesdatagroupidtest/AppScope/resources/base/media/app_icon.png
...atagroupidtest/AppScope/resources/base/media/app_icon.png
+0
-0
distributeddatamgr/preferencesdatagroupidtest/BUILD.gn
distributeddatamgr/preferencesdatagroupidtest/BUILD.gn
+43
-0
distributeddatamgr/preferencesdatagroupidtest/Test.json
distributeddatamgr/preferencesdatagroupidtest/Test.json
+19
-0
distributeddatamgr/preferencesdatagroupidtest/signature/openharmony_sx.p7b
...r/preferencesdatagroupidtest/signature/openharmony_sx.p7b
+0
-0
distributeddatamgr/preferencesdatagroupidtest/src/main/ets/TestAbility/TestAbility.ets
...sdatagroupidtest/src/main/ets/TestAbility/TestAbility.ets
+63
-0
distributeddatamgr/preferencesdatagroupidtest/src/main/ets/TestAbility/pages/Index.ets
...sdatagroupidtest/src/main/ets/TestAbility/pages/Index.ets
+49
-0
distributeddatamgr/preferencesdatagroupidtest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...upidtest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+49
-0
distributeddatamgr/preferencesdatagroupidtest/src/main/ets/test/List.test.ets
...referencesdatagroupidtest/src/main/ets/test/List.test.ets
+22
-0
distributeddatamgr/preferencesdatagroupidtest/src/main/ets/test/preferencesDataGroupIdCallback.test.ets
...src/main/ets/test/preferencesDataGroupIdCallback.test.ets
+261
-0
distributeddatamgr/preferencesdatagroupidtest/src/main/ets/test/preferencesDataGroupIdPromise.test.ets
.../src/main/ets/test/preferencesDataGroupIdPromise.test.ets
+245
-0
distributeddatamgr/preferencesdatagroupidtest/src/main/module.json
...eddatamgr/preferencesdatagroupidtest/src/main/module.json
+39
-0
distributeddatamgr/preferencesdatagroupidtest/src/main/resources/base/element/color.json
...atagroupidtest/src/main/resources/base/element/color.json
+8
-0
distributeddatamgr/preferencesdatagroupidtest/src/main/resources/base/element/string.json
...tagroupidtest/src/main/resources/base/element/string.json
+16
-0
distributeddatamgr/preferencesdatagroupidtest/src/main/resources/base/media/icon.png
...cesdatagroupidtest/src/main/resources/base/media/icon.png
+0
-0
distributeddatamgr/preferencesdatagroupidtest/src/main/resources/base/profile/test_pages.json
...oupidtest/src/main/resources/base/profile/test_pages.json
+5
-0
distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesSyncJsunit.test.js
...jstest/hap/src/main/js/test/PreferencesSyncJsunit.test.js
+26
-0
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/List.test.ets
...ionalStoreStagetest/entry/src/main/ets/test/List.test.ets
+4
-1
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreEmit.test.ets
...test/entry/src/main/ets/test/relationalStoreEmit.test.ets
+92
-0
distributeddatamgr/relationalstoredatagroupidtest/AppScope/app.json
...ddatamgr/relationalstoredatagroupidtest/AppScope/app.json
+16
-0
distributeddatamgr/relationalstoredatagroupidtest/AppScope/resources/base/element/string.json
...tagroupidtest/AppScope/resources/base/element/string.json
+8
-0
distributeddatamgr/relationalstoredatagroupidtest/AppScope/resources/base/media/app_icon.png
...atagroupidtest/AppScope/resources/base/media/app_icon.png
+0
-0
distributeddatamgr/relationalstoredatagroupidtest/BUILD.gn
distributeddatamgr/relationalstoredatagroupidtest/BUILD.gn
+43
-0
distributeddatamgr/relationalstoredatagroupidtest/Test.json
distributeddatamgr/relationalstoredatagroupidtest/Test.json
+19
-0
distributeddatamgr/relationalstoredatagroupidtest/signature/openharmony_sx.p7b
...lationalstoredatagroupidtest/signature/openharmony_sx.p7b
+0
-0
distributeddatamgr/relationalstoredatagroupidtest/src/main/ets/TestAbility/TestAbility.ets
...edatagroupidtest/src/main/ets/TestAbility/TestAbility.ets
+63
-0
distributeddatamgr/relationalstoredatagroupidtest/src/main/ets/TestAbility/pages/Index.ets
...edatagroupidtest/src/main/ets/TestAbility/pages/Index.ets
+49
-0
distributeddatamgr/relationalstoredatagroupidtest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...upidtest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+49
-0
distributeddatamgr/relationalstoredatagroupidtest/src/main/ets/test/List.test.ets
...ionalstoredatagroupidtest/src/main/ets/test/List.test.ets
+23
-0
distributeddatamgr/relationalstoredatagroupidtest/src/main/ets/test/relationalStoreDataGroupIdCallback.test.ets
...main/ets/test/relationalStoreDataGroupIdCallback.test.ets
+185
-0
distributeddatamgr/relationalstoredatagroupidtest/src/main/ets/test/relationalStoreDataGroupIdPromise.test.ets
.../main/ets/test/relationalStoreDataGroupIdPromise.test.ets
+191
-0
distributeddatamgr/relationalstoredatagroupidtest/src/main/module.json
...tamgr/relationalstoredatagroupidtest/src/main/module.json
+39
-0
distributeddatamgr/relationalstoredatagroupidtest/src/main/resources/base/element/color.json
...atagroupidtest/src/main/resources/base/element/color.json
+8
-0
distributeddatamgr/relationalstoredatagroupidtest/src/main/resources/base/element/string.json
...tagroupidtest/src/main/resources/base/element/string.json
+16
-0
distributeddatamgr/relationalstoredatagroupidtest/src/main/resources/base/media/icon.png
...oredatagroupidtest/src/main/resources/base/media/icon.png
+0
-0
distributeddatamgr/relationalstoredatagroupidtest/src/main/resources/base/profile/test_pages.json
...oupidtest/src/main/resources/base/profile/test_pages.json
+5
-0
未找到文件。
distributeddatamgr/BUILD.gn
浏览文件 @
c2ef1d94
...
...
@@ -23,8 +23,10 @@ group("distributeddatamgr") {
"dataSharejstest/hap:dataShare_js_test",
"distributedKVStoretest:distributedKVStoretest",
"kvStoretest:kvStoretest",
"preferencesdatagroupidtest:ActsPreferencesDataGroupIdTest",
"preferencesjstest/hap:preferences_js_test",
"relationalStoretest:relationalStoretest",
"relationalstoredatagroupidtest:ActsRelationalstoreDataGroupIdTest",
]
} else {
deps = [
...
...
distributeddatamgr/preferencesdatagroupidtest/AppScope/app.json
0 → 100644
浏览文件 @
c2ef1d94
{
"app"
:
{
"bundleName"
:
"ohos.acts.preferencesdatagroupidtest"
,
"vendor"
:
"example"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"icon"
:
"$media:app_icon"
,
"label"
:
"$string:app_name"
,
"minAPIVersion"
:
10
,
"targetAPIVersion"
:
10
,
"car"
:
{
"apiCompatibleVersion"
:
10
,
"singleUser"
:
false
}
}
}
distributeddatamgr/preferencesdatagroupidtest/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
c2ef1d94
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"xtsDemo1"
}
]
}
distributeddatamgr/preferencesdatagroupidtest/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
c2ef1d94
6.6 KB
distributeddatamgr/preferencesdatagroupidtest/BUILD.gn
0 → 100644
浏览文件 @
c2ef1d94
# Copyright (C) 2023 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsPreferencesDataGroupIdTest") {
hap_profile = "src/main/module.json"
deps = [
":preferencesDataGroupId_js_assets",
":preferencesDataGroupId_resources",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsPreferencesDataGroupIdTest"
subsystem_name = "distributeddatamgr"
part_name = "preferences"
}
ohos_app_scope("preferencesDataGroupId_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("preferencesDataGroupId_js_assets") {
source_dir = "src/main/ets"
}
ohos_resources("preferencesDataGroupId_resources") {
sources = [ "src/main/resources" ]
deps = [ ":preferencesDataGroupId_app_profile" ]
hap_profile = "src/main/module.json"
}
distributeddatamgr/preferencesdatagroupidtest/Test.json
0 → 100644
浏览文件 @
c2ef1d94
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"60000"
,
"shell-timeout"
:
"60000"
,
"bundle-name"
:
"ohos.acts.preferencesdatagroupidtest"
,
"module-name"
:
"preferencesDataGroupId"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsPreferencesDataGroupIdTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
\ No newline at end of file
distributeddatamgr/preferencesdatagroupidtest/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
c2ef1d94
文件已添加
distributeddatamgr/preferencesdatagroupidtest/src/main/ets/TestAbility/TestAbility.ets
0 → 100644
浏览文件 @
c2ef1d94
/*
* Copyright (C) 2023 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 UIAbility from "@ohos.app.ability.UIAbility";
import AbilityDelegatorRegistry from "@ohos.app.ability.abilityDelegatorRegistry";
import hilog from "@ohos.hilog";
import { Hypium } from "@ohos/hypium";
import testsuite from "../test/List.test";
import window from "@ohos.window";
export default class TestAbility extends UIAbility {
onCreate(want, launchParam) {
hilog.info(0x0000, "testTag", "%{public}s", "TestAbility onCreate");
hilog.info(0x0000, "testTag", "%{public}s", "want param:" + JSON.stringify(want) ?? "");
hilog.info(0x0000, "testTag", "%{public}s", "launchParam:" + JSON.stringify(launchParam) ?? "");
var abilityDelegator: any;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
var abilityDelegatorArguments: any;
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments();
hilog.info(0x0000, "testTag", "%{public}s", "start run testcase!!!");
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite);
}
onDestroy() {
hilog.info(0x0000, "testTag", "%{public}s", "TestAbility onDestroy");
}
onWindowStageCreate(windowStage: window.WindowStage) {
hilog.info(0x0000, "testTag", "%{public}s", "TestAbility onWindowStageCreate");
globalThis.abilityContext = this.context;
windowStage.loadContent("TestAbility/pages/Index", (err, data) => {
if (err.code) {
hilog.error(0x0000, "testTag", "Failed to load the content. Cause: %{public}s", JSON.stringify(err) ?? "");
return;
}
hilog.info(0x0000, "testTag", "Succeeded in loading the content. Data: %{public}s", JSON.stringify(data) ?? "");
});
}
onWindowStageDestroy() {
hilog.info(0x0000, "testTag", "%{public}s", "TestAbility onWindowStageDestroy");
}
onForeground() {
hilog.info(0x0000, "testTag", "%{public}s", "TestAbility onForeground");
}
onBackground() {
hilog.info(0x0000, "testTag", "%{public}s", "TestAbility onBackground");
}
}
distributeddatamgr/preferencesdatagroupidtest/src/main/ets/TestAbility/pages/Index.ets
0 → 100644
浏览文件 @
c2ef1d94
/*
* Copyright (C) 2023 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 '@ohos.hilog';
@Entry
@Component
struct Index {
aboutToAppear() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear');
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
distributeddatamgr/preferencesdatagroupidtest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
c2ef1d94
import
hilog
from
'
@ohos.hilog
'
;
import
TestRunner
from
'
@ohos.application.testRunner
'
;
import
AbilityDelegatorRegistry
from
'
@ohos.app.ability.abilityDelegatorRegistry
'
;
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
async
function
onAbilityCreateCallback
()
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
onAbilityCreateCallback
'
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
addAbilityMonitorCallback : %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner OnPrepare
'
);
}
async
onRun
()
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun run
'
);
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.TestAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a TestAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
var
debug
=
abilityDelegatorArguments
.
parameters
[
'
-D
'
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
cmd : %{public}s
'
,
cmd
);
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : err : %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : data : %{public}s
'
,
d
.
stdResult
??
''
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : data : %{public}s
'
,
d
.
exitCode
??
''
);
})
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun end
'
);
}
}
\ No newline at end of file
distributeddatamgr/preferencesdatagroupidtest/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
c2ef1d94
/*
* Copyright (c) 2023 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 preferencesDataGroupIdCallback from './preferencesDataGroupIdCallback.test'
import preferencesDataGroupIdPromise from './preferencesDataGroupIdPromise.test'
export default function testsuite() {
preferencesDataGroupIdCallback()
preferencesDataGroupIdPromise()
}
\ No newline at end of file
distributeddatamgr/preferencesdatagroupidtest/src/main/ets/test/preferencesDataGroupIdCallback.test.ets
0 → 100644
浏览文件 @
c2ef1d94
/*
* Copyright (c) 2023 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'
import dataPreferences from '@ohos.data.preferences';
const TAG = "[ttt]"
export default function preferencesDataGroupIdCallback() {
describe('preferencesDataGroupIdCallback', function () {
console.log(TAG + "*************Unit Test Begin*************");
/**
* @tc.number SUB_DDM_Preferences_DataGroupId_Callback_0100
* @tc.name preferencesgetPreferences dataGroupId null callback test
* @tc.desc preferences getPreferences dataGroupId null callback test
*/
it('SUB_DDM_Preferences_DataGroupId_Callback_0100', 0, async function (done) {
const Options = {
name: "test_preferences_callback",
dataGroupId: null,
};
try {
dataPreferences.getPreferences(globalThis.abilityContext, Options, async function (err) {
console.info(TAG, `getPreferences successfully.`);
expect().assertFail();
done();
dataPreferences.deletePreferences(globalThis.abilityContext, Options, function (error) {
console.info(TAG, `deletePreferences successfully.`);
expect().assertFail();
done();
})
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('401');
done();
}
})
/**
* @tc.number SUB_DDM_Preferences_DataGroupId_Callback_0200
* @tc.name preferences dataGroupId undefined callback test
* @tc.desc preferences getPreferences dataGroupId undefined callback test
*/
it('SUB_DDM_Preferences_DataGroupId_Callback_0200', 0, async function (done) {
const Options = {
name: "test_preferences_callback",
dataGroupId: undefined,
};
try {
dataPreferences.getPreferences(globalThis.abilityContext, Options, async function (err) {
console.info(TAG, `getPreferences successfully.`);
expect().assertFail();
done();
dataPreferences.deletePreferences(globalThis.abilityContext, Options, function (error) {
console.info(TAG, `deletePreferences successfully.`);
expect().assertFail();
done();
})
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('401');
done();
}
})
/**
* @tc.number SUB_DDM_Preferences_DataGroupId_Callback_0300
* @tc.name preferences dataGroupId callback test
* @tc.desc preferences getPreferences dataGroupId callback test
*/
it('SUB_DDM_Preferences_DataGroupId_Callback_0300', 0, async function (done) {
const Options = {
name: "test_preferences_callback",
dataGroupId: '112233',
};
try {
dataPreferences.getPreferences(globalThis.abilityContext, Options, async function (err) {
console.info(TAG, `getPreferences successfully.`);
expect().assertFail();
done();
dataPreferences.deletePreferences(globalThis.abilityContext, Options, function (error) {
console.info(TAG, `deletePreferences successfully.`);
expect().assertFail();
done();
})
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('15501002');
done();
}
})
/**
* @tc.number SUB_DDM_Preferences_DataGroupId_Callback_0400
* @tc.name preferences dataGroupId callback test
* @tc.desc preferences deletePreferences dataGroupId callback test
*/
it('SUB_DDM_Preferences_DataGroupId_Callback_0400', 0, async function (done) {
const Options = {
name: "test_preferences_callback",
dataGroupId: '123456',
};
try {
dataPreferences.getPreferences(globalThis.abilityContext, Options, async function (err) {
if (err) {
console.error(TAG, `getPreferences failed, code is ${err.code},message is ${err.message}`);
return false;
}
console.info(TAG, `getPreferences successfully.`);
dataPreferences.deletePreferences(globalThis.abilityContext, Options, function (error) {
if (error) {
console.error(TAG, `deletePreferences failed, code is ${error.code},message is ${error.message}`);
return false;
}
console.info(TAG, `deletePreferences successfully.`);
expect(error === undefined).assertTrue();
done();
})
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo !== null).assertFail();
}
})
/**
* @tc.number SUB_DDM_Preferences_DataGroupId_Callback_0500
* @tc.name preferences dataGroupId null callback test
* @tc.desc preferences getPreferences dataGroupId null callback test
*/
it('SUB_DDM_Preferences_DataGroupId_Callback_0500', 0, async function (done) {
const Options = {
name: "test_preferences_callback",
dataGroupId: null,
};
try {
dataPreferences.getPreferences(globalThis.abilityContext, Options, async function (err) {
console.info(TAG, `getPreferences successfully.`);
expect().assertFail();
done();
dataPreferences.removePreferencesFromCache(globalThis.abilityContext, Options, function (error) {
console.info(TAG, `removePreferencesFromCache successfully.`);
expect().assertFail();
done();
})
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('401');
done();
}
})
/**
* @tc.number SUB_DDM_Preferences_DataGroupId_Callback_0600
* @tc.name preferences dataGroupId undefined callback test
* @tc.desc preferences removePreferencesFromCache dataGroupId undefined callback test
*/
it('SUB_DDM_Preferences_DataGroupId_Callback_0600', 0, async function (done) {
const Options = {
name: "test_preferences_callback",
dataGroupId: undefined,
};
try {
dataPreferences.getPreferences(globalThis.abilityContext, Options, async function (err) {
console.info(TAG, `getPreferences successfully.`);
expect().assertFail();
done();
dataPreferences.removePreferencesFromCache(globalThis.abilityContext, Options, function (error) {
console.info(TAG, `removePreferencesFromCache successfully.`);
expect().assertFail();
done();
})
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('401');
done();
}
})
/**
* @tc.number SUB_DDM_Preferences_DataGroupId_Callback_0700
* @tc.name preferences dataGroupId callback test
* @tc.desc preferences removePreferencesFromCache dataGroupId callback test
*/
it('SUB_DDM_Preferences_DataGroupId_Callback_0700', 0, async function (done) {
const Options = {
name: "test_preferences_callback",
dataGroupId: '112233',
};
try {
dataPreferences.getPreferences(globalThis.abilityContext, Options, async function (err) {
console.info(TAG, `getPreferences successfully.`);
expect().assertFail();
done();
dataPreferences.removePreferencesFromCache(globalThis.abilityContext, Options, function (error) {
console.info(TAG, `removePreferencesFromCache successfully.`);
expect().assertFail();
done();
})
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('15501002');
done();
}
})
/**
* @tc.number SUB_DDM_Preferences_DataGroupId_Callback_0800
* @tc.name preferences dataGroupId callback test
* @tc.desc preferences removePreferencesFromCache dataGroupId callback test
*/
it('SUB_DDM_Preferences_DataGroupId_Callback_0800', 0, async function (done) {
const Options = {
name: "test_preferences_callback",
dataGroupId: '123456',
};
try {
dataPreferences.getPreferences(globalThis.abilityContext, Options, async function (err) {
if (err) {
console.error(TAG, `getPreferences failed, code is ${err.code},message is ${err.message}`);
return false;
}
console.info(TAG, `getPreferences successfully.`);
dataPreferences.removePreferencesFromCache(globalThis.abilityContext, Options, function (error) {
if (error) {
console.error(TAG, `removePreferencesFromCache failed, code is ${error.code},message is ${error.message}`);
return false;
}
console.info(TAG, `removePreferencesFromCache successfully.`);
expect(error === undefined).assertTrue();
done();
})
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo !== null).assertFail();
}
})
console.log(TAG + "*************Unit Test End*************");
})
}
\ No newline at end of file
distributeddatamgr/preferencesdatagroupidtest/src/main/ets/test/preferencesDataGroupIdPromise.test.ets
0 → 100644
浏览文件 @
c2ef1d94
/*
* Copyright (C) 2023 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'
import dataPreferences from '@ohos.data.preferences';
const TAG = "[ttt]"
export default function preferencesDataGroupIdPromise() {
describe('preferencesDataGroupIdPromise', function () {
console.log(TAG + "*************Unit Test Begin*************");
/**
* @tc.number SUB_DDM_Preferences_DataGroupId_Promise_0100
* @tc.name preferences dataGroupId null promise test
* @tc.desc preferences getPreferences dataGroupId null promise test
*/
it('SUB_DDM_Preferences_DataGroupId_Promise_0100', 0, async function (done) {
const Options = {
name: "test_preferences_callback",
dataGroupId: null,
};
try{
dataPreferences.getPreferences(globalThis.abilityContext, Options).then(async (data) => {
console.info(TAG, `getPreferences successfully.`);
expect().assertFail();
done();
dataPreferences.deletePreferences(globalThis.abilityContext, Options).then(async (val) => {
console.info(TAG, `deletePreferences successfully.`);
expect().assertFail();
done();
}).catch((error) => {
console.error(TAG, `deletePreferences failed, code is ${error.code},message is ${error.message}`);
expect(error !== null).assertFail();
done();
})
}).catch((err) => {
console.error(TAG, `getPreferences failed, code is ${err.code},message is ${err.message}`);
expect(err !== null).assertFail();
done();
})
}catch(errInfo){
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('401');
done();
}
})
/**
* @tc.number SUB_DDM_Preferences_DataGroupId_Promise_0200
* @tc.name preferences dataGroupId undefined promise test
* @tc.desc preferences getPreferences dataGroupId undefined promise test
*/
it('SUB_DDM_Preferences_DataGroupId_Promise_0200', 0, async function (done) {
const Options = {
name: "test_preferences_callback",
dataGroupId: undefined,
};
try{
dataPreferences.getPreferences(globalThis.abilityContext, Options).then(async (data) => {
console.info(TAG, `getPreferences successfully.`);
expect().assertFail();
done();
dataPreferences.deletePreferences(globalThis.abilityContext, Options).then(async (val) => {
console.info(TAG, `deletePreferences successfully.`);
expect().assertFail();
done();
}).catch((error) => {
console.error(TAG, `deletePreferences failed, code is ${error.code},message is ${error.message}`);
expect(error !== null).assertFail();
done();
})
}).catch((err) => {
console.error(TAG, `getPreferences failed, code is ${err.code},message is ${err.message}`);
expect(err !== null).assertFail();
done();
})
}catch(errInfo){
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('401');
done();
}
})
/**
* @tc.number SUB_DDM_Preferences_DataGroupId_Promise_0300
* @tc.name preferences dataGroupId promise test
* @tc.desc preferences getPreferences dataGroupId promise test
*/
it('SUB_DDM_Preferences_DataGroupId_Promise_0300', 0, async function (done) {
const Options = {
name: "test_preferences_callback",
dataGroupId: '112233',
};
try{
dataPreferences.getPreferences(globalThis.abilityContext, Options).then(async (data) => {
console.info(TAG, `getPreferences successfully.`);
expect().assertFail();
done();
dataPreferences.deletePreferences(globalThis.abilityContext, Options).then(async (val) => {
console.info(TAG, `deletePreferences successfully.`);
expect().assertFail();
done();
}).catch((error) => {
console.error(TAG, `deletePreferences failed, code is ${error.code},message is ${error.message}`);
expect(error !== null).assertFail();
done();
})
}).catch((err) => {
console.error(TAG, `getPreferences failed, code is ${err.code},message is ${err.message}`);
expect(err !== null).assertFail();
done();
})
}catch(errInfo){
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('15501002');
done();
}
})
/**
* @tc.number SUB_DDM_Preferences_DataGroupId_Promise_0400
* @tc.name preferences dataGroupId null promise test
* @tc.desc preferences getPreferences dataGroupId null promise test
*/
it('SUB_DDM_Preferences_DataGroupId_Promise_0400', 0, async function (done) {
const Options = {
name: "test_preferences_callback",
dataGroupId: null,
};
try{
dataPreferences.getPreferences(globalThis.abilityContext, Options).then(async (data) => {
console.info(TAG, `getPreferences successfully.`);
expect().assertFail();
done();
dataPreferences.removePreferencesFromCache(globalThis.abilityContext, Options).then(async (val) => {
console.info(TAG, `removePreferencesFromCache successfully.`);
expect().assertFail();
done();
}).catch((error) => {
console.error(TAG, `removePreferencesFromCache failed, code is ${error.code},message is ${error.message}`);
expect(error !== null).assertFail();
done();
})
}).catch((err) => {
console.error(TAG, `getPreferences failed, code is ${err.code},message is ${err.message}`);
expect(err !== null).assertFail();
done();
})
}catch(errInfo){
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('401');
done();
}
})
/**
* @tc.number SUB_DDM_Preferences_DataGroupId_Promise_0500
* @tc.name preferences dataGroupId undefined promise test
* @tc.desc preferences removePreferencesFromCache dataGroupId undefined promise test
*/
it('SUB_DDM_Preferences_DataGroupId_Promise_0500', 0, async function (done) {
const Options = {
name: "test_preferences_callback",
dataGroupId: undefined,
};
try{
dataPreferences.getPreferences(globalThis.abilityContext, Options).then(async (data) => {
console.info(TAG, `getPreferences successfully.`);
expect().assertFail();
done();
dataPreferences.removePreferencesFromCache(globalThis.abilityContext, Options).then(async (val) => {
console.info(TAG, `removePreferencesFromCache successfully.`);
expect().assertFail();
done();
}).catch((error) => {
console.error(TAG, `removePreferencesFromCache failed, code is ${error.code},message is ${error.message}`);
expect(error !== null).assertFail();
done();
})
}).catch((err) => {
console.error(TAG, `getPreferences failed, code is ${err.code},message is ${err.message}`);
expect(err !== null).assertFail();
done();
})
}catch(errInfo){
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('401');
done();
}
})
/**
* @tc.number SUB_DDM_Preferences_DataGroupId_Promise_0600
* @tc.name preferences dataGroupId promise test
* @tc.desc preferences removePreferencesFromCache dataGroupId promise test
*/
it('SUB_DDM_Preferences_DataGroupId_Promise_0600', 0, async function (done) {
const Options = {
name: "test_preferences_callback",
dataGroupId: '112233',
};
try{
dataPreferences.getPreferences(globalThis.abilityContext, Options).then(async (data) => {
console.info(TAG, `getPreferences successfully.`);
expect().assertFail();
done();
dataPreferences.removePreferencesFromCache(globalThis.abilityContext, Options).then(async (val) => {
console.info(TAG, `removePreferencesFromCache successfully.`);
expect().assertFail();
done();
}).catch((error) => {
console.error(TAG, `removePreferencesFromCache failed, code is ${error.code},message is ${error.message}`);
expect(error !== null).assertFail();
done();
})
}).catch((err) => {
console.error(TAG, `getPreferences failed, code is ${err.code},message is ${err.message}`);
expect(err !== null).assertFail();
done();
})
}catch(errInfo){
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('15501002');
done();
}
})
console.log(TAG + "*************Unit Test End*************");
})
}
\ No newline at end of file
distributeddatamgr/preferencesdatagroupidtest/src/main/module.json
0 → 100644
浏览文件 @
c2ef1d94
{
"module"
:
{
"name"
:
"preferencesDataGroupId"
,
"type"
:
"feature"
,
"description"
:
"$string:module_test_desc"
,
"mainElement"
:
"TestAbility"
,
"deviceTypes"
:
[
"default"
,
"tablet"
,
"phone"
,
"2in1"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"pages"
:
"$profile:test_pages"
,
"abilities"
:
[
{
"name"
:
"TestAbility"
,
"srcEntry"
:
"./ets/TestAbility/TestAbility.ets"
,
"description"
:
"$string:TestAbility_desc"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:TestAbility_label"
,
"exported"
:
true
,
"startWindowIcon"
:
"$media:icon"
,
"startWindowBackground"
:
"$color:start_window_background"
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:
[
"entity.system.home"
]
}
]
}
]
}
}
distributeddatamgr/preferencesdatagroupidtest/src/main/resources/base/element/color.json
0 → 100644
浏览文件 @
c2ef1d94
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
distributeddatamgr/preferencesdatagroupidtest/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
c2ef1d94
{
"string"
:
[
{
"name"
:
"module_test_desc"
,
"value"
:
"test ability description"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"the test ability"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"test label"
}
]
}
\ No newline at end of file
distributeddatamgr/preferencesdatagroupidtest/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
c2ef1d94
6.6 KB
distributeddatamgr/preferencesdatagroupidtest/src/main/resources/base/profile/test_pages.json
0 → 100644
浏览文件 @
c2ef1d94
{
"src"
:
[
"TestAbility/pages/Index"
]
}
distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesSyncJsunit.test.js
浏览文件 @
c2ef1d94
...
...
@@ -378,5 +378,31 @@ export default function PreferencesSyncTest() {
expect
(
"
default
"
).
assertEqual
(
mPreferences
.
getSync
(
KEY_TEST_STRING_ELEMENT
,
"
default
"
));
done
();
})
/**
* @tc.number SUB_DDM_Preferences_removePreferencesFromCacheSync_0100
* @tc.name removePreferencesFromCacheSync interface test
* @tc.desc removePreferencesFromCacheSync interface test
*/
it
(
'
SUB_DDM_Preferences_removePreferencesFromCacheSync_0100
'
,
0
,
async
function
(
done
)
{
console
.
log
(
"
SUB_DDM_Preferences_removePreferencesFromCacheSync_0100 begin.
"
);
mPreferences
=
await
dataPreferences
.
getPreferences
(
context
,
NAME
);
await
mPreferences
.
clearSync
();
await
mPreferences
.
putSync
(
KEY_TEST_STRING_ELEMENT
,
'
test
'
)
await
mPreferences
.
getSync
(
KEY_TEST_STRING_ELEMENT
,
"
defaultvalue
"
)
mPreferences
.
flush
(
async
function
(
err
,
val
)
{
if
(
err
)
{
console
.
log
(
"
flush err.
"
);
expect
().
assertFail
();
}
console
.
log
(
"
flush done.
"
);
await
dataPreferences
.
removePreferencesFromCacheSync
(
context
,
NAME
);
let
value
=
mPreferences
.
getSync
(
KEY_TEST_STRING_ELEMENT
,
"
defaultvalue
"
)
console
.
log
(
"
SUB_DDM_Preferences_removePreferencesFromCacheSync_0100 end.
"
+
value
);
expect
(
'
test
'
).
assertEqual
(
value
);
done
();
console
.
log
(
"
SUB_DDM_Preferences_removePreferencesFromCacheSync_0100 end.
"
);
});
})
})
}
\ No newline at end of file
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/List.test.ets
浏览文件 @
c2ef1d94
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022
-2023
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
...
...
@@ -16,8 +16,11 @@
import relationalStoreDistributedTest from './relationalStoreDistributedEtsunit.test.ets'
import relationalStoreTest from './relationalStoreEtsunit.test.ets'
import relationalStoreResultSetTest from './relationalStoreTestResultsetEtsunit.test.ets'
import relationalStoreEmitTest from './relationalStoreEmit.test'
export default function testsuite() {
relationalStoreDistributedTest(globalThis.abilityContext)
relationalStoreTest(globalThis.abilityContext)
relationalStoreResultSetTest(globalThis.abilityContext)
relationalStoreEmitTest()
}
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreEmit.test.ets
0 → 100644
浏览文件 @
c2ef1d94
/*
* Copyright (C) 2023 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'
;
import
data_Rdb
from
'@ohos.data.relationalStore'
;
const
TAG
=
"[RelationalStore_Emit_TEST]"
;
const
CREATE_TABLE_TEST
=
"CREATE TABLE IF NOT EXISTS test ("
+
"id INTEGER PRIMARY KEY AUTOINCREMENT, "
+
"name TEXT NOT NULL, "
+
"age INTEGER, "
+
"salary REAL, "
+
"blobType BLOB)"
;
let
rdbStore
;
const
STORE_CONFIG
=
{
name
:
"rdbstoreEmit.db"
,
securityLevel
:
data_Rdb
.
SecurityLevel
.
S1
};
function
sleep
(
ms
)
{
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
));
}
export
default
function
relationalStoreEmitTest
()
{
describe
(
'relationalStoreEmitTest'
,
function
()
{
beforeAll
(
async
function
()
{
console
.
info
(
TAG
+
'beforeAll'
);
})
beforeEach
(
async
function
()
{
console
.
info
(
TAG
+
'beforeEach'
);
rdbStore
=
await
data_Rdb
.
getRdbStore
(
globalThis
.
abilityContext
,
STORE_CONFIG
)
await
rdbStore
.
executeSql
(
CREATE_TABLE_TEST
);
})
afterEach
(
async
function
()
{
console
.
info
(
TAG
+
'afterAll'
);
data_Rdb
.
deleteRdbStore
(
globalThis
.
abilityContext
,
"rdbstoreEmit.db"
);
})
afterAll
(
async
function
()
{
console
.
info
(
TAG
+
'afterAll'
);
})
console
.
info
(
TAG
+
"*************Unit Test Begin*************"
);
/**
* @tc.number SUB_DDM_RelationalStore_Emit_0100
* @tc.name relationalStore emit test
* @tc.desc relationalStore emit test
*/
it
(
'testRdbStoreDistributed0012'
,
0
,
async
function
(
done
)
{
async
function
subscribeInsert
()
{
console
.
info
(
TAG
+
"subscribeInsert start"
);
const
valueBucket
=
{
"name"
:
"zhangsan"
}
await
rdbStore
.
insert
(
"test"
,
valueBucket
)
console
.
info
(
TAG
+
"subscribeInsert end"
);
}
try
{
await
rdbStore
.
on
(
'storeObserverInsert'
,
false
,
subscribeInsert
);
await
rdbStore
.
emit
(
'storeObserverInsert'
);
await
sleep
(
2000
);
let
resultSet
=
await
rdbStore
.
querySql
(
"SELECT * FROM test"
);
console
.
info
(
TAG
+
"resultSet = "
+
resultSet
.
rowCount
);
expect
(
1
)
.
assertEqual
(
resultSet
.
rowCount
);
done
();
}
catch
(
err
)
{
console
.
error
(
`failed, code is ${err.code},message is ${err.message}`
);
expect
()
.
assertFail
()
done
();
}
})
})
}
\ No newline at end of file
distributeddatamgr/relationalstoredatagroupidtest/AppScope/app.json
0 → 100644
浏览文件 @
c2ef1d94
{
"app"
:
{
"bundleName"
:
"ohos.acts.relationalstoredatagroupidtest"
,
"vendor"
:
"example"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"icon"
:
"$media:app_icon"
,
"label"
:
"$string:app_name"
,
"minAPIVersion"
:
10
,
"targetAPIVersion"
:
10
,
"car"
:
{
"apiCompatibleVersion"
:
10
,
"singleUser"
:
false
}
}
}
distributeddatamgr/relationalstoredatagroupidtest/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
c2ef1d94
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"xtsDemo1"
}
]
}
distributeddatamgr/relationalstoredatagroupidtest/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
c2ef1d94
6.6 KB
distributeddatamgr/relationalstoredatagroupidtest/BUILD.gn
0 → 100644
浏览文件 @
c2ef1d94
# Copyright (C) 2023 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsRelationalstoreDataGroupIdTest") {
hap_profile = "src/main/module.json"
deps = [
":relationalstoreDataGroupId_js_assets",
":relationalstoreDataGroupId_resources",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsRelationalstoreDataGroupIdTest"
subsystem_name = "distributeddatamgr"
part_name = "relational_store"
}
ohos_app_scope("relationalstoreDataGroupId_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("relationalstoreDataGroupId_js_assets") {
source_dir = "src/main/ets"
}
ohos_resources("relationalstoreDataGroupId_resources") {
sources = [ "src/main/resources" ]
deps = [ ":relationalstoreDataGroupId_app_profile" ]
hap_profile = "src/main/module.json"
}
distributeddatamgr/relationalstoredatagroupidtest/Test.json
0 → 100644
浏览文件 @
c2ef1d94
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"60000"
,
"shell-timeout"
:
"60000"
,
"bundle-name"
:
"ohos.acts.relationalstoredatagroupidtest"
,
"module-name"
:
"relationalstoreDataGroupId"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsRelationalstoreDataGroupIdTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
\ No newline at end of file
distributeddatamgr/relationalstoredatagroupidtest/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
c2ef1d94
文件已添加
distributeddatamgr/relationalstoredatagroupidtest/src/main/ets/TestAbility/TestAbility.ets
0 → 100644
浏览文件 @
c2ef1d94
/*
* Copyright (C) 2023 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 UIAbility from "@ohos.app.ability.UIAbility";
import AbilityDelegatorRegistry from "@ohos.app.ability.abilityDelegatorRegistry";
import hilog from "@ohos.hilog";
import { Hypium } from "@ohos/hypium";
import testsuite from "../test/List.test";
import window from "@ohos.window";
export default class TestAbility extends UIAbility {
onCreate(want, launchParam) {
hilog.info(0x0000, "testTag", "%{public}s", "TestAbility onCreate");
hilog.info(0x0000, "testTag", "%{public}s", "want param:" + JSON.stringify(want) ?? "");
hilog.info(0x0000, "testTag", "%{public}s", "launchParam:" + JSON.stringify(launchParam) ?? "");
var abilityDelegator: any;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
var abilityDelegatorArguments: any;
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments();
hilog.info(0x0000, "testTag", "%{public}s", "start run testcase!!!");
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite);
}
onDestroy() {
hilog.info(0x0000, "testTag", "%{public}s", "TestAbility onDestroy");
}
onWindowStageCreate(windowStage: window.WindowStage) {
hilog.info(0x0000, "testTag", "%{public}s", "TestAbility onWindowStageCreate");
globalThis.abilityContext = this.context;
windowStage.loadContent("TestAbility/pages/Index", (err, data) => {
if (err.code) {
hilog.error(0x0000, "testTag", "Failed to load the content. Cause: %{public}s", JSON.stringify(err) ?? "");
return;
}
hilog.info(0x0000, "testTag", "Succeeded in loading the content. Data: %{public}s", JSON.stringify(data) ?? "");
});
}
onWindowStageDestroy() {
hilog.info(0x0000, "testTag", "%{public}s", "TestAbility onWindowStageDestroy");
}
onForeground() {
hilog.info(0x0000, "testTag", "%{public}s", "TestAbility onForeground");
}
onBackground() {
hilog.info(0x0000, "testTag", "%{public}s", "TestAbility onBackground");
}
}
distributeddatamgr/relationalstoredatagroupidtest/src/main/ets/TestAbility/pages/Index.ets
0 → 100644
浏览文件 @
c2ef1d94
/*
* Copyright (C) 2023 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 '@ohos.hilog';
@Entry
@Component
struct Index {
aboutToAppear() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear');
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
distributeddatamgr/relationalstoredatagroupidtest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
c2ef1d94
import
hilog
from
'
@ohos.hilog
'
;
import
TestRunner
from
'
@ohos.application.testRunner
'
;
import
AbilityDelegatorRegistry
from
'
@ohos.app.ability.abilityDelegatorRegistry
'
;
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
async
function
onAbilityCreateCallback
()
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
onAbilityCreateCallback
'
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
addAbilityMonitorCallback : %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner OnPrepare
'
);
}
async
onRun
()
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun run
'
);
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.TestAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a TestAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
var
debug
=
abilityDelegatorArguments
.
parameters
[
'
-D
'
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
cmd : %{public}s
'
,
cmd
);
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : err : %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : data : %{public}s
'
,
d
.
stdResult
??
''
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : data : %{public}s
'
,
d
.
exitCode
??
''
);
})
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun end
'
);
}
}
\ No newline at end of file
distributeddatamgr/relationalstoredatagroupidtest/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
c2ef1d94
/*
* Copyright (c) 2023 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 relationalStoreDataGroupIdCallback from './relationalStoreDataGroupIdCallback.test'
import relationalStoreDataGroupIdPromise from './relationalStoreDataGroupIdPromise.test'
export default function testsuite() {
relationalStoreDataGroupIdCallback()
relationalStoreDataGroupIdPromise()
}
\ No newline at end of file
distributeddatamgr/relationalstoredatagroupidtest/src/main/ets/test/relationalStoreDataGroupIdCallback.test.ets
0 → 100644
浏览文件 @
c2ef1d94
/*
* Copyright (c) 2023 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'
import relationalStore from '@ohos.data.relationalStore';
const TAG = "[ttt]"
const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test ("
+ "id INTEGER PRIMARY KEY AUTOINCREMENT, "
+ "name TEXT NOT NULL, "
+ "age INTEGER, "
+ "salary REAL, "
+ "blobType BLOB)";
let context = globalThis.abilityContext;
//let rdbStore;
export default function relationalStoreDataGroupIdCallback() {
describe('relationalStoreDataGroupIdCallback', function () {
beforeAll(function () {
console.info(TAG + 'beforeAll')
})
beforeEach(function () {
console.info(TAG + 'beforeEach')
})
afterEach(function () {
console.info(TAG + 'afterEach')
})
afterAll(async function () {
console.info(TAG + 'afterAll')
})
console.log(TAG + "*************Unit Test Begin*************");
/**
* @tc.number SUB_DDM_RelationalStore_DataGroupId_Callback_0100
* @tc.name relationalStore dataGroupId null callback test
* @tc.desc relationalStore getRdbStore dataGroupId null callback test
*/
it('SUB_DDM_RelationalStore_DataGroupId_Callback_0100', 0, async function (done) {
const STORE_CONFIG = {
name: "RdbTest.db",
securityLevel: relationalStore.SecurityLevel.S1,
dataGroupId: null,
};
try {
relationalStore.getRdbStore(globalThis.abilityContext, STORE_CONFIG, async function (err, rdbStore) {
console.info(TAG, `Get RdbStore successfully.`);
expect().assertFail();
done();
await rdbStore.executeSql(CREATE_TABLE_TEST);
relationalStore.deleteRdbStore(globalThis.abilityContext, STORE_CONFIG, function (error) {
expect(error).assertFail();
console.info(TAG, `Delete RdbStore successfully.`);
done();
})
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('401');
done();
}
})
/**
* @tc.number SUB_DDM_RelationalStore_DataGroupId_Callback_0200
* @tc.name relationalStore dataGroupId undefined callback test
* @tc.desc relationalStore getRdbStore dataGroupId undefined callback test
*/
it('SUB_DDM_RelationalStore_DataGroupId_Callback_0200', 0, async function (done) {
const STORE_CONFIG = {
name: "RdbTest.db",
securityLevel: relationalStore.SecurityLevel.S1,
dataGroupId: undefined,
};
try {
relationalStore.getRdbStore(globalThis.abilityContext, STORE_CONFIG, async function (err, rdbStore) {
console.info(TAG, `Get RdbStore successfully.`);
expect().assertFail();
done();
await rdbStore.executeSql(CREATE_TABLE_TEST);
relationalStore.deleteRdbStore(globalThis.abilityContext, STORE_CONFIG, function (error) {
expect(error).assertFail();
console.info(TAG, `Delete RdbStore successfully.`);
done();
})
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('401');
done();
}
})
/**
* @tc.number SUB_DDM_RelationalStore_DataGroupId_Callback_0300
* @tc.name relationalStore dataGroupId callback test
* @tc.desc relationalStore getRdbStore dataGroupId callback test
*/
it('SUB_DDM_RelationalStore_DataGroupId_Callback_0300', 0, async function (done) {
const STORE_CONFIG = {
name: "RdbTest.db",
securityLevel: relationalStore.SecurityLevel.S1,
dataGroupId: '112233',
};
try {
relationalStore.getRdbStore(globalThis.abilityContext, STORE_CONFIG, async function (err, rdbStore) {
console.info(TAG, `Get RdbStore successfully.`);
expect().assertFail();
done();
await rdbStore.executeSql(CREATE_TABLE_TEST);
relationalStore.deleteRdbStore(globalThis.abilityContext, STORE_CONFIG, function (error) {
expect(error).assertFail();
console.info(TAG, `Delete RdbStore successfully.`);
done();
})
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('14801002')
done();
}
})
/**
* @tc.number SUB_DDM_RelationalStore_DataGroupId_Callback_0400
* @tc.name relationalStore dataGroupId callback test
* @tc.desc relationalStore deleteRdbStore dataGroupId callback test
*/
it('SUB_DDM_RelationalStore_DataGroupId_Callback_0400', 0, async function (done) {
const STORE_CONFIG = {
name: "RdbTest.db",
securityLevel: relationalStore.SecurityLevel.S1,
dataGroupId: '123456'
};
try {
relationalStore.getRdbStore(globalThis.abilityContext, STORE_CONFIG, async function (err, rdbStore) {
if (err) {
console.error(TAG, `Get RdbStore failed, code is ${err.code},message is ${err.message}`);
return false;
}
console.info(TAG, `Get RdbStore successfully.` + ` rdbStore = ${rdbStore} , err = ${err}`);
await rdbStore.executeSql(CREATE_TABLE_TEST);
relationalStore.deleteRdbStore(globalThis.abilityContext, STORE_CONFIG, function (err) {
if (err) {
console.error(TAG, `Delete RdbStore failed, code is ${err.code},message is ${err.message}`);
return false;
}
console.info(TAG, `Delete RdbStore successfully.` + ` rdbStore = ${rdbStore} , err = ${err}`);
expect(err === undefined).assertTrue()
done();
})
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo !== undefined).assertFail()
done();
}
})
console.log(TAG + "*************Unit Test End*************");
})
}
\ No newline at end of file
distributeddatamgr/relationalstoredatagroupidtest/src/main/ets/test/relationalStoreDataGroupIdPromise.test.ets
0 → 100644
浏览文件 @
c2ef1d94
/*
* Copyright (c) 2023 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'
import relationalStore from '@ohos.data.relationalStore';
const TAG = "[ttt]"
const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test ("
+ "id INTEGER PRIMARY KEY AUTOINCREMENT, "
+ "name TEXT NOT NULL, "
+ "age INTEGER, "
+ "salary REAL, "
+ "blobType BLOB)";
let rdbStore;
export default function relationalStoreDataGroupIdPromise() {
describe('relationalStoreDataGroupIdPromise', function () {
console.log(TAG + "*************Unit Test Begin*************");
/**
* @tc.number SUB_DDM_RelationalStore_DataGroupId_Promise_0100
* @tc.name relationalStore dataGroupId null promise test
* @tc.desc relationalStore getRdbStore dataGroupId null promise test
*/
it('SUB_DDM_RelationalStore_DataGroupId_Promise_0100', 0, async function (done) {
const STORE_CONFIG = {
name: "RdbTest.db",
securityLevel: relationalStore.SecurityLevel.S1,
dataGroupId: null,
};
try {
relationalStore.getRdbStore(globalThis.abilityContext, STORE_CONFIG).then(async (rdbStore) => {
console.info(TAG, `Get RdbStore successfully.`);
expect().assertFail();
done();
await rdbStore.executeSql(CREATE_TABLE_TEST);
relationalStore.deleteRdbStore(globalThis.abilityContext, STORE_CONFIG).then(async () => {
expect().assertFail();
console.info(TAG, `Delete RdbStore successfully.`);
done();
}).catch((error) => {
console.info(TAG, `Delete RdbStore fail, code is ${error.code},message is ${error.message}.`);
expect(error !== null).assertFail();
done();
})
}).catch((err) => {
console.info(TAG, `Get RdbStore fail, code is ${err.code},message is ${err.message}.`);
expect(err !== null).assertFail();
done();
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('401');
done();
}
})
/**
* @tc.number SUB_DDM_RelationalStore_DataGroupId_Promise_0200
* @tc.name relationalStore dataGroupId undefined callback test
* @tc.desc relationalStore getRdbStore dataGroupId undefined callback test
*/
it('SUB_DDM_RelationalStore_DataGroupId_Promise_0200', 0, async function (done) {
const STORE_CONFIG = {
name: "RdbTest.db",
securityLevel: relationalStore.SecurityLevel.S1,
dataGroupId: undefined,
};
try {
relationalStore.getRdbStore(globalThis.abilityContext, STORE_CONFIG).then(async (rdbStore) => {
console.info(TAG, `Get RdbStore successfully.`);
expect().assertFail();
done();
await rdbStore.executeSql(CREATE_TABLE_TEST);
relationalStore.deleteRdbStore(globalThis.abilityContext, STORE_CONFIG).then(async () => {
expect().assertFail();
console.info(TAG, `Delete RdbStore successfully.`);
done();
}).catch((error) => {
console.info(TAG, `Delete RdbStore fail, code is ${error.code},message is ${error.message}.`);
expect(error !== null).assertFail();
done();
})
}).catch((err) => {
console.info(TAG, `Get RdbStore fail, code is ${err.code},message is ${err.message}.`);
expect(err !== null).assertFail();
done();
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('401');
done();
}
})
/**
* @tc.number SUB_DDM_RelationalStore_DataGroupId_Promise_0300
* @tc.name relationalStore dataGroupId callback test
* @tc.desc relationalStore getRdbStore dataGroupId callback test
*/
it('SUB_DDM_RelationalStore_DataGroupId_Promise_0300', 0, async function (done) {
const STORE_CONFIG = {
name: "RdbTest.db",
securityLevel: relationalStore.SecurityLevel.S1,
dataGroupId: '112233',
};
try {
relationalStore.getRdbStore(globalThis.abilityContext, STORE_CONFIG).then(async (rdbStore) => {
console.info(TAG, `Get RdbStore successfully.`);
expect().assertFail();
done();
await rdbStore.executeSql(CREATE_TABLE_TEST);
relationalStore.deleteRdbStore(globalThis.abilityContext, STORE_CONFIG).then(async () => {
expect().assertFail();
console.info(TAG, `Delete RdbStore successfully.`);
done();
}).catch((error) => {
console.info(TAG, `Delete RdbStore fail, code is ${error.code},message is ${error.message}.`);
expect(error !== null).assertFail();
done();
})
}).catch((err) => {
console.info(TAG, `Get RdbStore fail, code is ${err.code},message is ${err.message}.`);
expect(err !== null).assertFail();
done();
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo.code).assertEqual('14801002');
done();
}
})
/**
* @tc.number SUB_DDM_RelationalStore_DataGroupId_Promise_0400
* @tc.name relationalStore dataGroupId callback test
* @tc.desc relationalStore deleteRdbStore dataGroupId callback test
*/
it('SUB_DDM_RelationalStore_DataGroupId_Promise_0400', 0, async function (done) {
const STORE_CONFIG = {
name: "RdbTest.db",
securityLevel: relationalStore.SecurityLevel.S1,
dataGroupId: '123456',
};
try {
relationalStore.getRdbStore(globalThis.abilityContext, STORE_CONFIG).then(async (rdbStore) => {
console.info(TAG, `Get RdbStore successfully.`);
// await rdbStore.executeSql(CREATE_TABLE_TEST);
rdbStore.executeSql(CREATE_TABLE_TEST, [], async function (error) {
if (error) {
console.error(TAG, `ExecuteSql failed, code is ${error.code},message is ${error.message}`);
return;
}
console.info(TAG, `executeSql1 done.` + error);
expect(error === undefined).assertTrue();
await relationalStore.deleteRdbStore(globalThis.abilityContext, STORE_CONFIG)
done();
})
}).catch((err) => {
console.info(TAG, `Get RdbStore fail, code is ${err.code},message is ${err.message}.`);
expect(err !== null).assertFail();
done();
})
} catch (errInfo) {
console.error(TAG, `failed, code is ${errInfo.code},message is ${errInfo.message}`);
expect(errInfo !== null).assertFail();
done();
}
})
console.info(TAG + "*************Unit Test End*************");
})
}
\ No newline at end of file
distributeddatamgr/relationalstoredatagroupidtest/src/main/module.json
0 → 100644
浏览文件 @
c2ef1d94
{
"module"
:
{
"name"
:
"relationalstoreDataGroupId"
,
"type"
:
"feature"
,
"description"
:
"$string:module_test_desc"
,
"mainElement"
:
"TestAbility"
,
"deviceTypes"
:
[
"default"
,
"tablet"
,
"phone"
,
"2in1"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"pages"
:
"$profile:test_pages"
,
"abilities"
:
[
{
"name"
:
"TestAbility"
,
"srcEntry"
:
"./ets/TestAbility/TestAbility.ets"
,
"description"
:
"$string:TestAbility_desc"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:TestAbility_label"
,
"exported"
:
true
,
"startWindowIcon"
:
"$media:icon"
,
"startWindowBackground"
:
"$color:start_window_background"
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:
[
"entity.system.home"
]
}
]
}
]
}
}
distributeddatamgr/relationalstoredatagroupidtest/src/main/resources/base/element/color.json
0 → 100644
浏览文件 @
c2ef1d94
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
distributeddatamgr/relationalstoredatagroupidtest/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
c2ef1d94
{
"string"
:
[
{
"name"
:
"module_test_desc"
,
"value"
:
"test ability description"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"the test ability"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"test label"
}
]
}
\ No newline at end of file
distributeddatamgr/relationalstoredatagroupidtest/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
c2ef1d94
6.6 KB
distributeddatamgr/relationalstoredatagroupidtest/src/main/resources/base/profile/test_pages.json
0 → 100644
浏览文件 @
c2ef1d94
{
"src"
:
[
"TestAbility/pages/Index"
]
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录