Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
318371fa
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看板
提交
318371fa
编写于
6月 25, 2023
作者:
Y
yanglifeng1217
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<modified>
Signed-off-by:
N
yanglifeng1217
<
yanglifeng5@huawei.com
>
上级
cc464cf9
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
480 addition
and
493 deletion
+480
-493
distributeddatamgr/UDMFtest/UDMFtest/entry/src/main/ets/test/UDMF.test.ets
...r/UDMFtest/UDMFtest/entry/src/main/ets/test/UDMF.test.ets
+5
-0
distributeddatamgr/UDMFtest/UDMFtest/entry/src/main/ets/test/UDMFApiCallback.test.ets
...UDMFtest/entry/src/main/ets/test/UDMFApiCallback.test.ets
+211
-220
distributeddatamgr/UDMFtest/UDMFtest/entry/src/main/ets/test/UDMFApiPromise.test.ets
.../UDMFtest/entry/src/main/ets/test/UDMFApiPromise.test.ets
+264
-273
未找到文件。
distributeddatamgr/UDMFtest/UDMFtest/entry/src/main/ets/test/UDMF.test.ets
浏览文件 @
318371fa
...
...
@@ -132,6 +132,11 @@ export default function UDMFApiTest() {
applicationDefinedRecord.applicationDefinedType = 'applicationDefinedType';
applicationDefinedRecord.rawData = u8Array;
let summary = new UDMF.Summary;
let records1 = summary.summary;
console.info("ttt " + records1);
let records2 = summary.totalSize;
/**
* @tc.number SUB_DistributedData_Udmf_API001
* @tc.name CreateData
...
...
distributeddatamgr/UDMFtest/UDMFtest/entry/src/main/ets/test/UDMFApiCallback.test.ets
浏览文件 @
318371fa
...
...
@@ -24,7 +24,7 @@ export default function UDMFApiCallback() {
beforeEach(async function () {
console.info(TAG + "beforeEach")
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
await UDMF.deleteData(options).then((data) => {
let size = data.length;
...
...
@@ -53,15 +53,15 @@ export default function UDMFApiCallback() {
expect(err === undefined).assertFail();
done();
} else {
console.error(TAG, `Failed
to insertData0100
code is ${err.code},message is ${err.message} `);
expect(err
.code).assertEqual('401'
);
console.error(TAG, `Failed
,
code is ${err.code},message is ${err.message} `);
expect(err
!== null).assertFail(
);
done();
}
})
}
catch (error) {
console.error(TAG, `Failed
,
code is ${error.code},message is ${error.message} `);
expect(error
!== null).assertFail(
);
console.error(TAG, `Failed
to insertData0100
code is ${error.code},message is ${error.message} `);
expect(error
.code).assertEqual('401'
);
done();
}
})
...
...
@@ -85,15 +85,15 @@ export default function UDMFApiCallback() {
expect(err === undefined).assertFail();
done();
} else {
console.error(TAG, `Failed
to insertData0200
code is ${err.code},message is ${err.message} `);
expect(err
.code).assertEqual('401'
);
console.error(TAG, `Failed
,
code is ${err.code},message is ${err.message} `);
expect(err
!== null).assertFail(
);
done();
}
})
}
catch (error) {
console.error(TAG, `Failed
,
code is ${error.code},message is ${error.message} `);
expect(error
!== null).assertFail(
);
console.error(TAG, `Failed
to insertData0200
code is ${error.code},message is ${error.message} `);
expect(error
.code).assertEqual('401'
);
done();
}
})
...
...
@@ -117,15 +117,15 @@ export default function UDMFApiCallback() {
expect(err === undefined).assertFail();
done();
} else {
console.error(TAG, `Failed
to insertData0300
code is ${err.code},message is ${err.message} `);
expect(err
.code).assertEqual('401'
);
console.error(TAG, `Failed
,
code is ${err.code},message is ${err.message} `);
expect(err
!== null).assertFail(
);
done();
}
})
}
catch (error) {
console.error(TAG, `Failed
,
code is ${error.code},message is ${error.message} `);
expect(error
!== null).assertFail(
);
console.error(TAG, `Failed
to insertData0300
code is ${error.code},message is ${error.message} `);
expect(error
.code).assertEqual('401'
);
done();
}
})
...
...
@@ -150,15 +150,15 @@ export default function UDMFApiCallback() {
expect(err === undefined).assertFail();
done();
} else {
console.error(TAG, `Failed
to insertData0400
code is ${err.code},message is ${err.message} `);
expect(err
.code).assertEqual('401'
);
console.error(TAG, `Failed
,
code is ${err.code},message is ${err.message} `);
expect(err
!== null).assertFail(
);
done();
}
})
}
catch (error) {
console.error(TAG, `Failed
,
code is ${error.code},message is ${error.message} `);
expect(error
!== null).assertFail(
);
console.error(TAG, `Failed
to insertData0400
code is ${error.code},message is ${error.message} `);
expect(error
.code).assertEqual('401'
);
done();
}
})
...
...
@@ -182,15 +182,15 @@ export default function UDMFApiCallback() {
expect(err === undefined).assertFail();
done();
} else {
console.error(TAG, `Failed
to insertData0500
code is ${err.code},message is ${err.message} `);
expect(err
.code).assertEqual('401'
);
console.error(TAG, `Failed
,
code is ${err.code},message is ${err.message} `);
expect(err
!== null).assertFail(
);
done();
}
})
}
catch (error) {
console.error(TAG, `Failed
,
code is ${error.code},message is ${error.message} `);
expect(error
!== null).assertFail(
);
console.error(TAG, `Failed
to insertData0500
code is ${error.code},message is ${error.message} `);
expect(error
.code).assertEqual('401'
);
done();
}
})
...
...
@@ -202,7 +202,7 @@ export default function UDMFApiCallback() {
*/
it('SUB_DDM_UDMF_InsertData_Callback_0600', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
}
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -232,7 +232,7 @@ export default function UDMFApiCallback() {
*/
it('SUB_DDM_UDMF_UpdateData_Callback_0100', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
}
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -270,7 +270,7 @@ export default function UDMFApiCallback() {
*/
it('SUB_DDM_UDMF_UpdateData_Callback_0200', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
}
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -282,20 +282,26 @@ export default function UDMFApiCallback() {
return;
}
console.info(TAG + `insertData0200 success; data = ${data}, options = ${options}`);
try{
UDMF.updateData({key: undefined}, unifiedData, function (err, ret) {
if (err === undefined) {
console.info(TAG + `updateData success; data = ${ret}, options = ${options}`);
expect(err !== null).assertFail()
done();
} else {
console.
info(`UpdateData failed.
code is ${err.code},message is ${err.message} `);
expect(err
.code).assertEqual('401'
);
console.
error(TAG, `Failed,
code is ${err.code},message is ${err.message} `);
expect(err
!== null).assertFail(
);
done();
}
});
}catch(errInfo){
console.info(`UpdateData failed. code is ${errInfo.code},message is ${errInfo.message} `);
expect(errInfo.code).assertEqual('401');
done();
}
});
} catch (error) {
console.
error(TAG, `Failed,
code is ${error.code},message is ${error.message} `);
console.
info(`UpdateData1 failed.
code is ${error.code},message is ${error.message} `);
expect(error !== null).assertFail();
done();
}
...
...
@@ -308,7 +314,7 @@ export default function UDMFApiCallback() {
*/
it('SUB_DDM_UDMF_UpdateData_Callback_0300', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
}
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -320,6 +326,7 @@ export default function UDMFApiCallback() {
return;
}
console.info(TAG + `insertData0300 success; data = ${data}, options = ${options}`);
try{
UDMF.updateData({key: null}, unifiedData, function (err, ret) {
if (err === undefined) {
console.info(TAG + `updateData success; data = ${ret}, options = ${options}`);
...
...
@@ -327,10 +334,16 @@ export default function UDMFApiCallback() {
done();
} else {
console.info(`UpdateData failed. code is ${err.code},message is ${err.message} `);
expect(err
.code).assertEqual('401');
expect(err
!== null).assertFail()
done();
}
});
}catch(errInfo){
console.info(`UpdateData failed. code is ${errInfo.code},message is ${errInfo.message} `);
expect(errInfo.code).assertEqual('401');
done();
}
});
} catch (error) {
console.error(TAG, `Failed, code is ${error.code},message is ${error.message} `);
...
...
@@ -344,45 +357,10 @@ export default function UDMFApiCallback() {
* @tc.name UDMF insertData callback interface test
* @tc.desc UDMF insertData callback interface test.
*/
it('SUB_DDM_UDMF_UpdateData_Callback_0400', 0, function (done) {
let options = {
intention: undefined
}
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
let unifiedData = new UDMF.UnifiedData(plainText);
try {
UDMF.insertData(options, unifiedData, function (e, data) {
if (e !== undefined) {
console.info(TAG + `insertData0400 fail, code is ${e.code},message is ${e.message}`);
}
UDMF.updateData({key: data}, unifiedData, function (err, ret) {
if (err === undefined) {
console.info(TAG + `updateData success; data = ${ret}, options = ${options}`);
expect(err !== null).assertFail()
done();
} else {
console.info(`UpdateData failed. code is ${err.code},message is ${err.message} `);
expect(err.code).assertEqual('401');
done();
}
});
});
} catch (error) {
console.error(TAG, `Failed, code is ${error.code},message is ${error.message} `);
expect(error !== null).assertFail();
done();
}
})
/**
* @tc.number SUB_DDM_UDMF_UpdateData_Callback_0500
* @tc.name UDMF updateData callback interface test
* @tc.desc UDMF updateData callback interface test.
*/
it('SUB_DDM_UDMF_UpdateData_Callback_0500', 0, function (done) {
it('SUB_DDM_UDMF_UpdateData_Callback_0400', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB,
intention: UDMF.Intention.
DATA
_HUB,
key: undefined
}
let plainText = new UDMF.PlainText();
...
...
@@ -421,7 +399,7 @@ export default function UDMFApiCallback() {
*/
it('SUB_DDM_UDMF_QueryData_Callback_0100', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -470,7 +448,7 @@ export default function UDMFApiCallback() {
*/
it('SUB_DDM_UDMF_QueryData_Callback_0200', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -519,7 +497,7 @@ export default function UDMFApiCallback() {
*/
it('SUB_DDM_UDMF_QueryData_Callback_0300', 0, function (done) {
let options1 = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -532,7 +510,7 @@ export default function UDMFApiCallback() {
}
console.info(TAG + `insertData0100 success; data = ${data}, options = ${options1}`);
let options2 = {
intention: UDMF.Intention.SUPER
_HUB,
intention: UDMF.Intention.DATA
_HUB,
key: data
};
UDMF.queryData(options2, function (err, ret) {
...
...
@@ -572,7 +550,7 @@ export default function UDMFApiCallback() {
*/
it('SUB_DDM_UDMF_QueryData_Callback_0400', 0, function (done) {
let options1 = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -585,9 +563,10 @@ export default function UDMFApiCallback() {
}
console.info(TAG + `insertData0400 success; data = ${data}, options = ${options1}`);
let options2 = {
intention: UDMF.Intention.
SUPER
_HUB,
intention: UDMF.Intention.
DATA
_HUB,
key: 'data'
};
try{
UDMF.queryData(options2, function (err, ret) {
if (err === undefined) {
let size = ret.length;
...
...
@@ -605,11 +584,16 @@ export default function UDMFApiCallback() {
expect(err === undefined).assertFail();
done();
} else {
console.info(`Failed to queryData.
code is ${err.code},message is ${err.message} `);
expect(err.code).assertEqual('401'
);
console.info(`Failed to queryData
code is ${err.code},message is ${err.message} `);
expect(err.code === 401).assertFail(
);
done();
}
});
}catch(errorInfo){
console.info(`Failed to queryData. code is ${errorInfo.code},message is ${errorInfo.message} `);
expect(errorInfo.code).assertEqual('401');
done();
}
});
} catch (error) {
console.error(TAG, `Failed, code is ${error.code},message is ${error.message} `);
...
...
@@ -625,7 +609,7 @@ export default function UDMFApiCallback() {
*/
it('SUB_DDM_UDMF_QueryData_Callback_0500', 0, function (done) {
let options1 = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -638,7 +622,7 @@ export default function UDMFApiCallback() {
}
console.info(TAG + `insertData0500 success; data = ${data}, options = ${options1}`);
let options2 = {
intention: UDMF.Intention.
SUPER
_HUB,
intention: UDMF.Intention.
DATA
_HUB,
key: undefined
};
UDMF.queryData(options2, function (err, ret) {
...
...
@@ -678,7 +662,7 @@ export default function UDMFApiCallback() {
*/
it('SUB_DDM_UDMF_DeleteData_Callback_0100', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -734,7 +718,7 @@ export default function UDMFApiCallback() {
*/
it('SUB_DDM_UDMF_DeleteData_Callback_0200', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -790,7 +774,7 @@ export default function UDMFApiCallback() {
*/
it('SUB_DDM_UDMF_DeleteData_Callback_0300', 0, function (done) {
let options1 = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -809,7 +793,7 @@ export default function UDMFApiCallback() {
}
console.info(TAG, ` queryData size = ${ret.length}`);
let options2 = {
intention: UDMF.Intention.
SUPER
_HUB,
intention: UDMF.Intention.
DATA
_HUB,
key: data
};
UDMF.deleteData(options2, function (err, row) {
...
...
@@ -850,7 +834,7 @@ export default function UDMFApiCallback() {
*/
it('SUB_DDM_UDMF_DeleteData_Callback_0400', 0, function (done) {
let options1 = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -869,9 +853,10 @@ export default function UDMFApiCallback() {
}
console.info(TAG, ` queryData size = ${ret.length}`);
let options2 = {
intention: UDMF.Intention.
SUPER
_HUB,
intention: UDMF.Intention.
DATA
_HUB,
key: 'data'
};
try{
UDMF.deleteData(options2, function (err, row) {
if (err == undefined) {
let size = row.length;
...
...
@@ -890,10 +875,16 @@ export default function UDMFApiCallback() {
done();
} else {
console.info(`Failed to deleteData. code is ${err.code},message is ${err.message} `);
expect(err.code).assertEqual('401'
);
expect(err.code === 401).assertFail(
);
done();
}
});
}catch(error){
console.info(`Failed to deleteData. code is ${error.code},message is ${error.message} `);
expect(error.code).assertEqual('401');
done();
}
});
});
} catch (error) {
...
...
@@ -910,7 +901,7 @@ export default function UDMFApiCallback() {
*/
it('SUB_DDM_UDMF_DeleteData_Callback_0300', 0, function (done) {
let options1 = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -929,7 +920,7 @@ export default function UDMFApiCallback() {
}
console.info(TAG, ` queryData size = ${ret.length}`);
let options2 = {
intention: UDMF.Intention.
SUPER
_HUB,
intention: UDMF.Intention.
DATA
_HUB,
key: undefined
};
UDMF.deleteData(options2, function (err, row) {
...
...
distributeddatamgr/UDMFtest/UDMFtest/entry/src/main/ets/test/UDMFApiPromise.test.ets
浏览文件 @
318371fa
...
...
@@ -24,7 +24,7 @@ export default function UDMFApiPromise() {
beforeEach(async function () {
console.info(TAG + "beforeEach")
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
await UDMF.deleteData(options).then((data) => {
let size = data.length;
...
...
@@ -52,14 +52,14 @@ export default function UDMFApiPromise() {
expect().assertFail();
done();
}).catch((err) => {
console.error(TAG, `Failed to insertData0100
code is ${err.code},message is ${err.message} `);
expect(err.code).assertEqual('401'
);
console.error(TAG, `Failed,
code is ${err.code},message is ${err.message} `);
expect(err !== null).assertFail(
);
done();
})
}
catch (error) {
console.error(TAG, `Failed
,
code is ${error.code},message is ${error.message} `);
expect(error
!== null).assertFail(
);
console.error(TAG, `Failed
to insertData0100
code is ${error.code},message is ${error.message} `);
expect(error
.code).assertEqual('401'
);
done();
}
})
...
...
@@ -82,14 +82,14 @@ export default function UDMFApiPromise() {
expect().assertFail();
done();
}).catch((err) => {
console.error(TAG, `Failed to insertData0200
code is ${err.code},message is ${err.message} `);
expect(err.code).assertEqual('401'
);
console.error(TAG, `Failed,
code is ${err.code},message is ${err.message} `);
expect(err !== null).assertFail(
);
done();
})
}
catch (error) {
console.error(TAG, `Failed
,
code is ${error.code},message is ${error.message} `);
expect(error
!== null).assertFail(
);
console.error(TAG, `Failed
to insertData0200
code is ${error.code},message is ${error.message} `);
expect(error
.code).assertEqual('401'
);
done();
}
})
...
...
@@ -112,14 +112,14 @@ export default function UDMFApiPromise() {
expect().assertFail();
done();
}).catch((err) => {
console.error(TAG, `Failed to insertData0300
code is ${err.code},message is ${err.message} `);
expect(err.code).assertEqual('401'
);
console.error(TAG, `Failed,
code is ${err.code},message is ${err.message} `);
expect(err !== null).assertFail(
);
done();
})
}
catch (error) {
console.error(TAG, `Failed
,
code is ${error.code},message is ${error.message} `);
expect(error
!== null).assertFail(
);
console.error(TAG, `Failed
to insertData0300
code is ${error.code},message is ${error.message} `);
expect(error
.code).assertEqual('401'
);
done();
}
})
...
...
@@ -143,14 +143,14 @@ export default function UDMFApiPromise() {
expect().assertFail();
done();
}).catch((err) => {
console.error(TAG, `Failed to insertData0400
code is ${err.code},message is ${err.message} `);
expect(err.code).assertEqual('401'
);
console.error(TAG, `Failed,
code is ${err.code},message is ${err.message} `);
expect(err !== null).assertFail(
);
done();
})
}
catch (error) {
console.error(TAG, `Failed
,
code is ${error.code},message is ${error.message} `);
expect(error
!== null).assertFail(
);
console.error(TAG, `Failed
to insertData0400
code is ${error.code},message is ${error.message} `);
expect(error
.code).assertEqual('401'
);
done();
}
})
...
...
@@ -173,14 +173,14 @@ export default function UDMFApiPromise() {
expect().assertFail();
done();
}).catch((err) => {
console.error(TAG, `Failed to insertData0500
code is ${err.code},message is ${err.message} `);
expect(err.code).assertEqual('401'
);
console.error(TAG, `Failed,
code is ${err.code},message is ${err.message} `);
expect(err !== null).assertFail(
);
done();
})
}
catch (error) {
console.error(TAG, `Failed
,
code is ${error.code},message is ${error.message} `);
expect(error
!== null).assertFail(
);
console.error(TAG, `Failed
to insertData0500
code is ${error.code},message is ${error.message} `);
expect(error
.code).assertEqual('401'
);
done();
}
})
...
...
@@ -192,7 +192,7 @@ export default function UDMFApiPromise() {
*/
it('SUB_DDM_UDMF_InsertData_Promise_0600', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
}
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -220,7 +220,7 @@ export default function UDMFApiPromise() {
*/
it('SUB_DDM_UDMF_UpdateData_Promise_0100', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
}
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -257,7 +257,7 @@ export default function UDMFApiPromise() {
*/
it('SUB_DDM_UDMF_UpdateData_Promise_0200', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
}
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -269,15 +269,21 @@ export default function UDMFApiPromise() {
return;
}
console.info(TAG + `insertData0200 success; data = ${data}, options = ${options}`);
try{
UDMF.updateData({key: undefined}, unifiedData).then((ret) => {
console.info(TAG + `updateData success; data = ${ret}, options = ${options}`);
expect().assertFail()
done();
}).catch((err) => {
console.info(`UpdateData failed. code is ${err.code},message is ${err.message} `);
expect(err
.code).assertEqual('401'
);
console.info(`UpdateData
1111
failed. code is ${err.code},message is ${err.message} `);
expect(err
!== null).assertFail(
);
done();
});
}catch(errInfo){
console.info(`UpdateData2222 failed. code is ${errInfo.code},message is ${errInfo.message} `);
expect(errInfo.code).assertEqual('401');
done();
}
});
} catch (error) {
console.error(TAG, `Failed, code is ${error.code},message is ${error.message} `);
...
...
@@ -293,7 +299,7 @@ export default function UDMFApiPromise() {
*/
it('SUB_DDM_UDMF_UpdateData_Promise_0300', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
}
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -305,15 +311,22 @@ export default function UDMFApiPromise() {
return;
}
console.info(TAG + `insertData0300 success; data = ${data}, options = ${options}`);
try{
UDMF.updateData({key: null}, unifiedData).then((ret) => {
console.info(TAG + `updateData success; data = ${ret}, options = ${options}`);
expect().assertFail()
done();
}).catch((err) => {
console.info(`UpdateData failed. code is ${err.code},message is ${err.message} `);
expect(err
.code).assertEqual('401'
);
expect(err
!== null).assertFail(
);
done();
});
}catch(errInfo){
console.info(`UpdateData failed. code is ${errInfo.code},message is ${errInfo.message} `);
expect(errInfo.code).assertEqual('401');
done();
}
});
} catch (error) {
console.error(TAG, `Failed, code is ${error.code},message is ${error.message} `);
...
...
@@ -327,43 +340,10 @@ export default function UDMFApiPromise() {
* @tc.name UDMF insertData promise interface test
* @tc.desc UDMF insertData promise interface test.
*/
it('SUB_DDM_UDMF_UpdateData_Promise_0400', 0, function (done) {
let options = {
intention: undefined
}
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
let unifiedData = new UDMF.UnifiedData(plainText);
try {
UDMF.insertData(options, unifiedData, function (e, data) {
if (e !== undefined) {
console.info(TAG + `insertData0400 fail, code is ${e.code},message is ${e.message}`);
}
UDMF.updateData({key: data}, unifiedData).then((ret) => {
console.info(TAG + `updateData success; data = ${ret}, options = ${options}`);
expect().assertFail()
done();
}).catch((err) => {
console.info(`UpdateData failed. code is ${err.code},message is ${err.message} `);
expect(err.code).assertEqual('401');
done();
});
});
} catch (error) {
console.error(TAG, `Failed, code is ${error.code},message is ${error.message} `);
expect(error !== null).assertFail();
done();
}
})
/**
* @tc.number SUB_DDM_UDMF_UpdateData_Promise_0500
* @tc.name UDMF updateData promise interface test
* @tc.desc UDMF updateData promise interface test.
*/
it('SUB_DDM_UDMF_UpdateData_Promise_0500', 0, function (done) {
it('SUB_DDM_UDMF_UpdateData_Promise_0400', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB,
intention: UDMF.Intention.
DATA
_HUB,
key: undefined
}
let plainText = new UDMF.PlainText();
...
...
@@ -385,7 +365,6 @@ export default function UDMFApiPromise() {
expect(err !== null).assertFail();
done();
});
});
}catch(error){
console.error(TAG, `Failed, code is ${error.code},message is ${error.message} `);
...
...
@@ -401,7 +380,7 @@ export default function UDMFApiPromise() {
*/
it('SUB_DDM_UDMF_QueryData_Promise_0100', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -448,7 +427,7 @@ export default function UDMFApiPromise() {
*/
it('SUB_DDM_UDMF_QueryData_Promise_0200', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -495,7 +474,7 @@ export default function UDMFApiPromise() {
*/
it('SUB_DDM_UDMF_QueryData_Promise_0300', 0, function (done) {
let options1 = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -508,7 +487,7 @@ export default function UDMFApiPromise() {
}
console.info(TAG + `insertData0100 success; data = ${data}, options = ${options1}`);
let options2 = {
intention: UDMF.Intention.
SUPER
_HUB,
intention: UDMF.Intention.
DATA
_HUB,
key: data
};
UDMF.queryData(options2).then((ret) => {
...
...
@@ -546,7 +525,7 @@ export default function UDMFApiPromise() {
*/
it('SUB_DDM_UDMF_QueryData_Promise_0400', 0, function (done) {
let options1 = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -559,9 +538,10 @@ export default function UDMFApiPromise() {
}
console.info(TAG + `insertData0400 success; data = ${data}, options = ${options1}`);
let options2 = {
intention: UDMF.Intention.
SUPER
_HUB,
intention: UDMF.Intention.
DATA
_HUB,
key: 'data'
};
try{
UDMF.queryData(options2).then((ret) => {
let size = ret.length;
console.info(TAG, ` data.size = ${size}`);
...
...
@@ -578,10 +558,15 @@ export default function UDMFApiPromise() {
expect().assertFail();
done();
}).catch((err) => {
console.info(`Failed
to queryData
. code is ${err.code},message is ${err.message} `);
expect(err
.code).assertEqual('401'
);
console.info(`Failed. code is ${err.code},message is ${err.message} `);
expect(err
!== null).assertFail(
);
done();
});
}catch(errInfo){
console.info(`Failed to queryData. code is ${errInfo.code},message is ${errInfo.message} `);
expect(errInfo.code).assertEqual('401');
done();
}
});
} catch (error) {
console.error(TAG, `Failed, code is ${error.code},message is ${error.message} `);
...
...
@@ -597,7 +582,7 @@ export default function UDMFApiPromise() {
*/
it('SUB_DDM_UDMF_QueryData_Promise_0500', 0, function (done) {
let options1 = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -610,7 +595,7 @@ export default function UDMFApiPromise() {
}
console.info(TAG + `insertData0500 success; data = ${data}, options = ${options1}`);
let options2 = {
intention: UDMF.Intention.
SUPER
_HUB,
intention: UDMF.Intention.
DATA
_HUB,
key: undefined
};
UDMF.queryData(options2).then((ret) => {
...
...
@@ -648,7 +633,7 @@ export default function UDMFApiPromise() {
*/
it('SUB_DDM_UDMF_DeleteData_Promise_0100', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -702,7 +687,7 @@ export default function UDMFApiPromise() {
*/
it('SUB_DDM_UDMF_DeleteData_Promise_0200', 0, function (done) {
let options = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -756,7 +741,7 @@ export default function UDMFApiPromise() {
*/
it('SUB_DDM_UDMF_DeleteData_Promise_0300', 0, function (done) {
let options1 = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -775,7 +760,7 @@ export default function UDMFApiPromise() {
}
console.info(TAG, ` queryData size = ${ret.length}`);
let options2 = {
intention: UDMF.Intention.
SUPER
_HUB,
intention: UDMF.Intention.
DATA
_HUB,
key: data
};
UDMF.deleteData(options2).then((row) => {
...
...
@@ -814,7 +799,7 @@ export default function UDMFApiPromise() {
*/
it('SUB_DDM_UDMF_DeleteData_Promise_0400', 0, function (done) {
let options1 = {
intention: UDMF.Intention.SUPER
_HUB
intention: UDMF.Intention.DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -833,9 +818,10 @@ export default function UDMFApiPromise() {
}
console.info(TAG, ` queryData size = ${ret.length}`);
let options2 = {
intention: UDMF.Intention.SUPER
_HUB,
intention: UDMF.Intention.DATA
_HUB,
key: 'data'
};
try{
UDMF.deleteData(options2).then((row) => {
let size = row.length;
console.info(TAG, ` deleteData size = ${size}`);
...
...
@@ -853,9 +839,14 @@ export default function UDMFApiPromise() {
done();
}).catch((err) => {
console.info(`Failed to deleteData. code is ${err.code},message is ${err.message} `);
expect(err.code).assertEqual('401'
);
expect(err !== null).assertFail(
);
done();
});
}catch(errInfo){
console.info(`Failed to deleteData. code is ${errInfo.code},message is ${errInfo.message} `);
expect(errInfo.code).assertEqual('401');
done();
}
});
});
} catch (error) {
...
...
@@ -872,7 +863,7 @@ export default function UDMFApiPromise() {
*/
it('SUB_DDM_UDMF_DeleteData_Promise_0500', 0, function (done) {
let options1 = {
intention: UDMF.Intention.
SUPER
_HUB
intention: UDMF.Intention.
DATA
_HUB
};
let plainText = new UDMF.PlainText();
plainText.textContent = "hello world!";
...
...
@@ -891,7 +882,7 @@ export default function UDMFApiPromise() {
}
console.info(TAG, ` queryData size = ${ret.length}`);
let options2 = {
intention: UDMF.Intention.
SUPER
_HUB,
intention: UDMF.Intention.
DATA
_HUB,
key: undefined
};
UDMF.deleteData(options2).then((row) => {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录