提交 e0568976 编写于 作者: Y yanglifeng1217

<yanglifeng5@huawei.com>

Signed-off-by: Nyanglifeng1217 <yanglifeng5@huawei.com>
上级 78ff0d0e
...@@ -19,6 +19,7 @@ group("distributeddatamgr") { ...@@ -19,6 +19,7 @@ group("distributeddatamgr") {
"appdatamgrjstest/hap:appdatamgr_js_test", "appdatamgrjstest/hap:appdatamgr_js_test",
"distributeddataObjectjstest/hap:distributeddataObject_js_test", "distributeddataObjectjstest/hap:distributeddataObject_js_test",
"distributeddatamgrjstest/hap:distributeddatamgr_js_test", "distributeddatamgrjstest/hap:distributeddatamgr_js_test",
"windowStage:windowStage",
] ]
} else { } else {
deps = [ deps = [
......
/* /*
* Copyright (C) 2022 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index'
import dataShare from '@ohos.data.dataShare' import dataShare from '@ohos.data.dataShare'
...@@ -214,8 +214,8 @@ export default function DataShareCombinationRdb() { ...@@ -214,8 +214,8 @@ export default function DataShareCombinationRdb() {
expect(err).assertFail(); expect(err).assertFail();
} }
}) })
/* /*
* @tc.number : SUB_DDM_DataShare_ETS_DataShareCombinationRdb005 * @tc.number : SUB_DDM_DataShare_ETS_DataShareCombinationRdb005
* @tc.name : Use getEntries get the value by mixing the string key * @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Off off * @tc.desc : Off off
...@@ -237,7 +237,6 @@ export default function DataShareCombinationRdb() { ...@@ -237,7 +237,6 @@ export default function DataShareCombinationRdb() {
} }
}) })
/* /*
* @tc.number : SUB_DDM_DataShare_ETS_DataShareCombinationRdb0106 * @tc.number : SUB_DDM_DataShare_ETS_DataShareCombinationRdb0106
* @tc.name : Use getEntries get the value by mixing the string key * @tc.name : Use getEntries get the value by mixing the string key
......
/* /*
* Copyright (C) 2022 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index'
import dataShare from '@ohos.data.dataShare' import dataShare from '@ohos.data.dataShare'
...@@ -79,7 +79,7 @@ Between.between("age", 18, 19) ...@@ -79,7 +79,7 @@ Between.between("age", 18, 19)
let NotBetween = new dataSharePredicates.DataSharePredicates(); let NotBetween = new dataSharePredicates.DataSharePredicates();
NotBetween.notBetween("age", 19, 20); NotBetween.notBetween("age", 19, 20);
let Distinct = new dataSharePredicates.DataSharePredicates(); let Distinct = new dataSharePredicates.DataSharePredicates();
Distinct.equalTo("age", 18).distinct("age"); Distinct.equalTo("age", 18).distinct();
let GroupBy = new dataSharePredicates.DataSharePredicates(); let GroupBy = new dataSharePredicates.DataSharePredicates();
GroupBy.groupBy(["name"]); GroupBy.groupBy(["name"]);
let IndexedBy = new dataSharePredicates.DataSharePredicates(); let IndexedBy = new dataSharePredicates.DataSharePredicates();
...@@ -1035,8 +1035,8 @@ export default function DataSharePredicatesRdb() { ...@@ -1035,8 +1035,8 @@ export default function DataSharePredicatesRdb() {
done(); done();
} }
}) })
/* /*
* @tc.number : SUB_DDM_DataShare_ETS_DataSharePredicatesRdb0124 * @tc.number : SUB_DDM_DataShare_ETS_DataSharePredicatesRdb0124
* @tc.name : Use getEntries get the value by mixing the string key * @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : DataShare Supports Predicates * @tc.desc : DataShare Supports Predicates
...@@ -1079,7 +1079,7 @@ export default function DataSharePredicatesRdb() { ...@@ -1079,7 +1079,7 @@ export default function DataSharePredicatesRdb() {
try { try {
await pubfun.publicinsert(globalThis.helper, uri, Insert).then((data) => { await pubfun.publicinsert(globalThis.helper, uri, Insert).then((data) => {
console.info("TestDataShare going batchInsert = " + data); console.info("TestDataShare going batchInsert = " + data);
IndexedBy.indexedBy(data); IndexedBy.indexedBy(globalThis.insertdata);
}) })
await pubfun.publicquery(globalThis.helper, uri, IndexedBy, ["*"]).then((data) => { await pubfun.publicquery(globalThis.helper, uri, IndexedBy, ["*"]).then((data) => {
console.info("TestDataShare going query = " + data); console.info("TestDataShare going query = " + data);
......
/* /*
* Copyright (C) 2022 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import file from '@system.file';
import file from '@system.file';
import { describe, it, expect } from 'hypium/index' import { describe, it, expect } from 'hypium/index'
import dataShare from '@ohos.data.dataShare' import dataShare from '@ohos.data.dataShare'
import dataSharePredicates from '@ohos.data.dataSharePredicates' import dataSharePredicates from '@ohos.data.dataSharePredicates'
...@@ -24,7 +23,8 @@ import DataShareResultSet from '@ohos.data.DataShareResultSet' ...@@ -24,7 +23,8 @@ import DataShareResultSet from '@ohos.data.DataShareResultSet'
function publicinsert(helper, uri, DataShareValuesBucket) { function publicinsert(helper, uri, DataShareValuesBucket) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.insert(uri, DataShareValuesBucket, (err, data) => { 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) { if (err) {
console.info("test insert err information: " + JSON.stringify(err)); console.info("test insert err information: " + JSON.stringify(err));
reject(err); reject(err);
...@@ -55,7 +55,7 @@ async function publicdelete(helper, uri, DataSharePredicates) { ...@@ -55,7 +55,7 @@ async function publicdelete(helper, uri, DataSharePredicates) {
function publicquery(helper, uri, DataSharePredicates, columns) { function publicquery(helper, uri, DataSharePredicates, columns) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.query(uri, DataSharePredicates, columns, (err, data) => { 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; globalThis.ResultSet = data;
if (err) { if (err) {
console.info("test query err information: " + JSON.stringify(err)); console.info("test query err information: " + JSON.stringify(err));
...@@ -71,7 +71,7 @@ function publicquery(helper, uri, DataSharePredicates, columns) { ...@@ -71,7 +71,7 @@ function publicquery(helper, uri, DataSharePredicates, columns) {
function publicupdate(helper, uri, DataSharePredicates, DataShareValuesBucket) { function publicupdate(helper, uri, DataSharePredicates, DataShareValuesBucket) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.update(uri, DataSharePredicates, DataShareValuesBucket, (err, data) => { 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) { if (err) {
console.info("test update err information: " + JSON.stringify(err)); console.info("test update err information: " + JSON.stringify(err));
reject(err); reject(err);
...@@ -86,7 +86,7 @@ function publicupdate(helper, uri, DataSharePredicates, DataShareValuesBucket) { ...@@ -86,7 +86,7 @@ function publicupdate(helper, uri, DataSharePredicates, DataShareValuesBucket) {
function publicbatchInsert(helper, uri, DataShareValuesBucket) { function publicbatchInsert(helper, uri, DataShareValuesBucket) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.batchInsert(uri, DataShareValuesBucket, (err, data) => { 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) { if (err) {
console.info("test batchInsert err information: " + JSON.stringify(err)); console.info("test batchInsert err information: " + JSON.stringify(err));
reject(err); reject(err);
...@@ -101,7 +101,7 @@ function publicbatchInsert(helper, uri, DataShareValuesBucket) { ...@@ -101,7 +101,7 @@ function publicbatchInsert(helper, uri, DataShareValuesBucket) {
function publicgetType(helper, uri) { function publicgetType(helper, uri) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.getType(uri, (err, data) => { helper.getType(uri, (err, data) => {
console.info("TestDataShare publicgetType Callback=" + JSON.stringify(data)); console.info("[ttt] [TestDataShare] publicgetType Callback=" + JSON.stringify(data));
if (err) { if (err) {
console.info("test getType err information: " + JSON.stringify(err)); console.info("test getType err information: " + JSON.stringify(err));
reject(err); reject(err);
...@@ -116,7 +116,7 @@ function publicgetType(helper, uri) { ...@@ -116,7 +116,7 @@ function publicgetType(helper, uri) {
function publicgetFileTypes(helper, uri, mimeTypeFilter) { function publicgetFileTypes(helper, uri, mimeTypeFilter) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.getFileTypes(uri, mimeTypeFilter, (err, data) => { 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) { if (err) {
console.info("test getFileTypes err information: " + JSON.stringify(err)); console.info("test getFileTypes err information: " + JSON.stringify(err));
reject(err); reject(err);
...@@ -131,7 +131,7 @@ function publicgetFileTypes(helper, uri, mimeTypeFilter) { ...@@ -131,7 +131,7 @@ function publicgetFileTypes(helper, uri, mimeTypeFilter) {
function publicnormalizeUri(helper, uri) { function publicnormalizeUri(helper, uri) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.normalizeUri(uri, (err, data) => { helper.normalizeUri(uri, (err, data) => {
console.info("TestDataShare publicnormalizeUri Callback=" + JSON.stringify(data)); console.info("[ttt] [TestDataShare] publicnormalizeUri Callback=" + JSON.stringify(data));
if (err) { if (err) {
console.info("test normalizeUri err information: " + JSON.stringify(err)); console.info("test normalizeUri err information: " + JSON.stringify(err));
reject(err); reject(err);
...@@ -146,7 +146,7 @@ function publicnormalizeUri(helper, uri) { ...@@ -146,7 +146,7 @@ function publicnormalizeUri(helper, uri) {
function publicdenormalizeUri(helper, uri) { function publicdenormalizeUri(helper, uri) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.denormalizeUri(uri, (err, data) => { helper.denormalizeUri(uri, (err, data) => {
console.info("TestDataShare publicdenormalizeUri Callback=" + JSON.stringify(data)); console.info("[ttt] [TestDataShare] publicdenormalizeUri Callback=" + JSON.stringify(data));
if (err) { if (err) {
console.info("test denormalizeUri err information: " + JSON.stringify(err)); console.info("test denormalizeUri err information: " + JSON.stringify(err));
reject(err); reject(err);
...@@ -161,7 +161,7 @@ function publicdenormalizeUri(helper, uri) { ...@@ -161,7 +161,7 @@ function publicdenormalizeUri(helper, uri) {
function publicopenFile(helper, uri, mode) { function publicopenFile(helper, uri, mode) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.denormalizeUri(uri, mode, (err, data) => { 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) { if (err) {
console.info("test openFile err information: " + JSON.stringify(err)); console.info("test openFile err information: " + JSON.stringify(err));
reject(err); reject(err);
......
/* /*
* Copyright (C) 2022 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import file from '@system.file';
import { describe, it, expect } from 'hypium/index' import { describe, it, expect } from 'hypium/index'
import dataShare from '@ohos.data.dataShare' import dataShare from '@ohos.data.dataShare'
import dataSharePredicates from '@ohos.data.dataSharePredicates' import dataSharePredicates from '@ohos.data.dataSharePredicates'
...@@ -22,7 +23,8 @@ import DataShareResultSet from '@ohos.data.DataShareResultSet' ...@@ -22,7 +23,8 @@ import DataShareResultSet from '@ohos.data.DataShareResultSet'
function publicinsert(helper, uri, DataShareValuesBucket) { function publicinsert(helper, uri, DataShareValuesBucket) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.insert(uri, DataShareValuesBucket).then((data) => { 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); resolve(data);
}).catch((err) => { }).catch((err) => {
console.info("test insert err information: " + JSON.stringify(err)); console.info("test insert err information: " + JSON.stringify(err));
...@@ -35,7 +37,7 @@ function publicinsert(helper, uri, DataShareValuesBucket) { ...@@ -35,7 +37,7 @@ function publicinsert(helper, uri, DataShareValuesBucket) {
function publicdelete(helper, uri, DataSharePredicates) { function publicdelete(helper, uri, DataSharePredicates) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.delete(uri, DataSharePredicates).then((data) => { 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); resolve(data);
}).catch((err) => { }).catch((err) => {
console.info("test delete err information: " + JSON.stringify(err)); console.info("test delete err information: " + JSON.stringify(err));
...@@ -48,7 +50,7 @@ function publicdelete(helper, uri, DataSharePredicates) { ...@@ -48,7 +50,7 @@ function publicdelete(helper, uri, DataSharePredicates) {
function publicquery(helper, uri, columns, DataSharePredicates) { function publicquery(helper, uri, columns, DataSharePredicates) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.query(uri, columns, DataSharePredicates).then((data) => { 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; globalThis.ResultSet = data;
resolve(data); resolve(data);
}).catch((err) => { }).catch((err) => {
...@@ -62,7 +64,7 @@ function publicquery(helper, uri, columns, DataSharePredicates) { ...@@ -62,7 +64,7 @@ function publicquery(helper, uri, columns, DataSharePredicates) {
function publicupdate(helper, uri, DataShareValuesBucket, DataSharePredicates) { function publicupdate(helper, uri, DataShareValuesBucket, DataSharePredicates) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.update(uri, DataShareValuesBucket, DataSharePredicates).then((data) => { 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); resolve(data);
}).catch((err) => { }).catch((err) => {
console.info("test update err information: " + JSON.stringify(err)); console.info("test update err information: " + JSON.stringify(err));
...@@ -75,7 +77,7 @@ function publicupdate(helper, uri, DataShareValuesBucket, DataSharePredicates) { ...@@ -75,7 +77,7 @@ function publicupdate(helper, uri, DataShareValuesBucket, DataSharePredicates) {
function publicbatchInsert(helper, uri, DataShareValuesBucket) { function publicbatchInsert(helper, uri, DataShareValuesBucket) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.batchInsert(uri, DataShareValuesBucket).then((data) => { 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); resolve(data);
}).catch((err) => { }).catch((err) => {
console.info("test batchInsert err information: " + JSON.stringify(err)); console.info("test batchInsert err information: " + JSON.stringify(err));
...@@ -88,7 +90,7 @@ function publicbatchInsert(helper, uri, DataShareValuesBucket) { ...@@ -88,7 +90,7 @@ function publicbatchInsert(helper, uri, DataShareValuesBucket) {
function publicgetType(helper, uri) { function publicgetType(helper, uri) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.getType(uri).then((data) => { helper.getType(uri).then((data) => {
console.info("TestDataShare publicgetType Callback=" + JSON.stringify(data)); console.info("[ttt] [TestDataShare] publicgetType Callback=" + JSON.stringify(data));
resolve(data); resolve(data);
}).catch((err) => { }).catch((err) => {
console.info("test getType err information: " + JSON.stringify(err)); console.info("test getType err information: " + JSON.stringify(err));
...@@ -101,7 +103,7 @@ function publicgetType(helper, uri) { ...@@ -101,7 +103,7 @@ function publicgetType(helper, uri) {
function publicgetFileTypes(helper, uri, mimeTypeFilter) { function publicgetFileTypes(helper, uri, mimeTypeFilter) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.getFileTypes(uri, mimeTypeFilter).then((data) => { 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); resolve(data);
}).catch((err) => { }).catch((err) => {
console.info("test getFileTypes err information: " + JSON.stringify(err)); console.info("test getFileTypes err information: " + JSON.stringify(err));
...@@ -114,7 +116,7 @@ function publicgetFileTypes(helper, uri, mimeTypeFilter) { ...@@ -114,7 +116,7 @@ function publicgetFileTypes(helper, uri, mimeTypeFilter) {
function publicnormalizeUri(helper, uri) { function publicnormalizeUri(helper, uri) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.normalizeUri(uri).then((data) => { helper.normalizeUri(uri).then((data) => {
console.info("TestDataShare publicnormalizeUri Callback=" + JSON.stringify(data)); console.info("[ttt] [TestDataShare] publicnormalizeUri Callback=" + JSON.stringify(data));
resolve(data); resolve(data);
}).catch((err) => { }).catch((err) => {
console.info("test normalizeUri err information: " + JSON.stringify(err)); console.info("test normalizeUri err information: " + JSON.stringify(err));
...@@ -127,7 +129,7 @@ function publicnormalizeUri(helper, uri) { ...@@ -127,7 +129,7 @@ function publicnormalizeUri(helper, uri) {
function publicdenormalizeUri(helper, uri) { function publicdenormalizeUri(helper, uri) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.denormalizeUri(uri).then((data) => { helper.denormalizeUri(uri).then((data) => {
console.info("TestDataShare publicdenormalizeUri Callback=" + JSON.stringify(data)); console.info("[ttt] [TestDataShare] publicdenormalizeUri Callback=" + JSON.stringify(data));
resolve(data); resolve(data);
}).catch((err) => { }).catch((err) => {
console.info("test denormalizeUri err information: " + JSON.stringify(err)); console.info("test denormalizeUri err information: " + JSON.stringify(err));
...@@ -140,7 +142,7 @@ function publicdenormalizeUri(helper, uri) { ...@@ -140,7 +142,7 @@ function publicdenormalizeUri(helper, uri) {
function publicopenFile(helper, uri, mode) { function publicopenFile(helper, uri, mode) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
helper.openFile(uri, mode).then((data) => { 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); resolve(data);
}).catch((err) => { }).catch((err) => {
console.info("test openFile err information: " + JSON.stringify(err)); console.info("test openFile err information: " + JSON.stringify(err));
......
/* /*
* Copyright (C) 2022 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index'
import dataShare from '@ohos.data.dataShare' import dataShare from '@ohos.data.dataShare'
...@@ -39,6 +39,7 @@ let UpdateString = { "name": "suns" }; ...@@ -39,6 +39,7 @@ let UpdateString = { "name": "suns" };
let UpdateBoolean = { "isStudent": false }; let UpdateBoolean = { "isStudent": false };
let UpdateUint8Array = { "Binary": new Uint8Array([1, 2, 3, 4]) }; let UpdateUint8Array = { "Binary": new Uint8Array([1, 2, 3, 4]) };
let UpdateNull = { "name": "1" }; let UpdateNull = { "name": "1" };
globalThis.Uint8 = new Uint8Array([1, 2, 3]);
//Predicates //Predicates
let PredicatesNumber = new dataSharePredicates.DataSharePredicates(); let PredicatesNumber = new dataSharePredicates.DataSharePredicates();
...@@ -48,7 +49,7 @@ PredicatesString.equalTo("name", "sun"); ...@@ -48,7 +49,7 @@ PredicatesString.equalTo("name", "sun");
let PredicatesBoolean = new dataSharePredicates.DataSharePredicates(); let PredicatesBoolean = new dataSharePredicates.DataSharePredicates();
PredicatesBoolean.equalTo("isStudent", true); PredicatesBoolean.equalTo("isStudent", true);
let PredicatesUint8Array = new dataSharePredicates.DataSharePredicates(); let PredicatesUint8Array = new dataSharePredicates.DataSharePredicates();
PredicatesUint8Array.equalTo("Binary", new Uint8Array([1, 2, 3])); PredicatesUint8Array.equalTo("Binary", globalThis.Uint8);
let PredicatesNull = new dataSharePredicates.DataSharePredicates(); let PredicatesNull = new dataSharePredicates.DataSharePredicates();
PredicatesNull.equalTo("name", ""); PredicatesNull.equalTo("name", "");
let PredicatesAll = new dataSharePredicates.DataSharePredicates(); let PredicatesAll = new dataSharePredicates.DataSharePredicates();
......
/* /*
* Copyright (C) 2022 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index'
import dataShare from '@ohos.data.dataShare' import dataShare from '@ohos.data.dataShare'
...@@ -39,6 +39,7 @@ let UpdateString = { "name": "suns" }; ...@@ -39,6 +39,7 @@ let UpdateString = { "name": "suns" };
let UpdateBoolean = { "isStudent": false }; let UpdateBoolean = { "isStudent": false };
let UpdateUint8Array = { "Binary": new Uint8Array([1, 2, 3, 4]) }; let UpdateUint8Array = { "Binary": new Uint8Array([1, 2, 3, 4]) };
let UpdateNull = { "name": "1" }; let UpdateNull = { "name": "1" };
globalThis.Uint8 = new Uint8Array([1, 2, 3]);
//Predicates //Predicates
let PredicatesNumber = new dataSharePredicates.DataSharePredicates(); let PredicatesNumber = new dataSharePredicates.DataSharePredicates();
...@@ -48,7 +49,7 @@ PredicatesString.equalTo("name", "sun"); ...@@ -48,7 +49,7 @@ PredicatesString.equalTo("name", "sun");
let PredicatesBoolean = new dataSharePredicates.DataSharePredicates(); let PredicatesBoolean = new dataSharePredicates.DataSharePredicates();
PredicatesBoolean.equalTo("isStudent", true); PredicatesBoolean.equalTo("isStudent", true);
let PredicatesUint8Array = new dataSharePredicates.DataSharePredicates(); let PredicatesUint8Array = new dataSharePredicates.DataSharePredicates();
PredicatesUint8Array.equalTo("Binary", new Uint8Array([1, 2, 3])); PredicatesUint8Array.equalTo("Binary", globalThis.Uint8);
let PredicatesNull = new dataSharePredicates.DataSharePredicates(); let PredicatesNull = new dataSharePredicates.DataSharePredicates();
PredicatesNull.equalTo("name", ""); PredicatesNull.equalTo("name", "");
let PredicatesAll = new dataSharePredicates.DataSharePredicates(); let PredicatesAll = new dataSharePredicates.DataSharePredicates();
...@@ -103,7 +104,7 @@ export default function DataShareSingleRdb_Promise() { ...@@ -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.name : Use getEntries get the value by mixing the string key
* @tc.desc : Insert number type data in Rdb * @tc.desc : Insert number type data in Rdb
* @tc.size : MediumTest * @tc.size : MediumTest
...@@ -917,7 +918,7 @@ export default function DataShareSingleRdb_Promise() { ...@@ -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.name : Use getEntries get the value by mixing the string key
* @tc.desc : Support GetFileTypes function * @tc.desc : Support GetFileTypes function
* @tc.size : MediumTest * @tc.size : MediumTest
......
...@@ -22,23 +22,23 @@ ohos_hap("ActsRdbServiceHap") { ...@@ -22,23 +22,23 @@ ohos_hap("ActsRdbServiceHap") {
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
js_build_mode = "debug" js_build_mode = "debug"
deps = [ deps = [
":kvService_js_assets", ":rdbService_js_assets",
":kvService_resources", ":rdbService_resources",
] ]
ets2abc = true ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
} }
ohos_app_scope("dataSharekv_app_profile") { ohos_app_scope("dataSharerdb_app_profile") {
app_profile = "AppScope/app.json" app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ] sources = [ "AppScope/resources" ]
} }
ohos_js_assets("kvService_js_assets") { ohos_js_assets("rdbService_js_assets") {
source_dir = "./entry/src/main/ets" source_dir = "./entry/src/main/ets"
} }
ohos_resources("kvService_resources") { ohos_resources("rdbService_resources") {
sources = [ "./entry/src/main/resources" ] sources = [ "./entry/src/main/resources" ]
deps = [ ":dataSharekv_app_profile" ] deps = [ ":dataSharerdb_app_profile" ]
hap_profile = "./entry/src/main/module.json" hap_profile = "./entry/src/main/module.json"
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册