Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6582f3c2
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看板
未验证
提交
6582f3c2
编写于
8月 28, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 28, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9860 distributeddatamgr
Merge pull request !9860 from lixinyi1094590959/master
上级
f1650529
c887cd06
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
1408 addition
and
1376 deletion
+1408
-1376
distributeddatamgr/crossplatform/preferencesetstest/src/main/ets/test/PreferencesCallBack.test.ets
...cesetstest/src/main/ets/test/PreferencesCallBack.test.ets
+3
-3
distributeddatamgr/crossplatform/preferencesetstest/src/main/ets/test/PreferencesCallBackWithError.test.ets
...t/src/main/ets/test/PreferencesCallBackWithError.test.ets
+7
-7
distributeddatamgr/crossplatform/preferencesetstest/src/main/ets/test/PreferencesIgnore.test.ets
...encesetstest/src/main/ets/test/PreferencesIgnore.test.ets
+9
-9
distributeddatamgr/crossplatform/preferencesetstest/src/main/ets/test/PreferencesPromiseWithError.test.ets
...st/src/main/ets/test/PreferencesPromiseWithError.test.ets
+12
-12
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupCallbackJsTest.js
...stest/hap/src/main/js/test/KvStoreBackupCallbackJsTest.js
+634
-624
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupPromiseJsTest.js
...jstest/hap/src/main/js/test/KvStoreBackupPromiseJsTest.js
+633
-620
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js
...bJstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js
+1
-1
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstorePredicatesJoinJsunit.test.js
...hap/src/main/js/test/RdbstorePredicatesJoinJsunit.test.js
+1
-1
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreRdbstoreJsunit.test.js
...stest/hap/src/main/js/test/RdbstoreRdbstoreJsunit.test.js
+1
-0
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreInsertJsunit.test.js
.../hap/src/main/js/test/RelationalStoreInsertJsunit.test.js
+1
-1
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStorePredicatesJoinJsunit.test.js
.../main/js/test/RelationalStorePredicatesJoinJsunit.test.js
+1
-1
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreQuery.test.js
...eJstest/hap/src/main/js/test/RelationalStoreQuery.test.js
+105
-97
未找到文件。
distributeddatamgr/crossplatform/preferencesetstest/src/main/ets/test/PreferencesCallBack.test.ets
浏览文件 @
6582f3c2
...
...
@@ -89,7 +89,7 @@ export default function preferencesCallBackTest() {
});
} catch (err) {
console.info("testPreferencesGetPreferences002 fail: " + err.message + "code: " + err.code);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'name' must be a without path non empty string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -145,7 +145,7 @@ export default function preferencesCallBackTest() {
});
} catch (err) {
console.info("testPreferencesDeletePreferences001 fail: " + err.message + "code: " + err.code);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'name' must be a without path non empty string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
}
...
...
@@ -239,7 +239,7 @@ export default function preferencesCallBackTest() {
});
} catch (err) {
console.info("testRemovePreferencesFromCache001 fail: " + err.message + "code: " + err.code);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'name' must be a without path non empty string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
}
...
...
distributeddatamgr/crossplatform/preferencesetstest/src/main/ets/test/PreferencesCallBackWithError.test.ets
浏览文件 @
6582f3c2
...
...
@@ -98,7 +98,7 @@ export default function preferencesCallbackWithErrorTest() {
});
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. Need 2 or 3 parameters!"
).assertTrue();
expect(err.code === "401").assertTrue();
done();
console.log("testMpreferencesGet0000 end.");
}
...
...
@@ -126,7 +126,7 @@ export default function preferencesCallbackWithErrorTest() {
});
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'value' must be string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -203,7 +203,7 @@ export default function preferencesCallbackWithErrorTest() {
});
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'value' must be string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
console.log("testMpreferencesHas0001 end.");
}
...
...
@@ -252,7 +252,7 @@ export default function preferencesCallbackWithErrorTest() {
});
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. Need 2 or 3 parameters!"
).assertTrue();
expect(err.code === "401").assertTrue();
done();
console.log("testMpreferencesPut0001 end.");
}
...
...
@@ -339,7 +339,7 @@ export default function preferencesCallbackWithErrorTest() {
});
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'value' must be string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -367,7 +367,7 @@ export default function preferencesCallbackWithErrorTest() {
});
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'value' must be ValueType."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -389,7 +389,7 @@ export default function preferencesCallbackWithErrorTest() {
});
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'value' must be string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
console.log("testMpreferencesDelete0001 end.");
}
...
...
distributeddatamgr/crossplatform/preferencesetstest/src/main/ets/test/PreferencesIgnore.test.ets
浏览文件 @
6582f3c2
...
...
@@ -58,7 +58,7 @@ export default function preferencesIgnoreTest() {
});
} catch (err) {
console.info("testPreferencesGetPreferences001 fail: " + err.message + "code: " + err.code);
expect(err.code === "401"
&& err.message == "Parameter error. The type of 'name' must be a without path non empty string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -90,7 +90,7 @@ export default function preferencesIgnoreTest() {
});
} catch (err) {
console.info("testPreferencesDeletePreferences002 fail: " + err.message + "code: " + err.code);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'name' must be a without path non empty string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
}
...
...
@@ -124,7 +124,7 @@ export default function preferencesIgnoreTest() {
});
} catch (err) {
console.info("testRemovePreferencesFromCache002 fail: " + err.message + "code: " + err.code);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'name' must be a without path non empty string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
}
...
...
@@ -145,7 +145,7 @@ export default function preferencesIgnoreTest() {
await dataPreferences.getPreferences(context, -1);
} catch (err) {
console.info("testGetPreferencesHelper0003 fail: " + err.message + "code: " + err.code);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'name' must be a without path non empty string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -164,7 +164,7 @@ export default function preferencesIgnoreTest() {
await dataPreferences.getPreferences(context);
} catch (err) {
console.info("testGetPreferencesHelper0004 fail: " + err.message + "code: " + err.code);
expect(err.code === "401"
&& err.message === "Parameter error. Need 2 or 3 parameters!"
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -184,7 +184,7 @@ export default function preferencesIgnoreTest() {
await dataPreferences.removePreferencesFromCache(context);
} catch (err) {
console.info("testRemovePreferencesFromCacheHelper0002 fail: " + err.message + "code: " + err.code);
expect(err.code === "401"
&& err.message === "Parameter error. Need 2 or 3 parameters!"
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -204,7 +204,7 @@ export default function preferencesIgnoreTest() {
await dataPreferences.removePreferencesFromCache(context, -1);
} catch (err) {
console.info("testRemovePreferencesFromCacheHelper0003 fail: " + err.message + "code: " + err.code);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'name' must be a without path non empty string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -224,7 +224,7 @@ export default function preferencesIgnoreTest() {
await dataPreferences.deletePreferences(context);
} catch (err) {
console.info("testPreferencesDeleteHelper0002 fail: " + err.message + "code: " + err.code);
expect(err.code === "401"
&& err.message === "Parameter error. Need 2 or 3 parameters!"
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -244,7 +244,7 @@ export default function preferencesIgnoreTest() {
await dataPreferences.deletePreferences(context, -1);
} catch (err) {
console.info("testPreferencesDeleteHelper0003 fail: " + err.message + "code: " + err.code);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'name' must be a without path non empty string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
distributeddatamgr/crossplatform/preferencesetstest/src/main/ets/test/PreferencesPromiseWithError.test.ets
浏览文件 @
6582f3c2
...
...
@@ -127,7 +127,7 @@ export default function preferencesPromiseWithErrorTest() {
});
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. Need 2 or 3 parameters!"
).assertTrue();
expect(err.code === "401").assertTrue();
done();
console.log("testMpreferencesGetPromise0001 end.");
}
...
...
@@ -157,7 +157,7 @@ export default function preferencesPromiseWithErrorTest() {
});
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'value' must be string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -205,7 +205,7 @@ export default function preferencesPromiseWithErrorTest() {
mPreference.getSync(1233);
} catch (err) {
console.log("trycatch1 err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. Need 2 parameters!"
).assertTrue();
expect(err.code === "401").assertTrue();
done();
console.log("testMpreferencesGetSyncWithError0001 end.");
}
...
...
@@ -226,7 +226,7 @@ export default function preferencesPromiseWithErrorTest() {
mPreference.getSync(-1, KEY_TEST_INT_ELEMENT);
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'value' must be string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -303,7 +303,7 @@ export default function preferencesPromiseWithErrorTest() {
});
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'value' must be string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
console.log("testMpreferencesHasPromise0001 end.");
}
...
...
@@ -358,7 +358,7 @@ export default function preferencesPromiseWithErrorTest() {
});
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. Need 2 or 3 parameters!"
).assertTrue();
expect(err.code === "401").assertTrue();
done();
console.log("testMpreferencesPutPromise0001 end.");
}
...
...
@@ -451,7 +451,7 @@ export default function preferencesPromiseWithErrorTest() {
});
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'value' must be string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -480,7 +480,7 @@ export default function preferencesPromiseWithErrorTest() {
});
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'value' must be ValueType."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -499,7 +499,7 @@ export default function preferencesPromiseWithErrorTest() {
mPreference.putSync(1233);
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. Need 2 parameters!"
).assertTrue();
expect(err.code === "401").assertTrue();
done();
console.log("testMpreferencesPutSyncWithError0001 end.");
}
...
...
@@ -565,7 +565,7 @@ export default function preferencesPromiseWithErrorTest() {
mPreference.putSync(-1, 123);
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'value' must be string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -584,7 +584,7 @@ export default function preferencesPromiseWithErrorTest() {
mPreference.putSync(KEY_TEST_STRING_ELEMENT, null);
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'value' must be ValueType."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
}
});
...
...
@@ -611,7 +611,7 @@ export default function preferencesPromiseWithErrorTest() {
});
} catch (err) {
console.log("trycatch err =" + err + ", code =" + err.code + ", message =" + err.message);
expect(err.code === "401"
&& err.message === "Parameter error. The type of 'value' must be string."
).assertTrue();
expect(err.code === "401").assertTrue();
done();
console.log("testMpreferencesDeletePromise0001 end.");
}
...
...
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupCallbackJsTest.js
浏览文件 @
6582f3c2
...
...
@@ -66,6 +66,7 @@ function publicCloseKvStore() {
reject
(
err
);
}
console
.
info
(
'
Test deleteKVStore data =
'
+
data
);
resolve
(
data
);
});
});
})
...
...
@@ -119,6 +120,7 @@ function publicBackup(kvStore,file){
function
publicDeleteBackup
(
kvStore
,
files
){
console
.
log
(
`Test deleteBackup
${
JSON
.
stringify
(
files
)}
`
)
return
new
Promise
(
function
(
resolve
,
reject
)
{
try
{
kvStore
.
deleteBackup
(
files
,
function
(
err
,
data
){
console
.
log
(
"
Test deleteBackup BackUpInfo =
"
+
data
);
if
(
err
!=
undefined
)
{
...
...
@@ -132,6 +134,10 @@ function publicDeleteBackup(kvStore,files){
resolve
(
data
);
}
})
}
catch
(
e
)
{
console
.
log
(
"
111Test deleteBackup err information:
"
+
e
);
reject
(
e
);
}
})
}
...
...
@@ -175,11 +181,10 @@ const optionLock = {
securityLevel
:
distributedData
.
SecurityLevel
.
S1
,
}
var
file
=
''
;
var
files
=
new
Array
();
let
file
=
''
;
let
files
=
new
Array
(
file
);
export
default
function
kvStoreBackupCallbackJsunittest
(){
describe
(
'
kvStoreBackupCallbackJsunittest
'
,
function
()
{
describe
(
'
kvStoreBackupCallbackJsunittest
'
,
function
()
{
beforeAll
(
async
function
()
{
console
.
info
(
'
Test beforeAll: Prerequisites at the test suite level,
'
+
'
which are executed before t he test suite is executed.
'
);
...
...
@@ -194,7 +199,12 @@ describe('kvStoreBackupCallbackJsunittest', function () {
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach: Test case-level clearance conditions,
'
+
'
which are executed after each test case is executed.
'
);
try
{
await
publicDeleteBackup
(
kvStore
,
files
);
}
catch
(
e
){
console
.
log
(
"
222Test deleteBackup err information:
"
+
e
);
};
await
publicCloseKvStore
();
files
=
[]
})
...
...
@@ -203,7 +213,7 @@ describe('kvStoreBackupCallbackJsunittest', function () {
'
which is executed after the test suite is executed
'
);
await
publicCloseKvStore
();
kvManager
=
null
;
console
.
info
(
"
Test kvstore =
"
+
kvStore
)
console
.
info
(
"
Test kvstore =
"
+
kvStore
);
})
/**
...
...
@@ -221,7 +231,7 @@ describe('kvStoreBackupCallbackJsunittest', function () {
done
();
}).
catch
((
err
)
=>
{
console
.
log
(
"
SUB_DDM_DKV_KVBACKUP_MANALRESTORE_CALLBACK_0100 Manualrestore fail 1
"
+
err
);
expect
(
err
==
"
Error: Parameter error.The number of parameters is incorrect.
"
).
assertEqual
(
true
);
expect
(
err
.
code
==
"
401
"
).
assertEqual
(
true
);
done
();
})
}
catch
(
e
)
{
...
...
@@ -837,5 +847,5 @@ describe('kvStoreBackupCallbackJsunittest', function () {
done
();
}
})
})
})
}
\ No newline at end of file
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupPromiseJsTest.js
浏览文件 @
6582f3c2
...
...
@@ -63,6 +63,7 @@ function publicCloseKvStore() {
reject
(
err
);
}
console
.
info
(
'
Test deleteKVStore data =
'
+
data
);
resolve
(
data
);
});
});
})
...
...
@@ -111,20 +112,27 @@ function publicBackup(kvStore,file){
})
}
function
publicDeleteBackup
(
kvStore
,
files
)
{
function
publicDeleteBackup
(
kvStore
,
files
){
console
.
log
(
`Test deleteBackup
${
JSON
.
stringify
(
files
)}
`
)
return
new
Promise
(
function
(
resolve
,
reject
)
{
kvStore
.
deleteBackup
(
files
).
then
((
data
)
=>
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
try
{
kvStore
.
deleteBackup
(
files
,
function
(
err
,
data
){
console
.
log
(
"
Test deleteBackup BackUpInfo =
"
+
data
);
var
devices
=
new
Array
();
if
(
err
!=
undefined
)
{
console
.
log
(
"
Test deleteBackup err information:
"
+
err
);
reject
(
err
);
}
else
{
var
devices
=
new
Array
();
devices
=
data
;
delresult
=
devices
;
console
.
log
(
"
Test deleteBackup pass
"
);
resolve
(
data
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
test deleteBackup err information:
"
+
err
);
reject
(
err
);
}
})
}
catch
(
e
)
{
console
.
log
(
"
111Test deleteBackup err information:
"
+
e
);
reject
(
e
);
}
})
}
...
...
@@ -144,7 +152,7 @@ function publicRestoreSp(kvStore,file){
function
publicRestore
(
kvStore
){
console
.
log
(
`Test restore `
)
return
new
Promise
(
function
(
resolve
,
reject
)
{
kvStore
.
restore
.
then
((
data
)
=>
{
kvStore
.
restore
()
.
then
((
data
)
=>
{
console
.
log
(
"
Test restore backupinfo information:
"
+
JSON
.
stringify
(
data
)
);
resolve
(
data
);
}).
catch
((
err
)
=>
{
...
...
@@ -166,11 +174,11 @@ const optionLock = {
securityLevel
:
distributedData
.
SecurityLevel
.
S1
,
}
var
file
=
''
;
var
files
=
new
Array
();
let
file
=
''
;
let
files
=
new
Array
(
file
);
export
default
function
kvStoreBackupPromiseJsunittest
(){
describe
(
'
kvStoreBackupPromiseJsunittest
'
,
function
()
{
describe
(
'
kvStoreBackupPromiseJsunittest
'
,
function
()
{
beforeAll
(
async
function
()
{
console
.
info
(
'
Test beforeAll: Prerequisites at the test suite level,
'
+
'
which are executed before the test suite is executed.
'
);
...
...
@@ -184,7 +192,12 @@ describe('kvStoreBackupPromiseJsunittest', function () {
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach: Test case-level clearance conditions,
'
+
'
which are executed after each test case is executed.
'
);
try
{
await
publicDeleteBackup
(
kvStore
,
files
);
}
catch
(
e
){
console
.
log
(
"
222Test deleteBackup err information:
"
+
e
);
}
})
afterAll
(
async
function
()
{
console
.
info
(
'
afterAll: Test suite-level cleanup condition,
'
+
...
...
@@ -207,11 +220,11 @@ describe('kvStoreBackupPromiseJsunittest', function () {
publicRestore
(
kvStore
).
then
((
data
)
=>
{
console
.
log
(
"
SUB_DDM_DKV_KVBACKUP_MANALRESTORE_PROMISE_0100 going restore =
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
data
==
'
code数字
'
);
expect
().
assertFail
(
);
done
();
}).
catch
((
err
)
=>
{
console
.
log
(
"
SUB_DDM_DKV_KVBACKUP_MANALRESTORE_PROMISE_0100 Manualrestore fail 1
"
+
err
);
expect
(
true
).
assertEqual
(
JSON
.
stringify
(
err
)
==
'
{}
'
);
expect
(
err
.
code
==
"
401
"
).
assertEqual
(
true
);
done
();
})
}
catch
(
e
)
{
...
...
@@ -814,5 +827,5 @@ describe('kvStoreBackupPromiseJsunittest', function () {
done
();
}
})
})
})
}
\ No newline at end of file
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js
浏览文件 @
6582f3c2
...
...
@@ -36,7 +36,7 @@ describe('rdbstoreInsertTest', function () {
console
.
info
(
TAG
+
'
beforeAll
'
)
rdbStore
=
await
dataRdb
.
getRdbStore
(
STORE_CONFIG
,
1
);
await
rdbStore
.
executeSql
(
CREATE_TABLE_TEST
,
null
)
await
rdbStore
.
executeSql
(
CREATE_TABLE_BATCHINSERT_TEST
,
null
);
})
beforeEach
(
async
function
()
{
...
...
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstorePredicatesJoinJsunit.test.js
浏览文件 @
6582f3c2
...
...
@@ -55,7 +55,7 @@ describe('rdbStorePredicatesJoinTest', function () {
afterEach
(
async
function
()
{
console
.
info
(
TAG
+
'
afterEach
'
)
await
dataRdb
.
deleteRdbStore
(
"
Insert
Test.db
"
);
await
dataRdb
.
deleteRdbStore
(
"
RdbJoin
Test.db
"
);
rdbStore
=
null
console
.
info
(
TAG
+
'
afterEach end
'
)
})
...
...
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreRdbstoreJsunit.test.js
浏览文件 @
6582f3c2
...
...
@@ -19,6 +19,7 @@ import abilityFeatureAbility from '@ohos.ability.featureAbility';
var
context
=
abilityFeatureAbility
.
getContext
();
var
contextApplication
=
context
.
getApplicationContext
()
var
rdbStore
=
undefined
;
const
TAG
=
"
[RDB_JSKITS_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)
"
;
...
...
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreInsertJsunit.test.js
浏览文件 @
6582f3c2
...
...
@@ -39,7 +39,7 @@ describe('relationalStoreInsertTest', function () {
console
.
info
(
TAG
+
'
beforeAll
'
)
rdbStore
=
await
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG
);
await
rdbStore
.
executeSql
(
CREATE_TABLE_TEST
,
null
)
await
rdbStore
.
executeSql
(
CREATE_TABLE_BATCHINSERT_TEST
,
null
);
})
beforeEach
(
async
function
()
{
...
...
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStorePredicatesJoinJsunit.test.js
浏览文件 @
6582f3c2
...
...
@@ -60,7 +60,7 @@ describe('relationalStorePredicatesJoinTest', function () {
afterEach
(
async
function
()
{
console
.
info
(
TAG
+
'
afterEach
'
)
await
data_Rdb
.
deleteRdbStore
(
context
,
"
Insert
Test.db
"
);
await
data_Rdb
.
deleteRdbStore
(
context
,
"
RdbJoin
Test.db
"
);
rdbStore
=
null
console
.
info
(
TAG
+
'
afterEach end
'
)
})
...
...
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreQuery.test.js
浏览文件 @
6582f3c2
...
...
@@ -19,12 +19,13 @@ import ability_featureAbility from '@ohos.ability.featureAbility';
const
TAG
=
"
[RelationalStore_JSKITS_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)
"
+
"
name TEXT NOT NULL,
"
+
"
age INTEGER,
"
+
"
salary REAL,
"
+
"
blobType BLOB)
"
const
STORE_CONFIG
=
{
name
:
"
Query.db
"
,
securityLevel
:
data_Rdb
.
SecurityLevel
.
S1
}
const
TEST_BUNDLE_NAME
=
"
ohos.acts.relationalstorejstest
"
const
TEST_STORE_ID
=
"
storeId
"
;
var
kvManager
=
null
var
kvStore
=
null
...
...
@@ -63,7 +64,7 @@ async function CreatRdbStore(context, STORE_CONFIG) {
}
await
RdbStore
.
insert
(
"
test
"
,
valueBucket
)
}
return
RdbStore
}
async
function
getLocalDeviceId
(){
...
...
@@ -153,21 +154,28 @@ export default function relationalStoreQueryTest(){
* @tc.number SUB_DDM_RelationalStore_JS_RemoteQueryTest_Promise_0010
* @tc.desc RelationalStore remotequery function test
*/
it
(
'
RdbRemoteQueryPromiseTest0010
'
,
0
,
async
function
(
done
){
console
.
info
(
TAG
+
"
RdbRemoteQueryPromiseTest0010 start
"
)
let
errInfo
=
undefined
let
predicates
=
new
data_Rdb
.
RdbPredicates
(
"
test
"
);
predicates
.
equalTo
(
"
name
"
,
"
zhangsan
"
)
try
{
rdbStore
.
remoteQuery
(
localDeviceId
,
"
test
"
,
predicates
,[
"
name
"
,
"
age
"
,
"
salary
"
])
await
rdbStore
.
remoteQuery
(
localDeviceId
,
"
test
"
,
predicates
,[
"
name
"
,
"
age
"
,
"
salary
"
]).
then
((
resultSet
)
=>
{
console
.
info
(
TAG
+
"
Remote query success
"
)
expect
().
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
TAG
+
"
Remote query error
"
+
err
)
expect
().
assertFail
();
})
}
catch
(
err
){
errInfo
=
err
}
expect
(
errInfo
.
code
).
assertEqual
(
"
401
"
)
console
.
info
(
TAG
+
"
RdbRemoteQueryPromiseTest0010 error:
"
+
err
)
expect
(
err
.
message
!==
null
).
assertTrue
();
done
();
}
console
.
info
(
TAG
+
"
RdbRemoteQueryPromiseTest0010 end
"
)
})
/**
* @tc.name RelationalStore remotequery test
* @tc.number SUB_DDM_RelationalStore_JS_RemoteQueryTest_Promise_0020
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录