未验证 提交 2f68ffc3 编写于 作者: O openharmony_ci 提交者: Gitee

!9525 【distributeddatamgr】【master】rdb Statistic.success 修改为Statistic.successful

Merge pull request !9525 from wuxiaodan/master
...@@ -245,9 +245,9 @@ export default function relationalStoreCloudSyncEtsTest(context) { ...@@ -245,9 +245,9 @@ export default function relationalStoreCloudSyncEtsTest(context) {
it('testRdbStoreStatistic0010', 0, async function (done) { it('testRdbStoreStatistic0010', 0, async function (done) {
console.log(TAG + "************* testRdbStoreStatistic0010 start *************"); console.log(TAG + "************* testRdbStoreStatistic0010 start *************");
try { try {
let statistic1 : relationalStore.Statistic = {"total":10, "success":6, "failed":3, "remained":1}; let statistic1 : relationalStore.Statistic = {"total":10, "successful":6, "failed":3, "remained":1};
expect(statistic1.total == 10 ).assertTrue(); expect(statistic1.total == 10 ).assertTrue();
expect(statistic1.success == 6 ).assertTrue(); expect(statistic1.successful == 6 ).assertTrue();
expect(statistic1.failed == 3 ).assertTrue(); expect(statistic1.failed == 3 ).assertTrue();
expect(statistic1.remained == 1 ).assertTrue(); expect(statistic1.remained == 1 ).assertTrue();
done(); done();
...@@ -267,8 +267,8 @@ export default function relationalStoreCloudSyncEtsTest(context) { ...@@ -267,8 +267,8 @@ export default function relationalStoreCloudSyncEtsTest(context) {
it('testRdbStoreTableDetails0010', 0, async function (done) { it('testRdbStoreTableDetails0010', 0, async function (done) {
console.log(TAG + "************* testRdbStoreTableDetails0010 start *************"); console.log(TAG + "************* testRdbStoreTableDetails0010 start *************");
try { try {
let statistic1 : relationalStore.Statistic = {"total":10, "success":6, "failed":3, "remained":1}; let statistic1 : relationalStore.Statistic = {"total":10, "successful":6, "failed":3, "remained":1};
let statistic2 : relationalStore.Statistic = {"total":100, "success":60, "failed":30, "remained":10}; let statistic2 : relationalStore.Statistic = {"total":100, "successful":60, "failed":30, "remained":10};
let tableDetail : relationalStore.TableDetails = {"upload": statistic1, "download": statistic2}; let tableDetail : relationalStore.TableDetails = {"upload": statistic1, "download": statistic2};
expect(tableDetail.upload == statistic1 ).assertTrue(); expect(tableDetail.upload == statistic1 ).assertTrue();
...@@ -315,8 +315,8 @@ export default function relationalStoreCloudSyncEtsTest(context) { ...@@ -315,8 +315,8 @@ export default function relationalStoreCloudSyncEtsTest(context) {
it('testRdbStoreProgressDetails0010', 0, async function (done) { it('testRdbStoreProgressDetails0010', 0, async function (done) {
console.log(TAG + "************* testRdbStoreProgressDetails0010 start *************"); console.log(TAG + "************* testRdbStoreProgressDetails0010 start *************");
try { try {
let statistic1 : relationalStore.Statistic = {"total":10, "success":6, "failed":3, "remained":1}; let statistic1 : relationalStore.Statistic = {"total":10, "successful":6, "failed":3, "remained":1};
let statistic2 : relationalStore.Statistic = {"total":100, "success":60, "failed":30, "remained":10}; let statistic2 : relationalStore.Statistic = {"total":100, "successful":60, "failed":30, "remained":10};
let tableDetail : relationalStore.TableDetails = {"upload": statistic1, "download": statistic2}; let tableDetail : relationalStore.TableDetails = {"upload": statistic1, "download": statistic2};
let tableName = "cloud_text"; let tableName = "cloud_text";
let progressDetail : relationalStore.ProgressDetails = {"schedule":2,"code":0,"details":{ [tableName]:tableDetail}}; let progressDetail : relationalStore.ProgressDetails = {"schedule":2,"code":0,"details":{ [tableName]:tableDetail}};
......
...@@ -73,13 +73,15 @@ export default function relationalStoreEmitTest() { ...@@ -73,13 +73,15 @@ export default function relationalStoreEmitTest() {
} }
try { try {
await rdbStore.on('storeObserverInsert', false, subscribeInsert); rdbStore.on('storeObserverInsert', false, subscribeInsert);
await rdbStore.emit('storeObserverInsert'); rdbStore.emit('storeObserverInsert');
await sleep(2000); await sleep(2000);
let resultSet = await rdbStore.querySql("SELECT * FROM test"); let resultSet = await rdbStore.querySql("SELECT * FROM test");
console.info(TAG + "resultSet = " + resultSet.rowCount); console.info(TAG + "resultSet = " + resultSet.rowCount);
expect(1).assertEqual(resultSet.rowCount); expect(1).assertEqual(resultSet.rowCount);
rdbStore.off('storeObserverInsert', false, subscribeInsert);
resultSet.close();
resultSet = null;
done(); done();
} catch (err) { } catch (err) {
console.error(`failed, code is ${err.code},message is ${err.message}`); console.error(`failed, code is ${err.code},message is ${err.message}`);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册