diff --git a/distributeddatamgr/BUILD.gn b/distributeddatamgr/BUILD.gn index 076d6369f267ea23abf563534f452a5b24a8123e..13262e64259d525ae46649ec45f21e60517c8c17 100644 --- a/distributeddatamgr/BUILD.gn +++ b/distributeddatamgr/BUILD.gn @@ -19,6 +19,7 @@ group("distributeddatamgr") { "appdatamgrjstest/hap:appdatamgr_js_test", "distributeddataObjectjstest/hap:distributeddataObject_js_test", "distributeddatamgrjstest/hap:distributeddatamgr_js_test", + "windowStage:windowStage", ] } else { deps = [ diff --git a/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataShareCombinationRdb.ets b/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataShareCombinationRdb.ets index 93ddbbe319d7325acc6bb3881ef35f0c5c94a98e..3679c6f36e7ffb1e7881eb5f431a5d23b703a9ee 100644 --- a/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataShareCombinationRdb.ets +++ b/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataShareCombinationRdb.ets @@ -1,17 +1,17 @@ /* - * Copyright (C) 2022 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. - */ +* Copyright (c) 2022 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 'hypium/index' import dataShare from '@ohos.data.dataShare' @@ -214,8 +214,8 @@ export default function DataShareCombinationRdb() { expect(err).assertFail(); } }) - - /* + + /* * @tc.number : SUB_DDM_DataShare_ETS_DataShareCombinationRdb005 * @tc.name : Use getEntries get the value by mixing the string key * @tc.desc : Off off @@ -237,7 +237,6 @@ export default function DataShareCombinationRdb() { } }) - /* * @tc.number : SUB_DDM_DataShare_ETS_DataShareCombinationRdb0106 * @tc.name : Use getEntries get the value by mixing the string key diff --git a/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataSharePredicatesRdb.ets b/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataSharePredicatesRdb.ets index 61396e9ea91b27e007fb1198cd084696f58328e3..9e363a4e127aef53771928ba0c6333d55b6c7767 100644 --- a/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataSharePredicatesRdb.ets +++ b/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataSharePredicatesRdb.ets @@ -1,17 +1,17 @@ /* - * Copyright (C) 2022 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. - */ +* Copyright (c) 2022 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 'hypium/index' import dataShare from '@ohos.data.dataShare' @@ -79,7 +79,7 @@ Between.between("age", 18, 19) let NotBetween = new dataSharePredicates.DataSharePredicates(); NotBetween.notBetween("age", 19, 20); let Distinct = new dataSharePredicates.DataSharePredicates(); -Distinct.equalTo("age", 18).distinct("age"); +Distinct.equalTo("age", 18).distinct(); let GroupBy = new dataSharePredicates.DataSharePredicates(); GroupBy.groupBy(["name"]); let IndexedBy = new dataSharePredicates.DataSharePredicates(); @@ -1035,8 +1035,8 @@ export default function DataSharePredicatesRdb() { done(); } }) - - /* + + /* * @tc.number : SUB_DDM_DataShare_ETS_DataSharePredicatesRdb0124 * @tc.name : Use getEntries get the value by mixing the string key * @tc.desc : DataShare Supports Predicates @@ -1079,7 +1079,7 @@ export default function DataSharePredicatesRdb() { try { await pubfun.publicinsert(globalThis.helper, uri, Insert).then((data) => { console.info("TestDataShare going batchInsert = " + data); - IndexedBy.indexedBy(data); + IndexedBy.indexedBy(globalThis.insertdata); }) await pubfun.publicquery(globalThis.helper, uri, IndexedBy, ["*"]).then((data) => { console.info("TestDataShare going query = " + data); diff --git a/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataSharePublicfunction_Callback.ets b/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataSharePublicfunction_Callback.ets index ff4ee98593fc5da7509d35826181877e3e1e8ea9..d423eac42cd7a53dd238054a24720d6a7af8aeb0 100644 --- a/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataSharePublicfunction_Callback.ets +++ b/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataSharePublicfunction_Callback.ets @@ -1,20 +1,19 @@ /* - * Copyright (C) 2022 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 file from '@system.file'; +* Copyright (c) 2022 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 file from '@system.file'; import { describe, it, expect } from 'hypium/index' import dataShare from '@ohos.data.dataShare' import dataSharePredicates from '@ohos.data.dataSharePredicates' @@ -24,7 +23,8 @@ import DataShareResultSet from '@ohos.data.DataShareResultSet' function publicinsert(helper, uri, DataShareValuesBucket) { return new Promise(function (resolve, reject) { helper.insert(uri, DataShareValuesBucket, (err, data) => { - console.info("TestDataShare publicinsert Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicinsert Callback=" + JSON.stringify(data)); + globalThis.insertdata = data; if (err) { console.info("test insert err information: " + JSON.stringify(err)); reject(err); @@ -55,7 +55,7 @@ async function publicdelete(helper, uri, DataSharePredicates) { function publicquery(helper, uri, DataSharePredicates, columns) { return new Promise(function (resolve, reject) { helper.query(uri, DataSharePredicates, columns, (err, data) => { - console.info("TestDataShare publicquery Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicquery Callback=" + JSON.stringify(data)); globalThis.ResultSet = data; if (err) { console.info("test query err information: " + JSON.stringify(err)); @@ -71,7 +71,7 @@ function publicquery(helper, uri, DataSharePredicates, columns) { function publicupdate(helper, uri, DataSharePredicates, DataShareValuesBucket) { return new Promise(function (resolve, reject) { helper.update(uri, DataSharePredicates, DataShareValuesBucket, (err, data) => { - console.info("TestDataShare publicupdate Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicupdate Callback=" + JSON.stringify(data)); if (err) { console.info("test update err information: " + JSON.stringify(err)); reject(err); @@ -86,7 +86,7 @@ function publicupdate(helper, uri, DataSharePredicates, DataShareValuesBucket) { function publicbatchInsert(helper, uri, DataShareValuesBucket) { return new Promise(function (resolve, reject) { helper.batchInsert(uri, DataShareValuesBucket, (err, data) => { - console.info("TestDataShare publicbatchInsert Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicbatchInsert Callback=" + JSON.stringify(data)); if (err) { console.info("test batchInsert err information: " + JSON.stringify(err)); reject(err); @@ -101,7 +101,7 @@ function publicbatchInsert(helper, uri, DataShareValuesBucket) { function publicgetType(helper, uri) { return new Promise(function (resolve, reject) { helper.getType(uri, (err, data) => { - console.info("TestDataShare publicgetType Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicgetType Callback=" + JSON.stringify(data)); if (err) { console.info("test getType err information: " + JSON.stringify(err)); reject(err); @@ -116,7 +116,7 @@ function publicgetType(helper, uri) { function publicgetFileTypes(helper, uri, mimeTypeFilter) { return new Promise(function (resolve, reject) { helper.getFileTypes(uri, mimeTypeFilter, (err, data) => { - console.info("TestDataShare publicgetFileTypes Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicgetFileTypes Callback=" + JSON.stringify(data)); if (err) { console.info("test getFileTypes err information: " + JSON.stringify(err)); reject(err); @@ -131,7 +131,7 @@ function publicgetFileTypes(helper, uri, mimeTypeFilter) { function publicnormalizeUri(helper, uri) { return new Promise(function (resolve, reject) { helper.normalizeUri(uri, (err, data) => { - console.info("TestDataShare publicnormalizeUri Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicnormalizeUri Callback=" + JSON.stringify(data)); if (err) { console.info("test normalizeUri err information: " + JSON.stringify(err)); reject(err); @@ -146,7 +146,7 @@ function publicnormalizeUri(helper, uri) { function publicdenormalizeUri(helper, uri) { return new Promise(function (resolve, reject) { helper.denormalizeUri(uri, (err, data) => { - console.info("TestDataShare publicdenormalizeUri Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicdenormalizeUri Callback=" + JSON.stringify(data)); if (err) { console.info("test denormalizeUri err information: " + JSON.stringify(err)); reject(err); @@ -161,7 +161,7 @@ function publicdenormalizeUri(helper, uri) { function publicopenFile(helper, uri, mode) { return new Promise(function (resolve, reject) { helper.denormalizeUri(uri, mode, (err, data) => { - console.info("TestDataShare publicopenFile Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicopenFile Callback=" + JSON.stringify(data)); if (err) { console.info("test openFile err information: " + JSON.stringify(err)); reject(err); diff --git a/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataSharePublicfunction_Promise.ets b/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataSharePublicfunction_Promise.ets index 0cba17215286696b67508033f047a0509ffc5e85..a5f6785c2ab68db883121cd095a49409dc66b377 100644 --- a/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataSharePublicfunction_Promise.ets +++ b/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataSharePublicfunction_Promise.ets @@ -1,18 +1,19 @@ /* - * Copyright (C) 2022 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. - */ +* Copyright (c) 2022 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 file from '@system.file'; import { describe, it, expect } from 'hypium/index' import dataShare from '@ohos.data.dataShare' import dataSharePredicates from '@ohos.data.dataSharePredicates' @@ -22,7 +23,8 @@ import DataShareResultSet from '@ohos.data.DataShareResultSet' function publicinsert(helper, uri, DataShareValuesBucket) { return new Promise(function (resolve, reject) { helper.insert(uri, DataShareValuesBucket).then((data) => { - console.info("TestDataShare publicinsert Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicinsert Callback=" + JSON.stringify(data)); + globalThis.insertdata = data; resolve(data); }).catch((err) => { console.info("test insert err information: " + JSON.stringify(err)); @@ -35,7 +37,7 @@ function publicinsert(helper, uri, DataShareValuesBucket) { function publicdelete(helper, uri, DataSharePredicates) { return new Promise(function (resolve, reject) { helper.delete(uri, DataSharePredicates).then((data) => { - console.info("TestDataShare publicdelete Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicdelete Callback=" + JSON.stringify(data)); resolve(data); }).catch((err) => { console.info("test delete err information: " + JSON.stringify(err)); @@ -48,7 +50,7 @@ function publicdelete(helper, uri, DataSharePredicates) { function publicquery(helper, uri, columns, DataSharePredicates) { return new Promise(function (resolve, reject) { helper.query(uri, columns, DataSharePredicates).then((data) => { - console.info("TestDataShare publicquery Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicquery Callback=" + JSON.stringify(data)); globalThis.ResultSet = data; resolve(data); }).catch((err) => { @@ -62,7 +64,7 @@ function publicquery(helper, uri, columns, DataSharePredicates) { function publicupdate(helper, uri, DataShareValuesBucket, DataSharePredicates) { return new Promise(function (resolve, reject) { helper.update(uri, DataShareValuesBucket, DataSharePredicates).then((data) => { - console.info("TestDataShare publicupdate Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicupdate Callback=" + JSON.stringify(data)); resolve(data); }).catch((err) => { console.info("test update err information: " + JSON.stringify(err)); @@ -75,7 +77,7 @@ function publicupdate(helper, uri, DataShareValuesBucket, DataSharePredicates) { function publicbatchInsert(helper, uri, DataShareValuesBucket) { return new Promise(function (resolve, reject) { helper.batchInsert(uri, DataShareValuesBucket).then((data) => { - console.info("TestDataShare publicbatchInsert Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicbatchInsert Callback=" + JSON.stringify(data)); resolve(data); }).catch((err) => { console.info("test batchInsert err information: " + JSON.stringify(err)); @@ -88,7 +90,7 @@ function publicbatchInsert(helper, uri, DataShareValuesBucket) { function publicgetType(helper, uri) { return new Promise(function (resolve, reject) { helper.getType(uri).then((data) => { - console.info("TestDataShare publicgetType Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicgetType Callback=" + JSON.stringify(data)); resolve(data); }).catch((err) => { console.info("test getType err information: " + JSON.stringify(err)); @@ -101,7 +103,7 @@ function publicgetType(helper, uri) { function publicgetFileTypes(helper, uri, mimeTypeFilter) { return new Promise(function (resolve, reject) { helper.getFileTypes(uri, mimeTypeFilter).then((data) => { - console.info("TestDataShare publicgetFileTypes Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicgetFileTypes Callback=" + JSON.stringify(data)); resolve(data); }).catch((err) => { console.info("test getFileTypes err information: " + JSON.stringify(err)); @@ -114,7 +116,7 @@ function publicgetFileTypes(helper, uri, mimeTypeFilter) { function publicnormalizeUri(helper, uri) { return new Promise(function (resolve, reject) { helper.normalizeUri(uri).then((data) => { - console.info("TestDataShare publicnormalizeUri Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicnormalizeUri Callback=" + JSON.stringify(data)); resolve(data); }).catch((err) => { console.info("test normalizeUri err information: " + JSON.stringify(err)); @@ -127,7 +129,7 @@ function publicnormalizeUri(helper, uri) { function publicdenormalizeUri(helper, uri) { return new Promise(function (resolve, reject) { helper.denormalizeUri(uri).then((data) => { - console.info("TestDataShare publicdenormalizeUri Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicdenormalizeUri Callback=" + JSON.stringify(data)); resolve(data); }).catch((err) => { console.info("test denormalizeUri err information: " + JSON.stringify(err)); @@ -140,7 +142,7 @@ function publicdenormalizeUri(helper, uri) { function publicopenFile(helper, uri, mode) { return new Promise(function (resolve, reject) { helper.openFile(uri, mode).then((data) => { - console.info("TestDataShare publicopenFile Callback=" + JSON.stringify(data)); + console.info("[ttt] [TestDataShare] publicopenFile Callback=" + JSON.stringify(data)); resolve(data); }).catch((err) => { console.info("test openFile err information: " + JSON.stringify(err)); diff --git a/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataShareSingleRdb_Callback.ets b/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataShareSingleRdb_Callback.ets index dfccde40363ad92f3e4803422c8eaf3f8386d15e..2d9f966a40f13f8f646629848eddb388623e9557 100644 --- a/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataShareSingleRdb_Callback.ets +++ b/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataShareSingleRdb_Callback.ets @@ -1,17 +1,17 @@ /* - * Copyright (C) 2022 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. - */ +* Copyright (c) 2022 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 'hypium/index' import dataShare from '@ohos.data.dataShare' @@ -39,6 +39,7 @@ let UpdateString = { "name": "suns" }; let UpdateBoolean = { "isStudent": false }; let UpdateUint8Array = { "Binary": new Uint8Array([1, 2, 3, 4]) }; let UpdateNull = { "name": "1" }; +globalThis.Uint8 = new Uint8Array([1, 2, 3]); //Predicates let PredicatesNumber = new dataSharePredicates.DataSharePredicates(); @@ -48,7 +49,7 @@ PredicatesString.equalTo("name", "sun"); let PredicatesBoolean = new dataSharePredicates.DataSharePredicates(); PredicatesBoolean.equalTo("isStudent", true); let PredicatesUint8Array = new dataSharePredicates.DataSharePredicates(); -PredicatesUint8Array.equalTo("Binary", new Uint8Array([1, 2, 3])); +PredicatesUint8Array.equalTo("Binary", globalThis.Uint8); let PredicatesNull = new dataSharePredicates.DataSharePredicates(); PredicatesNull.equalTo("name", ""); let PredicatesAll = new dataSharePredicates.DataSharePredicates(); diff --git a/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataShareSingleRdb_Promise.ets b/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataShareSingleRdb_Promise.ets index d3f2b860ae6d2c890f1454d2dd3d991c94891b08..93cbf7510567ca41dceeacd81102f7515683165f 100644 --- a/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataShareSingleRdb_Promise.ets +++ b/distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/Test/DataShareSingleRdb_Promise.ets @@ -1,17 +1,17 @@ /* - * Copyright (C) 2022 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. - */ +* Copyright (c) 2022 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 'hypium/index' import dataShare from '@ohos.data.dataShare' @@ -39,6 +39,7 @@ let UpdateString = { "name": "suns" }; let UpdateBoolean = { "isStudent": false }; let UpdateUint8Array = { "Binary": new Uint8Array([1, 2, 3, 4]) }; let UpdateNull = { "name": "1" }; +globalThis.Uint8 = new Uint8Array([1, 2, 3]); //Predicates let PredicatesNumber = new dataSharePredicates.DataSharePredicates(); @@ -48,7 +49,7 @@ PredicatesString.equalTo("name", "sun"); let PredicatesBoolean = new dataSharePredicates.DataSharePredicates(); PredicatesBoolean.equalTo("isStudent", true); let PredicatesUint8Array = new dataSharePredicates.DataSharePredicates(); -PredicatesUint8Array.equalTo("Binary", new Uint8Array([1, 2, 3])); +PredicatesUint8Array.equalTo("Binary", globalThis.Uint8); let PredicatesNull = new dataSharePredicates.DataSharePredicates(); PredicatesNull.equalTo("name", ""); let PredicatesAll = new dataSharePredicates.DataSharePredicates(); @@ -103,7 +104,7 @@ export default function DataShareSingleRdb_Promise() { }) /* - * @tc.number : SUB_DDM_DataShare_JS_DataShareInsertRdb0101 + * @tc.number : SUB_DDM_DataShare_ETS_DataShareInsertRdb0101 * @tc.name : Use getEntries get the value by mixing the string key * @tc.desc : Insert number type data in Rdb * @tc.size : MediumTest @@ -917,7 +918,7 @@ export default function DataShareSingleRdb_Promise() { }) /* - * @tc.number : SUB_DDM_DataShare_ETS_DataShareGetFileTypes0101 + * @tc.number : DataShareGetFileTypes0101 * @tc.name : Use getEntries get the value by mixing the string key * @tc.desc : Support GetFileTypes function * @tc.size : MediumTest diff --git a/distributeddatamgr/windowStage/server/rdbService/BUILD.gn b/distributeddatamgr/windowStage/server/rdbService/BUILD.gn index 8c437f27e44d66b09546a020dae1b72c33359e88..7dcd432675f739bf1d2a5de30be44f6b6bede343 100644 --- a/distributeddatamgr/windowStage/server/rdbService/BUILD.gn +++ b/distributeddatamgr/windowStage/server/rdbService/BUILD.gn @@ -22,23 +22,23 @@ ohos_hap("ActsRdbServiceHap") { "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" js_build_mode = "debug" deps = [ - ":kvService_js_assets", - ":kvService_resources", + ":rdbService_js_assets", + ":rdbService_resources", ] ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" } -ohos_app_scope("dataSharekv_app_profile") { +ohos_app_scope("dataSharerdb_app_profile") { app_profile = "AppScope/app.json" sources = [ "AppScope/resources" ] } -ohos_js_assets("kvService_js_assets") { +ohos_js_assets("rdbService_js_assets") { source_dir = "./entry/src/main/ets" } -ohos_resources("kvService_resources") { +ohos_resources("rdbService_resources") { sources = [ "./entry/src/main/resources" ] - deps = [ ":dataSharekv_app_profile" ] + deps = [ ":dataSharerdb_app_profile" ] hap_profile = "./entry/src/main/module.json" }