未验证 提交 0747a7ca 编写于 作者: O openharmony_ci 提交者: Gitee

!3549 update file testcase

Merge pull request !3549 from raoxian/cherry-pick-1655171785
...@@ -74,10 +74,7 @@ export function fileToWriteOnly(fpath) { ...@@ -74,10 +74,7 @@ export function fileToWriteOnly(fpath) {
return false return false
} }
} }
export function nextFileName1(testName) {
const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.storage.fileio/cache/'
return BASE_PATH + testName + '_' + randomString(testName.length);
}
export async function nextFileName(testName) { export async function nextFileName(testName) {
let context = featureAbility.getContext(); let context = featureAbility.getContext();
let data = await context.getCacheDir(); let data = await context.getCacheDir();
......
...@@ -36,16 +36,19 @@ describe('fileio_stream', function () { ...@@ -36,16 +36,19 @@ describe('fileio_stream', function () {
try { try {
let ss = fileio.createStreamSync(fpath, 'r+'); let ss = fileio.createStreamSync(fpath, 'r+');
expect(ss !== null).assertTrue(); expect(ss !== null).assertTrue();
ss.write(new ArrayBuffer(4096), { let length = 4096;
ss.write(new ArrayBuffer(length), {
position: 1 position: 1
}).then(function (len) { }).then(function (len) {
expect(len == (FILE_CONTENT.length - 1)).assertTrue(); expect(len == length).assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue(); fileio.unlinkSync(fpath);
ss.closeSync();
done();
}) })
done(); } catch (err) {
} catch (e) { console.info('fileio_test_stream_write_async_000 has failed for ' + err);
console.log('fileio_test_stream_write_async_000 has failed for ' + e);
expect(null).assertFail(); expect(null).assertFail();
done();
} }
}); });
...@@ -59,20 +62,22 @@ describe('fileio_stream', function () { ...@@ -59,20 +62,22 @@ describe('fileio_stream', function () {
* @tc.require * @tc.require
*/ */
it('fileio_test_stream_write_async_001', 0, async function (done) { it('fileio_test_stream_write_async_001', 0, async function (done) {
let fpath = nextFileName1('fileio_test_stream_write_async_001'); let fpath = await nextFileName('fileio_test_stream_write_async_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try { try {
let ss = fileio.createStreamSync(fpath, 'r+'); let ss = fileio.createStreamSync(fpath, 'r+');
expect(ss !== null).assertTrue(); expect(ss !== null).assertTrue();
ss.write(new ArrayBuffer(4096), { offset: 1, encoding: 'utf-8' }, function (err, bytesWritten) { ss.write(new ArrayBuffer(4096), { offset: 1, encoding: 'utf-8' }, function (err, bytesWritten) {
expect(bytesWritten == (FILE_CONTENT.length - 1)).assertTrue(); expect(bytesWritten == 4095).assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue(); fileio.unlinkSync(fpath);
ss.closeSync();
done();
}); });
done(); } catch (err) {
} catch (e) { console.info('fileio_test_stream_write_async_001 has failed for ' + err);
console.log('fileio_test_stream_write_async_001 has failed for ' + e);
expect(null).assertFail(); expect(null).assertFail();
done();
} }
}); });
}); });
...@@ -169,14 +169,12 @@ describe('fileio_copyfile', function () { ...@@ -169,14 +169,12 @@ describe('fileio_copyfile', function () {
fileio fileio
.copyFile(1, fpath) .copyFile(1, fpath)
.then(function (err) { .then(function (err) {
}) fileio.unlinkSync(fpath);
.catch(function (e) {
expect(!!e).assertTrue();
done(); done();
}); });
} catch (e) { } catch (e) {
expect(!!e).assertTrue(); console.log('fileio_copy_file_async_003 has failed for ' + e);
done(); expect(null).assertFail();
} }
}); });
......
...@@ -46,11 +46,11 @@ describe('fileTest', function () { ...@@ -46,11 +46,11 @@ describe('fileTest', function () {
file.delete({ file.delete({
uri: 'internal://cache/../files/File_Delete_001', uri: 'internal://cache/../files/File_Delete_001',
success: function () { success: function () {
console.log('File_Delete_001 call delete success'); console.info('File_Delete_001 call delete success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Delete_001 call delete fail, code: ' + code + ', data: ' + data); console.info('File_Delete_001 call delete fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
done(); done();
}, },
...@@ -66,22 +66,22 @@ describe('fileTest', function () { ...@@ -66,22 +66,22 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: 'internal://cache/File_Delete_002', uri: 'internal://cache/File_Delete_002',
success: function () { success: function () {
console.log('File_Delete_002 call mkdir success.'); console.info('File_Delete_002 call mkdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Delete_002 call mkdir fail, code: ' + code + ', data: ' + data); console.info('File_Delete_002 call mkdir fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_Delete_002', uri: 'internal://cache/File_Delete_002',
success: function () { success: function () {
console.log('File_Delete_002 call delete success.'); console.info('File_Delete_002 call delete success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Delete_002 call delete fail, code: ' + code + ', data: ' + data); console.info('File_Delete_002 call delete fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -96,11 +96,11 @@ describe('fileTest', function () { ...@@ -96,11 +96,11 @@ describe('fileTest', function () {
file.delete({ file.delete({
uri: 'internal://ohos/workspace/text.txt', uri: 'internal://ohos/workspace/text.txt',
success: function () { success: function () {
console.log('File_Delete_003 call delete success.'); console.info('File_Delete_003 call delete success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Delete_003 call delete fail, code: ' + code + ', data: ' + data); console.info('File_Delete_003 call delete fail, code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -121,11 +121,11 @@ describe('fileTest', function () { ...@@ -121,11 +121,11 @@ describe('fileTest', function () {
file.delete({ file.delete({
uri: 'internal://app/File_Delete_004', uri: 'internal://app/File_Delete_004',
success: function () { success: function () {
console.log('File_Delete_004 call delete success.'); console.info('File_Delete_004 call delete success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Delete_004 call delete fail, code: ' + code + ', data: ' + data); console.info('File_Delete_004 call delete fail, code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
}, },
...@@ -141,11 +141,11 @@ describe('fileTest', function () { ...@@ -141,11 +141,11 @@ describe('fileTest', function () {
file.delete({ file.delete({
uri: 'internal://app/File_Delete_005', uri: 'internal://app/File_Delete_005',
success: function () { success: function () {
console.log('File_Delete_005 call delete success.'); console.info('File_Delete_005 call delete success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Delete_005 call delete fail, code: ' + code + ', data: ' + data); console.info('File_Delete_005 call delete fail, code: ' + code + ', data: ' + data);
expect(code == 301).assertTrue(); expect(code == 301).assertTrue();
done(); done();
}, },
...@@ -163,18 +163,18 @@ describe('fileTest', function () { ...@@ -163,18 +163,18 @@ describe('fileTest', function () {
let uri = 'internal://cache/' + firstPath; let uri = 'internal://cache/' + firstPath;
fileio.mkdirSync(dpath); fileio.mkdirSync(dpath);
for (let i = 0; i < 16; i++) { for (let i = 0; i < 16; i++) {
console.log('frequency' + i); console.info('frequency' + i);
let sonPath = randomString(251); let sonPath = randomString(251);
uri = uri + '/f' + sonPath; uri = uri + '/f' + sonPath;
} }
file.delete({ file.delete({
uri: uri, uri: uri,
success: function () { success: function () {
console.log('File_Delete_006 call delete success'); console.info('File_Delete_006 call delete success');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Delete_006 call delete fail, code: ' + code + ', data: ' + data); console.info('File_Delete_006 call delete fail, code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
}, },
...@@ -191,22 +191,22 @@ describe('fileTest', function () { ...@@ -191,22 +191,22 @@ describe('fileTest', function () {
uri: 'internal://cache/File_Delete_007', uri: 'internal://cache/File_Delete_007',
text: 'test', text: 'test',
success: function () { success: function () {
console.log('File_Delete_007 call writeText success'); console.info('File_Delete_007 call writeText success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Delete_007 call writeText fail, code: ' + code + ', data: ' + data); console.info('File_Delete_007 call writeText fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_Delete_007', uri: 'internal://cache/File_Delete_007',
success: function () { success: function () {
console.log('File_Delete_007 call delete success'); console.info('File_Delete_007 call delete success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Delete_007 call delete fail, code: ' + code + ', data: ' + data); console.info('File_Delete_007 call delete fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -222,22 +222,22 @@ describe('fileTest', function () { ...@@ -222,22 +222,22 @@ describe('fileTest', function () {
uri: 'internal://cache/../cache/File_Delete_008', uri: 'internal://cache/../cache/File_Delete_008',
text: 'Text that just for test.', text: 'Text that just for test.',
success: function () { success: function () {
console.log('File_Delete_008 call writeText success'); console.info('File_Delete_008 call writeText success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Delete_008 call writeText fail, code: ' + code + ', data: ' + data); console.info('File_Delete_008 call writeText fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/../cache/File_Delete_008', uri: 'internal://cache/../cache/File_Delete_008',
success: function () { success: function () {
console.log('File_Delete_008 call delete success');`` console.info('File_Delete_008 call delete success');``
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Delete_008 call delete fail, code: ' + code + ', data: ' + data); console.info('File_Delete_008 call delete fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -253,33 +253,33 @@ describe('fileTest', function () { ...@@ -253,33 +253,33 @@ describe('fileTest', function () {
uri: 'internal://cache/File_writeText_001', uri: 'internal://cache/File_writeText_001',
text: 'sawyerwang.', text: 'sawyerwang.',
success: function () { success: function () {
console.log('File_writeText_001 call writeText success'); console.info('File_writeText_001 call writeText success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_001 call writeText fail , code: ' + code + ', data: ' + data); console.info('File_writeText_001 call writeText fail , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readText({ file.readText({
uri: 'internal://cache/File_writeText_001', uri: 'internal://cache/File_writeText_001',
success: function (data) { success: function (data) {
console.log('File_writeText_001 call read success. Content: ' ); console.info('File_writeText_001 call read success. Content: ' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_001 call read fail , code: ' + code + ', data: ' + data); console.info('File_writeText_001 call read fail , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_writeText_001', uri: 'internal://cache/File_writeText_001',
success: function () { success: function () {
console.log('File_writeText_001 call delete success'); console.info('File_writeText_001 call delete success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_001 call delete fail, code: ' + code + ', data: ' + data); console.info('File_writeText_001 call delete fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -295,11 +295,11 @@ describe('fileTest', function () { ...@@ -295,11 +295,11 @@ describe('fileTest', function () {
uri: 'internal://cache/File_writeText_002', uri: 'internal://cache/File_writeText_002',
text: 'Text1.', text: 'Text1.',
success: function () { success: function () {
console.log('File_writeText_002 call writeText success.'); console.info('File_writeText_002 call writeText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_002 call writeText fail, code: ' + code + ', data: ' + data); console.info('File_writeText_002 call writeText fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -308,33 +308,33 @@ describe('fileTest', function () { ...@@ -308,33 +308,33 @@ describe('fileTest', function () {
text: 'Text2.', text: 'Text2.',
append: true, append: true,
success: function () { success: function () {
console.log('File_writeText_002 call writeText success.'); console.info('File_writeText_002 call writeText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_002 call writeText fail, code: ' + code + ', data: ' + data); console.info('File_writeText_002 call writeText fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readText({ file.readText({
uri: 'internal://cache/File_writeText_002', uri: 'internal://cache/File_writeText_002',
success: function (data) { success: function (data) {
console.log('File_writeText_002 call read success. Content: ' ); console.info('File_writeText_002 call read success. Content: ' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_002 call read fail, code: ' + code + ', data: ' + data); console.info('File_writeText_002 call read fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_writeText_002', uri: 'internal://cache/File_writeText_002',
success: function () { success: function () {
console.log('File_writeText_002 call delete success'); console.info('File_writeText_002 call delete success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_002 call delete fail, code: ' + code + ', data: ' + data); console.info('File_writeText_002 call delete fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -351,33 +351,33 @@ describe('fileTest', function () { ...@@ -351,33 +351,33 @@ describe('fileTest', function () {
uri: 'internal://cache/File_writeText_003', uri: 'internal://cache/File_writeText_003',
text: txt, text: txt,
success: function () { success: function () {
console.log('File_writeText_003 call writeText success.'); console.info('File_writeText_003 call writeText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_003 call writeText fail, code: ' + code + ', data: ' + data); console.info('File_writeText_003 call writeText fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readText({ file.readText({
uri: 'internal://cache/File_writeText_003', uri: 'internal://cache/File_writeText_003',
success: function (data) { success: function (data) {
console.log('File_writeText_003 call read success. Content: ' ); console.info('File_writeText_003 call read success. Content: ' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_003 call read fail, code: ' + code + ', data: ' + data); console.info('File_writeText_003 call read fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_writeText_003', uri: 'internal://cache/File_writeText_003',
success: function () { success: function () {
console.log('File_writeText_003 call delete success'); console.info('File_writeText_003 call delete success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_003 call delete fail, code: ' + code + ', data: ' + data); console.info('File_writeText_003 call delete fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -394,11 +394,11 @@ describe('fileTest', function () { ...@@ -394,11 +394,11 @@ describe('fileTest', function () {
text: 'hello', text: 'hello',
encoding: 'UTF-8', encoding: 'UTF-8',
success: function () { success: function () {
console.log('File_writeText_004 call writeText success.'); console.info('File_writeText_004 call writeText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_004 call writeText fail, code: ' + code + ', data: ' + data); console.info('File_writeText_004 call writeText fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -406,22 +406,22 @@ describe('fileTest', function () { ...@@ -406,22 +406,22 @@ describe('fileTest', function () {
uri: 'internal://cache/File_writeText_004', uri: 'internal://cache/File_writeText_004',
encoding: 'UTF-8', encoding: 'UTF-8',
success: function (data) { success: function (data) {
console.log('File_writeText_004 call readText success. Content: ' ); console.info('File_writeText_004 call readText success. Content: ' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_004 call readText fail, code: ' + code + ', data: ' + data); console.info('File_writeText_004 call readText fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_writeText_004', uri: 'internal://cache/File_writeText_004',
success: function () { success: function () {
console.log('File_writeText_004 delete success'); console.info('File_writeText_004 delete success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_004 delete , code: ' + code + ', data: ' + data); console.info('File_writeText_004 delete , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -437,11 +437,11 @@ describe('fileTest', function () { ...@@ -437,11 +437,11 @@ describe('fileTest', function () {
uri: 'internal://cache/File_writeText_005', uri: 'internal://cache/File_writeText_005',
text: 'hello,world', text: 'hello,world',
success: function () { success: function () {
console.log('File_writeText_005 call writeText success.'); console.info('File_writeText_005 call writeText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_005 call writeText fail, code: ' + code + ', data: ' + data); console.info('File_writeText_005 call writeText fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -450,33 +450,33 @@ describe('fileTest', function () { ...@@ -450,33 +450,33 @@ describe('fileTest', function () {
text: 'hello', text: 'hello',
append: true, append: true,
success: function () { success: function () {
console.log('File_writeText_005 call writeText success.'); console.info('File_writeText_005 call writeText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_005 call writeText fail, code: ' + code + ', data: ' + data); console.info('File_writeText_005 call writeText fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readText({ file.readText({
uri: 'internal://cache/File_writeText_005', uri: 'internal://cache/File_writeText_005',
success: function (data) { success: function (data) {
console.log('File_writeText_005 call read success ' ); console.info('File_writeText_005 call read success ' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_005 call readText fail , code: ' + code + ', data: ' + data); console.info('File_writeText_005 call readText fail , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_writeText_005', uri: 'internal://cache/File_writeText_005',
success: function () { success: function () {
console.log('File_writeText_005 call delete success'); console.info('File_writeText_005 call delete success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_005 call delete fail, code: ' + code + ', data: ' + data); console.info('File_writeText_005 call delete fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -492,33 +492,33 @@ describe('fileTest', function () { ...@@ -492,33 +492,33 @@ describe('fileTest', function () {
uri: 'internal://cache/File_writeText_006', uri: 'internal://cache/File_writeText_006',
text: 'hello', text: 'hello',
success: function () { success: function () {
console.log('File_writeText_006 call writeText success.'); console.info('File_writeText_006 call writeText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_006 call writeText fail, code: ' + code + ', data: ' + data); console.info('File_writeText_006 call writeText fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readText({ file.readText({
uri: 'internal://cache/File_writeText_006', uri: 'internal://cache/File_writeText_006',
success: function (data) { success: function (data) {
console.log('File_writeText_006 call read success ' ); console.info('File_writeText_006 call read success ' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_006 call readText fail, code: ' + code + ', data: ' + data); console.info('File_writeText_006 call readText fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_writeText_006', uri: 'internal://cache/File_writeText_006',
success: function () { success: function () {
console.log('File_writeText_006 delete success'); console.info('File_writeText_006 delete success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_006 delete , code: ' + code + ', data: ' + data); console.info('File_writeText_006 delete , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -534,11 +534,11 @@ describe('fileTest', function () { ...@@ -534,11 +534,11 @@ describe('fileTest', function () {
uri: '/data/accounts/account_0/appdata', uri: '/data/accounts/account_0/appdata',
text: 'hello', text: 'hello',
success: function () { success: function () {
console.log('File_writeText_007 call writeText success.'); console.info('File_writeText_007 call writeText success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_007, code: ' + code + ', data: ' + data); console.info('File_writeText_007, code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -551,17 +551,17 @@ describe('fileTest', function () { ...@@ -551,17 +551,17 @@ describe('fileTest', function () {
* @tc.desc Function of API, error code: 300 The uri path is dir path. * @tc.desc Function of API, error code: 300 The uri path is dir path.
*/ */
it('File_writeText_008', 0, async function (done) { it('File_writeText_008', 0, async function (done) {
let dpath = await fileName('File_writeText_008d'); let dpath = await nextFileName('File_writeText_008d');
expect(fileio.mkdirSync(dpath) !== null).assertTrue(); expect(fileio.mkdirSync(dpath) !== null).assertTrue();
file.writeText({ file.writeText({
uri: 'internal://cache/File_writeText_008d/', uri: 'internal://cache/File_writeText_008d/',
text: 'hello', text: 'hello',
success: function () { success: function () {
console.log('File_writeText_008 call writeText success.'); console.info('File_writeText_008 call writeText success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_008 , code: ' + code + ', data: ' + data); console.info('File_writeText_008 , code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
}, },
...@@ -578,11 +578,11 @@ describe('fileTest', function () { ...@@ -578,11 +578,11 @@ describe('fileTest', function () {
uri: 'internal://app/File_writeText_009d/File_writeText_009', uri: 'internal://app/File_writeText_009d/File_writeText_009',
text: 'test', text: 'test',
success: function () { success: function () {
console.log('File_writeText_009 call writeText success.'); console.info('File_writeText_009 call writeText success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_009 , code: ' + code + ', data: ' + data); console.info('File_writeText_009 , code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
}, },
...@@ -599,22 +599,22 @@ describe('fileTest', function () { ...@@ -599,22 +599,22 @@ describe('fileTest', function () {
uri: 'internal://cache/File_writeText_010', uri: 'internal://cache/File_writeText_010',
text: 'test', text: 'test',
success: function () { success: function () {
console.log('File_writeText_010 mkdir success'); console.info('File_writeText_010 mkdir success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_010 fail code: ' + code + ', data: ' + data); console.info('File_writeText_010 fail code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_writeText_010', uri: 'internal://cache/File_writeText_010',
success: function () { success: function () {
console.log('File_writeText_010 delete success'); console.info('File_writeText_010 delete success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_010 fail, code: ' + code + ', data: ' + data); console.info('File_writeText_010 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -630,33 +630,33 @@ describe('fileTest', function () { ...@@ -630,33 +630,33 @@ describe('fileTest', function () {
uri: 'internal://cache/../cache/File_writeText_011', uri: 'internal://cache/../cache/File_writeText_011',
text: 'sawyerwang', text: 'sawyerwang',
success: function () { success: function () {
console.log('File_writeText_011 mkdir success '); console.info('File_writeText_011 mkdir success ');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_011 , code: ' + code + ', data: ' + data); console.info('File_writeText_011 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readText({ file.readText({
uri: 'internal://cache/../cache/File_writeText_011', uri: 'internal://cache/../cache/File_writeText_011',
success: function (data) { success: function (data) {
console.log('File_writeText_011 read success ' ); console.info('File_writeText_011 read success ' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_011 , code: ' + code + ', data: ' + data); console.info('File_writeText_011 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/../cache/File_writeText_011', uri: 'internal://cache/../cache/File_writeText_011',
success: function () { success: function () {
console.log('File_writeText_011 delete success'); console.info('File_writeText_011 delete success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeText_011 delete , code: ' + code + ', data: ' + data); console.info('File_writeText_011 delete , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -672,12 +672,12 @@ describe('fileTest', function () { ...@@ -672,12 +672,12 @@ describe('fileTest', function () {
uri: 'internal://app/notdir/File_writeText_013', uri: 'internal://app/notdir/File_writeText_013',
text: 'sawyerwang', text: 'sawyerwang',
success: function () { success: function () {
console.log('File_writeText_013 mkdir success'); console.info('File_writeText_013 mkdir success');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
console.log('File_writeText_013 , code: ' + code + ', data: ' + data); console.info('File_writeText_013 , code: ' + code + ', data: ' + data);
done(); done();
}, },
}); });
...@@ -696,22 +696,22 @@ describe('fileTest', function () { ...@@ -696,22 +696,22 @@ describe('fileTest', function () {
buffer: buf, buffer: buf,
append: true, append: true,
success: function () { success: function () {
console.log('File_writeArrayBuffer_001 call writeArrayBuffer success.'); console.info('File_writeArrayBuffer_001 call writeArrayBuffer success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_001 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_001 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readArrayBuffer({ file.readArrayBuffer({
uri: 'internal://cache/File_writeArrayBuffer_001', uri: 'internal://cache/File_writeArrayBuffer_001',
success: function (data) { success: function (data) {
console.log('File_writeArrayBuffer_001 call readArrayBuffer success.' ); console.info('File_writeArrayBuffer_001 call readArrayBuffer success.' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_001 readArrayBuffer , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_001 readArrayBuffer , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -731,22 +731,22 @@ describe('fileTest', function () { ...@@ -731,22 +731,22 @@ describe('fileTest', function () {
uri: 'internal://cache/File_writeArrayBuffer_002', uri: 'internal://cache/File_writeArrayBuffer_002',
buffer: buf, buffer: buf,
success: function () { success: function () {
console.log('File_writeArrayBuffer_002 call writeArrayBuffer success.'); console.info('File_writeArrayBuffer_002 call writeArrayBuffer success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_002 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_002 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readArrayBuffer({ file.readArrayBuffer({
uri: 'internal://cache/File_writeArrayBuffer_002', uri: 'internal://cache/File_writeArrayBuffer_002',
success: function (data) { success: function (data) {
console.log('File_writeArrayBuffer_002 call readArrayBuffer success.' ); console.info('File_writeArrayBuffer_002 call readArrayBuffer success.' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_002 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_002 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -766,11 +766,11 @@ describe('fileTest', function () { ...@@ -766,11 +766,11 @@ describe('fileTest', function () {
uri: 'internal://cache/File_writeArrayBuffer_003', uri: 'internal://cache/File_writeArrayBuffer_003',
buffer: buf, buffer: buf,
success: function () { success: function () {
console.log('File_writeArrayBuffer_003 call writeText success.'); console.info('File_writeArrayBuffer_003 call writeText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_003 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_003 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -779,22 +779,22 @@ describe('fileTest', function () { ...@@ -779,22 +779,22 @@ describe('fileTest', function () {
buffer: buf, buffer: buf,
append: true, append: true,
success: function () { success: function () {
console.log('File_writeArrayBuffer_003 call writeArrayBuffer success.'); console.info('File_writeArrayBuffer_003 call writeArrayBuffer success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_003 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_003 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readArrayBuffer({ file.readArrayBuffer({
uri: 'internal://cache/File_writeArrayBuffer_003', uri: 'internal://cache/File_writeArrayBuffer_003',
success: function (data) { success: function (data) {
console.log('File_writeArrayBuffer_003 readArrayBuffer success:' ); console.info('File_writeArrayBuffer_003 readArrayBuffer success:' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_003 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_003 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -812,11 +812,11 @@ describe('fileTest', function () { ...@@ -812,11 +812,11 @@ describe('fileTest', function () {
buffer: buf, buffer: buf,
append: false, append: false,
success: function () { success: function () {
console.log('File_writeArrayBuffer_004 success call writeText success.'); console.info('File_writeArrayBuffer_004 success call writeText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_004 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_004 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -825,22 +825,22 @@ describe('fileTest', function () { ...@@ -825,22 +825,22 @@ describe('fileTest', function () {
buffer: buf, buffer: buf,
append: false, append: false,
success: function () { success: function () {
console.log('File_writeArrayBuffer_004 call writeArrayBuffer success.'); console.info('File_writeArrayBuffer_004 call writeArrayBuffer success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_004 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_004 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readArrayBuffer({ file.readArrayBuffer({
uri: 'internal://cache/File_writeArrayBuffer_004', uri: 'internal://cache/File_writeArrayBuffer_004',
success: function (data) { success: function (data) {
console.log('File_writeArrayBuffer_004: readArrayBuffer success ' ); console.info('File_writeArrayBuffer_004: readArrayBuffer success ' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_004 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_004 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -860,11 +860,11 @@ describe('fileTest', function () { ...@@ -860,11 +860,11 @@ describe('fileTest', function () {
uri: 'internal://cache/File_writeArrayBuffer_005', uri: 'internal://cache/File_writeArrayBuffer_005',
buffer: buf, buffer: buf,
success: function () { success: function () {
console.log('File_writeArrayBuffer_005 call writeText success.'); console.info('File_writeArrayBuffer_005 call writeText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_005 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_005 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -873,22 +873,22 @@ describe('fileTest', function () { ...@@ -873,22 +873,22 @@ describe('fileTest', function () {
buffer: buf, buffer: buf,
position: 10, position: 10,
success: function () { success: function () {
console.log('File_writeArrayBuffer_005 call writeArrayBuffer success.'); console.info('File_writeArrayBuffer_005 call writeArrayBuffer success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_005 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_005 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readArrayBuffer({ file.readArrayBuffer({
uri: 'internal://cache/File_writeArrayBuffer_005', uri: 'internal://cache/File_writeArrayBuffer_005',
success: function (data) { success: function (data) {
console.log('File_writeArrayBuffer_005 read success:' ); console.info('File_writeArrayBuffer_005 read success:' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_005 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_005 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -908,11 +908,11 @@ describe('fileTest', function () { ...@@ -908,11 +908,11 @@ describe('fileTest', function () {
uri: 'internal://cache/File_writeArrayBuffer_006', uri: 'internal://cache/File_writeArrayBuffer_006',
buffer: buf, buffer: buf,
success: function () { success: function () {
console.log('File_writeArrayBuffer_006 call writeText success.'); console.info('File_writeArrayBuffer_006 call writeText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_006 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_006 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -920,22 +920,22 @@ describe('fileTest', function () { ...@@ -920,22 +920,22 @@ describe('fileTest', function () {
uri: 'internal://cache/File_writeArrayBuffer_006', uri: 'internal://cache/File_writeArrayBuffer_006',
buffer: buf, buffer: buf,
success: function () { success: function () {
console.log('File_writeArrayBuffer_006 call writeArrayBuffer success.'); console.info('File_writeArrayBuffer_006 call writeArrayBuffer success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_006 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_006 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readArrayBuffer({ file.readArrayBuffer({
uri: 'internal://cache/File_writeArrayBuffer_006', uri: 'internal://cache/File_writeArrayBuffer_006',
success: function () { success: function () {
console.log('File_writeArrayBuffer_006 pass'); console.info('File_writeArrayBuffer_006 pass');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_006 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_006 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -952,11 +952,11 @@ describe('fileTest', function () { ...@@ -952,11 +952,11 @@ describe('fileTest', function () {
uri: '', uri: '',
buffer: buf, buffer: buf,
success: function () { success: function () {
console.log('File_writeArrayBuffer_007 call writeArrayBuffer success.'); console.info('File_writeArrayBuffer_007 call writeArrayBuffer success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_007 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_007 , code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -973,7 +973,7 @@ describe('fileTest', function () { ...@@ -973,7 +973,7 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: 'internal://app/File_writeArrayBuffer_008', uri: 'internal://app/File_writeArrayBuffer_008',
success: function () { success: function () {
console.log('call mkdir success.'); console.info('call mkdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
...@@ -984,11 +984,11 @@ describe('fileTest', function () { ...@@ -984,11 +984,11 @@ describe('fileTest', function () {
uri: 'internal://app/notdir/File_writeArrayBuffer_008', uri: 'internal://app/notdir/File_writeArrayBuffer_008',
buffer: buf, buffer: buf,
success: function () { success: function () {
console.log('File_writeArrayBuffer_008 call writeArrayBuffer success.'); console.info('File_writeArrayBuffer_008 call writeArrayBuffer success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_008 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_008 , code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
}, },
...@@ -1006,33 +1006,33 @@ describe('fileTest', function () { ...@@ -1006,33 +1006,33 @@ describe('fileTest', function () {
uri: 'internal://cache/File_writeArrayBuffer_009', uri: 'internal://cache/File_writeArrayBuffer_009',
buffer: buf, buffer: buf,
success: function () { success: function () {
console.log('File_writeArrayBuffer_009 call success'); console.info('File_writeArrayBuffer_009 call success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_009 fail'); console.info('File_writeArrayBuffer_009 fail');
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readArrayBuffer({ file.readArrayBuffer({
uri: 'internal://cache/File_writeArrayBuffer_009', uri: 'internal://cache/File_writeArrayBuffer_009',
success: function (data) { success: function (data) {
console.log('File_writeArrayBuffer_009 pass'); console.info('File_writeArrayBuffer_009 pass');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_009 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_009 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_writeArrayBuffer_009', uri: 'internal://cache/File_writeArrayBuffer_009',
success: function () { success: function () {
console.log('File_writeArrayBuffer_009 call success'); console.info('File_writeArrayBuffer_009 call success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_009 fail, code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_009 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1050,22 +1050,22 @@ describe('fileTest', function () { ...@@ -1050,22 +1050,22 @@ describe('fileTest', function () {
buffer: buf, buffer: buf,
append: true, append: true,
success: function () { success: function () {
console.log('File_writeArrayBuffer_010 call writeArrayBuffer success.'); console.info('File_writeArrayBuffer_010 call writeArrayBuffer success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_010 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_010 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readArrayBuffer({ file.readArrayBuffer({
uri: 'internal://cache/../cache/File_writeArrayBuffer_010', uri: 'internal://cache/../cache/File_writeArrayBuffer_010',
success: function (data) { success: function (data) {
console.log('File_writeArrayBuffer_010 pass'); console.info('File_writeArrayBuffer_010 pass');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_010 readArrayBuffer , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_010 readArrayBuffer , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1083,11 +1083,11 @@ describe('fileTest', function () { ...@@ -1083,11 +1083,11 @@ describe('fileTest', function () {
buffer: buf, buffer: buf,
append: true, append: true,
success: function () { success: function () {
console.log('File_writeArrayBuffer_012 => pass'); console.info('File_writeArrayBuffer_012 => pass');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_writeArrayBuffer_012 , code: ' + code + ', data: ' + data); console.info('File_writeArrayBuffer_012 , code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
}, },
...@@ -1104,22 +1104,22 @@ describe('fileTest', function () { ...@@ -1104,22 +1104,22 @@ describe('fileTest', function () {
uri: 'internal://cache/File_readText_001', uri: 'internal://cache/File_readText_001',
text: 'Text that just for test.', text: 'Text that just for test.',
success: function () { success: function () {
console.log('File_readText_001 call writeText success.'); console.info('File_readText_001 call writeText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_readText_001 , code: ' + code + ', data: ' + data); console.info('File_readText_001 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readText({ file.readText({
uri: 'internal://cache/File_readText_001', uri: 'internal://cache/File_readText_001',
success: function (data) { success: function (data) {
console.log('File_readText_001 call readText success.'); console.info('File_readText_001 call readText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_readText_001 , code: ' + code + ', data: ' + data); console.info('File_readText_001 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1136,11 +1136,11 @@ describe('fileTest', function () { ...@@ -1136,11 +1136,11 @@ describe('fileTest', function () {
text: 'Text that just for test.', text: 'Text that just for test.',
encoding: 'utf-8', encoding: 'utf-8',
success: function () { success: function () {
console.log('File_readText_002 call writeText success.'); console.info('File_readText_002 call writeText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_readText_002 , code: ' + code + ', data: ' + data); console.info('File_readText_002 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1148,11 +1148,11 @@ describe('fileTest', function () { ...@@ -1148,11 +1148,11 @@ describe('fileTest', function () {
uri: 'internal://cache/File_readText_002', uri: 'internal://cache/File_readText_002',
encoding: 'utf-8', encoding: 'utf-8',
success: function (data) { success: function (data) {
console.log('File_readText_002 call readText success.'); console.info('File_readText_002 call readText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_readText_002 , code: ' + code + ', data: ' + data); console.info('File_readText_002 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1167,11 +1167,11 @@ describe('fileTest', function () { ...@@ -1167,11 +1167,11 @@ describe('fileTest', function () {
file.readText({ file.readText({
uri: '', uri: '',
success: function (data) { success: function (data) {
console.log(data.text); console.info(data.text);
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_readText_003 , code: ' + code + ', data: ' + data); console.info('File_readText_003 , code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -1187,11 +1187,11 @@ describe('fileTest', function () { ...@@ -1187,11 +1187,11 @@ describe('fileTest', function () {
file.readText({ file.readText({
uri: 'internal://cache/', uri: 'internal://cache/',
success: function (data) { success: function (data) {
console.log(data.text); console.info(data.text);
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_readText_004 , code: ' + code + ', data: ' + data); console.info('File_readText_004 , code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
}, },
...@@ -1207,11 +1207,11 @@ describe('fileTest', function () { ...@@ -1207,11 +1207,11 @@ describe('fileTest', function () {
file.readText({ file.readText({
uri: 'internal://cache/workspace/text.txt', uri: 'internal://cache/workspace/text.txt',
success: function (data) { success: function (data) {
console.log(data.text); console.info(data.text);
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_readText_005 , code: ' + code + ', data: ' + data); console.info('File_readText_005 , code: ' + code + ', data: ' + data);
expect(code == 301).assertTrue(); expect(code == 301).assertTrue();
done(); done();
}, },
...@@ -1228,33 +1228,33 @@ describe('fileTest', function () { ...@@ -1228,33 +1228,33 @@ describe('fileTest', function () {
uri: 'internal://cache/File_readText_006', uri: 'internal://cache/File_readText_006',
text: 'test', text: 'test',
success: function () { success: function () {
console.log('File_readText_006 call success'); console.info('File_readText_006 call success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_readText_006 fail, code: ' + code + ', data: ' + data); console.info('File_readText_006 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readText({ file.readText({
uri: 'internal://cache/File_readText_006', uri: 'internal://cache/File_readText_006',
success: function (data) { success: function (data) {
console.log('File_readText_006 call success' ); console.info('File_readText_006 call success' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_readText_006 fail'); console.info('File_readText_006 fail');
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_readText_006', uri: 'internal://cache/File_readText_006',
success: function () { success: function () {
console.log('File_readText_006 call success'); console.info('File_readText_006 call success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_readText_006 fail, code: ' + code + ', data: ' + data); console.info('File_readText_006 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1270,22 +1270,22 @@ describe('fileTest', function () { ...@@ -1270,22 +1270,22 @@ describe('fileTest', function () {
uri: 'internal://cache/../files/../files/File_readText_007', uri: 'internal://cache/../files/../files/File_readText_007',
text: 'Text that just for test.', text: 'Text that just for test.',
success: function () { success: function () {
console.log('File_readText_007 call writeText success.'); console.info('File_readText_007 call writeText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_readText_007 , code: ' + code + ', data: ' + data); console.info('File_readText_007 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readText({ file.readText({
uri: 'internal://cache/../files/../files/File_readText_007', uri: 'internal://cache/../files/../files/File_readText_007',
success: function (data) { success: function (data) {
console.log('File_readText_007 call readText success. data.text:' ); console.info('File_readText_007 call readText success. data.text:' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_readText_007 , code: ' + code + ', data: ' + data); console.info('File_readText_007 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1308,7 +1308,7 @@ describe('fileTest', function () { ...@@ -1308,7 +1308,7 @@ describe('fileTest', function () {
file.readText({ file.readText({
uri: "internal://cache/File_readText_008", uri: "internal://cache/File_readText_008",
success: function (data) { success: function (data) {
console.log("call readText success: " + data.text); console.info("call readText success: " + data.text);
expect(text == data.text).assertTrue(); expect(text == data.text).assertTrue();
expect(fileio.unlinkSync(fpath) !== null).assertTrue(); expect(fileio.unlinkSync(fpath) !== null).assertTrue();
done(); done();
...@@ -1319,7 +1319,7 @@ describe('fileTest', function () { ...@@ -1319,7 +1319,7 @@ describe('fileTest', function () {
}, },
}); });
} catch (e) { } catch (e) {
console.log("File_readText_008 has failed for " + e); console.info("File_readText_008 has failed for " + e);
expect(null).assertFail(); expect(null).assertFail();
} }
}); });
...@@ -1335,11 +1335,11 @@ describe('fileTest', function () { ...@@ -1335,11 +1335,11 @@ describe('fileTest', function () {
uri: 'internal://cache/File_read_array_buffer_001', uri: 'internal://cache/File_read_array_buffer_001',
buffer: buffer, buffer: buffer,
success: function () { success: function () {
console.log('File_read_array_buffer_001 call writeArrayBuffer success.'); console.info('File_read_array_buffer_001 call writeArrayBuffer success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_read_array_buffer_001 , code: ' + code + ', data: ' + data); console.info('File_read_array_buffer_001 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1348,11 +1348,11 @@ describe('fileTest', function () { ...@@ -1348,11 +1348,11 @@ describe('fileTest', function () {
position: 0, position: 0,
length: 10, length: 10,
success: function (data) { success: function (data) {
console.log('File_read_array_buffer_001 pass'); console.info('File_read_array_buffer_001 pass');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_read_array_buffer_001 , code: ' + code + ', data: ' + data); console.info('File_read_array_buffer_001 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1372,22 +1372,22 @@ describe('fileTest', function () { ...@@ -1372,22 +1372,22 @@ describe('fileTest', function () {
uri: 'internal://cache/File_read_array_buffer_002', uri: 'internal://cache/File_read_array_buffer_002',
buffer: buffer, buffer: buffer,
success: function () { success: function () {
console.log('File_read_array_buffer_002 call writeArrayBuffer success.'); console.info('File_read_array_buffer_002 call writeArrayBuffer success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_read_array_buffer_002 , code: ' + code + ', data: ' + data); console.info('File_read_array_buffer_002 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readArrayBuffer({ file.readArrayBuffer({
uri: 'internal://cache/File_read_array_buffer_002', uri: 'internal://cache/File_read_array_buffer_002',
success: function (data) { success: function (data) {
console.log('File_read_array_buffer_002 pass'); console.info('File_read_array_buffer_002 pass');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_read_array_buffer_002 , code: ' + code + ', data: ' + data); console.info('File_read_array_buffer_002 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1402,11 +1402,11 @@ describe('fileTest', function () { ...@@ -1402,11 +1402,11 @@ describe('fileTest', function () {
file.readArrayBuffer({ file.readArrayBuffer({
uri: '', uri: '',
success: function (data) { success: function (data) {
console.log('File_read_array_buffer_003 call readArrayBuffer success: ' ); console.info('File_read_array_buffer_003 call readArrayBuffer success: ' );
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_read_array_buffer_003 , code: ' + code + ', data: ' + data); console.info('File_read_array_buffer_003 , code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -1425,11 +1425,11 @@ describe('fileTest', function () { ...@@ -1425,11 +1425,11 @@ describe('fileTest', function () {
uri: fpath, uri: fpath,
position: 100, position: 100,
success: function (data) { success: function (data) {
console.log('File_read_array_buffer_004 call readArrayBuffer success: ' ); console.info('File_read_array_buffer_004 call readArrayBuffer success: ' );
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_read_array_buffer_004 , code: ' + code + ', data: ' + data); console.info('File_read_array_buffer_004 , code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -1448,11 +1448,11 @@ describe('fileTest', function () { ...@@ -1448,11 +1448,11 @@ describe('fileTest', function () {
uri: fpath, uri: fpath,
length: -1, length: -1,
success: function (data) { success: function (data) {
console.log('File_read_array_buffer_005 call readArrayBuffer success: ' ); console.info('File_read_array_buffer_005 call readArrayBuffer success: ' );
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_read_array_buffer_005 , code: ' + code + ', data: ' + data); console.info('File_read_array_buffer_005 , code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -1468,11 +1468,11 @@ describe('fileTest', function () { ...@@ -1468,11 +1468,11 @@ describe('fileTest', function () {
file.readArrayBuffer({ file.readArrayBuffer({
uri: 'internal://app', uri: 'internal://app',
success: function (data) { success: function (data) {
console.log('File_read_array_buffer_006 call readArrayBuffer success: ' ); console.info('File_read_array_buffer_006 call readArrayBuffer success: ' );
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_read_array_buffer_006 , code: ' + code + ', data: ' + data); console.info('File_read_array_buffer_006 , code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -1488,11 +1488,11 @@ describe('fileTest', function () { ...@@ -1488,11 +1488,11 @@ describe('fileTest', function () {
file.readArrayBuffer({ file.readArrayBuffer({
uri: 'internal://cache/File_read_array_buffer_007', uri: 'internal://cache/File_read_array_buffer_007',
success: function (data) { success: function (data) {
console.log('File_read_array_buffer_007 call readArrayBuffer success: ' ); console.info('File_read_array_buffer_007 call readArrayBuffer success: ' );
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_read_array_buffer_007 , code: ' + code + ', data: ' + data); console.info('File_read_array_buffer_007 , code: ' + code + ', data: ' + data);
expect(code == 301).assertTrue(); expect(code == 301).assertTrue();
done(); done();
}, },
...@@ -1510,33 +1510,33 @@ describe('fileTest', function () { ...@@ -1510,33 +1510,33 @@ describe('fileTest', function () {
uri: 'internal://cache/File_read_array_buffer_008', uri: 'internal://cache/File_read_array_buffer_008',
buffer: buf, buffer: buf,
success: function () { success: function () {
console.log('File_read_array_buffer_008 call success'); console.info('File_read_array_buffer_008 call success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_read_array_buffer_008 fail, code: ' + code + ', data: ' + data); console.info('File_read_array_buffer_008 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readArrayBuffer({ file.readArrayBuffer({
uri: 'internal://cache/File_read_array_buffer_008', uri: 'internal://cache/File_read_array_buffer_008',
success: function (data) { success: function (data) {
console.log('File_read_array_buffer_008 call success ' ); console.info('File_read_array_buffer_008 call success ' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_read_array_buffer_008 fail'); console.info('File_read_array_buffer_008 fail');
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_read_array_buffer_008', uri: 'internal://cache/File_read_array_buffer_008',
success: function () { success: function () {
console.log('File_read_array_buffer_008:call success'); console.info('File_read_array_buffer_008:call success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_read_array_buffer_008 fail, code: ' + code + ', data: ' + data); console.info('File_read_array_buffer_008 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1553,11 +1553,11 @@ describe('fileTest', function () { ...@@ -1553,11 +1553,11 @@ describe('fileTest', function () {
uri: 'internal://cache/../cache/File_read_array_buffer_009', uri: 'internal://cache/../cache/File_read_array_buffer_009',
buffer: buffer, buffer: buffer,
success: function () { success: function () {
console.log('File_read_array_buffer_009 call writeArrayBuffer success.'); console.info('File_read_array_buffer_009 call writeArrayBuffer success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_read_array_buffer_009 , code: ' + code + ', data: ' + data); console.info('File_read_array_buffer_009 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1566,11 +1566,11 @@ describe('fileTest', function () { ...@@ -1566,11 +1566,11 @@ describe('fileTest', function () {
position: 0, position: 0,
length: 10, length: 10,
success: function (data) { success: function (data) {
console.log('File_read_array_buffer_009 call readArrayBuffer success. data.buffer:' ); console.info('File_read_array_buffer_009 call readArrayBuffer success. data.buffer:' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_read_array_buffer_009 , code: ' + code + ', data: ' + data); console.info('File_read_array_buffer_009 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1589,33 +1589,33 @@ describe('fileTest', function () { ...@@ -1589,33 +1589,33 @@ describe('fileTest', function () {
uri: 'internal://cache/File_access_001', uri: 'internal://cache/File_access_001',
text: 'Text that just for test.', text: 'Text that just for test.',
success: function () { success: function () {
console.log('File_access_001 call success.'); console.info('File_access_001 call success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_001 fail,code: ' + code + ', data: ' + data); console.info('File_access_001 fail,code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.access({ file.access({
uri: 'internal://cache/File_access_001', uri: 'internal://cache/File_access_001',
success: function () { success: function () {
console.log('File_access_001 call access success.'); console.info('File_access_001 call access success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_001 , code: ' + code + ', data: ' + data); console.info('File_access_001 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_access_001', uri: 'internal://cache/File_access_001',
success: function () { success: function () {
console.log('File_access_001 call delete success.'); console.info('File_access_001 call delete success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_001 , code: ' + code + ', data: ' + data); console.info('File_access_001 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1630,33 +1630,33 @@ describe('fileTest', function () { ...@@ -1630,33 +1630,33 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: 'internal://cache/File_access_002', uri: 'internal://cache/File_access_002',
success: function () { success: function () {
console.log('File_access_002 call success.'); console.info('File_access_002 call success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_002 fail, code: ' + code + ', data: ' + data); console.info('File_access_002 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.access({ file.access({
uri: 'internal://cache/File_access_002', uri: 'internal://cache/File_access_002',
success: function () { success: function () {
console.log('File_access_002 call access success.'); console.info('File_access_002 call access success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_002 , code: ' + code + ', data: ' + data); console.info('File_access_002 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.rmdir({ file.rmdir({
uri: 'internal://cache/File_access_002', uri: 'internal://cache/File_access_002',
success: function () { success: function () {
console.log('File_access_002 call rmdir success.'); console.info('File_access_002 call rmdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_002 , code: ' + code + ', data: ' + data); console.info('File_access_002 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1672,11 +1672,11 @@ describe('fileTest', function () { ...@@ -1672,11 +1672,11 @@ describe('fileTest', function () {
file.access({ file.access({
uri: fpath, uri: fpath,
success: function () { success: function () {
console.log('File_access_003 call access success.'); console.info('File_access_003 call access success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_003 , code: ' + code + ', data: ' + data); console.info('File_access_003 , code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -1692,11 +1692,11 @@ describe('fileTest', function () { ...@@ -1692,11 +1692,11 @@ describe('fileTest', function () {
file.access({ file.access({
uri: 'internal://app/File_access_004.txt', uri: 'internal://app/File_access_004.txt',
success: function () { success: function () {
console.log('File_access_004 call access success.'); console.info('File_access_004 call access success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_004 , code: ' + code + ', data: ' + data); console.info('File_access_004 , code: ' + code + ', data: ' + data);
expect(code == 301).assertTrue(); expect(code == 301).assertTrue();
done(); done();
}, },
...@@ -1712,11 +1712,11 @@ describe('fileTest', function () { ...@@ -1712,11 +1712,11 @@ describe('fileTest', function () {
file.access({ file.access({
uri: 'internal://app/File_access_005', uri: 'internal://app/File_access_005',
success: function () { success: function () {
console.log('File_access_005 call access success.'); console.info('File_access_005 call access success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_005 , code: ' + code + ', data: ' + data); console.info('File_access_005 , code: ' + code + ', data: ' + data);
expect(code == 301).assertTrue(); expect(code == 301).assertTrue();
done(); done();
}, },
...@@ -1734,18 +1734,18 @@ describe('fileTest', function () { ...@@ -1734,18 +1734,18 @@ describe('fileTest', function () {
let uri = 'internal://cache/' + firstPath; let uri = 'internal://cache/' + firstPath;
fileio.mkdirSync(dpath); fileio.mkdirSync(dpath);
for (let i = 0; i < 16; i++) { for (let i = 0; i < 16; i++) {
console.log('time' + i); console.info('time' + i);
let sonPath = randomString(251); let sonPath = randomString(251);
uri = uri + '/f' + sonPath; uri = uri + '/f' + sonPath;
} }
file.access({ file.access({
uri: uri, uri: uri,
success: function () { success: function () {
console.log('File_access_006 => pass'); console.info('File_access_006 => pass');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_006 , code: ' + code + ', data: ' + data); console.info('File_access_006 , code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
fileio.rmdirSync(dpath); fileio.rmdirSync(dpath);
done(); done();
...@@ -1764,33 +1764,33 @@ describe('fileTest', function () { ...@@ -1764,33 +1764,33 @@ describe('fileTest', function () {
uri: 'internal://cache/File_access_007', uri: 'internal://cache/File_access_007',
text: 'hello', text: 'hello',
success: function () { success: function () {
console.log('File_access_007 mkdir success '); console.info('File_access_007 mkdir success ');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_007 fail, code: ' + code + ', data: ' + data); console.info('File_access_007 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.access({ file.access({
uri: 'internal://cache/File_access_007', uri: 'internal://cache/File_access_007',
success: function () { success: function () {
console.log('File_access_007 access success'); console.info('File_access_007 access success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_007 fail'); console.info('File_access_007 fail');
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_access_007', uri: 'internal://cache/File_access_007',
success: function () { success: function () {
console.log('File_access_007 delete success'); console.info('File_access_007 delete success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_007 fail, code: ' + code + ', data: ' + data); console.info('File_access_007 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1806,33 +1806,33 @@ describe('fileTest', function () { ...@@ -1806,33 +1806,33 @@ describe('fileTest', function () {
uri: 'internal://cache/../cache/File_access_008', uri: 'internal://cache/../cache/File_access_008',
text: 'Text that just for test.', text: 'Text that just for test.',
success: function () { success: function () {
console.log('File_access_008 mkdir success.'); console.info('File_access_008 mkdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_008 fail,code: ' + code + ', data: ' + data); console.info('File_access_008 fail,code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.access({ file.access({
uri: 'internal://cache/../cache/File_access_008', uri: 'internal://cache/../cache/File_access_008',
success: function () { success: function () {
console.log('File_access_008 call access success.'); console.info('File_access_008 call access success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_008 , code: ' + code + ', data: ' + data); console.info('File_access_008 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/../cache/File_access_008', uri: 'internal://cache/../cache/File_access_008',
success: function () { success: function () {
console.log('File_access_008 call delete success.'); console.info('File_access_008 call delete success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_access_008 , code: ' + code + ', data: ' + data); console.info('File_access_008 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1847,22 +1847,22 @@ describe('fileTest', function () { ...@@ -1847,22 +1847,22 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: 'internal://cache/File_mkdir_001', uri: 'internal://cache/File_mkdir_001',
success: function () { success: function () {
console.log('File_mkdir_001 call mkdir success.'); console.info('File_mkdir_001 call mkdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_mkdir_001 , code: ' + code + ', data: ' + data); console.info('File_mkdir_001 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.rmdir({ file.rmdir({
uri: 'internal://cache/File_mkdir_001', uri: 'internal://cache/File_mkdir_001',
success: function () { success: function () {
console.log('File_mkdir_001 call rmdir success.'); console.info('File_mkdir_001 call rmdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_mkdir_001 , code: ' + code + ', data: ' + data); console.info('File_mkdir_001 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1877,11 +1877,11 @@ describe('fileTest', function () { ...@@ -1877,11 +1877,11 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: 'internal://app/test/File_mkdir_002', uri: 'internal://app/test/File_mkdir_002',
success: function () { success: function () {
console.log('File_mkdir_002 call mkdir success.'); console.info('File_mkdir_002 call mkdir success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_mkdir_002 , code: ' + code + ', data: ' + data); console.info('File_mkdir_002 , code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
}, },
...@@ -1898,11 +1898,11 @@ describe('fileTest', function () { ...@@ -1898,11 +1898,11 @@ describe('fileTest', function () {
uri: 'internal://cache/test/File_mkdir_003d', uri: 'internal://cache/test/File_mkdir_003d',
recursive: true, recursive: true,
success: function () { success: function () {
console.log('File_mkdir_003 call mkdir success.'); console.info('File_mkdir_003 call mkdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_mkdir_003 , code: ' + code + ', data: ' + data); console.info('File_mkdir_003 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -1917,11 +1917,11 @@ describe('fileTest', function () { ...@@ -1917,11 +1917,11 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: 'internal://files/test/File_mkdir_002d', uri: 'internal://files/test/File_mkdir_002d',
success: function () { success: function () {
console.log('File_mkdir_004 call mkdir success.'); console.info('File_mkdir_004 call mkdir success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_mkdir_004, code: ' + code + ', data: ' + data); console.info('File_mkdir_004, code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -1937,11 +1937,11 @@ describe('fileTest', function () { ...@@ -1937,11 +1937,11 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: 'internal://cache/!@/<>', uri: 'internal://cache/!@/<>',
success: function () { success: function () {
console.log('File_mkdir_005 mkdir success'); console.info('File_mkdir_005 mkdir success');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_mkdir_005 fail, code: ' + code + ', data: ' + data); console.info('File_mkdir_005 fail, code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
}, },
...@@ -1958,11 +1958,11 @@ describe('fileTest', function () { ...@@ -1958,11 +1958,11 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: 'internal://cache/' + fileName, uri: 'internal://cache/' + fileName,
success: function () { success: function () {
console.log('File_mkdir_006 mkdir success'); console.info('File_mkdir_006 mkdir success');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_mkdir_006 =>fail ,code:' + code + ',data: ' + data); console.info('File_mkdir_006 =>fail ,code:' + code + ',data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
}, },
...@@ -1978,22 +1978,22 @@ describe('fileTest', function () { ...@@ -1978,22 +1978,22 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: 'internal://cache/File_mkdir_007d', uri: 'internal://cache/File_mkdir_007d',
success: function () { success: function () {
console.log('File_mkdir_007 mkdir success'); console.info('File_mkdir_007 mkdir success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_mkdir_007 fail, code: ' + code + ', data: ' + data); console.info('File_mkdir_007 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.rmdir({ file.rmdir({
uri: 'internal://cache/File_mkdir_007d', uri: 'internal://cache/File_mkdir_007d',
success: function () { success: function () {
console.log('File_mkdir_007 delete success'); console.info('File_mkdir_007 delete success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_mkdir_007 fail, code: ' + code + ', data: ' + data); console.info('File_mkdir_007 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2008,22 +2008,22 @@ describe('fileTest', function () { ...@@ -2008,22 +2008,22 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: 'internal://cache/../files/File_mkdir_008', uri: 'internal://cache/../files/File_mkdir_008',
success: function () { success: function () {
console.log('File_mkdir_008 call mkdir success.'); console.info('File_mkdir_008 call mkdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_mkdir_008 , code: ' + code + ', data: ' + data); console.info('File_mkdir_008 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.rmdir({ file.rmdir({
uri: 'internal://cache/../files/File_mkdir_008', uri: 'internal://cache/../files/File_mkdir_008',
success: function () { success: function () {
console.log('File_mkdir_008 call rmdir success.'); console.info('File_mkdir_008 call rmdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_mkdir_008 , code: ' + code + ', data: ' + data); console.info('File_mkdir_008 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2038,11 +2038,11 @@ describe('fileTest', function () { ...@@ -2038,11 +2038,11 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: 'internal://app/notdir/File_mkdir_010', uri: 'internal://app/notdir/File_mkdir_010',
success: function () { success: function () {
console.log('File_mkdir_010 call mkdir success.'); console.info('File_mkdir_010 call mkdir success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_mkdir_010 call mkdir callback fail, code: ' + code + ', data: ' + data); console.info('File_mkdir_010 call mkdir callback fail, code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
}, },
...@@ -2058,22 +2058,22 @@ describe('fileTest', function () { ...@@ -2058,22 +2058,22 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: 'internal://cache/File_rmdir_001', uri: 'internal://cache/File_rmdir_001',
success: function () { success: function () {
console.log('File_rmdir_001 call mkdir success.'); console.info('File_rmdir_001 call mkdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_001 fail, code: ' + code + ', data: ' + data); console.info('File_rmdir_001 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.rmdir({ file.rmdir({
uri: 'internal://cache/File_rmdir_001', uri: 'internal://cache/File_rmdir_001',
success: function () { success: function () {
console.log('File_rmdir_001 call rmdir success.'); console.info('File_rmdir_001 call rmdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_001 fail, code: ' + code + ', data: ' + data); console.info('File_rmdir_001 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2089,11 +2089,11 @@ describe('fileTest', function () { ...@@ -2089,11 +2089,11 @@ describe('fileTest', function () {
uri: 'internal://app/test/File_rmdir_002', uri: 'internal://app/test/File_rmdir_002',
recursive: true, recursive: true,
success: function () { success: function () {
console.log('File_rmdir_002 mkdir success.'); console.info('File_rmdir_002 mkdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_002 fail, code: ' + code + ', data: ' + data); console.info('File_rmdir_002 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2101,11 +2101,11 @@ describe('fileTest', function () { ...@@ -2101,11 +2101,11 @@ describe('fileTest', function () {
uri: 'internal://app/test', uri: 'internal://app/test',
recursive: false, recursive: false,
success: function () { success: function () {
console.log('File_rmdir_002 call rmdir success.'); console.info('File_rmdir_002 call rmdir success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_002 fail, code: ' + code + ', data: ' + data); console.info('File_rmdir_002 fail, code: ' + code + ', data: ' + data);
expect(code == 301 || code == 300).assertTrue(); expect(code == 301 || code == 300).assertTrue();
done(); done();
}, },
...@@ -2122,11 +2122,11 @@ describe('fileTest', function () { ...@@ -2122,11 +2122,11 @@ describe('fileTest', function () {
uri: 'internal://cache/test/File_rmdir_003/File_rmdir_003_1/File_rmdir_003_2', uri: 'internal://cache/test/File_rmdir_003/File_rmdir_003_1/File_rmdir_003_2',
recursive: true, recursive: true,
success: function () { success: function () {
console.log('File_rmdir_003 mkdir success.'); console.info('File_rmdir_003 mkdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_003 fail, code: ' + code + ', data: ' + data); console.info('File_rmdir_003 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2134,11 +2134,11 @@ describe('fileTest', function () { ...@@ -2134,11 +2134,11 @@ describe('fileTest', function () {
uri: 'internal://cache/test/File_rmdir_003_1/File_rmdir_003_1/File_rmdir_003_2', uri: 'internal://cache/test/File_rmdir_003_1/File_rmdir_003_1/File_rmdir_003_2',
recursive: true, recursive: true,
success: function () { success: function () {
console.log('File_rmdir_003 mkdir success.'); console.info('File_rmdir_003 mkdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_003 fail, code: ' + code + ', data: ' + data); console.info('File_rmdir_003 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2146,11 +2146,11 @@ describe('fileTest', function () { ...@@ -2146,11 +2146,11 @@ describe('fileTest', function () {
uri: 'internal://cache/test/File_rmdir_003_2/File_rmdir_003_1/File_rmdir_003_2', uri: 'internal://cache/test/File_rmdir_003_2/File_rmdir_003_1/File_rmdir_003_2',
recursive: true, recursive: true,
success: function () { success: function () {
console.log('File_rmdir_003 mkdir success.'); console.info('File_rmdir_003 mkdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_003 fail, code: ' + code + ', data: ' + data); console.info('File_rmdir_003 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2158,11 +2158,11 @@ describe('fileTest', function () { ...@@ -2158,11 +2158,11 @@ describe('fileTest', function () {
uri: 'internal://cache/test', uri: 'internal://cache/test',
recursive: true, recursive: true,
success: function () { success: function () {
console.log('File_rmdir_003 call rmdir success.'); console.info('File_rmdir_003 call rmdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_003 , code: ' + code + ', data: ' + data); console.info('File_rmdir_003 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2177,11 +2177,11 @@ describe('fileTest', function () { ...@@ -2177,11 +2177,11 @@ describe('fileTest', function () {
file.rmdir({ file.rmdir({
uri: '/data/accounts/account_0/appdata/ohos.acts.distributeddatamgr.distributedfile/cache/', uri: '/data/accounts/account_0/appdata/ohos.acts.distributeddatamgr.distributedfile/cache/',
success: function () { success: function () {
console.log('File_rmdir_004 call rmdir success.'); console.info('File_rmdir_004 call rmdir success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_004 , code: ' + code + ', data: ' + data); console.info('File_rmdir_004 , code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -2197,11 +2197,11 @@ describe('fileTest', function () { ...@@ -2197,11 +2197,11 @@ describe('fileTest', function () {
file.rmdir({ file.rmdir({
uri: 'internal://app/test/123', uri: 'internal://app/test/123',
success: function () { success: function () {
console.log('File_rmdir_005 call rmdir success.'); console.info('File_rmdir_005 call rmdir success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_005 , code: ' + code + ', data: ' + data); console.info('File_rmdir_005 , code: ' + code + ', data: ' + data);
expect(code == 301).assertTrue(); expect(code == 301).assertTrue();
done(); done();
}, },
...@@ -2219,22 +2219,22 @@ describe('fileTest', function () { ...@@ -2219,22 +2219,22 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: uri, uri: uri,
success: function () { success: function () {
console.log('File_rmdir_006 mkdir success'); console.info('File_rmdir_006 mkdir success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_006 fail'); console.info('File_rmdir_006 fail');
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.rmdir({ file.rmdir({
uri: uri, uri: uri,
success: function () { success: function () {
console.log('File_rmdir_006 => rmdir success'); console.info('File_rmdir_006 => rmdir success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_006 => fail'); console.info('File_rmdir_006 => fail');
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2249,22 +2249,22 @@ describe('fileTest', function () { ...@@ -2249,22 +2249,22 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: 'internal://cache/File_rmdir_007d', uri: 'internal://cache/File_rmdir_007d',
success: function () { success: function () {
console.log('File_rmdir_007 mkdir success'); console.info('File_rmdir_007 mkdir success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_007 fail, code: ' + code + ', data: ' + data); console.info('File_rmdir_007 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.rmdir({ file.rmdir({
uri: 'internal://cache/File_rmdir_007d', uri: 'internal://cache/File_rmdir_007d',
success: function () { success: function () {
console.log('File_rmdir_007 rmdir success'); console.info('File_rmdir_007 rmdir success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_007 fail, code: ' + code + ', data: ' + data); console.info('File_rmdir_007 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2279,22 +2279,22 @@ describe('fileTest', function () { ...@@ -2279,22 +2279,22 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: 'internal://cache/../files/File_rmdir_008', uri: 'internal://cache/../files/File_rmdir_008',
success: function () { success: function () {
console.log('File_rmdir_008 call mkdir success.'); console.info('File_rmdir_008 call mkdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_008 , code: ' + code + ', data: ' + data); console.info('File_rmdir_008 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.rmdir({ file.rmdir({
uri: 'internal://cache/../files/File_rmdir_008', uri: 'internal://cache/../files/File_rmdir_008',
success: function () { success: function () {
console.log('File_rmdir_008 call rmdir success.'); console.info('File_rmdir_008 call rmdir success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_008 , code: ' + code + ', data: ' + data); console.info('File_rmdir_008 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2309,11 +2309,11 @@ describe('fileTest', function () { ...@@ -2309,11 +2309,11 @@ describe('fileTest', function () {
file.rmdir({ file.rmdir({
uri: 'internal://app/../../com.ohos.systemui', uri: 'internal://app/../../com.ohos.systemui',
success: function () { success: function () {
console.log('File_rmdir_010 call rmdir success.'); console.info('File_rmdir_010 call rmdir success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_rmdir_010 call rmdir callback fail, code: ' + code + ', data: ' + data); console.info('File_rmdir_010 call rmdir callback fail, code: ' + code + ', data: ' + data);
expect(code == 301).assertTrue(); expect(code == 301).assertTrue();
done(); done();
}, },
...@@ -2330,7 +2330,7 @@ describe('fileTest', function () { ...@@ -2330,7 +2330,7 @@ describe('fileTest', function () {
uri: 'internal://cache/File_Move_001', uri: 'internal://cache/File_Move_001',
text: 'Text that just for test.', text: 'Text that just for test.',
success: function () { success: function () {
console.log('File_Move_001 call writeText success.'); console.info('File_Move_001 call writeText success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
...@@ -2342,11 +2342,11 @@ describe('fileTest', function () { ...@@ -2342,11 +2342,11 @@ describe('fileTest', function () {
srcUri: 'internal://cache/File_Move_001', srcUri: 'internal://cache/File_Move_001',
dstUri: 'internal://cache/File_Move_001_1', dstUri: 'internal://cache/File_Move_001_1',
success: function (data) { success: function (data) {
console.log('File_Move_001 call writeText success. data:' + data); console.info('File_Move_001 call writeText success. data:' + data);
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Move_001 , code: ' + code + ', data: ' + data); console.info('File_Move_001 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2369,11 +2369,11 @@ describe('fileTest', function () { ...@@ -2369,11 +2369,11 @@ describe('fileTest', function () {
srcUri: 'internal://cache/../files/File_Move_002' + typeArray[i], srcUri: 'internal://cache/../files/File_Move_002' + typeArray[i],
dstUri: 'internal://cache/../files/cache/File_Move_002' + typeArray[i], dstUri: 'internal://cache/../files/cache/File_Move_002' + typeArray[i],
success: function (uri) { success: function (uri) {
console.log('File_Move_002 call move success. uri: ' + uri); console.info('File_Move_002 call move success. uri: ' + uri);
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Move_002 , code: ' + code + ', data: ' + data); console.info('File_Move_002 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2395,11 +2395,11 @@ describe('fileTest', function () { ...@@ -2395,11 +2395,11 @@ describe('fileTest', function () {
srcUri: srcUri, srcUri: srcUri,
dstUri: dstUri, dstUri: dstUri,
success: function () { success: function () {
console.log('File_Move_003 call move success.'); console.info('File_Move_003 call move success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Move_003 , code: ' + code + ', data: ' + data); console.info('File_Move_003 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2417,11 +2417,11 @@ describe('fileTest', function () { ...@@ -2417,11 +2417,11 @@ describe('fileTest', function () {
srcUri: 'internal://app/File_Move_004', srcUri: 'internal://app/File_Move_004',
dstUri: null, dstUri: null,
success: function () { success: function () {
console.log('File_Move_004 call move success.'); console.info('File_Move_004 call move success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Move_004 , code: ' + code + ', data: ' + data); console.info('File_Move_004 , code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -2440,13 +2440,12 @@ describe('fileTest', function () { ...@@ -2440,13 +2440,12 @@ describe('fileTest', function () {
srcUri: 'internal://cache/../files/File_Move_005d', srcUri: 'internal://cache/../files/File_Move_005d',
dstUri: 'internal://app/cache/File_Move_005d', dstUri: 'internal://app/cache/File_Move_005d',
success: function () { success: function () {
console.log('File_Move_005 call move success.'); console.info('File_Move_005 call move success.');
expect(null).assertFail(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Move_005 , code: ' + code + ', data: ' + data); console.info('File_Move_005 , code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(null).assertFail();
done();
}, },
}); });
}); });
...@@ -2463,11 +2462,11 @@ describe('fileTest', function () { ...@@ -2463,11 +2462,11 @@ describe('fileTest', function () {
srcUri: 'internal://app/File_Move', srcUri: 'internal://app/File_Move',
dstUri: 'internal://app/File_Move_006', dstUri: 'internal://app/File_Move_006',
success: function () { success: function () {
console.log('File_Move_006 call move success.'); console.info('File_Move_006 call move success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Move_006 , code: ' + code + ', data: ' + data); console.info('File_Move_006 , code: ' + code + ', data: ' + data);
expect(code == 301).assertTrue(); expect(code == 301).assertTrue();
done(); done();
}, },
...@@ -2485,7 +2484,7 @@ describe('fileTest', function () { ...@@ -2485,7 +2484,7 @@ describe('fileTest', function () {
let uri = 'internal://app/' + firstPath; let uri = 'internal://app/' + firstPath;
fileio.mkdirSync(dpath); fileio.mkdirSync(dpath);
for (let i = 0; i < 16; i++) { for (let i = 0; i < 16; i++) {
console.log('time' + i); console.info('time' + i);
let sonPath = randomString(251); let sonPath = randomString(251);
uri = uri + '/f' + sonPath; uri = uri + '/f' + sonPath;
} }
...@@ -2493,11 +2492,11 @@ describe('fileTest', function () { ...@@ -2493,11 +2492,11 @@ describe('fileTest', function () {
srcUri: uri, srcUri: uri,
dstUri: 'internal://cache/File_Move_007', dstUri: 'internal://cache/File_Move_007',
success: function () { success: function () {
console.log('File_Move_007 => move success'); console.info('File_Move_007 => move success');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Move_007 => move fail'); console.info('File_Move_007 => move fail');
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
}, },
...@@ -2515,11 +2514,11 @@ describe('fileTest', function () { ...@@ -2515,11 +2514,11 @@ describe('fileTest', function () {
uri: 'internal://cache/File_Move_008', uri: 'internal://cache/File_Move_008',
text: 'sss', text: 'sss',
success: function () { success: function () {
console.log('File_Move_008 mkdir success '); console.info('File_Move_008 mkdir success ');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Move_008 fail, code: ' + code + ', data: ' + data); console.info('File_Move_008 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2527,22 +2526,22 @@ describe('fileTest', function () { ...@@ -2527,22 +2526,22 @@ describe('fileTest', function () {
srcUri: 'internal://cache/File_Move_008', srcUri: 'internal://cache/File_Move_008',
dstUri: 'internal://app/File_Move_008', dstUri: 'internal://app/File_Move_008',
success: function (uri) { success: function (uri) {
console.log('File_Move_008 => pass, uri:' + uri); console.info('File_Move_008 => pass, uri:' + uri);
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Move_008 , code: ' + code + ', data: ' + data); console.info('File_Move_008 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://app/File_Move_008', uri: 'internal://app/File_Move_008',
success: function () { success: function () {
console.log('File_Move_008 delete success'); console.info('File_Move_008 delete success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Move_008 fail, code: ' + code + ', data: ' + data); console.info('File_Move_008 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2560,13 +2559,12 @@ describe('fileTest', function () { ...@@ -2560,13 +2559,12 @@ describe('fileTest', function () {
srcUri: 'internal://app/File_Move_009', srcUri: 'internal://app/File_Move_009',
dstUri: 'internal://app/File_Move_009', dstUri: 'internal://app/File_Move_009',
success: function (data) { success: function (data) {
console.log('File_Move_009 => pass'); console.info('File_Move_009 => pass');
expect(null).assertFail(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Move_009 , code: ' + code + ', data: ' + data); console.info('File_Move_009 , code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(null).assertFail();
done();
}, },
}); });
}); });
...@@ -2585,11 +2583,11 @@ describe('fileTest', function () { ...@@ -2585,11 +2583,11 @@ describe('fileTest', function () {
srcUri: 'internal://app/File_Move_010', srcUri: 'internal://app/File_Move_010',
dstUri: 'internal://app/cache/File_Move_010', dstUri: 'internal://app/cache/File_Move_010',
success: function (data) { success: function (data) {
console.log('File_Move_010 => pass'); console.info('File_Move_010 => pass');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Move_010 , code: ' + code + ', data: ' + data); console.info('File_Move_010 , code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
}, },
...@@ -2608,11 +2606,11 @@ describe('fileTest', function () { ...@@ -2608,11 +2606,11 @@ describe('fileTest', function () {
srcUri: 'internal://cache/../files/File_Move_011', srcUri: 'internal://cache/../files/File_Move_011',
dstUri: 'internal://cache/File_Move_011', dstUri: 'internal://cache/File_Move_011',
success: function (uri) { success: function (uri) {
console.log('File_Move_011 => pass, uri' + uri); console.info('File_Move_011 => pass, uri' + uri);
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Move_011 , code: ' + code + ', data: ' + data); console.info('File_Move_011 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2630,11 +2628,11 @@ describe('fileTest', function () { ...@@ -2630,11 +2628,11 @@ describe('fileTest', function () {
srcUri: 'internal://app/../files/File_Move_012', srcUri: 'internal://app/../files/File_Move_012',
dstUri: 'internal://app/notdir/File_Move_012', dstUri: 'internal://app/notdir/File_Move_012',
success: function (uri) { success: function (uri) {
console.log('File_Move_012 => pass, uri' + uri); console.info('File_Move_012 => pass, uri' + uri);
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Move_012 , code: ' + code + ', data: ' + data); console.info('File_Move_012 , code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
}, },
...@@ -2655,11 +2653,11 @@ describe('fileTest', function () { ...@@ -2655,11 +2653,11 @@ describe('fileTest', function () {
srcUri: 'internal://cache/../files/File_Move_014', srcUri: 'internal://cache/../files/File_Move_014',
dstUri: dstUri, dstUri: dstUri,
success: function (uri) { success: function (uri) {
console.log('File_Move_014 move pass'); console.info('File_Move_014 move pass');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Move_014 => fail , code: ' + code + ', data: ' + data); console.info('File_Move_014 => fail , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2678,24 +2676,24 @@ describe('fileTest', function () { ...@@ -2678,24 +2676,24 @@ describe('fileTest', function () {
srcUri: 'internal://cache/../files/File_Copy_001', srcUri: 'internal://cache/../files/File_Copy_001',
dstUri: 'internal://cache/../files/cache/File_Copy_001', dstUri: 'internal://cache/../files/cache/File_Copy_001',
success: function () { success: function () {
console.log('File_Copy_001 call copy success.'); console.info('File_Copy_001 call copy success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_001 , code: ' + code + ', data: ' + data); console.info('File_Copy_001 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readText({ file.readText({
uri: 'internal://cache/../files/cache/File_Copy_001', uri: 'internal://cache/../files/cache/File_Copy_001',
success: function (data) { success: function (data) {
console.log('File_Copy_001 read success:' ); console.info('File_Copy_001 read success:' );
expect(fileio.unlinkSync(srcFpath) !== null).assertTrue(); expect(fileio.unlinkSync(srcFpath) !== null).assertTrue();
expect(fileio.unlinkSync(dstFpath) !== null).assertTrue(); expect(fileio.unlinkSync(dstFpath) !== null).assertTrue();
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_001 call readText callback fail, code: ' + code + ', data: ' + data); console.info('File_Copy_001 call readText callback fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2716,13 +2714,13 @@ describe('fileTest', function () { ...@@ -2716,13 +2714,13 @@ describe('fileTest', function () {
srcUri: 'internal://cache/../files/File_Copy_002' + typeArray[i], srcUri: 'internal://cache/../files/File_Copy_002' + typeArray[i],
dstUri: 'internal://cache/../files/cache/File_Copy_002' + typeArray[i], dstUri: 'internal://cache/../files/cache/File_Copy_002' + typeArray[i],
success: function () { success: function () {
console.log('File_Copy_002 call copy success.'); console.info('File_Copy_002 call copy success.');
expect(fileio.unlinkSync(srcFpath) !== null).assertTrue(); expect(fileio.unlinkSync(srcFpath) !== null).assertTrue();
expect(fileio.unlinkSync(dstFpath) !== null).assertTrue(); expect(fileio.unlinkSync(dstFpath) !== null).assertTrue();
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_002 , code: ' + code + ', data: ' + data); console.info('File_Copy_002 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2742,24 +2740,24 @@ describe('fileTest', function () { ...@@ -2742,24 +2740,24 @@ describe('fileTest', function () {
srcUri: 'internal://cache/../files/File_Copy_003', srcUri: 'internal://cache/../files/File_Copy_003',
dstUri: 'internal://cache/../files/cache/File_Copy_003', dstUri: 'internal://cache/../files/cache/File_Copy_003',
success: function () { success: function () {
console.log('File_Copy_003 call copy success.'); console.info('File_Copy_003 call copy success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_003 , code: ' + code + ', data: ' + data); console.info('File_Copy_003 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readText({ file.readText({
uri: 'internal://cache/../files/cache/File_Copy_003', uri: 'internal://cache/../files/cache/File_Copy_003',
success: function (data) { success: function (data) {
console.log('File_Copy_003 readText success, data.text:' ); console.info('File_Copy_003 readText success, data.text:' );
expect(fileio.unlinkSync(srcFpath) !== null).assertTrue(); expect(fileio.unlinkSync(srcFpath) !== null).assertTrue();
expect(fileio.unlinkSync(dstFpath) !== null).assertTrue(); expect(fileio.unlinkSync(dstFpath) !== null).assertTrue();
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_003 call readText callback fail, code: ' + code + ', data: ' + data); console.info('File_Copy_003 call readText callback fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
...@@ -2778,11 +2776,11 @@ describe('fileTest', function () { ...@@ -2778,11 +2776,11 @@ describe('fileTest', function () {
srcUri: 'internal://app/File_Copy_004', srcUri: 'internal://app/File_Copy_004',
dstUri: null, dstUri: null,
success: function () { success: function () {
console.log('File_Copy_004 call copy success.'); console.info('File_Copy_004 call copy success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_004 , code: ' + code + ', data: ' + data); console.info('File_Copy_004 , code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
expect(fileio.unlinkSync(srcFpath) !== null).assertTrue(); expect(fileio.unlinkSync(srcFpath) !== null).assertTrue();
done(); done();
...@@ -2800,18 +2798,17 @@ describe('fileTest', function () { ...@@ -2800,18 +2798,17 @@ describe('fileTest', function () {
file.mkdir({ file.mkdir({
uri: 'internal://cache/File_Copy_005d', uri: 'internal://cache/File_Copy_005d',
success: function () { success: function () {
console.log('File_Copy_005 call mkdir success.'); console.info('File_Copy_005 call mkdir success.');
file.copy({ file.copy({
srcUri: 'internal://cache/File_Copy_005d', srcUri: 'internal://cache/File_Copy_005d',
dstUri: 'internal://cache/File_Copy_005d_1', dstUri: 'internal://cache/File_Copy_005d_1',
success: function () { success: function () {
console.log('File_Copy_005 call copy success.'); console.info('File_Copy_005 call copy success.');
expect(null).assertFail(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_005 , code: ' + code + ', data: ' + data); console.info('File_Copy_005 , code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(null).assertFail();
done();
}, },
}); });
}, },
...@@ -2832,11 +2829,11 @@ describe('fileTest', function () { ...@@ -2832,11 +2829,11 @@ describe('fileTest', function () {
srcUri: 'internal://app/fakepath', srcUri: 'internal://app/fakepath',
dstUri: 'internal://app/fakepath1', dstUri: 'internal://app/fakepath1',
success: function () { success: function () {
console.log('File_Copy_006 call copy success.'); console.info('File_Copy_006 call copy success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_006 , code: ' + code + ', data: ' + data); console.info('File_Copy_006 , code: ' + code + ', data: ' + data);
expect(code == 301).assertTrue(); expect(code == 301).assertTrue();
done(); done();
}, },
...@@ -2854,7 +2851,7 @@ describe('fileTest', function () { ...@@ -2854,7 +2851,7 @@ describe('fileTest', function () {
let uri = 'internal://cache/' + firstPath; let uri = 'internal://cache/' + firstPath;
fileio.mkdirSync(dpath); fileio.mkdirSync(dpath);
for (let i = 0; i < 16; i++) { for (let i = 0; i < 16; i++) {
console.log('time' + i); console.info('time' + i);
let sonPath = randomString(251); let sonPath = randomString(251);
uri = uri + '/f' + sonPath; uri = uri + '/f' + sonPath;
} }
...@@ -2862,11 +2859,11 @@ describe('fileTest', function () { ...@@ -2862,11 +2859,11 @@ describe('fileTest', function () {
srcUri: uri, srcUri: uri,
dstUri: uri, dstUri: uri,
success: function () { success: function () {
console.log('File_Copy_007 => copy success'); console.info('File_Copy_007 => copy success');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_007 => fail, code: ' + code + ', data: ' + data); console.info('File_Copy_007 => fail, code: ' + code + ', data: ' + data);
fileio.rmdirSync(dpath); fileio.rmdirSync(dpath);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
...@@ -2884,11 +2881,11 @@ describe('fileTest', function () { ...@@ -2884,11 +2881,11 @@ describe('fileTest', function () {
uri: 'internal://cache/File_Copy_008', uri: 'internal://cache/File_Copy_008',
text: 'test', text: 'test',
success: function () { success: function () {
console.log('File_Copy_008 mkdir success'); console.info('File_Copy_008 mkdir success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_008 fail, code: ' + code + ', data: ' + data); console.info('File_Copy_008 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2896,33 +2893,33 @@ describe('fileTest', function () { ...@@ -2896,33 +2893,33 @@ describe('fileTest', function () {
srcUri: 'internal://cache/File_Copy_008', srcUri: 'internal://cache/File_Copy_008',
dstUri: 'internal://cache/../files/File_Copy_008', dstUri: 'internal://cache/../files/File_Copy_008',
success: function () { success: function () {
console.log('File_Copy_008 move success'); console.info('File_Copy_008 move success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_008 , code: ' + code + ', data: ' + data); console.info('File_Copy_008 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/../files/File_Copy_008', uri: 'internal://cache/../files/File_Copy_008',
success: function () { success: function () {
console.log('File_Copy_008 delete success '); console.info('File_Copy_008 delete success ');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_008 fail, code: ' + code + ', data: ' + data); console.info('File_Copy_008 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_Copy_008', uri: 'internal://cache/File_Copy_008',
success: function () { success: function () {
console.log('File_Copy_008 delete success'); console.info('File_Copy_008 delete success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_008 fail, code: ' + code + ', data: ' + data); console.info('File_Copy_008 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -2940,15 +2937,14 @@ describe('fileTest', function () { ...@@ -2940,15 +2937,14 @@ describe('fileTest', function () {
srcUri: 'internal://app/File_Copy_009', srcUri: 'internal://app/File_Copy_009',
dstUri: 'internal://app/File_Copy_009', dstUri: 'internal://app/File_Copy_009',
success: function (data) { success: function (data) {
console.log('File_Copy_009 => pass'); console.info('File_Copy_009 => pass');
expect(null).assertFail();
},
fail: function (data, code) {
console.log('File_Copy_009 , code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue();
fileio.unlinkSync(srcFpath); fileio.unlinkSync(srcFpath);
done(); done();
}, },
fail: function (data, code) {
console.info('File_Copy_009 , code: ' + code + ', data: ' + data);
expect(null).assertFail();
},
}); });
}); });
...@@ -2966,12 +2962,12 @@ describe('fileTest', function () { ...@@ -2966,12 +2962,12 @@ describe('fileTest', function () {
srcUri: 'internal://app/File_Copy_010', srcUri: 'internal://app/File_Copy_010',
dstUri: 'internal://app/cache/File_Copy_010', dstUri: 'internal://app/cache/File_Copy_010',
success: function (data) { success: function (data) {
console.log('File_Copy_010 => pass'); console.info('File_Copy_010 => pass');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_010 , code: ' + code + ', data: ' + data); console.info('File_Copy_010 , code: ' + code + ', data: ' + data);
console.log("code::" + code); console.info("code::" + code);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
fileio.unlinkSync(srcFpath); fileio.unlinkSync(srcFpath);
fileio.unlinkSync(dstFpath); fileio.unlinkSync(dstFpath);
...@@ -2992,22 +2988,22 @@ describe('fileTest', function () { ...@@ -2992,22 +2988,22 @@ describe('fileTest', function () {
srcUri: 'internal://cache/../files/File_Copy_011', srcUri: 'internal://cache/../files/File_Copy_011',
dstUri: 'internal://cache/File_Copy_011', dstUri: 'internal://cache/File_Copy_011',
success: function () { success: function () {
console.log('File_Copy_011 copy pass'); console.info('File_Copy_011 copy pass');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_011 , code: ' + code + ', data: ' + data); console.info('File_Copy_011 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.readText({ file.readText({
uri: 'internal://cache/File_Copy_011', uri: 'internal://cache/File_Copy_011',
success: function (data) { success: function (data) {
console.log('File_Copy_011 read success:' ); console.info('File_Copy_011 read success:' );
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_011 call readText callback fail, code: ' + code + ', data: ' + data); console.info('File_Copy_011 call readText callback fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3025,11 +3021,11 @@ describe('fileTest', function () { ...@@ -3025,11 +3021,11 @@ describe('fileTest', function () {
srcUri: 'internal://app/../files/File_Copy_012', srcUri: 'internal://app/../files/File_Copy_012',
dstUri: 'internal://app/notdir/File_Move_012', dstUri: 'internal://app/notdir/File_Move_012',
success: function () { success: function () {
console.log('File_Copy_012 copy pass'); console.info('File_Copy_012 copy pass');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_012 , code: ' + code + ', data: ' + data); console.info('File_Copy_012 , code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
expect(fileio.unlinkSync(srcFpath) !== null).assertTrue(); expect(fileio.unlinkSync(srcFpath) !== null).assertTrue();
done(); done();
...@@ -3052,11 +3048,11 @@ describe('fileTest', function () { ...@@ -3052,11 +3048,11 @@ describe('fileTest', function () {
srcUri: 'internal://cache/../files/File_Copy_014', srcUri: 'internal://cache/../files/File_Copy_014',
dstUri: dstUri, dstUri: dstUri,
success: function (uri) { success: function (uri) {
console.log('File_Copy_014 copy pass'); console.info('File_Copy_014 copy pass');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Copy_014 => fail , code: ' + code + ', data: ' + data); console.info('File_Copy_014 => fail , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3077,14 +3073,14 @@ describe('fileTest', function () { ...@@ -3077,14 +3073,14 @@ describe('fileTest', function () {
file.list({ file.list({
uri: 'internal://cache/../files/File_List_001d', uri: 'internal://cache/../files/File_List_001d',
success: function (data) { success: function (data) {
console.log('File_List_001 call list success.' + JSON.stringify(data.fileList)); console.info('File_List_001 call list success.' + JSON.stringify(data.fileList));
expect(fileio.unlinkSync(fpath) !== null).assertTrue(); expect(fileio.unlinkSync(fpath) !== null).assertTrue();
expect(fileio.rmdirSync(ddpath) !== null).assertTrue(); expect(fileio.rmdirSync(ddpath) !== null).assertTrue();
expect(fileio.rmdirSync(dpath) !== null).assertTrue(); expect(fileio.rmdirSync(dpath) !== null).assertTrue();
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_List_001 , code: ' + code + ', data: ' + data); console.info('File_List_001 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3105,14 +3101,14 @@ describe('fileTest', function () { ...@@ -3105,14 +3101,14 @@ describe('fileTest', function () {
file.list({ file.list({
uri: 'internal://cache/../files/File_List_002d', uri: 'internal://cache/../files/File_List_002d',
success: function (data) { success: function (data) {
console.log('File_List_002 call list success.' + JSON.stringify(data.fileList)); console.info('File_List_002 call list success.' + JSON.stringify(data.fileList));
expect(fileio.unlinkSync(fpath) !== null).assertTrue(); expect(fileio.unlinkSync(fpath) !== null).assertTrue();
expect(fileio.rmdirSync(ddpath) !== null).assertTrue(); expect(fileio.rmdirSync(ddpath) !== null).assertTrue();
expect(fileio.rmdirSync(dpath) !== null).assertTrue(); expect(fileio.rmdirSync(dpath) !== null).assertTrue();
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_List_002 , code: ' + code + ', data: ' + data); console.info('File_List_002 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3133,11 +3129,11 @@ describe('fileTest', function () { ...@@ -3133,11 +3129,11 @@ describe('fileTest', function () {
file.list({ file.list({
uri: 'internal://cache/../files/File_List_003d', uri: 'internal://cache/../files/File_List_003d',
success: function (data) { success: function (data) {
console.log('File_List_003 call list success.' + JSON.stringify(data.fileList)); console.info('File_List_003 call list success.' + JSON.stringify(data.fileList));
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_List_003 , code: ' + code + ', data: ' + data); console.info('File_List_003 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3145,21 +3141,21 @@ describe('fileTest', function () { ...@@ -3145,21 +3141,21 @@ describe('fileTest', function () {
uri: 'internal://cache/../files/File_List_003d/File_List_003', uri: 'internal://cache/../files/File_List_003d/File_List_003',
text: '1', text: '1',
success: function (data) { success: function (data) {
console.log('File_List_003 call write success.'); console.info('File_List_003 call write success.');
done(); done();
} }
}); });
file.list({ file.list({
uri: 'internal://cache/../files/File_List_003d', uri: 'internal://cache/../files/File_List_003d',
success: function (data) { success: function (data) {
console.log('File_List_003 call list success.' + JSON.stringify(data.fileList)); console.info('File_List_003 call list success.' + JSON.stringify(data.fileList));
expect(fileio.unlinkSync(fpath) !== null).assertTrue(); expect(fileio.unlinkSync(fpath) !== null).assertTrue();
expect(fileio.rmdirSync(ddpath) !== null).assertTrue(); expect(fileio.rmdirSync(ddpath) !== null).assertTrue();
expect(fileio.rmdirSync(dpath) !== null).assertTrue(); expect(fileio.rmdirSync(dpath) !== null).assertTrue();
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_List_003 , code: ' + code + ', data: ' + data); console.info('File_List_003 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3180,11 +3176,11 @@ describe('fileTest', function () { ...@@ -3180,11 +3176,11 @@ describe('fileTest', function () {
file.list({ file.list({
uri: 'internal://cache/../files/File_List_004d', uri: 'internal://cache/../files/File_List_004d',
success: function (data) { success: function (data) {
console.log('File_List_004 call list success.'); console.info('File_List_004 call list success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_List_004 , code: ' + code + ', data: ' + data); console.info('File_List_004 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3205,11 +3201,11 @@ describe('fileTest', function () { ...@@ -3205,11 +3201,11 @@ describe('fileTest', function () {
file.list({ file.list({
uri: 'internal://cache/../files/File_List_005d', uri: 'internal://cache/../files/File_List_005d',
success: function (data) { success: function (data) {
console.log('File_List_005 call list success.'); console.info('File_List_005 call list success.');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_List_005 , code: ' + code + ', data: ' + data); console.info('File_List_005 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3225,11 +3221,11 @@ describe('fileTest', function () { ...@@ -3225,11 +3221,11 @@ describe('fileTest', function () {
file.list({ file.list({
uri: dpath, uri: dpath,
success: function (data) { success: function (data) {
console.log('File_List_006 call list success.' + data.fileList); console.info('File_List_006 call list success.' + data.fileList);
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_List_006 , code: ' + code + ', data: ' + data); console.info('File_List_006 , code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -3247,12 +3243,12 @@ describe('fileTest', function () { ...@@ -3247,12 +3243,12 @@ describe('fileTest', function () {
file.list({ file.list({
uri: 'internal://cache/../files/File_List_007', uri: 'internal://cache/../files/File_List_007',
success: function (data) { success: function (data) {
console.log('File_List_007 pass, data.fileList:' + JSON.stringify(data.fileList)); console.info('File_List_007 pass, data.fileList:' + JSON.stringify(data.fileList));
expect(fileio.unlinkSync(fpath) !== null).assertTrue(); expect(fileio.unlinkSync(fpath) !== null).assertTrue();
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_List_007 , code: ' + code + ', data: ' + data); console.info('File_List_007 , code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3267,11 +3263,11 @@ describe('fileTest', function () { ...@@ -3267,11 +3263,11 @@ describe('fileTest', function () {
file.list({ file.list({
uri: 'internal://app/fakepath', uri: 'internal://app/fakepath',
success: function (data) { success: function (data) {
console.log('File_List_008 call list success.' + JSON.stringify(data.fileList)); console.info('File_List_008 call list success.' + JSON.stringify(data.fileList));
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_List_008 , code: ' + code + ', data: ' + data); console.info('File_List_008 , code: ' + code + ', data: ' + data);
expect(code == 301).assertTrue(); expect(code == 301).assertTrue();
done(); done();
}, },
...@@ -3289,18 +3285,18 @@ describe('fileTest', function () { ...@@ -3289,18 +3285,18 @@ describe('fileTest', function () {
let uri = 'internal://app/' + firstPath; let uri = 'internal://app/' + firstPath;
fileio.mkdirSync(dpath); fileio.mkdirSync(dpath);
for (let i = 0; i < 16; i++) { for (let i = 0; i < 16; i++) {
console.log('time' + i); console.info('time' + i);
let sonPath = randomString(251); let sonPath = randomString(251);
uri = uri + '/f' + sonPath; uri = uri + '/f' + sonPath;
} }
file.list({ file.list({
uri: uri, uri: uri,
success: function (data) { success: function (data) {
console.log('File_List_009 => pass' + data); console.info('File_List_009 => pass' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_List_009 , code: ' + code + ', data: ' + data); console.info('File_List_009 , code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
fileio.rmdirSync(dpath); fileio.rmdirSync(dpath);
done(); done();
...@@ -3327,13 +3323,13 @@ describe('fileTest', function () { ...@@ -3327,13 +3323,13 @@ describe('fileTest', function () {
expect(prepareFile(fffpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fffpath, FILE_CONTENT)).assertTrue();
} }
catch (e) { catch (e) {
console.log('File_List_010 has failed for ' + e); console.info('File_List_010 has failed for ' + e);
expect(null).assertFail(); expect(null).assertFail();
} }
file.list({ file.list({
uri: 'internal://cache/File_List_010d', uri: 'internal://cache/File_List_010d',
success: function (data) { success: function (data) {
console.log('File_List_010 => pass' + JSON.stringify(data.fileList)); console.info('File_List_010 => pass' + JSON.stringify(data.fileList));
expect(fileio.unlinkSync(fpath) !== null).assertTrue(); expect(fileio.unlinkSync(fpath) !== null).assertTrue();
expect(fileio.unlinkSync(ffpath) !== null).assertTrue(); expect(fileio.unlinkSync(ffpath) !== null).assertTrue();
expect(fileio.unlinkSync(fffpath) !== null).assertTrue(); expect(fileio.unlinkSync(fffpath) !== null).assertTrue();
...@@ -3342,7 +3338,7 @@ describe('fileTest', function () { ...@@ -3342,7 +3338,7 @@ describe('fileTest', function () {
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_List_010 fail, code: ' + code + ', data: ' + data); console.info('File_List_010 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3363,14 +3359,14 @@ describe('fileTest', function () { ...@@ -3363,14 +3359,14 @@ describe('fileTest', function () {
file.list({ file.list({
uri: 'internal://cache/../files/File_List_011d', uri: 'internal://cache/../files/File_List_011d',
success: function (data) { success: function (data) {
console.log('File_List_011 call list success.' + JSON.stringify(data.fileList)); console.info('File_List_011 call list success.' + JSON.stringify(data.fileList));
expect(fileio.unlinkSync(fpath) !== null).assertTrue(); expect(fileio.unlinkSync(fpath) !== null).assertTrue();
expect(fileio.rmdirSync(ddpath) !== null).assertTrue(); expect(fileio.rmdirSync(ddpath) !== null).assertTrue();
expect(fileio.rmdirSync(dpath) !== null).assertTrue(); expect(fileio.rmdirSync(dpath) !== null).assertTrue();
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_List_011 fail, code: ' + code + ', data: ' + data); console.info('File_List_011 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3385,11 +3381,11 @@ describe('fileTest', function () { ...@@ -3385,11 +3381,11 @@ describe('fileTest', function () {
file.list({ file.list({
uri: 'internal://cache/../files/../../', uri: 'internal://cache/../files/../../',
success: function (data) { success: function (data) {
console.log('File_List_012 call list success.' + JSON.stringify(data.fileList)); console.info('File_List_012 call list success.' + JSON.stringify(data.fileList));
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_List_012 fail, code: ' + code + ', data: ' + data); console.info('File_List_012 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3407,12 +3403,12 @@ describe('fileTest', function () { ...@@ -3407,12 +3403,12 @@ describe('fileTest', function () {
uri: 'internal://cache/../files/File_Get_001', uri: 'internal://cache/../files/File_Get_001',
recursive: true, recursive: true,
success: function (data) { success: function (data) {
console.log('File_Get_001 pass,data.uri:' ); console.info('File_Get_001 pass,data.uri:' );
expect(fileio.unlinkSync(fpath) !== null).assertTrue(); expect(fileio.unlinkSync(fpath) !== null).assertTrue();
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_001 fail, code: ' + code + ', data: ' + data); console.info('File_Get_001 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3430,17 +3426,17 @@ describe('fileTest', function () { ...@@ -3430,17 +3426,17 @@ describe('fileTest', function () {
uri: 'internal://cache/../files/File_Get_002', uri: 'internal://cache/../files/File_Get_002',
recursive: false, recursive: false,
success: function (data) { success: function (data) {
console.log('File_Get_002 => file list:'); console.info('File_Get_002 => file list:');
console.log('{uri:' ); console.info('{uri:' );
console.log('length:' + data.length); console.info('length:' + data.length);
console.log('lastModifiedTime:' + data.lastModifiedTime); console.info('lastModifiedTime:' + data.lastModifiedTime);
console.log('type:' + data.type); console.info('type:' + data.type);
console.log('subFiles:' + data.subFiles + '}'); console.info('subFiles:' + data.subFiles + '}');
expect(fileio.unlinkSync(fpath) !== null).assertTrue(); expect(fileio.unlinkSync(fpath) !== null).assertTrue();
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_002 fail, code: ' + code + ', data: ' + data); console.info('File_Get_002 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3457,18 +3453,18 @@ describe('fileTest', function () { ...@@ -3457,18 +3453,18 @@ describe('fileTest', function () {
file.get({ file.get({
uri: 'internal://cache/../files/File_Get_003', uri: 'internal://cache/../files/File_Get_003',
success: function (data) { success: function (data) {
console.log('File_Get_003 => file list:'); console.info('File_Get_003 => file list:');
console.log('{uri:' ); console.info('{uri:' );
console.log('length:' + data.length); console.info('length:' + data.length);
console.log('lastModifiedTime:' + data.lastModifiedTime); console.info('lastModifiedTime:' + data.lastModifiedTime);
console.log('type:' + data.type); console.info('type:' + data.type);
console.log('subFiles:' + data.subFiles + '}'); console.info('subFiles:' + data.subFiles + '}');
console.log('File_Get_003 => pass'); console.info('File_Get_003 => pass');
expect(fileio.unlinkSync(fpath) !== null).assertTrue(); expect(fileio.unlinkSync(fpath) !== null).assertTrue();
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_003 fail, code: ' + code + ', data: ' + data); console.info('File_Get_003 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3492,13 +3488,13 @@ describe('fileTest', function () { ...@@ -3492,13 +3488,13 @@ describe('fileTest', function () {
uri: 'internal://cache/../files/File_Get_004d', uri: 'internal://cache/../files/File_Get_004d',
recursive: true, recursive: true,
success: function (data) { success: function (data) {
console.log('File_Get_004 => file list:'); console.info('File_Get_004 => file list:');
console.log('{uri:' ); console.info('{uri:' );
console.log('length:' + data.length); console.info('length:' + data.length);
console.log('lastModifiedTime:' + data.lastModifiedTime); console.info('lastModifiedTime:' + data.lastModifiedTime);
console.log('type:' + data.type); console.info('type:' + data.type);
console.log('subFiles:' + data.subFiles + '}'); console.info('subFiles:' + data.subFiles + '}');
console.log('File_Get_004 => pass'); console.info('File_Get_004 => pass');
expect(fileio.unlinkSync(ffpath) !== null).assertTrue(); expect(fileio.unlinkSync(ffpath) !== null).assertTrue();
expect(fileio.unlinkSync(fpath) !== null).assertTrue(); expect(fileio.unlinkSync(fpath) !== null).assertTrue();
expect(fileio.rmdirSync(ddpath) !== null).assertTrue(); expect(fileio.rmdirSync(ddpath) !== null).assertTrue();
...@@ -3506,7 +3502,7 @@ describe('fileTest', function () { ...@@ -3506,7 +3502,7 @@ describe('fileTest', function () {
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_004 fail, code: ' + code + ', data: ' + data); console.info('File_Get_004 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3530,13 +3526,13 @@ describe('fileTest', function () { ...@@ -3530,13 +3526,13 @@ describe('fileTest', function () {
uri: 'internal://cache/../files/File_Get_005d', uri: 'internal://cache/../files/File_Get_005d',
recursive: false, recursive: false,
success: function (data) { success: function (data) {
console.log('File_Get_005 => file list :'); console.info('File_Get_005 => file list :');
console.log('{uri:' ); console.info('{uri:' );
console.log('length:' + data.length); console.info('length:' + data.length);
console.log('lastModifiedTime:' + data.lastModifiedTime); console.info('lastModifiedTime:' + data.lastModifiedTime);
console.log('type:' + data.type); console.info('type:' + data.type);
console.log('subFiles:' + data.subFiles + '}'); console.info('subFiles:' + data.subFiles + '}');
console.log('File_Get_005 => pass'); console.info('File_Get_005 => pass');
expect(fileio.unlinkSync(ffpath) !== null).assertTrue(); expect(fileio.unlinkSync(ffpath) !== null).assertTrue();
expect(fileio.unlinkSync(fpath) !== null).assertTrue(); expect(fileio.unlinkSync(fpath) !== null).assertTrue();
expect(fileio.rmdirSync(ddpath) !== null).assertTrue(); expect(fileio.rmdirSync(ddpath) !== null).assertTrue();
...@@ -3544,7 +3540,7 @@ describe('fileTest', function () { ...@@ -3544,7 +3540,7 @@ describe('fileTest', function () {
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_005 fail, code: ' + code + ', data: ' + data); console.info('File_Get_005 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3567,13 +3563,13 @@ describe('fileTest', function () { ...@@ -3567,13 +3563,13 @@ describe('fileTest', function () {
file.get({ file.get({
uri: 'internal://cache/../files/File_Get_006d', uri: 'internal://cache/../files/File_Get_006d',
success: function (data) { success: function (data) {
console.log('File_Get_006 file list:'); console.info('File_Get_006 file list:');
console.log('{uri:' ); console.info('{uri:' );
console.log('length:' + data.length); console.info('length:' + data.length);
console.log('lastModifiedTime:' + data.lastModifiedTime); console.info('lastModifiedTime:' + data.lastModifiedTime);
console.log('type:' + data.type); console.info('type:' + data.type);
console.log('subFiles:' + data.subFiles + '}'); console.info('subFiles:' + data.subFiles + '}');
console.log('File_Get_006 => pass'); console.info('File_Get_006 => pass');
expect(fileio.unlinkSync(ffpath) !== null).assertTrue(); expect(fileio.unlinkSync(ffpath) !== null).assertTrue();
expect(fileio.unlinkSync(fpath) !== null).assertTrue(); expect(fileio.unlinkSync(fpath) !== null).assertTrue();
expect(fileio.rmdirSync(ddpath) !== null).assertTrue(); expect(fileio.rmdirSync(ddpath) !== null).assertTrue();
...@@ -3581,7 +3577,7 @@ describe('fileTest', function () { ...@@ -3581,7 +3577,7 @@ describe('fileTest', function () {
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_006 fail, code: ' + code + ', data: ' + data); console.info('File_Get_006 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3596,11 +3592,11 @@ describe('fileTest', function () { ...@@ -3596,11 +3592,11 @@ describe('fileTest', function () {
file.get({ file.get({
recursive: true, recursive: true,
success: function (data) { success: function (data) {
console.log('File_Get_007 call Copy success.'); console.info('File_Get_007 call Copy success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_007 fail, code: ' + code + ', data: ' + data); console.info('File_Get_007 fail, code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -3615,11 +3611,11 @@ describe('fileTest', function () { ...@@ -3615,11 +3611,11 @@ describe('fileTest', function () {
it('File_Get_008', 0, async function (done) { it('File_Get_008', 0, async function (done) {
file.get({ file.get({
success: function (data) { success: function (data) {
console.log(data); console.info(data);
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_008 fail, code: ' + code + ', data: ' + data); console.info('File_Get_008 fail, code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -3635,11 +3631,11 @@ describe('fileTest', function () { ...@@ -3635,11 +3631,11 @@ describe('fileTest', function () {
file.get({ file.get({
uri: 'internal://app/File_Get_009', uri: 'internal://app/File_Get_009',
success: function (data) { success: function (data) {
console.log('File_Get_009 call Copy success.'); console.info('File_Get_009 call Copy success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_009 fail, code: ' + code + ', data: ' + data); console.info('File_Get_009 fail, code: ' + code + ', data: ' + data);
expect(code == 301).assertTrue(); expect(code == 301).assertTrue();
done(); done();
}, },
...@@ -3655,11 +3651,11 @@ describe('fileTest', function () { ...@@ -3655,11 +3651,11 @@ describe('fileTest', function () {
file.get({ file.get({
uri: -1, uri: -1,
success: function (data) { success: function (data) {
console.log('File_Get_010 call Copy success.'); console.info('File_Get_010 call Copy success.');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_010 fail, code: ' + code + ', data: ' + data); console.info('File_Get_010 fail, code: ' + code + ', data: ' + data);
expect(code == 202).assertTrue(); expect(code == 202).assertTrue();
done(); done();
}, },
...@@ -3676,11 +3672,11 @@ describe('fileTest', function () { ...@@ -3676,11 +3672,11 @@ describe('fileTest', function () {
uri: 'internal://cache/File_Get_011', uri: 'internal://cache/File_Get_011',
text: 'test', text: 'test',
success: function () { success: function () {
console.log('File_Get_011 mkdir success'); console.info('File_Get_011 mkdir success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_011 fail, code: ' + code + ', data: ' + data); console.info('File_Get_011 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3688,27 +3684,27 @@ describe('fileTest', function () { ...@@ -3688,27 +3684,27 @@ describe('fileTest', function () {
uri: 'internal://cache/File_Get_011', uri: 'internal://cache/File_Get_011',
recursive: true, recursive: true,
success: function (data) { success: function (data) {
console.log('file list'); console.info('file list');
console.log('uri:' ); console.info('uri:' );
console.log('length:' + data.length); console.info('length:' + data.length);
console.log('lastModifiedTime:' + data.lastModifiedTime); console.info('lastModifiedTime:' + data.lastModifiedTime);
console.log('type:' + data.type); console.info('type:' + data.type);
console.log('subFiles:' + data.subFiles); console.info('subFiles:' + data.subFiles);
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_011 fail, code: ' + code + ', data: ' + data); console.info('File_Get_011 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
file.delete({ file.delete({
uri: 'internal://cache/File_Get_011', uri: 'internal://cache/File_Get_011',
success: function () { success: function () {
console.log('File_Get_011 delete success'); console.info('File_Get_011 delete success');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_011 fail, code: ' + code + ', data: ' + data); console.info('File_Get_011 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3725,7 +3721,7 @@ describe('fileTest', function () { ...@@ -3725,7 +3721,7 @@ describe('fileTest', function () {
let uri = 'internal://cache/' + firstPath; let uri = 'internal://cache/' + firstPath;
expect(fileio.mkdirSync(dpath) !== null).assertTrue(); expect(fileio.mkdirSync(dpath) !== null).assertTrue();
for (let i = 0; i < 16; i++) { for (let i = 0; i < 16; i++) {
console.log('time' + i); console.info('time' + i);
let sonPath = randomString(251); let sonPath = randomString(251);
uri = uri + '/f' + sonPath; uri = uri + '/f' + sonPath;
} }
...@@ -3733,17 +3729,17 @@ describe('fileTest', function () { ...@@ -3733,17 +3729,17 @@ describe('fileTest', function () {
uri: uri, uri: uri,
recursive: true, recursive: true,
success: function (data) { success: function (data) {
console.log('file list'); console.info('file list');
console.log('uri:' ); console.info('uri:' );
console.log('length:' + data.length); console.info('length:' + data.length);
console.log('lastModifiedTime:' + data.lastModifiedTime); console.info('lastModifiedTime:' + data.lastModifiedTime);
console.log('type:' + data.type); console.info('type:' + data.type);
console.log('subFiles:' + data.subFiles); console.info('subFiles:' + data.subFiles);
console.log('File_Get_012 => pass'); console.info('File_Get_012 => pass');
expect(null).assertFail(); expect(null).assertFail();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_012 fail, code: ' + code + ', data: ' + data); console.info('File_Get_012 fail, code: ' + code + ', data: ' + data);
expect(code == 300).assertTrue(); expect(code == 300).assertTrue();
done(); done();
}, },
...@@ -3768,13 +3764,13 @@ describe('fileTest', function () { ...@@ -3768,13 +3764,13 @@ describe('fileTest', function () {
uri: 'internal://cache/../files/../files/File_Get_013d', uri: 'internal://cache/../files/../files/File_Get_013d',
recursive: true, recursive: true,
success: function (data) { success: function (data) {
console.log('File_Get_013 => file list:'); console.info('File_Get_013 => file list:');
console.log('{uri:' ); console.info('{uri:' );
console.log('length:' + data.length); console.info('length:' + data.length);
console.log('lastModifiedTime:' + data.lastModifiedTime); console.info('lastModifiedTime:' + data.lastModifiedTime);
console.log('type:' + data.type); console.info('type:' + data.type);
console.log('subFiles:' + data.subFiles + '}'); console.info('subFiles:' + data.subFiles + '}');
console.log('File_Get_013 => pass'); console.info('File_Get_013 => pass');
expect(fileio.unlinkSync(ffpath) !== null).assertTrue(); expect(fileio.unlinkSync(ffpath) !== null).assertTrue();
expect(fileio.unlinkSync(fpath) !== null).assertTrue(); expect(fileio.unlinkSync(fpath) !== null).assertTrue();
expect(fileio.rmdirSync(ddpath) !== null).assertTrue(); expect(fileio.rmdirSync(ddpath) !== null).assertTrue();
...@@ -3782,7 +3778,7 @@ describe('fileTest', function () { ...@@ -3782,7 +3778,7 @@ describe('fileTest', function () {
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_013 fail, code: ' + code + ', data: ' + data); console.info('File_Get_013 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
...@@ -3797,17 +3793,17 @@ describe('fileTest', function () { ...@@ -3797,17 +3793,17 @@ describe('fileTest', function () {
file.get({ file.get({
uri: 'internal://cache/../files/../../', uri: 'internal://cache/../files/../../',
success: function (data) { success: function (data) {
console.log('File_Get_014 => file list :'); console.info('File_Get_014 => file list :');
console.log('{uri:' ); console.info('{uri:' );
console.log('length:' + data.length); console.info('length:' + data.length);
console.log('lastModifiedTime:' + data.lastModifiedTime); console.info('lastModifiedTime:' + data.lastModifiedTime);
console.log('type:' + data.type); console.info('type:' + data.type);
console.log('subFiles:' + data.subFiles + '}'); console.info('subFiles:' + data.subFiles + '}');
console.log('File_Get_014 => pass'); console.info('File_Get_014 => pass');
done(); done();
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('File_Get_014 fail, code: ' + code + ', data: ' + data); console.info('File_Get_014 fail, code: ' + code + ', data: ' + data);
expect(null).assertFail(); expect(null).assertFail();
}, },
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册