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

!9049 【gn 切hvigor】PART4_FA_storage

Merge pull request !9049 from quxianfei/loc_20230621_0001
# Copyright (C) 2022 Huawei Device Co., Ltd.
# Copyright (c) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
......@@ -13,23 +13,11 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("storagefileiov9_js_test") {
hap_profile = "./src/main/config.json"
deps = [
":storagefileiov9_js_assets",
":storagefileiov9_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
ohos_js_app_suite("storagefileiov9_js_test") {
test_hap = true
testonly = true
hap_name = "ActsStorageFileIoV9JSTest"
subsystem_name = "filemanagement"
part_name = "file_api"
}
ohos_js_assets("storagefileiov9_js_assets") {
js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
}
ohos_resources("storagefileiov9_js_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
certificate_profile = "./signature/openharmony_sx.p7b"
}
{
"description": "Configuration for storage filefs Tests",
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "600000",
"shell-timeout": "600000",
"bundle-name": "ohos.acts.storage.fileiov9",
"package-name": "ohos.acts.storage.fileiov9"
},
"kits": [
{
"test-file-name": ["ActsStorageFileIoV9JSTest.hap"],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
{
"description": "Configuration for storage filefs Tests",
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "600000",
"shell-timeout": "600000",
"bundle-name": "ohos.acts.storage.fileiov9",
"package-name": "ohos.acts.storage.fileiov9_test"
},
"kits": [
{
"test-file-name": ["ActsStorageFileIoV9JSTest.hap"],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"app": {
"signingConfigs": [
],
"compileSdkVersion": 10,
"compatibleSdkVersion": 10,
"products": [
{
"name": "default",
"signingConfig": "default"
}
]
},
"modules": [
{
"name": "entry",
"srcPath": "./entry",
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
}
]
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"apiType": 'faMode',
"buildOption": {
},
"targets": [
{
"name": "default",
},
{
"name": "ohosTest",
}
]
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export { legacyHapTasks } from '@ohos/hvigor-ohos-plugin';
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"license": "",
"devDependencies": {},
"author": "",
"name": "entry",
"description": "Please describe the basic information.",
"main": "",
"version": "1.0.0",
"dependencies": {}
}
{
"app":{
"bundleName":"ohos.acts.storage.fileiov9",
"vendor":"example",
"version":{
"code":1000000,
"name":"1.0.0"
}
},
"deviceConfig":{
},
"module":{
"package":"ohos.acts.storage.fileiov9",
"name":".entry",
"mainAbility":".MainAbility",
"deviceType":[
"default",
"tablet"
],
"distro":{
"deliveryWithInstall":true,
"installationFree":true,
"moduleName":"entry",
"moduleType":"entry"
},
"abilities":[
{
"description":"$string:MainAbility_desc",
"formsEnabled":false,
"icon":"$media:icon",
"label":"$string:MainAbility_label",
"launchType":"standard",
"name":".MainAbility",
"orientation":"unspecified",
"skills":[
{
"actions":[
"action.system.home"
],
"entities":[
"entity.system.home"
]
}
],
"srcLanguage":"js",
"srcPath":"MainAbility",
"type":"page",
"visible":true
}
],
"js":[
{
"name":".MainAbility",
"pages":[
"pages/index/index"
],
"window":{
"autoDesignWidth":false,
"designWidth":720
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......@@ -12,14 +12,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import hilog from '@ohos.hilog';
export default {
data: {
title: ""
onCreate() {
hilog.info(0x0000, 'testTag', '%{public}s', 'Application onCreate');
},
onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'Application onDestroy');
},
onInit() {
this.title = this.$t('strings.world');
}
}
......
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
}
}
{
"string": [
{
"name": "app_name",
"value": "storagefilefsjstest"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
}
]
}
{
"string": [
{
"name": "app_name",
"value": "storagefilefsjstest"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
}
]
}
{
"app":{
"bundleName":"ohos.acts.storage.fileiov9",
"vendor":"example",
"version":{
"code":1000000,
"name":"1.0.0"
}
},
"deviceConfig":{
},
"module":{
"package":"ohos.acts.storage.fileiov9_test",
"name":".entry_test",
"mainAbility":".TestAbility",
"deviceType":[
"default",
"tablet"
],
"testRunner":{
"name":"OpenHarmonyTestRunner",
"srcPath":"TestRunner"
},
"distro":{
"deliveryWithInstall":true,
"installationFree":true,
"moduleName":"entry_test",
"moduleType":"feature"
},
"abilities":[
{
"description":"$string:TestAbility_desc",
"formsEnabled":false,
"icon":"$media:icon",
"label":"$string:TestAbility_label",
"launchType":"standard",
"name":".TestAbility",
"orientation":"unspecified",
"skills":[
{
"actions":[
"action.system.home"
],
"entities":[
"entity.system.home"
]
}
],
"srcLanguage":"js",
"srcPath":"TestAbility",
"type":"page",
"visible":true
}
],
"js":[
{
"name":".TestAbility",
"pages":[
"pages/index/index"
],
"window":{
"autoDesignWidth":false,
"designWidth":720
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......@@ -12,20 +12,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
import hilog from '@ohos.hilog';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
import { Hypium } from '@ohos/hypium';
import testsuite from '../test/List.test';
export default {
onCreate() {
console.info('TestApplication onCreate')
hilog.info(0x0000, 'testTag', '%{public}s', 'TestApplication onCreate');
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info("TestApplication onDestroy");
hilog.info(0x0000, 'testTag', '%{public}s', 'TestApplication onDestroy');
}
};
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......@@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
data: {
title: ""
......
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......@@ -12,48 +12,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package', '-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
targetParams += ' ' + key + ' ' + parameters[key]
}
}
return targetParams.trim()
}
import hilog from '@ohos.hilog';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
export default {
onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare')
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare');
},
onRun() {
console.log('OpenHarmonyTestRunner onRun run')
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run');
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
console.info('debug value : '+debug)
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd)
hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd);
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + data.stdResult);
console.info('executeShellCommand : data : ' + data.exitCode);
hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? '');
hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', data.stdResult ?? '');
hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', data.exitCode ?? '');
})
}
};
};
\ No newline at end of file
/*
* Copyright (C) 2022-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import fileIO from '@ohos.file.fs';
import util from '@ohos.util';
import featureAbility from '@ohos.ability.featureAbility';
export const FILE_CONTENT = 'hello world';
import {
describe, it, expect
}
from '@ohos/hypium'
export function prepareFile(fpath, content) {
try {
let file = fileIO.openSync(fpath, fileIO.OpenMode.CREATE | fileIO.OpenMode.READ_WRITE)
fileIO.truncateSync(file.fd)
fileIO.writeSync(file.fd, content)
fileIO.fsyncSync(file.fd)
fileIO.closeSync(file)
return true
}
catch (e) {
console.log('Failed to prepareFile for ' + e)
return false
}
}
export function prepare200MFile(fpath) {
try {
let file = fileIO.openSync(fpath, fileIO.OpenMode.CREATE | fileIO.OpenMode.READ_WRITE)
fileIO.truncateSync(file.fd)
let bf = new ArrayBuffer(1024 * 1024 * 20);
for (let i = 0; i < 10; i++) {
let position = bf.byteLength * i;
let writeLen = fileIO.writeSync(file.fd, bf, { offset: 0, length: bf.byteLength, position: position, encoding: 'utf-8' });
}
fileIO.fsyncSync(file.fd)
fileIO.closeSync(file)
return true
}
catch (e) {
console.log('Failed to prepare200MFile for ' + e)
return false
}
}
export async function nextFileName(testName) {
let context = featureAbility.getContext();
let data = await context.getCacheDir();
let BASE_PATH = data + '/';
return BASE_PATH + testName + '_' + randomString(testName.length);
}
export async function fileName(testName) {
let context = featureAbility.getContext();
let data = await context.getFilesDir();
let BASE_PATH = data + '/';
return BASE_PATH + testName + '_' + randomString(testName.length);
}
export function randomString(num) {
let len= num;
var $chars = 'aaaabbbbcccc';
var maxPos = $chars.length;
var pwd = '';
for (var i = 0; i < len; i++) {
pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
}
return pwd;
}
function isIntNum(val) {
return typeof val === 'number' && val % 1 === 0;
}
function isBigInt(val) {
return typeof val === 'bigint';
}
function isString(str) {
return (typeof str == 'string') && str.constructor == String;
}
export {
fileIO,
isIntNum,
isBigInt,
isString,
describe,
it,
expect,
util
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import fileIO from '@ohos.file.fs';
import util from '@ohos.util';
import featureAbility from '@ohos.ability.featureAbility';
export const FILE_CONTENT = 'hello world';
import {
describe, it, expect
}
from '@ohos/hypium'
export function prepareFile(fpath, content) {
try {
let file = fileIO.openSync(fpath, fileIO.OpenMode.CREATE | fileIO.OpenMode.READ_WRITE)
fileIO.truncateSync(file.fd)
fileIO.writeSync(file.fd, content)
fileIO.fsyncSync(file.fd)
fileIO.closeSync(file)
return true
}
catch (e) {
console.log('Failed to prepareFile for ' + e)
return false
}
}
export function prepare200MFile(fpath) {
try {
let file = fileIO.openSync(fpath, fileIO.OpenMode.CREATE | fileIO.OpenMode.READ_WRITE)
fileIO.truncateSync(file.fd)
let bf = new ArrayBuffer(1024 * 1024 * 20);
for (let i = 0; i < 10; i++) {
let position = bf.byteLength * i;
let writeLen = fileIO.writeSync(file.fd, bf, { offset: 0, length: bf.byteLength, position: position, encoding: 'utf-8' });
}
fileIO.fsyncSync(file.fd)
fileIO.closeSync(file)
return true
}
catch (e) {
console.log('Failed to prepare200MFile for ' + e)
return false
}
}
export async function nextFileName(testName) {
let context = featureAbility.getContext();
let data = await context.getCacheDir();
let BASE_PATH = data + '/';
return BASE_PATH + testName + '_' + randomString(testName.length);
}
export async function fileName(testName) {
let context = featureAbility.getContext();
let data = await context.getFilesDir();
let BASE_PATH = data + '/';
return BASE_PATH + testName + '_' + randomString(testName.length);
}
export function randomString(num) {
let len= num;
var $chars = 'aaaabbbbcccc';
var maxPos = $chars.length;
var pwd = '';
for (var i = 0; i < len; i++) {
pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
}
return pwd;
}
function isIntNum(val) {
return typeof val === 'number' && val % 1 === 0;
}
function isBigInt(val) {
return typeof val === 'bigint';
}
function isString(str) {
return (typeof str == 'string') && str.constructor == String;
}
export {
fileIO,
isIntNum,
isBigInt,
isString,
describe,
it,
expect,
util
};
\ No newline at end of file
/*
* Copyright (C) 2022-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import fileIOAccess from './members/access.test.js'
import fileIOClose from './members/close.test.js'
import fileIOCopyDir from './members/copyDir.test'
import fileIOCopyfile from './members/copyFile.test.js'
import fileIOCreateStream from './members/createStream.test.js'
import fileIOFdatasync from './members/fdatasync.test.js'
import fileIOFdOpenStream from './members/fdopenStream.test.js'
import fileIOFileLock from './members/fileLock.test.js'
import fileIOFsync from './members/fsync.test.js'
import fileIOHash from './members/hash.test.js'
import fileIOListfile from './members/listFile.test.js'
import fileIOLstat from './members/lstat.test.js'
import fileIOMkdir from './members/mkdir.test.js'
import fileIOMkdtemp from './members/mkdtemp.test.js'
import fileIOMoveDir from './members/moveDir.test.js'
import fileIOMoveFile from './members/moveFile.test.js'
import fileIOOpen from './members/open.test.js'
import fileIORead from './members/read.test.js'
import fileIOReadtext from './members/readtext.test.js'
import fileIORename from './members/rename.test.js'
import fileIORmdir from './members/rmdir.test'
import fileIOStat from './members/stat.test.js'
import fileIOStreamClose from './class_stream/close.test.js'
import fileIOStreamFlush from './class_stream/flush.test.js'
import fileIOStreamRead from './class_stream/read.test.js'
import fileIOStreamWrite from './class_stream/write.test.js'
import fileIOSymlink from './members/symlink.test.js'
import fileIOTruncate from './members/truncate.test.js'
import fileIOUnlink from './members/unlink.test.js'
import fileIOWrite from './members/write.test.js'
import fileIORW from './members/filerw.test.js'
export default function testsuite() {
fileIOAccess()
fileIOClose()
fileIOCopyDir()
fileIOCopyfile()
fileIOCreateStream()
fileIOFdatasync()
fileIOFdOpenStream()
fileIOFileLock()
fileIOFsync()
fileIOHash()
fileIOListfile()
fileIOLstat()
fileIOMkdir()
fileIOMkdtemp()
fileIOMoveDir()
fileIOMoveFile()
fileIOOpen()
fileIORead()
fileIOReadtext()
fileIORename()
fileIORmdir()
fileIOStat()
fileIOStreamClose()
fileIOStreamFlush()
fileIOStreamRead()
fileIOStreamWrite()
fileIOSymlink()
fileIOTruncate()
fileIOUnlink()
fileIOWrite()
fileIORW()
}
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import fileIOAccess from './members/access.test.js'
import fileIOClose from './members/close.test.js'
import fileIOCopyDir from './members/copyDir.test'
import fileIOCopyfile from './members/copyFile.test.js'
import fileIOCreateStream from './members/createStream.test.js'
import fileIOFdatasync from './members/fdatasync.test.js'
import fileIOFdOpenStream from './members/fdopenStream.test.js'
import fileIOFileLock from './members/fileLock.test.js'
import fileIOFsync from './members/fsync.test.js'
import fileIOHash from './members/hash.test.js'
import fileIOListfile from './members/listFile.test.js'
import fileIOLstat from './members/lstat.test.js'
import fileIOMkdir from './members/mkdir.test.js'
import fileIOMkdtemp from './members/mkdtemp.test.js'
import fileIOMoveDir from './members/moveDir.test.js'
import fileIOMoveFile from './members/moveFile.test.js'
import fileIOOpen from './members/open.test.js'
import fileIORead from './members/read.test.js'
import fileIOReadtext from './members/readtext.test.js'
import fileIORename from './members/rename.test.js'
import fileIORmdir from './members/rmdir.test'
import fileIOStat from './members/stat.test.js'
import fileIOStreamClose from './class_stream/close.test.js'
import fileIOStreamFlush from './class_stream/flush.test.js'
import fileIOStreamRead from './class_stream/read.test.js'
import fileIOStreamWrite from './class_stream/write.test.js'
import fileIOSymlink from './members/symlink.test.js'
import fileIOTruncate from './members/truncate.test.js'
import fileIOUnlink from './members/unlink.test.js'
import fileIOWrite from './members/write.test.js'
import fileIORW from './members/filerw.test.js'
export default function testsuite() {
fileIOAccess()
fileIOClose()
fileIOCopyDir()
fileIOCopyfile()
fileIOCreateStream()
fileIOFdatasync()
fileIOFdOpenStream()
fileIOFileLock()
fileIOFsync()
fileIOHash()
fileIOListfile()
fileIOLstat()
fileIOMkdir()
fileIOMkdtemp()
fileIOMoveDir()
fileIOMoveFile()
fileIOOpen()
fileIORead()
fileIOReadtext()
fileIORename()
fileIORmdir()
fileIOStat()
fileIOStreamClose()
fileIOStreamFlush()
fileIOStreamRead()
fileIOStreamWrite()
fileIOSymlink()
fileIOTruncate()
fileIOUnlink()
fileIOWrite()
fileIORW()
}
/*
* Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
fileIO, FILE_CONTENT, prepareFile, nextFileName, describe, it, expect,
} from '../Common';
export default function fileIOStreamClose() {
describe('fileIO_fs_stream_close', function () {
/**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_SYNC_0000
* @tc.name fileIO_test_stream_close_sync_000
* @tc.desc Test the closeSync() interface of class Stream.
* Open a file stream, close file stream.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it('fileIO_test_stream_close_sync_000', 0, async function () {
let fpath = await nextFileName('fileIO_test_stream_close_sync_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = fileIO.createStreamSync(fpath, 'r');
expect(sr !== null).assertTrue();
sr.closeSync();
fileIO.unlinkSync(fpath);
} catch (e) {
console.log('fileIO_test_stream_close_sync_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
})
/**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_SYNC_0100
* @tc.name fileIO_test_stream_close_sync_001
* @tc.desc Test the closeSync() interface of class Stream.
* Invalid parameter, don't requrie any parameters.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_stream_close_sync_001', 0, async function () {
let fpath = await nextFileName('fileIO_test_stream_close_sync_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
let sr = fileIO.createStreamSync(fpath, 'r');
try {
expect(sr !== null).assertTrue();
sr.closeSync(1);
expect(false).assertTrue();
} catch (e) {
sr.closeSync();
fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_close_sync_001 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
}
})
/**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_SYNC_0200
* @tc.name fileIO_test_stream_close_sync_002
* @tc.desc Test the closeSync() interface of class Stream.
* The file stream has been closed.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_stream_close_sync_002', 0, async function () {
let fpath = await nextFileName('fileIO_test_stream_close_sync_002');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
let sr = fileIO.createStreamSync(fpath, 'r');
try {
expect(sr !== null).assertTrue();
sr.closeSync();
sr.closeSync();
expect(false).assertTrue();
} catch (e) {
fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_close_sync_002 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900005 && e.message == 'I/O error').assertTrue();
}
})
/**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0000
* @tc.name fileIO_test_stream_close_async_000
* @tc.desc Test the close() interface of class Stream. Promise.
* Open a file stream, close file stream.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 1
* @tc.require
*/
it('fileIO_test_stream_close_async_000', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_close_async_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = fileIO.createStreamSync(fpath, 'r');
expect(sr !== null).assertTrue();
await sr.close();
fileIO.unlinkSync(fpath);
done();
} catch (e) {
console.log('fileIO_test_stream_close_async_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0100
* @tc.name fileIO_test_stream_close_async_001
* @tc.desc Test the close() interface of class Stream. Callback.
* Open a file stream, close file stream.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 1
* @tc.require
*/
it('fileIO_test_stream_close_async_001', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_close_async_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = fileIO.createStreamSync(fpath, 'r');
expect(sr !== null).assertTrue();
sr.close((err) => {
if (err) {
console.log('fileIO_test_stream_close_async_001 error package: ' + JSON.stringify(err));
expect(false).assertTrue();
}
fileIO.unlinkSync(fpath);
})
done();
} catch (e) {
console.log('fileIO_test_stream_close_async_001 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0200
* @tc.name fileIO_test_stream_close_async_002
* @tc.desc Test the close() interface of class Stream. Promise.
* The file stream has been closed.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_stream_close_async_002', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_close_async_002');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = fileIO.createStreamSync(fpath, 'r');
expect(sr !== null).assertTrue();
await sr.close();
await sr.close();
expect(false).assertTrue();
} catch (e) {
fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_close_async_002 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900005 && e.message == 'I/O error').assertTrue();
done();
}
});
/**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0300
* @tc.name fileIO_test_stream_close_async_003
* @tc.desc Test the close() interface of class Stream. Promise.
* Invalid parameter, don't requrie any parameters.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_stream_close_async_003', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_close_async_003');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = fileIO.createStreamSync(fpath, 'r');
expect(sr !== null).assertTrue();
await sr.close(1);
expect(false).assertTrue();
} catch (e) {
fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_close_async_003 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
done();
}
});
})
}
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
fileIO, FILE_CONTENT, prepareFile, nextFileName, describe, it, expect,
} from '../Common';
export default function fileIOStreamClose() {
describe('fileIO_fs_stream_close', function () {
/**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_SYNC_0000
* @tc.name fileIO_test_stream_close_sync_000
* @tc.desc Test the closeSync() interface of class Stream.
* Open a file stream, close file stream.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it('fileIO_test_stream_close_sync_000', 0, async function () {
let fpath = await nextFileName('fileIO_test_stream_close_sync_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = fileIO.createStreamSync(fpath, 'r');
expect(sr !== null).assertTrue();
sr.closeSync();
fileIO.unlinkSync(fpath);
} catch (e) {
console.log('fileIO_test_stream_close_sync_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
})
/**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_SYNC_0100
* @tc.name fileIO_test_stream_close_sync_001
* @tc.desc Test the closeSync() interface of class Stream.
* Invalid parameter, don't requrie any parameters.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_stream_close_sync_001', 0, async function () {
let fpath = await nextFileName('fileIO_test_stream_close_sync_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
let sr = fileIO.createStreamSync(fpath, 'r');
try {
expect(sr !== null).assertTrue();
sr.closeSync(1);
expect(false).assertTrue();
} catch (e) {
sr.closeSync();
fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_close_sync_001 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
}
})
/**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_SYNC_0200
* @tc.name fileIO_test_stream_close_sync_002
* @tc.desc Test the closeSync() interface of class Stream.
* The file stream has been closed.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_stream_close_sync_002', 0, async function () {
let fpath = await nextFileName('fileIO_test_stream_close_sync_002');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
let sr = fileIO.createStreamSync(fpath, 'r');
try {
expect(sr !== null).assertTrue();
sr.closeSync();
sr.closeSync();
expect(false).assertTrue();
} catch (e) {
fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_close_sync_002 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900005 && e.message == 'I/O error').assertTrue();
}
})
/**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0000
* @tc.name fileIO_test_stream_close_async_000
* @tc.desc Test the close() interface of class Stream. Promise.
* Open a file stream, close file stream.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 1
* @tc.require
*/
it('fileIO_test_stream_close_async_000', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_close_async_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = fileIO.createStreamSync(fpath, 'r');
expect(sr !== null).assertTrue();
await sr.close();
fileIO.unlinkSync(fpath);
done();
} catch (e) {
console.log('fileIO_test_stream_close_async_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0100
* @tc.name fileIO_test_stream_close_async_001
* @tc.desc Test the close() interface of class Stream. Callback.
* Open a file stream, close file stream.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 1
* @tc.require
*/
it('fileIO_test_stream_close_async_001', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_close_async_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = fileIO.createStreamSync(fpath, 'r');
expect(sr !== null).assertTrue();
sr.close((err) => {
if (err) {
console.log('fileIO_test_stream_close_async_001 error package: ' + JSON.stringify(err));
expect(false).assertTrue();
}
fileIO.unlinkSync(fpath);
})
done();
} catch (e) {
console.log('fileIO_test_stream_close_async_001 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0200
* @tc.name fileIO_test_stream_close_async_002
* @tc.desc Test the close() interface of class Stream. Promise.
* The file stream has been closed.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_stream_close_async_002', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_close_async_002');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = fileIO.createStreamSync(fpath, 'r');
expect(sr !== null).assertTrue();
await sr.close();
await sr.close();
expect(false).assertTrue();
} catch (e) {
fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_close_async_002 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900005 && e.message == 'I/O error').assertTrue();
done();
}
});
/**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0300
* @tc.name fileIO_test_stream_close_async_003
* @tc.desc Test the close() interface of class Stream. Promise.
* Invalid parameter, don't requrie any parameters.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_stream_close_async_003', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_close_async_003');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = fileIO.createStreamSync(fpath, 'r');
expect(sr !== null).assertTrue();
await sr.close(1);
expect(false).assertTrue();
} catch (e) {
fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_close_async_003 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
done();
}
});
})
}
/*
* Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
fileIO, FILE_CONTENT, prepareFile, nextFileName, describe, it, expect,
} from '../Common';
export default function fileIOStreamFlush() {
describe('fileIO_fs_stream_flush', function () {
/**
* @tc.number SUB_DF_FILEIO_STREAM_FLUSH_SYNC_0000
* @tc.name fileIO_test_stream_flush_sync_000
* @tc.desc Test the flushSync() interface of class Stream.
* Refresh file stream.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it('fileIO_test_stream_flush_sync_000', 0, async function () {
let fpath = await nextFileName('fileIO_test_stream_flush_sync_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = fileIO.createStreamSync(fpath, 'r+');
expect(sr !== null).assertTrue();
expect(sr.writeSync(FILE_CONTENT) == FILE_CONTENT.length).assertTrue();
sr.flushSync();
sr.closeSync();
fileIO.unlinkSync(fpath);
} catch (e) {
console.log('fileIO_test_stream_flush_sync_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_STREAM_FLUSH_SYNC_0100
* @tc.name fileIO_test_stream_flush_sync_001
* @tc.desc Test the flushSync() interface of class Stream.
* Invalid parameter, don't requrie any parameters.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_stream_flush_sync_001', 0, async function () {
let fpath = await nextFileName('fileIO_test_stream_flush_sync_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
let sr = fileIO.createStreamSync(fpath, 'r+');
try {
expect(sr !== null).assertTrue();
sr.flushSync(1);
expect(false).assertTrue();
} catch (e) {
sr.closeSync();
fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_flush_sync_001 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_STREAM_FLUSH_ASYNC_0000
* @tc.name fileIO_test_stream_flush_async_000
* @tc.desc Test the flush() interface of class Stream. Promise.then().catch()
* Refresh the file stream.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_stream_flush_async_000', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_flush_async_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = await fileIO.createStreamSync(fpath, 'r+');
expect(sr !== null).assertTrue();
expect(sr.writeSync(FILE_CONTENT) == FILE_CONTENT.length).assertTrue();
sr.flush().then(() => {
sr.closeSync();
fileIO.unlinkSync(fpath);
done();
}).catch((err) => {
console.log('fileIO_test_stream_flush_async_000 error package' + JSON.stringify(err));
expect(false).assertTrue();
});
} catch (e) {
console.log('fileIO_test_stream_flush_async_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_STREAM_FLUSH_ASYNC_0100
* @tc.name fileIO_test_stream_flush_async_001
* @tc.desc Test the flush() interface of class Stream. Callback.
* Refresh the file stream.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 1
* @tc.require
*/
it('fileIO_test_stream_flush_async_001', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_flush_async_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = await fileIO.createStreamSync(fpath, 'r+');
expect(sr !== null).assertTrue();
expect(sr.writeSync(FILE_CONTENT) == FILE_CONTENT.length).assertTrue();
sr.flush((err) => {
if (err) {
console.log('fileIO_test_stream_flush_async_001 error package' + JSON.stringify(err));
expect(false).assertTrue();
}
sr.closeSync();
fileIO.unlinkSync(fpath);
done();
})
} catch (e) {
console.log('fileIO_test_stream_flush_async_001 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_STREAM_FLUSH_ASYNC_0100
* @tc.name fileIO_test_stream_flush_async_002
* @tc.desc Test the flush() interface of class Stream. Promise.
* Refresh the file stream.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_stream_flush_async_002', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_flush_async_002');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
let sr = fileIO.createStreamSync(fpath, 'r+');
try {
expect(sr !== null).assertTrue();
await sr.flush(1);
expect(false).assertTrue();
} catch (e) {
sr.closeSync();
fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_flush_async_002 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
done();
}
});
});
}
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
fileIO, FILE_CONTENT, prepareFile, nextFileName, describe, it, expect,
} from '../Common';
export default function fileIOStreamFlush() {
describe('fileIO_fs_stream_flush', function () {
/**
* @tc.number SUB_DF_FILEIO_STREAM_FLUSH_SYNC_0000
* @tc.name fileIO_test_stream_flush_sync_000
* @tc.desc Test the flushSync() interface of class Stream.
* Refresh file stream.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it('fileIO_test_stream_flush_sync_000', 0, async function () {
let fpath = await nextFileName('fileIO_test_stream_flush_sync_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = fileIO.createStreamSync(fpath, 'r+');
expect(sr !== null).assertTrue();
expect(sr.writeSync(FILE_CONTENT) == FILE_CONTENT.length).assertTrue();
sr.flushSync();
sr.closeSync();
fileIO.unlinkSync(fpath);
} catch (e) {
console.log('fileIO_test_stream_flush_sync_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_STREAM_FLUSH_SYNC_0100
* @tc.name fileIO_test_stream_flush_sync_001
* @tc.desc Test the flushSync() interface of class Stream.
* Invalid parameter, don't requrie any parameters.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_stream_flush_sync_001', 0, async function () {
let fpath = await nextFileName('fileIO_test_stream_flush_sync_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
let sr = fileIO.createStreamSync(fpath, 'r+');
try {
expect(sr !== null).assertTrue();
sr.flushSync(1);
expect(false).assertTrue();
} catch (e) {
sr.closeSync();
fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_flush_sync_001 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_STREAM_FLUSH_ASYNC_0000
* @tc.name fileIO_test_stream_flush_async_000
* @tc.desc Test the flush() interface of class Stream. Promise.then().catch()
* Refresh the file stream.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_stream_flush_async_000', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_flush_async_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = await fileIO.createStreamSync(fpath, 'r+');
expect(sr !== null).assertTrue();
expect(sr.writeSync(FILE_CONTENT) == FILE_CONTENT.length).assertTrue();
sr.flush().then(() => {
sr.closeSync();
fileIO.unlinkSync(fpath);
done();
}).catch((err) => {
console.log('fileIO_test_stream_flush_async_000 error package' + JSON.stringify(err));
expect(false).assertTrue();
});
} catch (e) {
console.log('fileIO_test_stream_flush_async_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_STREAM_FLUSH_ASYNC_0100
* @tc.name fileIO_test_stream_flush_async_001
* @tc.desc Test the flush() interface of class Stream. Callback.
* Refresh the file stream.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 1
* @tc.require
*/
it('fileIO_test_stream_flush_async_001', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_flush_async_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let sr = await fileIO.createStreamSync(fpath, 'r+');
expect(sr !== null).assertTrue();
expect(sr.writeSync(FILE_CONTENT) == FILE_CONTENT.length).assertTrue();
sr.flush((err) => {
if (err) {
console.log('fileIO_test_stream_flush_async_001 error package' + JSON.stringify(err));
expect(false).assertTrue();
}
sr.closeSync();
fileIO.unlinkSync(fpath);
done();
})
} catch (e) {
console.log('fileIO_test_stream_flush_async_001 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_STREAM_FLUSH_ASYNC_0100
* @tc.name fileIO_test_stream_flush_async_002
* @tc.desc Test the flush() interface of class Stream. Promise.
* Refresh the file stream.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_stream_flush_async_002', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_flush_async_002');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
let sr = fileIO.createStreamSync(fpath, 'r+');
try {
expect(sr !== null).assertTrue();
await sr.flush(1);
expect(false).assertTrue();
} catch (e) {
sr.closeSync();
fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_flush_async_002 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
done();
}
});
});
}
/*
* Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
fileIO, FILE_CONTENT, prepareFile, nextFileName, isIntNum, describe, it, expect,
} from '../Common';
export default function fileIOAccess() {
describe('fileIO_fs_access', function () {
/**
* @tc.number SUB_DF_FILEIO_ACCESS_SYNC_0000
* @tc.name fileIO_test_access_sync_000
* @tc.desc Test accessSync() interface.
* This interface shall work properly in normal case.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it('fileIO_test_access_sync_000', 0, async function () {
let fpath = await nextFileName('fileIO_test_access_sync_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
expect(fileIO.accessSync(fpath)).assertTrue();
let file = fileIO.openSync(fpath);
expect(isIntNum(file.fd)).assertTrue();
let readlen = fileIO.readSync(file.fd, new ArrayBuffer(4096));
expect(readlen == FILE_CONTENT.length).assertTrue();
fileIO.closeSync(file);
fileIO.unlinkSync(fpath);
} catch (e) {
console.log('fileIO_test_access_sync_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_SYNC_0100
* @tc.name fileIO_test_access_sync_001
* @tc.desc Test accessSync() interface.
* The test file is not exist.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_sync_001', 0, async function () {
let fpath = await nextFileName('fileIO_test_access_sync_001');
try {
let ret = fileIO.accessSync(fpath);
expect(ret === false).assertTrue();
} catch (e) {
console.log('fileIO_test_access_sync_001 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_SYNC_0200
* @tc.name fileIO_test_access_sync_002
* @tc.desc Test accessSync() interface.
* The test file path is illegal.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_sync_002', 0, async function () {
try {
expect(fileIO.accessSync(-1)).assertTrue();
expect(false).assertTrue();
} catch (e) {
console.log('fileIO_test_access_sync_001 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0000
* @tc.name fileIO_test_access_async_000
* @tc.desc Test access() interface. Promise.
* Use promise to test that the file is exist. Sync method reads data from file.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_async_000', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_access_async_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let ret = await fileIO.access(fpath);
expect(ret === true).assertTrue();
let file = fileIO.openSync(fpath);
expect(isIntNum(file.fd)).assertTrue();
let readlen = fileIO.readSync(file.fd, new ArrayBuffer(4096));
expect(readlen == FILE_CONTENT.length).assertTrue();
fileIO.closeSync(file);
fileIO.unlinkSync(fpath);
done();
} catch (e) {
console.log('fileIO_test_access_async_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0100
* @tc.name fileIO_test_access_async_001
* @tc.desc Test access() interface. Callback.
* Use callback to test that the file is exist. Sync method reads data from file.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_async_001', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_access_async_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
fileIO.access(fpath, (err, ret) => {
if (err) {
console.log('fileIO_test_access_async_001 error package: ' + JSON.stringify(err));
expect(false).assertTrue();
}
expect(ret === true).assertTrue();
let file = fileIO.openSync(fpath);
expect(isIntNum(file.fd)).assertTrue();
let readlen = fileIO.readSync(file.fd, new ArrayBuffer(4096));
expect(readlen == FILE_CONTENT.length).assertTrue();
fileIO.closeSync(file);
fileIO.unlinkSync(fpath);
});
done();
} catch (e) {
console.log('fileIO_test_access_async_001 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0200
* @tc.name fileIO_test_access_async_002
* @tc.desc Test access() interface. Promise.
* Async test file does not exist.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_async_002', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_access_async_002');
try {
let ret = await fileIO.access(fpath);
expect(ret === false).assertTrue();
done();
} catch (e) {
console.log('fileIO_test_access_async_002 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0300
* @tc.name fileIO_test_access_async_003
* @tc.desc Test access() interface. Callback.
* Async test file does not exist.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_async_003', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_access_async_002');
try {
fileIO.access(fpath, (err, ret) => {
if (err) {
console.log('fileIO_test_access_async_003 error package: ' + JSON.stringify(err));
expect(false).assertTrue();
}
expect(ret === false).assertTrue();
done();
});
} catch (e) {
console.log('fileIO_test_access_async_003 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0400
* @tc.name fileIO_test_access_async_004
* @tc.desc Test access() interface. Promise.
* Invalid path parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_async_004', 0, async function (done) {
try {
await fileIO.access(-1);
expect(false).assertTrue();
} catch (e) {
console.log('fileIO_test_access_async_004 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
done();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0500
* @tc.name fileIO_test_access_async_005
* @tc.desc Test access() interface. Callback.
* Invalid path parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_async_005', 0, async function (done) {
try {
fileIO.access(-1, (err) => {
expect(false).assertTrue();
});
} catch (e) {
console.log('fileIO_test_access_async_005 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
done();
}
});
});
}
/*
* Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
fileIO, FILE_CONTENT, prepareFile, nextFileName, isIntNum, describe, it, expect,
} from '../Common';
export default function fileIOAccess() {
describe('fileIO_fs_access', function () {
/**
* @tc.number SUB_DF_FILEIO_ACCESS_SYNC_0000
* @tc.name fileIO_test_access_sync_000
* @tc.desc Test accessSync() interface.
* This interface shall work properly in normal case.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it('fileIO_test_access_sync_000', 0, async function () {
let fpath = await nextFileName('fileIO_test_access_sync_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
expect(fileIO.accessSync(fpath)).assertTrue();
let file = fileIO.openSync(fpath);
expect(isIntNum(file.fd)).assertTrue();
let readlen = fileIO.readSync(file.fd, new ArrayBuffer(4096));
expect(readlen == FILE_CONTENT.length).assertTrue();
fileIO.closeSync(file);
fileIO.unlinkSync(fpath);
} catch (e) {
console.log('fileIO_test_access_sync_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_SYNC_0100
* @tc.name fileIO_test_access_sync_001
* @tc.desc Test accessSync() interface.
* The test file is not exist.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_sync_001', 0, async function () {
let fpath = await nextFileName('fileIO_test_access_sync_001');
try {
let ret = fileIO.accessSync(fpath);
expect(ret === false).assertTrue();
} catch (e) {
console.log('fileIO_test_access_sync_001 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_SYNC_0200
* @tc.name fileIO_test_access_sync_002
* @tc.desc Test accessSync() interface.
* The test file path is illegal.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_sync_002', 0, async function () {
try {
expect(fileIO.accessSync(-1)).assertTrue();
expect(false).assertTrue();
} catch (e) {
console.log('fileIO_test_access_sync_001 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0000
* @tc.name fileIO_test_access_async_000
* @tc.desc Test access() interface. Promise.
* Use promise to test that the file is exist. Sync method reads data from file.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_async_000', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_access_async_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let ret = await fileIO.access(fpath);
expect(ret === true).assertTrue();
let file = fileIO.openSync(fpath);
expect(isIntNum(file.fd)).assertTrue();
let readlen = fileIO.readSync(file.fd, new ArrayBuffer(4096));
expect(readlen == FILE_CONTENT.length).assertTrue();
fileIO.closeSync(file);
fileIO.unlinkSync(fpath);
done();
} catch (e) {
console.log('fileIO_test_access_async_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0100
* @tc.name fileIO_test_access_async_001
* @tc.desc Test access() interface. Callback.
* Use callback to test that the file is exist. Sync method reads data from file.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_async_001', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_access_async_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
fileIO.access(fpath, (err, ret) => {
if (err) {
console.log('fileIO_test_access_async_001 error package: ' + JSON.stringify(err));
expect(false).assertTrue();
}
expect(ret === true).assertTrue();
let file = fileIO.openSync(fpath);
expect(isIntNum(file.fd)).assertTrue();
let readlen = fileIO.readSync(file.fd, new ArrayBuffer(4096));
expect(readlen == FILE_CONTENT.length).assertTrue();
fileIO.closeSync(file);
fileIO.unlinkSync(fpath);
});
done();
} catch (e) {
console.log('fileIO_test_access_async_001 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0200
* @tc.name fileIO_test_access_async_002
* @tc.desc Test access() interface. Promise.
* Async test file does not exist.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_async_002', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_access_async_002');
try {
let ret = await fileIO.access(fpath);
expect(ret === false).assertTrue();
done();
} catch (e) {
console.log('fileIO_test_access_async_002 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0300
* @tc.name fileIO_test_access_async_003
* @tc.desc Test access() interface. Callback.
* Async test file does not exist.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_async_003', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_access_async_002');
try {
fileIO.access(fpath, (err, ret) => {
if (err) {
console.log('fileIO_test_access_async_003 error package: ' + JSON.stringify(err));
expect(false).assertTrue();
}
expect(ret === false).assertTrue();
done();
});
} catch (e) {
console.log('fileIO_test_access_async_003 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0400
* @tc.name fileIO_test_access_async_004
* @tc.desc Test access() interface. Promise.
* Invalid path parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_async_004', 0, async function (done) {
try {
await fileIO.access(-1);
expect(false).assertTrue();
} catch (e) {
console.log('fileIO_test_access_async_004 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
done();
}
});
/**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0500
* @tc.name fileIO_test_access_async_005
* @tc.desc Test access() interface. Callback.
* Invalid path parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it('fileIO_test_access_async_005', 0, async function (done) {
try {
fileIO.access(-1, (err) => {
expect(false).assertTrue();
});
} catch (e) {
console.log('fileIO_test_access_async_005 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
done();
}
});
});
}
{
"string": [
{
"name": "app_name",
"value": "storagefilefsjstest"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
}
]
}
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"hvigorVersion": "2.0.0",
"dependencies": {
"@ohos/hvigor-ohos-plugin": "2.0.0"
}
}
此差异已折叠。
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export { legacyAppTasks } from '@ohos/hvigor-ohos-plugin';
\ No newline at end of file
此差异已折叠。
此差异已折叠。
{
"strings": {
"hello": "Hello",
"world": "Test"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "测试"
}
}
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册