提交 b938a3f0 编写于 作者: Z z00445003

Merge branch 'my_xts_acts' of gitee.com:zhoujun62/xts_acts into my_xts_acts

Change-Id: Id0128e193f2f613e22e73cc3a3461c0fd92a5bb5
......@@ -22,6 +22,7 @@ describe('ActsDataAbilityHelperTest', function () {
let dataShareUri = ("datashare:///com.example.dataabilityserver_fa.DataAbility");
let columns = ['id', 'name', 'introduction']
let DAHelper;
let gSetTimeout = 500;
let TAG = ''
function sleep(delay) {
......@@ -98,7 +99,7 @@ describe('ActsDataAbilityHelperTest', function () {
.then(function (data) {
console.log(TAG + ' then data====>'
+ 'json data [ ' + JSON.stringify(data) + ' ]');
expect(data).assertEqual(1);
expect(data).assertEqual(2);
console.log(TAG + '====<end');
done();
}).catch(function (err) {
......@@ -133,7 +134,7 @@ describe('ActsDataAbilityHelperTest', function () {
columns,
predicates,
(err, data) => {
console.log(TAG + ' insert err, data====>'
console.log(TAG + ' query err, data====>'
+ 'json err [ ' + JSON.stringify(err) + ' ], json data [ ' + JSON.stringify(data) + ' ]');
expect(typeof (data)).assertEqual("object");
console.log(TAG + '====<end');
......@@ -337,7 +338,7 @@ describe('ActsDataAbilityHelperTest', function () {
(err, data) => {
console.log(TAG +' batchInsert err, data====>'
+ 'json err [ ' + JSON.stringify(err) + ' ], json data [ ' + JSON.stringify(data) + ' ]');
expect(data).assertEqual(1);
expect(data).assertEqual(3);
console.log(TAG +'====<end');
done();
});
......@@ -363,11 +364,11 @@ describe('ActsDataAbilityHelperTest', function () {
{'name': 'JS', 'introduction': 'Guide'}, {'name': 'GO', 'introduction': 'Expert'});
DAHelper.batchInsert(
dataAbilityUri,
predicates
vbs
).then((data) => {
console.log(TAG + ' then data====>'
+ 'json data [ ' + JSON.stringify(data) + ' ]');
expect(data).assertEqual(1);
expect(data).assertEqual(3);
console.log(TAG + '====<end');
done();
}).catch((err) => {
......@@ -547,6 +548,7 @@ describe('ActsDataAbilityHelperTest', function () {
* @tc.name: Obtains the MIME type of files.
* @tc.desc: Check the return value of the interface (by AsyncCallback)
*/
it('ACTS_DataAbilityAccessDataShare_GetFileTypes_0100', 0, async function (done) {
TAG = 'ACTS_DataAbilityAccessDataShare_GetFileTypes_0100';
console.log(TAG + '====<begin');
......@@ -570,7 +572,7 @@ describe('ActsDataAbilityHelperTest', function () {
} else if (i == 1) {
expect(data[i]).assertEqual("type00");
} else if (i == 2) {
expect(data[i]).assertEqual("tyep03");
expect(data[i]).assertEqual("type03");
}
}
console.log(TAG + '====<end');
......@@ -585,11 +587,12 @@ describe('ActsDataAbilityHelperTest', function () {
}
})
/*
/*
* @tc.number: ACTS_DataAbilityAccessDataShare_GetFileTypes_0200
* @tc.name: Obtains the MIME type of files.
* @tc.desc: Check the return value of the interface (by promise)
*/
it('ACTS_DataAbilityAccessDataShare_GetFileTypes_0200', 0, async function (done) {
TAG = 'ACTS_DataAbilityAccessDataShare_GetFileTypes_0200';
console.log(TAG + '====<begin');
......@@ -611,7 +614,7 @@ describe('ActsDataAbilityHelperTest', function () {
} else if (i == 1) {
expect(data[i]).assertEqual("type00");
} else if (i == 2) {
expect(data[i]).assertEqual("tyep03");
expect(data[i]).assertEqual("type03");
}
}
console.log(TAG + '====<end');
......@@ -667,7 +670,7 @@ describe('ActsDataAbilityHelperTest', function () {
* @tc.name: Converts the given uri that refer to the Data ability into a normalized URI.
* @tc.desc: Check the return value of the interface (by promise)
*/
it('ACTS_NormalizeUri_0100', 0, async function (done) {
it('ACTS_DataAbilityAccessDataShare_NormalizeUri_0200', 0, async function (done) {
TAG = 'ACTS_DataAbilityAccessDataShare_NormalizeUri_0200';
console.log(TAG + '====<begin');
let ret = false;
......
......@@ -73,7 +73,7 @@ export default class DataShareExtAbility extends Extension {
console.log('[DataShareServer]: [insert] value = ' + value);
console.log('[DataShareServer]: [insert] value = ' + JSON.stringify(value));
await rdbStore.insert(TBL_NAME, value, function (err, ret) {
console.log('zhoujun: [DataShareTest] <<Provider>> [insert] callback ret:' + ret);
console.log('[DataShareServer]: <<Provider>> [insert] callback ret:' + ret);
if (callback != undefined) {
callback(err, ret);
}
......@@ -84,7 +84,7 @@ export default class DataShareExtAbility extends Extension {
async update(uri, predicates, value, callback) {
console.log('[DataShareServer]: [update] enter');
if (predicates == null || predicates == undefined) {
console.error('zhoujun: [DataShareTest] <<Provider>> [update] invalid predicates');
console.error('[DataShareServer]: <<Provider>> [update] invalid predicates');
return;
}
console.log('[DataShareServer]: [update] values = ' + value);
......@@ -165,7 +165,7 @@ export default class DataShareExtAbility extends Extension {
async batchInsert(uri: string, valueBuckets, callback) {
console.log('[DataShareServer]: [batchInsert] enter');
if (valueBuckets == null || valueBuckets.length == undefined) {
console.error('zhoujun: [DataShareTest] <<Provider>> [batchInsert] invalid valueBuckets');
console.error('[DataShareServer]: <<Provider>> [batchInsert] invalid valueBuckets');
return;
}
console.log('[DataShareServer]: [batchInsert] valueBuckets.length:' + valueBuckets.length);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册