未验证 提交 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"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
...@@ -13,23 +13,11 @@ ...@@ -13,23 +13,11 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("storagefileiov9_js_test") { ohos_js_app_suite("storagefileiov9_js_test") {
hap_profile = "./src/main/config.json" test_hap = true
deps = [ testonly = true
":storagefileiov9_js_assets",
":storagefileiov9_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsStorageFileIoV9JSTest" hap_name = "ActsStorageFileIoV9JSTest"
subsystem_name = "filemanagement" subsystem_name = "filemanagement"
part_name = "file_api" part_name = "file_api"
} certificate_profile = "./signature/openharmony_sx.p7b"
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"
} }
{ {
"description": "Configuration for storage filefs Tests", "description": "Configuration for storage filefs Tests",
"driver": { "driver": {
"type": "OHJSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "600000", "test-timeout": "600000",
"shell-timeout": "600000", "shell-timeout": "600000",
"bundle-name": "ohos.acts.storage.fileiov9", "bundle-name": "ohos.acts.storage.fileiov9",
"package-name": "ohos.acts.storage.fileiov9" "package-name": "ohos.acts.storage.fileiov9_test"
}, },
"kits": [ "kits": [
{ {
"test-file-name": ["ActsStorageFileIoV9JSTest.hap"], "test-file-name": ["ActsStorageFileIoV9JSTest.hap"],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import hilog from '@ohos.hilog';
export default { export default {
data: { onCreate() {
title: "" 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": [ "string": [
{ {
"name": "app_name", "name": "app_name",
"value": "storagefilefsjstest" "value": "storagefilefsjstest"
}, },
{ {
"name": "mainability_description", "name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability" "value": "JS_Phone_Empty Feature Ability"
}, },
{ {
"name": "MainAbility_desc", "name": "MainAbility_desc",
"value": "description" "value": "description"
}, },
{ {
"name": "MainAbility_label", "name": "MainAbility_label",
"value": "label" "value": "label"
}, },
{ {
"name": "TestAbility_desc", "name": "TestAbility_desc",
"value": "description" "value": "description"
}, },
{ {
"name": "TestAbility_label", "name": "TestAbility_label",
"value": "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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -12,20 +12,22 @@ ...@@ -12,20 +12,22 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import hilog from '@ohos.hilog';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
import { Hypium } from '@ohos/hypium' import { Hypium } from '@ohos/hypium';
import testsuite from '../test/List.test' import testsuite from '../test/List.test';
export default { export default {
onCreate() { onCreate() {
console.info('TestApplication onCreate') hilog.info(0x0000, 'testTag', '%{public}s', 'TestApplication onCreate');
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!') hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}, },
onDestroy() { 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
export default { export default {
data: { data: {
title: "" 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -12,48 +12,30 @@ ...@@ -12,48 +12,30 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import hilog from '@ohos.hilog';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.app.ability.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()
}
export default { export default {
onPrepare() { onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare') hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare');
}, },
onRun() { onRun() {
console.log('OpenHarmonyTestRunner onRun run') hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run');
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"] var debug = abilityDelegatorArguments.parameters["-D"]
console.info('debug value : '+debug)
if (debug == 'true') if (debug == 'true')
{ {
cmd += ' -D' cmd += ' -D'
} }
console.info('cmd : '+cmd) hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd);
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err)); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? '');
console.info('executeShellCommand : data : ' + data.stdResult); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', data.stdResult ?? '');
console.info('executeShellCommand : data : ' + data.exitCode); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', data.exitCode ?? '');
}) })
} }
}; };
\ No newline at end of file
/* /**
* Copyright (C) 2022-2023 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License'); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import fileIO from '@ohos.file.fs'; import fileIO from '@ohos.file.fs';
import util from '@ohos.util'; import util from '@ohos.util';
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
export const FILE_CONTENT = 'hello world'; export const FILE_CONTENT = 'hello world';
import { import {
describe, it, expect describe, it, expect
} }
from '@ohos/hypium' from '@ohos/hypium'
export function prepareFile(fpath, content) { export function prepareFile(fpath, content) {
try { try {
let file = fileIO.openSync(fpath, fileIO.OpenMode.CREATE | fileIO.OpenMode.READ_WRITE) let file = fileIO.openSync(fpath, fileIO.OpenMode.CREATE | fileIO.OpenMode.READ_WRITE)
fileIO.truncateSync(file.fd) fileIO.truncateSync(file.fd)
fileIO.writeSync(file.fd, content) fileIO.writeSync(file.fd, content)
fileIO.fsyncSync(file.fd) fileIO.fsyncSync(file.fd)
fileIO.closeSync(file) fileIO.closeSync(file)
return true return true
} }
catch (e) { catch (e) {
console.log('Failed to prepareFile for ' + e) console.log('Failed to prepareFile for ' + e)
return false return false
} }
} }
export function prepare200MFile(fpath) { export function prepare200MFile(fpath) {
try { try {
let file = fileIO.openSync(fpath, fileIO.OpenMode.CREATE | fileIO.OpenMode.READ_WRITE) let file = fileIO.openSync(fpath, fileIO.OpenMode.CREATE | fileIO.OpenMode.READ_WRITE)
fileIO.truncateSync(file.fd) fileIO.truncateSync(file.fd)
let bf = new ArrayBuffer(1024 * 1024 * 20); let bf = new ArrayBuffer(1024 * 1024 * 20);
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
let position = bf.byteLength * i; let position = bf.byteLength * i;
let writeLen = fileIO.writeSync(file.fd, bf, { offset: 0, length: bf.byteLength, position: position, encoding: 'utf-8' }); let writeLen = fileIO.writeSync(file.fd, bf, { offset: 0, length: bf.byteLength, position: position, encoding: 'utf-8' });
} }
fileIO.fsyncSync(file.fd) fileIO.fsyncSync(file.fd)
fileIO.closeSync(file) fileIO.closeSync(file)
return true return true
} }
catch (e) { catch (e) {
console.log('Failed to prepare200MFile for ' + e) console.log('Failed to prepare200MFile for ' + e)
return false return false
} }
} }
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();
let BASE_PATH = data + '/'; let BASE_PATH = data + '/';
return BASE_PATH + testName + '_' + randomString(testName.length); return BASE_PATH + testName + '_' + randomString(testName.length);
} }
export async function fileName(testName) { export async function fileName(testName) {
let context = featureAbility.getContext(); let context = featureAbility.getContext();
let data = await context.getFilesDir(); let data = await context.getFilesDir();
let BASE_PATH = data + '/'; let BASE_PATH = data + '/';
return BASE_PATH + testName + '_' + randomString(testName.length); return BASE_PATH + testName + '_' + randomString(testName.length);
} }
export function randomString(num) { export function randomString(num) {
let len= num; let len= num;
var $chars = 'aaaabbbbcccc'; var $chars = 'aaaabbbbcccc';
var maxPos = $chars.length; var maxPos = $chars.length;
var pwd = ''; var pwd = '';
for (var i = 0; i < len; i++) { for (var i = 0; i < len; i++) {
pwd += $chars.charAt(Math.floor(Math.random() * maxPos)); pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
} }
return pwd; return pwd;
} }
function isIntNum(val) { function isIntNum(val) {
return typeof val === 'number' && val % 1 === 0; return typeof val === 'number' && val % 1 === 0;
} }
function isBigInt(val) { function isBigInt(val) {
return typeof val === 'bigint'; return typeof val === 'bigint';
} }
function isString(str) { function isString(str) {
return (typeof str == 'string') && str.constructor == String; return (typeof str == 'string') && str.constructor == String;
} }
export { export {
fileIO, fileIO,
isIntNum, isIntNum,
isBigInt, isBigInt,
isString, isString,
describe, describe,
it, it,
expect, expect,
util util
}; };
\ No newline at end of file
/* /**
* Copyright (C) 2022-2023 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import fileIOAccess from './members/access.test.js' import fileIOAccess from './members/access.test.js'
import fileIOClose from './members/close.test.js' import fileIOClose from './members/close.test.js'
import fileIOCopyDir from './members/copyDir.test' import fileIOCopyDir from './members/copyDir.test'
import fileIOCopyfile from './members/copyFile.test.js' import fileIOCopyfile from './members/copyFile.test.js'
import fileIOCreateStream from './members/createStream.test.js' import fileIOCreateStream from './members/createStream.test.js'
import fileIOFdatasync from './members/fdatasync.test.js' import fileIOFdatasync from './members/fdatasync.test.js'
import fileIOFdOpenStream from './members/fdopenStream.test.js' import fileIOFdOpenStream from './members/fdopenStream.test.js'
import fileIOFileLock from './members/fileLock.test.js' import fileIOFileLock from './members/fileLock.test.js'
import fileIOFsync from './members/fsync.test.js' import fileIOFsync from './members/fsync.test.js'
import fileIOHash from './members/hash.test.js' import fileIOHash from './members/hash.test.js'
import fileIOListfile from './members/listFile.test.js' import fileIOListfile from './members/listFile.test.js'
import fileIOLstat from './members/lstat.test.js' import fileIOLstat from './members/lstat.test.js'
import fileIOMkdir from './members/mkdir.test.js' import fileIOMkdir from './members/mkdir.test.js'
import fileIOMkdtemp from './members/mkdtemp.test.js' import fileIOMkdtemp from './members/mkdtemp.test.js'
import fileIOMoveDir from './members/moveDir.test.js' import fileIOMoveDir from './members/moveDir.test.js'
import fileIOMoveFile from './members/moveFile.test.js' import fileIOMoveFile from './members/moveFile.test.js'
import fileIOOpen from './members/open.test.js' import fileIOOpen from './members/open.test.js'
import fileIORead from './members/read.test.js' import fileIORead from './members/read.test.js'
import fileIOReadtext from './members/readtext.test.js' import fileIOReadtext from './members/readtext.test.js'
import fileIORename from './members/rename.test.js' import fileIORename from './members/rename.test.js'
import fileIORmdir from './members/rmdir.test' import fileIORmdir from './members/rmdir.test'
import fileIOStat from './members/stat.test.js' import fileIOStat from './members/stat.test.js'
import fileIOStreamClose from './class_stream/close.test.js' import fileIOStreamClose from './class_stream/close.test.js'
import fileIOStreamFlush from './class_stream/flush.test.js' import fileIOStreamFlush from './class_stream/flush.test.js'
import fileIOStreamRead from './class_stream/read.test.js' import fileIOStreamRead from './class_stream/read.test.js'
import fileIOStreamWrite from './class_stream/write.test.js' import fileIOStreamWrite from './class_stream/write.test.js'
import fileIOSymlink from './members/symlink.test.js' import fileIOSymlink from './members/symlink.test.js'
import fileIOTruncate from './members/truncate.test.js' import fileIOTruncate from './members/truncate.test.js'
import fileIOUnlink from './members/unlink.test.js' import fileIOUnlink from './members/unlink.test.js'
import fileIOWrite from './members/write.test.js' import fileIOWrite from './members/write.test.js'
import fileIORW from './members/filerw.test.js' import fileIORW from './members/filerw.test.js'
export default function testsuite() { export default function testsuite() {
fileIOAccess() fileIOAccess()
fileIOClose() fileIOClose()
fileIOCopyDir() fileIOCopyDir()
fileIOCopyfile() fileIOCopyfile()
fileIOCreateStream() fileIOCreateStream()
fileIOFdatasync() fileIOFdatasync()
fileIOFdOpenStream() fileIOFdOpenStream()
fileIOFileLock() fileIOFileLock()
fileIOFsync() fileIOFsync()
fileIOHash() fileIOHash()
fileIOListfile() fileIOListfile()
fileIOLstat() fileIOLstat()
fileIOMkdir() fileIOMkdir()
fileIOMkdtemp() fileIOMkdtemp()
fileIOMoveDir() fileIOMoveDir()
fileIOMoveFile() fileIOMoveFile()
fileIOOpen() fileIOOpen()
fileIORead() fileIORead()
fileIOReadtext() fileIOReadtext()
fileIORename() fileIORename()
fileIORmdir() fileIORmdir()
fileIOStat() fileIOStat()
fileIOStreamClose() fileIOStreamClose()
fileIOStreamFlush() fileIOStreamFlush()
fileIOStreamRead() fileIOStreamRead()
fileIOStreamWrite() fileIOStreamWrite()
fileIOSymlink() fileIOSymlink()
fileIOTruncate() fileIOTruncate()
fileIOUnlink() fileIOUnlink()
fileIOWrite() fileIOWrite()
fileIORW() fileIORW()
} }
/* /**
* Copyright (C) 2023 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License'); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { import {
fileIO, FILE_CONTENT, prepareFile, nextFileName, describe, it, expect, fileIO, FILE_CONTENT, prepareFile, nextFileName, describe, it, expect,
} from '../Common'; } from '../Common';
export default function fileIOStreamClose() { export default function fileIOStreamClose() {
describe('fileIO_fs_stream_close', function () { describe('fileIO_fs_stream_close', function () {
/** /**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_SYNC_0000 * @tc.number SUB_DF_FILEIO_STREAM_CLOSE_SYNC_0000
* @tc.name fileIO_test_stream_close_sync_000 * @tc.name fileIO_test_stream_close_sync_000
* @tc.desc Test the closeSync() interface of class Stream. * @tc.desc Test the closeSync() interface of class Stream.
* Open a file stream, close file stream. * Open a file stream, close file stream.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 0 * @tc.level Level 0
* @tc.require * @tc.require
*/ */
it('fileIO_test_stream_close_sync_000', 0, async function () { it('fileIO_test_stream_close_sync_000', 0, async function () {
let fpath = await nextFileName('fileIO_test_stream_close_sync_000'); let fpath = await nextFileName('fileIO_test_stream_close_sync_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try { try {
let sr = fileIO.createStreamSync(fpath, 'r'); let sr = fileIO.createStreamSync(fpath, 'r');
expect(sr !== null).assertTrue(); expect(sr !== null).assertTrue();
sr.closeSync(); sr.closeSync();
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
} catch (e) { } catch (e) {
console.log('fileIO_test_stream_close_sync_000 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_stream_close_sync_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue(); expect(false).assertTrue();
} }
}) })
/** /**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_SYNC_0100 * @tc.number SUB_DF_FILEIO_STREAM_CLOSE_SYNC_0100
* @tc.name fileIO_test_stream_close_sync_001 * @tc.name fileIO_test_stream_close_sync_001
* @tc.desc Test the closeSync() interface of class Stream. * @tc.desc Test the closeSync() interface of class Stream.
* Invalid parameter, don't requrie any parameters. * Invalid parameter, don't requrie any parameters.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 3 * @tc.level Level 3
* @tc.require * @tc.require
*/ */
it('fileIO_test_stream_close_sync_001', 0, async function () { it('fileIO_test_stream_close_sync_001', 0, async function () {
let fpath = await nextFileName('fileIO_test_stream_close_sync_001'); let fpath = await nextFileName('fileIO_test_stream_close_sync_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
let sr = fileIO.createStreamSync(fpath, 'r'); let sr = fileIO.createStreamSync(fpath, 'r');
try { try {
expect(sr !== null).assertTrue(); expect(sr !== null).assertTrue();
sr.closeSync(1); sr.closeSync(1);
expect(false).assertTrue(); expect(false).assertTrue();
} catch (e) { } catch (e) {
sr.closeSync(); sr.closeSync();
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_close_sync_001 has failed for ' + e.message + ', code: ' + e.code); 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(); expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
} }
}) })
/** /**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_SYNC_0200 * @tc.number SUB_DF_FILEIO_STREAM_CLOSE_SYNC_0200
* @tc.name fileIO_test_stream_close_sync_002 * @tc.name fileIO_test_stream_close_sync_002
* @tc.desc Test the closeSync() interface of class Stream. * @tc.desc Test the closeSync() interface of class Stream.
* The file stream has been closed. * The file stream has been closed.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 3 * @tc.level Level 3
* @tc.require * @tc.require
*/ */
it('fileIO_test_stream_close_sync_002', 0, async function () { it('fileIO_test_stream_close_sync_002', 0, async function () {
let fpath = await nextFileName('fileIO_test_stream_close_sync_002'); let fpath = await nextFileName('fileIO_test_stream_close_sync_002');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
let sr = fileIO.createStreamSync(fpath, 'r'); let sr = fileIO.createStreamSync(fpath, 'r');
try { try {
expect(sr !== null).assertTrue(); expect(sr !== null).assertTrue();
sr.closeSync(); sr.closeSync();
sr.closeSync(); sr.closeSync();
expect(false).assertTrue(); expect(false).assertTrue();
} catch (e) { } catch (e) {
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_close_sync_002 has failed for ' + e.message + ', code: ' + e.code); 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(); expect(e.code == 13900005 && e.message == 'I/O error').assertTrue();
} }
}) })
/** /**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0000 * @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0000
* @tc.name fileIO_test_stream_close_async_000 * @tc.name fileIO_test_stream_close_async_000
* @tc.desc Test the close() interface of class Stream. Promise. * @tc.desc Test the close() interface of class Stream. Promise.
* Open a file stream, close file stream. * Open a file stream, close file stream.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 1 * @tc.level Level 1
* @tc.require * @tc.require
*/ */
it('fileIO_test_stream_close_async_000', 0, async function (done) { it('fileIO_test_stream_close_async_000', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_close_async_000'); let fpath = await nextFileName('fileIO_test_stream_close_async_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try { try {
let sr = fileIO.createStreamSync(fpath, 'r'); let sr = fileIO.createStreamSync(fpath, 'r');
expect(sr !== null).assertTrue(); expect(sr !== null).assertTrue();
await sr.close(); await sr.close();
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
done(); done();
} catch (e) { } catch (e) {
console.log('fileIO_test_stream_close_async_000 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_stream_close_async_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
/** /**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0100 * @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0100
* @tc.name fileIO_test_stream_close_async_001 * @tc.name fileIO_test_stream_close_async_001
* @tc.desc Test the close() interface of class Stream. Callback. * @tc.desc Test the close() interface of class Stream. Callback.
* Open a file stream, close file stream. * Open a file stream, close file stream.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 1 * @tc.level Level 1
* @tc.require * @tc.require
*/ */
it('fileIO_test_stream_close_async_001', 0, async function (done) { it('fileIO_test_stream_close_async_001', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_close_async_001'); let fpath = await nextFileName('fileIO_test_stream_close_async_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try { try {
let sr = fileIO.createStreamSync(fpath, 'r'); let sr = fileIO.createStreamSync(fpath, 'r');
expect(sr !== null).assertTrue(); expect(sr !== null).assertTrue();
sr.close((err) => { sr.close((err) => {
if (err) { if (err) {
console.log('fileIO_test_stream_close_async_001 error package: ' + JSON.stringify(err)); console.log('fileIO_test_stream_close_async_001 error package: ' + JSON.stringify(err));
expect(false).assertTrue(); expect(false).assertTrue();
} }
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
}) })
done(); done();
} catch (e) { } catch (e) {
console.log('fileIO_test_stream_close_async_001 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_stream_close_async_001 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
/** /**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0200 * @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0200
* @tc.name fileIO_test_stream_close_async_002 * @tc.name fileIO_test_stream_close_async_002
* @tc.desc Test the close() interface of class Stream. Promise. * @tc.desc Test the close() interface of class Stream. Promise.
* The file stream has been closed. * The file stream has been closed.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 3 * @tc.level Level 3
* @tc.require * @tc.require
*/ */
it('fileIO_test_stream_close_async_002', 0, async function (done) { it('fileIO_test_stream_close_async_002', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_close_async_002'); let fpath = await nextFileName('fileIO_test_stream_close_async_002');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try { try {
let sr = fileIO.createStreamSync(fpath, 'r'); let sr = fileIO.createStreamSync(fpath, 'r');
expect(sr !== null).assertTrue(); expect(sr !== null).assertTrue();
await sr.close(); await sr.close();
await sr.close(); await sr.close();
expect(false).assertTrue(); expect(false).assertTrue();
} catch (e) { } catch (e) {
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_close_async_002 has failed for ' + e.message + ', code: ' + e.code); 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(); expect(e.code == 13900005 && e.message == 'I/O error').assertTrue();
done(); done();
} }
}); });
/** /**
* @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0300 * @tc.number SUB_DF_FILEIO_STREAM_CLOSE_ASYNC_0300
* @tc.name fileIO_test_stream_close_async_003 * @tc.name fileIO_test_stream_close_async_003
* @tc.desc Test the close() interface of class Stream. Promise. * @tc.desc Test the close() interface of class Stream. Promise.
* Invalid parameter, don't requrie any parameters. * Invalid parameter, don't requrie any parameters.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 3 * @tc.level Level 3
* @tc.require * @tc.require
*/ */
it('fileIO_test_stream_close_async_003', 0, async function (done) { it('fileIO_test_stream_close_async_003', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_close_async_003'); let fpath = await nextFileName('fileIO_test_stream_close_async_003');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try { try {
let sr = fileIO.createStreamSync(fpath, 'r'); let sr = fileIO.createStreamSync(fpath, 'r');
expect(sr !== null).assertTrue(); expect(sr !== null).assertTrue();
await sr.close(1); await sr.close(1);
expect(false).assertTrue(); expect(false).assertTrue();
} catch (e) { } catch (e) {
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_close_async_003 has failed for ' + e.message + ', code: ' + e.code); 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(); expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
done(); done();
} }
}); });
}) })
} }
/* /**
* Copyright (C) 2023 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License'); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { import {
fileIO, FILE_CONTENT, prepareFile, nextFileName, describe, it, expect, fileIO, FILE_CONTENT, prepareFile, nextFileName, describe, it, expect,
} from '../Common'; } from '../Common';
export default function fileIOStreamFlush() { export default function fileIOStreamFlush() {
describe('fileIO_fs_stream_flush', function () { describe('fileIO_fs_stream_flush', function () {
/** /**
* @tc.number SUB_DF_FILEIO_STREAM_FLUSH_SYNC_0000 * @tc.number SUB_DF_FILEIO_STREAM_FLUSH_SYNC_0000
* @tc.name fileIO_test_stream_flush_sync_000 * @tc.name fileIO_test_stream_flush_sync_000
* @tc.desc Test the flushSync() interface of class Stream. * @tc.desc Test the flushSync() interface of class Stream.
* Refresh file stream. * Refresh file stream.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 0 * @tc.level Level 0
* @tc.require * @tc.require
*/ */
it('fileIO_test_stream_flush_sync_000', 0, async function () { it('fileIO_test_stream_flush_sync_000', 0, async function () {
let fpath = await nextFileName('fileIO_test_stream_flush_sync_000'); let fpath = await nextFileName('fileIO_test_stream_flush_sync_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try { try {
let sr = fileIO.createStreamSync(fpath, 'r+'); let sr = fileIO.createStreamSync(fpath, 'r+');
expect(sr !== null).assertTrue(); expect(sr !== null).assertTrue();
expect(sr.writeSync(FILE_CONTENT) == FILE_CONTENT.length).assertTrue(); expect(sr.writeSync(FILE_CONTENT) == FILE_CONTENT.length).assertTrue();
sr.flushSync(); sr.flushSync();
sr.closeSync(); sr.closeSync();
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
} catch (e) { } catch (e) {
console.log('fileIO_test_stream_flush_sync_000 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_stream_flush_sync_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
/** /**
* @tc.number SUB_DF_FILEIO_STREAM_FLUSH_SYNC_0100 * @tc.number SUB_DF_FILEIO_STREAM_FLUSH_SYNC_0100
* @tc.name fileIO_test_stream_flush_sync_001 * @tc.name fileIO_test_stream_flush_sync_001
* @tc.desc Test the flushSync() interface of class Stream. * @tc.desc Test the flushSync() interface of class Stream.
* Invalid parameter, don't requrie any parameters. * Invalid parameter, don't requrie any parameters.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 3 * @tc.level Level 3
* @tc.require * @tc.require
*/ */
it('fileIO_test_stream_flush_sync_001', 0, async function () { it('fileIO_test_stream_flush_sync_001', 0, async function () {
let fpath = await nextFileName('fileIO_test_stream_flush_sync_001'); let fpath = await nextFileName('fileIO_test_stream_flush_sync_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
let sr = fileIO.createStreamSync(fpath, 'r+'); let sr = fileIO.createStreamSync(fpath, 'r+');
try { try {
expect(sr !== null).assertTrue(); expect(sr !== null).assertTrue();
sr.flushSync(1); sr.flushSync(1);
expect(false).assertTrue(); expect(false).assertTrue();
} catch (e) { } catch (e) {
sr.closeSync(); sr.closeSync();
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_flush_sync_001 has failed for ' + e.message + ', code: ' + e.code); 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(); expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
} }
}); });
/** /**
* @tc.number SUB_DF_FILEIO_STREAM_FLUSH_ASYNC_0000 * @tc.number SUB_DF_FILEIO_STREAM_FLUSH_ASYNC_0000
* @tc.name fileIO_test_stream_flush_async_000 * @tc.name fileIO_test_stream_flush_async_000
* @tc.desc Test the flush() interface of class Stream. Promise.then().catch() * @tc.desc Test the flush() interface of class Stream. Promise.then().catch()
* Refresh the file stream. * Refresh the file stream.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 3 * @tc.level Level 3
* @tc.require * @tc.require
*/ */
it('fileIO_test_stream_flush_async_000', 0, async function (done) { it('fileIO_test_stream_flush_async_000', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_flush_async_000'); let fpath = await nextFileName('fileIO_test_stream_flush_async_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try { try {
let sr = await fileIO.createStreamSync(fpath, 'r+'); let sr = await fileIO.createStreamSync(fpath, 'r+');
expect(sr !== null).assertTrue(); expect(sr !== null).assertTrue();
expect(sr.writeSync(FILE_CONTENT) == FILE_CONTENT.length).assertTrue(); expect(sr.writeSync(FILE_CONTENT) == FILE_CONTENT.length).assertTrue();
sr.flush().then(() => { sr.flush().then(() => {
sr.closeSync(); sr.closeSync();
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
done(); done();
}).catch((err) => { }).catch((err) => {
console.log('fileIO_test_stream_flush_async_000 error package' + JSON.stringify(err)); console.log('fileIO_test_stream_flush_async_000 error package' + JSON.stringify(err));
expect(false).assertTrue(); expect(false).assertTrue();
}); });
} catch (e) { } catch (e) {
console.log('fileIO_test_stream_flush_async_000 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_stream_flush_async_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
/** /**
* @tc.number SUB_DF_FILEIO_STREAM_FLUSH_ASYNC_0100 * @tc.number SUB_DF_FILEIO_STREAM_FLUSH_ASYNC_0100
* @tc.name fileIO_test_stream_flush_async_001 * @tc.name fileIO_test_stream_flush_async_001
* @tc.desc Test the flush() interface of class Stream. Callback. * @tc.desc Test the flush() interface of class Stream. Callback.
* Refresh the file stream. * Refresh the file stream.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 1 * @tc.level Level 1
* @tc.require * @tc.require
*/ */
it('fileIO_test_stream_flush_async_001', 0, async function (done) { it('fileIO_test_stream_flush_async_001', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_flush_async_001'); let fpath = await nextFileName('fileIO_test_stream_flush_async_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try { try {
let sr = await fileIO.createStreamSync(fpath, 'r+'); let sr = await fileIO.createStreamSync(fpath, 'r+');
expect(sr !== null).assertTrue(); expect(sr !== null).assertTrue();
expect(sr.writeSync(FILE_CONTENT) == FILE_CONTENT.length).assertTrue(); expect(sr.writeSync(FILE_CONTENT) == FILE_CONTENT.length).assertTrue();
sr.flush((err) => { sr.flush((err) => {
if (err) { if (err) {
console.log('fileIO_test_stream_flush_async_001 error package' + JSON.stringify(err)); console.log('fileIO_test_stream_flush_async_001 error package' + JSON.stringify(err));
expect(false).assertTrue(); expect(false).assertTrue();
} }
sr.closeSync(); sr.closeSync();
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
done(); done();
}) })
} catch (e) { } catch (e) {
console.log('fileIO_test_stream_flush_async_001 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_stream_flush_async_001 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
/** /**
* @tc.number SUB_DF_FILEIO_STREAM_FLUSH_ASYNC_0100 * @tc.number SUB_DF_FILEIO_STREAM_FLUSH_ASYNC_0100
* @tc.name fileIO_test_stream_flush_async_002 * @tc.name fileIO_test_stream_flush_async_002
* @tc.desc Test the flush() interface of class Stream. Promise. * @tc.desc Test the flush() interface of class Stream. Promise.
* Refresh the file stream. * Refresh the file stream.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 3 * @tc.level Level 3
* @tc.require * @tc.require
*/ */
it('fileIO_test_stream_flush_async_002', 0, async function (done) { it('fileIO_test_stream_flush_async_002', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_stream_flush_async_002'); let fpath = await nextFileName('fileIO_test_stream_flush_async_002');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
let sr = fileIO.createStreamSync(fpath, 'r+'); let sr = fileIO.createStreamSync(fpath, 'r+');
try { try {
expect(sr !== null).assertTrue(); expect(sr !== null).assertTrue();
await sr.flush(1); await sr.flush(1);
expect(false).assertTrue(); expect(false).assertTrue();
} catch (e) { } catch (e) {
sr.closeSync(); sr.closeSync();
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
console.log('fileIO_test_stream_flush_async_002 has failed for ' + e.message + ', code: ' + e.code); 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(); expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
done(); done();
} }
}); });
}); });
} }
/* /*
* Copyright (C) 2023 Huawei Device Co., Ltd. * Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License'); * Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS, * distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { import {
fileIO, FILE_CONTENT, prepareFile, nextFileName, isIntNum, describe, it, expect, fileIO, FILE_CONTENT, prepareFile, nextFileName, isIntNum, describe, it, expect,
} from '../Common'; } from '../Common';
export default function fileIOAccess() { export default function fileIOAccess() {
describe('fileIO_fs_access', function () { describe('fileIO_fs_access', function () {
/** /**
* @tc.number SUB_DF_FILEIO_ACCESS_SYNC_0000 * @tc.number SUB_DF_FILEIO_ACCESS_SYNC_0000
* @tc.name fileIO_test_access_sync_000 * @tc.name fileIO_test_access_sync_000
* @tc.desc Test accessSync() interface. * @tc.desc Test accessSync() interface.
* This interface shall work properly in normal case. * This interface shall work properly in normal case.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 0 * @tc.level Level 0
* @tc.require * @tc.require
*/ */
it('fileIO_test_access_sync_000', 0, async function () { it('fileIO_test_access_sync_000', 0, async function () {
let fpath = await nextFileName('fileIO_test_access_sync_000'); let fpath = await nextFileName('fileIO_test_access_sync_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try { try {
expect(fileIO.accessSync(fpath)).assertTrue(); expect(fileIO.accessSync(fpath)).assertTrue();
let file = fileIO.openSync(fpath); let file = fileIO.openSync(fpath);
expect(isIntNum(file.fd)).assertTrue(); expect(isIntNum(file.fd)).assertTrue();
let readlen = fileIO.readSync(file.fd, new ArrayBuffer(4096)); let readlen = fileIO.readSync(file.fd, new ArrayBuffer(4096));
expect(readlen == FILE_CONTENT.length).assertTrue(); expect(readlen == FILE_CONTENT.length).assertTrue();
fileIO.closeSync(file); fileIO.closeSync(file);
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
} catch (e) { } catch (e) {
console.log('fileIO_test_access_sync_000 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_access_sync_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
/** /**
* @tc.number SUB_DF_FILEIO_ACCESS_SYNC_0100 * @tc.number SUB_DF_FILEIO_ACCESS_SYNC_0100
* @tc.name fileIO_test_access_sync_001 * @tc.name fileIO_test_access_sync_001
* @tc.desc Test accessSync() interface. * @tc.desc Test accessSync() interface.
* The test file is not exist. * The test file is not exist.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 3 * @tc.level Level 3
* @tc.require * @tc.require
*/ */
it('fileIO_test_access_sync_001', 0, async function () { it('fileIO_test_access_sync_001', 0, async function () {
let fpath = await nextFileName('fileIO_test_access_sync_001'); let fpath = await nextFileName('fileIO_test_access_sync_001');
try { try {
let ret = fileIO.accessSync(fpath); let ret = fileIO.accessSync(fpath);
expect(ret === false).assertTrue(); expect(ret === false).assertTrue();
} catch (e) { } catch (e) {
console.log('fileIO_test_access_sync_001 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_access_sync_001 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
/** /**
* @tc.number SUB_DF_FILEIO_ACCESS_SYNC_0200 * @tc.number SUB_DF_FILEIO_ACCESS_SYNC_0200
* @tc.name fileIO_test_access_sync_002 * @tc.name fileIO_test_access_sync_002
* @tc.desc Test accessSync() interface. * @tc.desc Test accessSync() interface.
* The test file path is illegal. * The test file path is illegal.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 3 * @tc.level Level 3
* @tc.require * @tc.require
*/ */
it('fileIO_test_access_sync_002', 0, async function () { it('fileIO_test_access_sync_002', 0, async function () {
try { try {
expect(fileIO.accessSync(-1)).assertTrue(); expect(fileIO.accessSync(-1)).assertTrue();
expect(false).assertTrue(); expect(false).assertTrue();
} catch (e) { } catch (e) {
console.log('fileIO_test_access_sync_001 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_access_sync_001 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue(); expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
} }
}); });
/** /**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0000 * @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0000
* @tc.name fileIO_test_access_async_000 * @tc.name fileIO_test_access_async_000
* @tc.desc Test access() interface. Promise. * @tc.desc Test access() interface. Promise.
* Use promise to test that the file is exist. Sync method reads data from file. * Use promise to test that the file is exist. Sync method reads data from file.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 3 * @tc.level Level 3
* @tc.require * @tc.require
*/ */
it('fileIO_test_access_async_000', 0, async function (done) { it('fileIO_test_access_async_000', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_access_async_000'); let fpath = await nextFileName('fileIO_test_access_async_000');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try { try {
let ret = await fileIO.access(fpath); let ret = await fileIO.access(fpath);
expect(ret === true).assertTrue(); expect(ret === true).assertTrue();
let file = fileIO.openSync(fpath); let file = fileIO.openSync(fpath);
expect(isIntNum(file.fd)).assertTrue(); expect(isIntNum(file.fd)).assertTrue();
let readlen = fileIO.readSync(file.fd, new ArrayBuffer(4096)); let readlen = fileIO.readSync(file.fd, new ArrayBuffer(4096));
expect(readlen == FILE_CONTENT.length).assertTrue(); expect(readlen == FILE_CONTENT.length).assertTrue();
fileIO.closeSync(file); fileIO.closeSync(file);
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
done(); done();
} catch (e) { } catch (e) {
console.log('fileIO_test_access_async_000 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_access_async_000 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
/** /**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0100 * @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0100
* @tc.name fileIO_test_access_async_001 * @tc.name fileIO_test_access_async_001
* @tc.desc Test access() interface. Callback. * @tc.desc Test access() interface. Callback.
* Use callback to test that the file is exist. Sync method reads data from file. * Use callback to test that the file is exist. Sync method reads data from file.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 3 * @tc.level Level 3
* @tc.require * @tc.require
*/ */
it('fileIO_test_access_async_001', 0, async function (done) { it('fileIO_test_access_async_001', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_access_async_001'); let fpath = await nextFileName('fileIO_test_access_async_001');
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try { try {
fileIO.access(fpath, (err, ret) => { fileIO.access(fpath, (err, ret) => {
if (err) { if (err) {
console.log('fileIO_test_access_async_001 error package: ' + JSON.stringify(err)); console.log('fileIO_test_access_async_001 error package: ' + JSON.stringify(err));
expect(false).assertTrue(); expect(false).assertTrue();
} }
expect(ret === true).assertTrue(); expect(ret === true).assertTrue();
let file = fileIO.openSync(fpath); let file = fileIO.openSync(fpath);
expect(isIntNum(file.fd)).assertTrue(); expect(isIntNum(file.fd)).assertTrue();
let readlen = fileIO.readSync(file.fd, new ArrayBuffer(4096)); let readlen = fileIO.readSync(file.fd, new ArrayBuffer(4096));
expect(readlen == FILE_CONTENT.length).assertTrue(); expect(readlen == FILE_CONTENT.length).assertTrue();
fileIO.closeSync(file); fileIO.closeSync(file);
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
}); });
done(); done();
} catch (e) { } catch (e) {
console.log('fileIO_test_access_async_001 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_access_async_001 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
/** /**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0200 * @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0200
* @tc.name fileIO_test_access_async_002 * @tc.name fileIO_test_access_async_002
* @tc.desc Test access() interface. Promise. * @tc.desc Test access() interface. Promise.
* Async test file does not exist. * Async test file does not exist.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 3 * @tc.level Level 3
* @tc.require * @tc.require
*/ */
it('fileIO_test_access_async_002', 0, async function (done) { it('fileIO_test_access_async_002', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_access_async_002'); let fpath = await nextFileName('fileIO_test_access_async_002');
try { try {
let ret = await fileIO.access(fpath); let ret = await fileIO.access(fpath);
expect(ret === false).assertTrue(); expect(ret === false).assertTrue();
done(); done();
} catch (e) { } catch (e) {
console.log('fileIO_test_access_async_002 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_access_async_002 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
/** /**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0300 * @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0300
* @tc.name fileIO_test_access_async_003 * @tc.name fileIO_test_access_async_003
* @tc.desc Test access() interface. Callback. * @tc.desc Test access() interface. Callback.
* Async test file does not exist. * Async test file does not exist.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 3 * @tc.level Level 3
* @tc.require * @tc.require
*/ */
it('fileIO_test_access_async_003', 0, async function (done) { it('fileIO_test_access_async_003', 0, async function (done) {
let fpath = await nextFileName('fileIO_test_access_async_002'); let fpath = await nextFileName('fileIO_test_access_async_002');
try { try {
fileIO.access(fpath, (err, ret) => { fileIO.access(fpath, (err, ret) => {
if (err) { if (err) {
console.log('fileIO_test_access_async_003 error package: ' + JSON.stringify(err)); console.log('fileIO_test_access_async_003 error package: ' + JSON.stringify(err));
expect(false).assertTrue(); expect(false).assertTrue();
} }
expect(ret === false).assertTrue(); expect(ret === false).assertTrue();
done(); done();
}); });
} catch (e) { } catch (e) {
console.log('fileIO_test_access_async_003 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_access_async_003 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
/** /**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0400 * @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0400
* @tc.name fileIO_test_access_async_004 * @tc.name fileIO_test_access_async_004
* @tc.desc Test access() interface. Promise. * @tc.desc Test access() interface. Promise.
* Invalid path parameter. * Invalid path parameter.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 3 * @tc.level Level 3
* @tc.require * @tc.require
*/ */
it('fileIO_test_access_async_004', 0, async function (done) { it('fileIO_test_access_async_004', 0, async function (done) {
try { try {
await fileIO.access(-1); await fileIO.access(-1);
expect(false).assertTrue(); expect(false).assertTrue();
} catch (e) { } catch (e) {
console.log('fileIO_test_access_async_004 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_access_async_004 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue(); expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
done(); done();
} }
}); });
/** /**
* @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0500 * @tc.number SUB_DF_FILEIO_ACCESS_ASYNC_0500
* @tc.name fileIO_test_access_async_005 * @tc.name fileIO_test_access_async_005
* @tc.desc Test access() interface. Callback. * @tc.desc Test access() interface. Callback.
* Invalid path parameter. * Invalid path parameter.
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 3 * @tc.level Level 3
* @tc.require * @tc.require
*/ */
it('fileIO_test_access_async_005', 0, async function (done) { it('fileIO_test_access_async_005', 0, async function (done) {
try { try {
fileIO.access(-1, (err) => { fileIO.access(-1, (err) => {
expect(false).assertTrue(); expect(false).assertTrue();
}); });
} catch (e) { } catch (e) {
console.log('fileIO_test_access_async_005 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_access_async_005 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue(); expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
done(); 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.
先完成此消息的编辑!
想要评论请 注册