提交 d925cd38 编写于 作者: H hu0475

完成global子系统i18n,resourceManager模块的跨平台测试套

Signed-off-by: Nhu0475 <huyanqiang5@huawei.com>
上级 166733e6
......@@ -17,6 +17,8 @@ group("global") {
testonly = true
if (is_standard_system) {
deps = [
"crossplatform/resourcemanageretstest:resourceManager_ets_test",
"crossplatform/i18netstest:i18n_ets_test",
"global_napi_test:ActsGlobalNapiTest",
"global_stage:global_stage_hap",
"i18n_standard/intljs:intljs_test",
......
{
"app": {
"bundleName": "ohos.acts.global.crossplatform.i18n.normal",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name",
"minAPIVersion": 9,
"targetAPIVersion": 9,
"car": {
"apiCompatibleVersion": 9,
"singleUser": false
}
}
}
{
"string": [
{
"name": "app_name",
"value": "xtsDemo1"
}
]
}
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("i18n_ets_test") {
hap_profile = "src/main/module.json"
deps = [
":windowStage_js_assets",
":windowStage_resources",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
# hap_name: HAP的名字,可选,默认为目标名
hap_name = "i18n_ets_test"
subsystem_name = "global"
part_name = "i18n"
}
ohos_app_scope("windowStage_app_profile") {
# app_profile: HAP的AppScope中的app.json,只在Stage模型下使用
app_profile = "AppScope/app.json"
# sources: 资源文件路径
sources = [ "AppScope/resources" ]
}
ohos_js_assets("windowStage_js_assets") {
# source_dir: js或ets代码路径,兼容FA模型的单ability配置到ability目录
source_dir = "src/main/ets"
}
ohos_resources("windowStage_resources") {
# sources: 资源文件路径
sources = [ "src/main/resources" ]
# deps: 当前目标的依赖
deps = [ ":windowStage_app_profile" ]
# hap_profile: HAP的config.json,Stage模型对应module.json
hap_profile = "src/main/module.json"
}
\ No newline at end of file
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "60000",
"shell-timeout": "60000",
"bundle-name": "ohos.acts.global.crossplatform.i18n.normal",
"module-name": "entry_test"
},
"kits": [
{
"test-file-name": [
"i18n_ets_test.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
import UIAbility from '@ohos.app.ability.UIAbility';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
import hilog from '@ohos.hilog';
import { Hypium } from '@ohos/hypium';
import testsuite from '../test/List.test';
import window from '@ohos.window';
export default class TestAbility extends UIAbility {
onCreate(want, launchParam) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate');
hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? '');
hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? '');
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy');
}
onWindowStageCreate(windowStage: window.WindowStage) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate');
windowStage.loadContent('TestAbility/pages/Index', (err, data) => {
if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s',
JSON.stringify(data) ?? '');
});
}
onWindowStageDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy');
}
onForeground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground');
}
onBackground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground');
}
}
\ No newline at end of file
import hilog from '@ohos.hilog';
@Entry
@Component
struct Index {
aboutToAppear() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear');
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
import hilog from '@ohos.hilog';
import TestRunner from '@ohos.application.testRunner';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
var abilityDelegator = undefined
var abilityDelegatorArguments = undefined
async function onAbilityCreateCallback() {
hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback');
}
async function addAbilityMonitorCallback(err: any) {
hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? '');
}
export default class OpenHarmonyTestRunner implements TestRunner {
constructor() {
}
onPrepare() {
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare ');
}
async onRun() {
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run');
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'
let lMonitor = {
abilityName: testAbilityName,
onAbilityCreate: onAbilityCreateCallback,
};
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName
var debug = abilityDelegatorArguments.parameters['-D']
if (debug == 'true')
{
cmd += ' -D'
}
hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd);
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? '');
hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? '');
hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? '');
})
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end');
}
}
\ No newline at end of file
import I18n from './l18n.test'
export default function testsuite() {
I18n()
}
\ 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.
*/
import I18n from '@ohos.i18n'
import intl from '@ohos.intl'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
export default function I18nTest() {
describe('I18nTest', function () {
console.log('*************start I18NTest*************');
let hour = I18n.is24HourClock();
console.log('init 24 hour clock value ' + hour);
/* *
* execute this step before all testcases
*/
beforeAll(function(){
console.log('step before all cases in I18n.'
+ ' 24hour: ' + I18n.is24HourClock()
+ ' syslocale: ' + I18n.getSystemLocale());
})
/* *
* execute this step before every testcase
*/
beforeEach(function(){
console.log('step before every case in I18n.');
})
/* *
* execute this step after every testcase
*/
afterEach(function(){
console.log('step after every case in I18n.');
})
/* *
* execute this step after all testcases
*/
afterAll(function(){
console.log('step after all cases in I18n.'
+ ' 24hour: ' + I18n.is24HourClock()
+ ' syslocale: ' + I18n.getSystemLocale());
})
/* *
* @tc.number TEST_GETDISPLAYCOUNTRY_001
* @tc.name testGetDisplayCountry001
* @tc.desc check the display country
*/
it('testGetDisplayCountry001', 0, function () {
let value = I18n.System.getDisplayCountry('zh-Hans-CN', 'en-US', true);
console.log('testGetDisplayCountry001 ' + value);
expect(value).assertEqual('China');
})
/* *
* @tc.number TEST_GETDISPLAYCOUNTRY_002
* @tc.name testGetDisplayCountry002
* @tc.desc check the display country
*/
it('testGetDisplayCountry002', 0, function () {
let value = I18n.System.getDisplayCountry('zh-Hans-CN', 'en-US', undefined);
console.log('testGetDisplayCountry002 ' + value);
expect(value).assertEqual('China');
})
/* *
* @tc.number TEST_GETDISPLAYCOUNTRY_003
* @tc.name testGetDisplayCountry003
* @tc.desc check the display country
*/
it('testGetDisplayCountry003', 0, function () {
let value = I18n.System.getDisplayCountry('zh-Hans-CN', 'en-US', null);
console.log('testGetDisplayCountry003 ' + value);
expect(value).assertEqual('China');
})
/* *
* @tc.number TEST_GETDISPLAYCOUNTRY_004
* @tc.name testGetDisplayCountry004
* @tc.desc check the display country
*/
it('testGetDisplayCountry004', 0, function () {
try{
//@ts-ignore
let value = I18n.System.getDisplayCountry('zh', 'en-US', true);
console.log('testGetDisplayCountry004 ' + value);
expect(value).assertEqual('');
}catch(e){
console.log('testGetDisplayCountry004 ' + e.code);
console.log('testGetDisplayCountry004 ' + e.message);
expect(e.code).assertEqual('890001');
expect(e.message).assertEqual('Param value not valid');
}
})
/* *
* @tc.number TEST_GETDISPLAYCOUNTRY_005
* @tc.name testGetDisplayCountry005
* @tc.desc check the display country
*/
it('testGetDisplayCountry005', 0, function () {
let value = I18n.System.getDisplayCountry('zh-CN', 'en-US', true);
console.log('testGetDisplayCountry005 ' + value);
expect(value).assertEqual('China');
})
/* *
* @tc.number TEST_GETDISPLAYCOUNTRY_006
* @tc.name testGetDisplayCountry006
* @tc.desc check the display country
*/
it('testGetDisplayCountry006', 0, function () {
try{
//@ts-ignore
let value = I18n.System.getDisplayCountry('zh-Hans', 'en-US', true);
console.log('testGetDisplayCountry006 ' + value);
expect(value).assertEqual('');
}catch(e){
console.log('testGetDisplayCountry006 ' + e.code);
console.log('testGetDisplayCountry006 ' + e.message);
expect(e.code).assertEqual('890001');
expect(e.message).assertEqual('Param value not valid');
}
})
/* *
* @tc.number TEST_GETDISPLAYCOUNTRY_007
* @tc.name testGetDisplayCountry007
* @tc.desc check the language
*/
it('i18n_system_test_0700', 0, function () {
let value = I18n.System.getDisplayCountry('zh-Hans-CN', 'en-US', false);
console.log('i18n_system_test_0700 ' + value);
expect(value).assertEqual('China');
})
/* *
* @tc.number TEST_GETDISPLAYCOUNTRY_008
* @tc.name testGetDisplayCountry008
* @tc.desc check the language
*/
it('testGetDisplayCountry008', 0, function () {
let value = I18n.System.getDisplayCountry('zh-Hans-CN', 'en-US');
console.log('testGetDisplayCountry008 ' + value);
expect(value).assertEqual('China');
})
/* *
* @tc.number TEST_GETDISPLAYCOUNTRY_009
* @tc.name testGetDisplayCountry009
* @tc.desc check the language
*/
it('testGetDisplayCountry009', 0, function () {
try{
//@ts-ignore
let value = I18n.System.getDisplayCountry('zh-Hans-CN');
console.log('testGetDisplayCountry009 ' + value);
expect(value).assertEqual('China');
}catch(e){
console.log('testGetDisplayCountry009 ' + e.code);
console.log('testGetDisplayCountry009 ' + e.message);
expect(e.code).assertEqual('401');
expect(e.message).assertEqual('Check param failed');
}
})
/* *
* @tc.number TEST_GETDISPLAYCOUNTRY_010
* @tc.name testGetDisplayCountry010
* @tc.desc check the language
*/
it('testGetDisplayCountry010', 0, function () {
try{
//@ts-ignore
let value = I18n.System.getDisplayCountry('zh-Hans-CN', 12345);
console.log('testGetDisplayCountry010 ' + value);
expect(value).assertEqual('China');
}catch(e){
console.log('testGetDisplayCountry010 ' + e.code);
console.log('testGetDisplayCountry010 ' + e.message);
expect(e.code).assertEqual('890001');
expect(e.message).assertEqual('Param value not valid');
}
})
/* *
* @tc.number TEST_GETDISPLAYLANGUAGE_001
* @tc.name testGetDisplayLanguage001
* @tc.desc check the language
*/
it('testGetDisplayLanguage001', 0, function () {
let value = I18n.System.getDisplayLanguage('zh-Hans-CN', 'en-US', true);
console.log('testGetDisplayLanguage001 ' + value);
expect(value).assertEqual('Simplified Chinese');
})
/* *
* @tc.number TEST_GETDISPLAYLANGUAGE_002
* @tc.name testGetDisplayLanguage002
* @tc.desc check the language
*/
it('testGetDisplayLanguage002', 0, function () {
let value = I18n.System.getDisplayLanguage('zh-Hans-CN', 'en-US', undefined);
console.log('testGetDisplayLanguage002 ' + value);
expect(value).assertEqual('Simplified Chinese');
})
/* *
* @tc.number TEST_GETDISPLAYLANGUAGE_003
* @tc.name testGetDisplayLanguage003
* @tc.desc check the language
*/
it('testGetDisplayLanguage003', 0, function () {
let value = I18n.System.getDisplayLanguage('zh-Hans-CN', 'en-US', null);
console.log('testGetDisplayLanguage003 ' + value);
expect(value).assertEqual('Simplified Chinese');
})
/* *
* @tc.number TEST_GETDISPLAYLANGUAGE_004
* @tc.name testGetDisplayLanguage004
* @tc.desc check the language
*/
it('testGetDisplayLanguage004', 0, function () {
let value = I18n.System.getDisplayLanguage('zh-Hans-CN', 'en-GB', true);
console.log('testGetDisplayLanguage004 ' + value);
expect(value).assertEqual('Simplified Chinese');
})
/* *
* @tc.number TEST_GETDISPLAYLANGUAGE_005
* @tc.name testGetDisplayLanguage005
* @tc.desc check the language
*/
it('testGetDisplayLanguage005', 0, function () {
let value = I18n.System.getDisplayLanguage('zh', 'en-US', true);
console.log('testGetDisplayLanguage005 ' + value);
expect(value).assertEqual('Chinese');
})
/* *
* @tc.number TEST_GETDISPLAYLANGUAGE_006
* @tc.name testGetDisplayLanguage006
* @tc.desc check the language
*/
it('testGetDisplayLanguage006', 0, function () {
let value = I18n.System.getDisplayLanguage('zh-CN', 'en-US', true);
console.log('testGetDisplayLanguage006 ' + value);
expect(value).assertEqual('Chinese');
})
/* *
* @tc.number TEST_GETDISPLAYLANGUAGE_007
* @tc.name testGetDisplayLanguage007
* @tc.desc check the language
*/
it('testGetDisplayLanguage007', 0, function () {
let value = I18n.System.getDisplayLanguage('zh-Hans', 'en-US', true);
console.log('testGetDisplayLanguage007 ' + value);
expect(value).assertEqual('Simplified Chinese');
})
/* *
* @tc.number TEST_GETDISPLAYLANGUAGE_008
* @tc.name testGetDisplayLanguage008
* @tc.desc check the language
*/
it('testGetDisplayLanguage008', 0, function () {
let value = I18n.System.getDisplayLanguage('zh-Hans-CN', 'en-US', false);
console.log('testGetDisplayLanguage008 ' + value);
expect(value).assertEqual('Simplified Chinese');
})
/* *
* @tc.number TEST_GETDISPLAYLANGUAGE_009
* @tc.name testGetDisplayLanguage009
* @tc.desc check the language
*/
it('testGetDisplayLanguage009', 0, function () {
let value = I18n.System.getDisplayLanguage('zh-Hans-CN', 'en-US');
console.log('testGetDisplayLanguage009 ' + value);
expect(value).assertEqual('Simplified Chinese');
})
/* *
* @tc.number TEST_GETDISPLAYLANGUAGE_010
* @tc.name testGetDisplayLanguage010
* @tc.desc check the language
*/
it('testGetDisplayLanguage010', 0, function () {
try{
//@ts-ignore
let value = I18n.System.getDisplayLanguage('zh-Hans-CN');
console.log('testGetDisplayLanguage010 ' + value);
expect(value).assertEqual('Simplified Chinese');
}catch(e){
console.log('testGetDisplayLanguage010 ' + e.code);
console.log('testGetDisplayLanguage010 ' + e.message);
expect(e.code).assertEqual('401');
expect(e.message).assertEqual('Check param failed');
}
})
/* *
* @tc.number TEST_GETDISPLAYLANGUAGE_011
* @tc.name testGetDisplayLanguage011
* @tc.desc check the language
*/
it('testGetDisplayLanguage011', 0, function () {
try{
//@ts-ignore
let value = I18n.System.getDisplayLanguage('zh-Hans-CN', 12345);
console.log('testGetDisplayLanguage011 ' + value);
expect(value).assertEqual('Simplified Chinese');
}catch(e){
console.log('testGetDisplayLanguage011 ' + e.code);
console.log('testGetDisplayLanguage011 ' + e.message);
expect(e.code).assertEqual('890001');
expect(e.message).assertEqual('Param value not valid');
}
})
/* *
* @tc.number TEST_SYSTEMLANGUAGE_001
* @tc.name testSystemLanguage001
* @tc.desc check the getSystemLanguage
*/
it('testSystemLanguage001', 0, function () {
let lang = I18n.System.getSystemLanguage();
console.log('testSystemLanguage001 ' + lang);
expect(lang).assertInstanceOf('String');
})
/* *
* @tc.number TEST_GETSYSTEMREGION_001
* @tc.name testGetSystemRegion001
* @tc.desc check the getSystemRegion
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetSystemRegion001', 0, function () {
let region = I18n.System.getSystemRegion();
console.log(' testGetSystemRegion001 ' + region);
expect(region).assertInstanceOf('String');
})
/* *
* @tc.number TEST_GETSYSTEMLOCALE_001
* @tc.name testGetSystemLocale001
* @tc.desc check the getSystemLocale
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it(' testGetSystemLocale001', 0, function () {
let locale = I18n.System.getSystemLocale();
console.log(' testGetSystemLocale001 ' + locale);
expect(locale).assertInstanceOf('String');
})
/* *
* @tc.number TEST_IS24HOURCLOCK_001
* @tc.name testIs24HourClock001
* @tc.desc check the value of is24HourClock method
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIs24HourClock001', 0, function () {
let value = I18n.System.is24HourClock();
console.log('testIs24HourClock001 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_GETDATEORDER_001
* @tc.name testGetDateOrder001
* @tc.desc get the DateOrder value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetDateOrder001', 0, function () {
console.log('testGetDateOrder001 ' + 'start');
let value = I18n.I18NUtil.getDateOrder('en');
console.log('testGetDateOrder001 ' + value);
expect(value).assertEqual('LLL-d-y');
})
/* *
* @tc.number TEST_GETDATEORDER_002
* @tc.name testGetDateOrder002
* @tc.desc get the DateOrder value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetDateOrder002', 0, function () {
console.log('testGetDateOrder002 ' + 'start');
let value = I18n.I18NUtil.getDateOrder('th');
console.log('testGetDateOrder002 ' + value);
expect(value).assertEqual('d-LLL-y');
})
/* *
* @tc.number TEST_GETDATEORDER_003
* @tc.name testGetDateOrder003
* @tc.desc get the DateOrder value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetDateOrder003', 0, function () {
console.log('testGetDateOrder003 ' + 'start');
let value = I18n.I18NUtil.getDateOrder('jp');
console.log('testGetDateOrder003 ' + value);
expect(value).assertEqual('LLL-d-y');
})
/**
* @tc.number TEST_GETCALENDAR_001
* @tc.name testGetCalendar001
* @tc.desc get the getCalendar value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it(' testGetCalendar001', 0, function () {
console.log(' testGetCalendar001 ' + 'start');
let calendar = I18n.getCalendar('ja', 'japanese');
expect(calendar != null).assertTrue();
})
/**
* @tc.number TEST_SETTIME_001
* @tc.name testSetTime001
* @tc.desc get the setTime value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testSetTime001', 0, function () {
console.log('testSetTime001 ' + 'start');
let calendar = I18n.getCalendar('zh');
//actuall month is 9
let date1 = new Date(2021, 8, 8, 8, 8, 8, 8);
calendar.setTime(date1);
let value = calendar.isWeekend();
console.log('testSetTime001 ' + value);
expect(value).assertFalse();
})
/**
* @tc.number TEST_SETTIME_002
* @tc.name testSetTime002
* @tc.desc get the setTime value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testSetTime002', 0, function () {
console.log('testSetTime002 ' + 'start');
let calendar = I18n.getCalendar('zh');
let date1 = new Date(2021, 18, 8, 8, 8, 8, 8);
calendar.setTime(date1);
let value = calendar.isWeekend();
console.log('testSetTime002 ' + value);
expect(value).assertFalse();
})
/**
* @tc.number TEST_SETTIME_003
* @tc.name testSetTime003
* @tc.desc get the setTime value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testSetTime003', 0, function () {
console.log('testSetTime003 ' + 'start');
let calendar = I18n.getCalendar('zh');
calendar.setTime(10540800000);
let value = calendar.isWeekend();
console.log('testSetTime003 ' + value);
expect(value).assertTrue();
})
/**
* @tc.number TEST_SET_001
* @tc.name testSet001
* @tc.desc get the set value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testSet001', 0, function () {
console.log('testSet001 ' + 'start');
let calendar = I18n.getCalendar('zh');
calendar.set(2021, 11, 11);
let value = calendar.isWeekend();
console.log('testSet001 ' + value);
expect(value).assertTrue();
})
/**
* @tc.number TEST_SET_002
* @tc.name testSet002
* @tc.desc get the set value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testSet002', 0, function () {
console.log('testSet002 ' + 'start');
let calendar = I18n.getCalendar('zh');
calendar.set(2021, 11, 11, 10, 10, 10);
let value = calendar.isWeekend();
console.log('testSet002 ' + value);
expect(value).assertTrue();
})
/**
* @tc.number TEST_SET_003
* @tc.name testSet003
* @tc.desc get the set value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testSet003', 0, function () {
console.log('testSet003 ' + 'start');
let calendar = I18n.getCalendar('zh');
calendar.set(2021, 11, 11, 10, 10);
let value = calendar.isWeekend();
console.log('testSet003 ' + value);
expect(value).assertTrue();
})
/**
* @tc.number TEST_SETTIMEZONEANDGETTIMEZONE_001
* @tc.name testSetTimeZoneAndGetTimeZone001
* @tc.desc get the setTimeZone and getTimeZone value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testSetTimeZoneAndGetTimeZone001', 0, function () {
console.log('testSetTimeZoneAndGetTimeZone001 ' + 'start');
let calendar = I18n.getCalendar('zh');
calendar.setTimeZone('Asia/Shanghai');
let value = calendar.getTimeZone();
console.log('testSetTimeZoneAndGetTimeZone001 ' + value);
expect(value).assertEqual('China Standard Time');
})
/**
* @tc.number TEST_SETTIMEZONEANDGETTIMEZONE_002
* @tc.name testSetTimeZoneAndGetTimeZone002
* @tc.desc get the setTimeZone and getTimeZone value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testSetTimeZoneAndGetTimeZone002', 0, function () {
console.log('testSetTimeZoneAndGetTimeZone002 ' + 'start');
let calendar = I18n.getCalendar('zh');
calendar.setTimeZone('AAA');
let value = calendar.getTimeZone();
console.log('testSetTimeZoneAndGetTimeZone002 ' + value);
expect(value).assertEqual('GMT');
})
/**
* @tc.number TEST_GETFIRSTDAYOFWEEKANDSETFIRSTDAYOFWEEK_001
* @tc.name testGetFirstDayOfWeekAndSetFirstDayOfWeek001
* @tc.desc get the setFirstDayOfWeek and getFirstDayOfWeek value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetFirstDayOfWeekAndSetFirstDayOfWeek001', 0, function () {
console.log('testGetFirstDayOfWeekAndSetFirstDayOfWeek001 ' + 'start');
let calendar = I18n.getCalendar('zh');
calendar.setFirstDayOfWeek(1);
let value = calendar.getFirstDayOfWeek();
console.log('testGetFirstDayOfWeekAndSetFirstDayOfWeek001 ' + value);
expect(value).assertEqual(1);
})
/**
* @tc.number TEST_GETFIRSTDAYOFWEEKANDSETFIRSTDAYOFWEEK_002
* @tc.name testGetFirstDayOfWeekAndSetFirstDayOfWeek002
* @tc.desc get the setFirstDayOfWeek and getFirstDayOfWeek value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetFirstDayOfWeekAndSetFirstDayOfWeek002', 0, function () {
console.log('testGetFirstDayOfWeekAndSetFirstDayOfWeek002 ' + 'start');
let calendar = I18n.getCalendar('zh');
calendar.setFirstDayOfWeek(0);
let value = calendar.getFirstDayOfWeek();
console.log('testGetFirstDayOfWeekAndSetFirstDayOfWeek002 ' + value);
expect(value).assertEqual(1);
})
/**
* @tc.number TEST_GETFIRSTDAYOFWEEKANDSETFIRSTDAYOFWEEK_003
* @tc.name testGetFirstDayOfWeekAndSetFirstDayOfWeek003
* @tc.desc get the setFirstDayOfWeek and getFirstDayOfWeek value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetFirstDayOfWeekAndSetFirstDayOfWeek003', 0, function () {
console.log('testGetFirstDayOfWeekAndSetFirstDayOfWeek003 ' + 'start');
let calendar = I18n.getCalendar('zh');
calendar.setFirstDayOfWeek(7);
let value = calendar.getFirstDayOfWeek();
console.log('testGetFirstDayOfWeekAndSetFirstDayOfWeek003 ' + value);
expect(value).assertEqual(7);
})
/**
* @tc.number TEST_GETFIRSTDAYOFWEEKANDSETFIRSTDAYOFWEEK_004
* @tc.name testGetFirstDayOfWeekAndSetFirstDayOfWeek004
* @tc.desc get the setFirstDayOfWeek and getFirstDayOfWeek value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetFirstDayOfWeekAndSetFirstDayOfWeek004', 0, function () {
console.log('testGetFirstDayOfWeekAndSetFirstDayOfWeek004 ' + 'start');
let calendar = I18n.getCalendar('zh');
calendar.setFirstDayOfWeek(8);
let value = calendar.getFirstDayOfWeek();
console.log('testGetFirstDayOfWeekAndSetFirstDayOfWeek004 ' + value);
expect(value).assertEqual(1);
})
/**
* @tc.number TEST_SET_MINIMALDAYS_IN_FIRST_WEEK_AND_GET_MINIMALDAYS_IN_FIRST_WEEK_001
* @tc.name testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek001
* @tc.desc get the setMinimalDaysInFirstWeek and getMinimalDaysInFirstWeek value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek001', 0, function () {
console.log('testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek001 ' + 'start');
let calendar = I18n.getCalendar('zh');
calendar.setMinimalDaysInFirstWeek(1);
let value = calendar.getMinimalDaysInFirstWeek();
console.log('testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek001 ' + value);
expect(value).assertEqual(1);
})
/**
* @tc.number TEST_SET_MINIMALDAYS_IN_FIRST_WEEK_AND_GET_MINIMALDAYS_IN_FIRST_WEEK_002
* @tc.name testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek002
* @tc.desc get the setMinimalDaysInFirstWeek and getMinimalDaysInFirstWeek value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek002', 0, function () {
console.log('testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek002 ' + 'start');
let calendar = I18n.getCalendar('zh');
calendar.setMinimalDaysInFirstWeek(0);
let value = calendar.getMinimalDaysInFirstWeek();
console.log('testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek002 ' + value);
expect(value).assertEqual(1);
})
/**
* @tc.number TEST_SET_MINIMALDAYS_IN_FIRST_WEEK_AND_GET_MINIMALDAYS_IN_FIRST_WEEK_003
* @tc.name testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek003
* @tc.desc get the setMinimalDaysInFirstWeek and getMinimalDaysInFirstWeek value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek003', 0, function () {
console.log('testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek003 ' + 'start');
let calendar = I18n.getCalendar('zh');
calendar.setMinimalDaysInFirstWeek(8);
let value = calendar.getMinimalDaysInFirstWeek();
console.log('testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek003 ' + value);
expect(value).assertEqual(7);
})
/**
* @tc.number TEST_SET_MINIMALDAYS_IN_FIRST_WEEK_AND_GET_MINIMALDAYS_IN_FIRST_WEEK_004
* @tc.name testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek004
* @tc.desc get the setMinimalDaysInFirstWeek and getMinimalDaysInFirstWeek value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek004', 0, function () {
console.log('testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek004 ' + 'start');
let calendar = I18n.getCalendar('zh');
calendar.setMinimalDaysInFirstWeek(7);
let value = calendar.getMinimalDaysInFirstWeek();
console.log('testSetMinimalDaysInFirstWeekAndGetMinimalDaysInFirstWeek004 ' + value);
expect(value).assertEqual(7);
})
/**
* @tc.number TEST_GET_001
* @tc.name testGet001
* @tc.desc get the get value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGet001', 0, function () {
console.log('testGet001 ' + 'start');
let calendar = I18n.getCalendar('zh');
let value = calendar.get('year');
console.log('testGet001 ' + value);
expect(value).assertLarger(0);
})
/**
* @tc.number TEST_GET_002
* @tc.name testGet002
* @tc.desc get the get value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGet002', 0, function () {
console.log('testGet002 ' + 'start');
let calendar = I18n.getCalendar('zh');
let date1 = new Date(2021, 8, 8, 8, 8, 8, 8);
calendar.setTime(date1);
let value = calendar.get('month');
console.log('testGet002 ' + value);
expect(value).assertEqual(8);
})
/**
* @tc.number TEST_GET_003
* @tc.name testGet003
* @tc.desc get the get value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGet003', 0, function () {
console.log('testGet003 ' + 'start');
let calendar = I18n.getCalendar('zh');
let value = calendar.get('day_of_year');
console.log('testGet003 ' + value);
expect(value).assertLarger(0);
})
/**
* @tc.number TEST_IS_WEEKEND_001
* @tc.name testIsWeekend001
* @tc.desc get the isWeekend value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsWeekend001', 0, function () {
console.log('testIsWeekend001 ' + 'start');
let calendar = I18n.getCalendar('zh');
let value = calendar.isWeekend(new Date(2021, 10, 1, 10, 0, 0, 0));
console.log('testIsWeekend001 ' + value);
expect(value).assertFalse();
})
/**
* @tc.number TEST_I18N.ISRTL_001
* @tc.name testI18n.IsRTL001
* @tc.desc get the isRTL value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testI18n.IsRTL001', 0, function () {
console.log('testI18n.IsRTL001 ' + 'start');
let value = I18n.isRTL('zh-CN');
console.log('testI18n.IsRTL001 ' + value);
expect(value).assertFalse();
})
/**
* @tc.number TEST_I18N.ISRTL_002
* @tc.name testI18n.IsRTL002
* @tc.desc get the isRTL value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testI18n.IsRTL002', 0, function () {
console.log('testI18n.IsRTL002 ' + 'start');
let value = I18n.isRTL('en-US');
console.log('testI18n.IsRTL002 ' + value);
expect(value).assertFalse();
})
/**
* @tc.number TEST_I18N.ISRTL_003
* @tc.name testI18n.IsRTL003
* @tc.desc get the isRTL value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testI18n.IsRTL003', 0, function () {
console.log('testI18n.IsRTL003 ' + 'start');
let value = I18n.isRTL('ar');
console.log('testI18n.IsRTL003 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number TEST_IS_DIGIT_001
* @tc.name testIsDigit001
* @tc.desc check the isDigit interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsDigit001', 0, function () {
console.log('testIsDigit001 ' + 'start');
let value = I18n.Unicode.isDigit('abc');
console.log('testIsDigit001 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_IS_DIGIT_002
* @tc.name testIsDigit002
* @tc.desc check the isDigit interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsDigit002', 0, function () {
console.log('testIsDigit002 ' + 'start');
let value = I18n.Unicode.isDigit('123');
console.log('testIsDigit002 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number TEST_IS_DIGIT_003
* @tc.name testIsDigit003
* @tc.desc check the isDigit interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsDigit003', 0, function () {
console.log('testIsDigit003 ' + 'start');
let value = I18n.Unicode.isDigit('123abc');
console.log('testIsDigit003 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number TEST_IS_DIGIT_004
* @tc.name testIsDigit004
* @tc.desc check the isDigit interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsDigit004', 0, function () {
console.log('testIsDigit004 ' + 'start');
let value = I18n.Unicode.isDigit('abc123');
console.log('testIsDigit004 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_IS_DIGIT_005
* @tc.name testIsDigit005
* @tc.desc check the isDigit interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsDigit005', 0, function () {
console.log('testIsDigit005 ' + 'start');
let value = I18n.Unicode.isDigit('');
console.log('testIsDigit005 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_IS_SPACE_CHAR_001
* @tc.name testIsSpaceChar001
* @tc.desc check the isSpaceChar interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsSpaceChar001', 0, function () {
console.log('testIsSpaceChar001 ' + 'start');
let value = I18n.Unicode.isSpaceChar('abc');
console.log('testIsSpaceChar001 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_IS_SPACE_CHAR_002
* @tc.name testIsSpaceChar002
* @tc.desc check the isSpaceChar interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsSpaceChar002', 0, function () {
console.log('testIsSpaceChar002 ' + 'start');
let value = I18n.Unicode.isSpaceChar(' ');
console.log('testIsSpaceChar002 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number TEST_IS_SPACE_CHAR_003
* @tc.name testIsSpaceChar003
* @tc.desc check the isSpaceChar interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsSpaceChar003', 0, function () {
console.log('testIsSpaceChar003 ' + 'start');
let value = I18n.Unicode.isSpaceChar(' ');
console.log('testIsSpaceChar003--' + value + '--');
expect(value).assertTrue();
})
/* *
* @tc.number TEST_IS_WHITESPACE_001
* @tc.name testIsWhitespace001
* @tc.desc check the isWhitespace interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsWhitespace001', 0, function () {
console.log('testIsWhitespace001 ' + 'start');
let value = I18n.Unicode.isWhitespace('abc');
console.log('testIsWhitespace001 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_IS_WHITESPACE_002
* @tc.name testIsWhitespace002
* @tc.desc check the isWhitespace interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsWhitespace002', 0, function () {
console.log('testIsWhitespace002 ' + 'start');
let value = I18n.Unicode.isWhitespace('\u0009');
console.log('testIsWhitespace002--' + value + '--');
expect(value).assertTrue();
})
/* *
* @tc.number TEST_I18N.UNICODE.ISRTL_001
* @tc.name testI18n.Unicode.IsRTL001
* @tc.desc check the isRTL interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testI18n.Unicode.IsRTL001', 0, function () {
console.log('testI18n.Unicode.IsRTL001 ' + 'start');
let value = I18n.Unicode.isRTL('abc');
console.log('testI18n.Unicode.IsRTL001 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_I18N.UNICODE.ISRTL_002
* @tc.name testI18n.Unicode.IsRTL002
* @tc.desc check the isRTL interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testI18n.Unicode.IsRTL002', 0, function () {
console.log('testI18n.Unicode.IsRTL002 ' + 'start');
let value = I18n.Unicode.isRTL('١٢٣٤٥٦٧');
console.log('testI18n.Unicode.IsRTL002 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_I18N.UNICODE.ISRTL_003
* @tc.name testI18n.Unicode.IsRTL003
* @tc.desc check the isRTL interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testI18n.Unicode.IsRTL003', 0, function () {
console.log('testI18n.Unicode.IsRTL003 ' + 'start');
let value = I18n.Unicode.isRTL('我是小明');
console.log('testI18n.Unicode.IsRTL003 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_I18N.UNICODE.ISRTL_004
* @tc.name testI18n.Unicode.IsRTL004
* @tc.desc check the isRTL interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testI18n.Unicode.IsRTL004', 0, function () {
console.log('testI18n.Unicode.IsRTL004 ' + 'start');
let value = I18n.Unicode.isRTL('نحن');
console.log('testI18n.Unicode.IsRTL004 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number TEST_IS_IDEOGRAPH_001
* @tc.name testIsIdeograph001
* @tc.desc check the isIdeograph interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsIdeograph001', 0, function () {
console.log('testIsIdeograph001 ' + 'start');
let value = I18n.Unicode.isIdeograph('abc');
console.log('testIsIdeograph001 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_IS_IDEOGRAPH_002
* @tc.name testIsIdeograph002
* @tc.desc check the isIdeograph interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsIdeograph002', 0, function () {
console.log('testIsIdeograph002 ' + 'start');
let value = I18n.Unicode.isIdeograph('我');
console.log('testIsIdeograph002 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number TEST_IS_IDEOGRAPH_003
* @tc.name testIsIdeograph003
* @tc.desc check the isIdeograph interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsIdeograph003', 0, function () {
console.log('testIsIdeograph003 ' + 'start');
let value = I18n.Unicode.isIdeograph('우리');
console.log('testIsIdeograph003 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_IS_IDEOGRAPH_004
* @tc.name testIsIdeograph004
* @tc.desc check the isIdeograph interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsIdeograph004', 0, function () {
console.log('testIsIdeograph004 ' + 'start');
let value = I18n.Unicode.isIdeograph('私たち');
console.log('testIsIdeograph004 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number TEST_IS_LETTER_001
* @tc.name testIsLetter001
* @tc.desc check the isLetter interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsLetter001', 0, function () {
console.log('testIsLetter001 ' + 'start');
let value = I18n.Unicode.isLetter('abc');
console.log('testIsLetter001 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number TEST_IS_LETTER_002
* @tc.name testIsLetter002
* @tc.desc check the isLetter interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsLetter002', 0, function () {
console.log('testIsLetter002 ' + 'start');
let value = I18n.Unicode.isLetter('123');
console.log('testIsLetter002 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_IS_LETTER_003
* @tc.name testIsLetter003
* @tc.desc check the isLetter interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsLetter003', 0, function () {
console.log('testIsLetter003 ' + 'start');
let value = I18n.Unicode.isLetter('abc123');
console.log('testIsLetter003 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number TEST_IS_LETTER_004
* @tc.name testIsLetter004
* @tc.desc check the isLetter interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsLetter004', 0, function () {
console.log('testIsLetter004 ' + 'start');
let value = I18n.Unicode.isLetter('123abc');
console.log('testIsLetter004 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_IS_LOWER_CASE_001
* @tc.name testIsLowerCase001
* @tc.desc check the isLowerCase interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsLowerCase001', 0, function () {
console.log('testIsLowerCase001 ' + 'start');
let value = I18n.Unicode.isLowerCase('abc');
console.log('testIsLowerCase001 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number TEST_IS_LOWER_CASE_002
* @tc.name testIsLowerCase002
* @tc.desc check the isLowerCase interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsLowerCase002', 0, function () {
console.log('testIsLowerCase002 ' + 'start');
let value = I18n.Unicode.isLowerCase('ABC');
console.log('testIsLowerCase002 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_IS_LOWER_CASE_003
* @tc.name testIsLowerCase003
* @tc.desc check the isLowerCase interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsLowerCase003', 0, function () {
console.log('testIsLowerCase003 ' + 'start');
let value = I18n.Unicode.isLowerCase('abcDEF');
console.log('testIsLowerCase003 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number TEST_IS_LOWER_CASE_004
* @tc.name testIsLowerCase004
* @tc.desc check the isLowerCase interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsLowerCase004', 0, function () {
console.log('testIsLowerCase004 ' + 'start');
let value = I18n.Unicode.isLowerCase('ABCdef');
console.log('testIsLowerCase004 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_IS_UPPER_CASE_001
* @tc.name testIsUpperCase001
* @tc.desc check the isUpperCase interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsUpperCase001', 0, function () {
console.log('testIsUpperCase001 ' + 'start');
let value = I18n.Unicode.isUpperCase('ABC');
console.log('testIsUpperCase001 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number TEST_IS_UPPER_CASE_002
* @tc.name testIsUpperCase002
* @tc.desc check the isUpperCase interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsUpperCase002', 0, function () {
console.log('testIsUpperCase002 ' + 'start');
let value = I18n.Unicode.isUpperCase('abc');
console.log('testIsUpperCase002 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_IS_UPPER_CASE_003
* @tc.name testIsUpperCase003
* @tc.desc check the isUpperCase interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsUpperCase003', 0, function () {
console.log('testIsUpperCase003 ' + 'start');
let value = I18n.Unicode.isUpperCase('ABCdef');
console.log('testIsUpperCase003 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number TEST_IS_UPPER_CASE_004
* @tc.name testIsUpperCase004
* @tc.desc check the isUpperCase interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testIsUpperCase004', 0, function () {
console.log('testIsUpperCase004 ' + 'start');
let value = I18n.Unicode.isUpperCase('abcDEF');
console.log('testIsUpperCase004 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number TEST_GET_TYPE_001
* @tc.name testGetType001
* @tc.desc check the getType interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetType001', 0, function () {
console.log('testGetType001 ' + 'start');
let value = I18n.Unicode.getType('a');
console.log('testGetType001 ' + value);
expect(value).assertEqual('U_LOWERCASE_LETTER');
})
/* *
* @tc.number TEST_GET_TYPE_002
* @tc.name testGetType002
* @tc.desc check the getType interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetType002', 0, function () {
console.log('testGetType002 ' + 'start');
let value = I18n.Unicode.getType('ABC');
console.log('testGetType002 ' + value);
expect(value).assertEqual('U_UPPERCASE_LETTER');
})
/* *
* @tc.number TEST_GET_TYPE_003
* @tc.name testGetType003
* @tc.desc check the getType interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetType003', 0, function () {
console.log('testGetType003 ' + 'start');
let value = I18n.Unicode.getType('ABCdef');
console.log('testGetType003 ' + value);
expect(value).assertEqual('U_UPPERCASE_LETTER');
})
/* *
* @tc.number TEST_GET_TYPE_004
* @tc.name testGetType004
* @tc.desc check the getType interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetType004', 0, function () {
console.log('testGetType004 ' + 'start');
let value = I18n.Unicode.getType('123');
console.log('testGetType004 ' + value);
expect(value).assertEqual('U_DECIMAL_DIGIT_NUMBER');
})
/* *
* @tc.number TEST_GET_TYPE_005
* @tc.name testGetType005
* @tc.desc check the getType interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetType005', 0, function () {
console.log('testGetType005 ' + 'start');
let value = I18n.Unicode.getType('123abc');
console.log('testGetType005 ' + value);
expect(value).assertEqual('U_DECIMAL_DIGIT_NUMBER');
})
/* *
* @tc.number TEST_GET_TYPE_006
* @tc.name testGetType006
* @tc.desc check the getType interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetType006', 0, function () {
console.log('testGetType006 ' + 'start');
let value = I18n.Unicode.getType('١٢٣٤٥٦٧');
console.log('testGetType006 ' + value);
expect(value).assertEqual('U_DECIMAL_DIGIT_NUMBER');
})
/* *
* @tc.number TEST_GET_TYPE_007
* @tc.name testGetType007
* @tc.desc check the getType interface
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetType007', 0, function () {
console.log('testGetType007 ' + 'start');
let value = I18n.Unicode.getType(' ');
console.log('testGetType007 ' + value);
expect(value).assertEqual('U_SPACE_SEPARATOR');
})
/* *
* @tc.number TEST_GET_TIME_ZONE_001
* @tc.name testGetTimeZone001
* @tc.desc get the getTimeZone value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetTimeZone001', 0, function () {
console.log('testGetTimeZone001 ' + 'start');
let timezone = I18n.getTimeZone();
let value = timezone.getID();
console.log('testGetTimeZone001 ' + value);
expect(value.length > 0).assertTrue();
})
/* *
* @tc.number TEST_GET_ID_001
* @tc.name testGetID001
* @tc.desc get the getID value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetID001', 0, function () {
console.log('testGetID001 ' + 'start');
let timezone = I18n.getTimeZone('ACT');
let value = timezone.getID();
console.log('testGetID001 ' + value);
expect(value).assertEqual('ACT');
})
/* *
* @tc.number TEST_GET_RAW_OFF_SET_001
* @tc.name testGetRawOffSet001
* @tc.desc get the getRawOffset value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetRawOffSet001', 0, function () {
console.log('testGetRawOffSet001 ' + 'start');
let timezone = I18n.getTimeZone();
let value = timezone.getRawOffset();
console.log('testGetRawOffSet001 ' + value);
expect(value >= 0).assertEqual(true);
})
/* *
* @tc.number TEST_GET_OFF_SET_001
* @tc.name testGetOffSet001
* @tc.desc get the getOffset value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetOffSet001', 0, function () {
console.log('testGetOffSet001 ' + 'start');
let timezone = I18n.getTimeZone();
let value = timezone.getOffset();
console.log('testGetOffSet001 ' + value);
expect(value >= 0).assertEqual(true);
})
/* *
* @tc.number TEST_GET_OFF_SET_002
* @tc.name testGetOffSet002
* @tc.desc get the getOffset value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetOffSet002', 0, function () {
console.log('testGetOffSet002 ' + 'start');
let timezone = I18n.getTimeZone();
let value = timezone.getOffset(10540800000);
console.log('testGetOffSet002 ' + value);
expect(value >= 0).assertEqual(true);
})
/* *
* @tc.number TEST_GET_OFF_SET_003
* @tc.name testGetOffSet003
* @tc.desc get the getOffset value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetOffSet003', 0, function () {
console.log('testGetOffSet003 ' + 'start');
let timezone = I18n.getTimeZone('ACT');
let value = timezone.getOffset();
console.log('testGetOffSet003 ' + value);
expect(value > 0).assertEqual(true);
})
/* *
* @tc.number TEST_GET_OFF_SET_004
* @tc.name testGetOffSet004
* @tc.desc get the getOffset value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetOffSet004', 0, function () {
console.log('testGetOffSet004 ' + 'start');
let timezone = I18n.getTimeZone('ACT');
let value = timezone.getOffset(10540800000);
console.log('testGetOffSet004 ' + value);
expect(value > 0).assertEqual(true);
})
/* *
* @tc.number TEST_GET_AVAILABLE_IDS_001
* @tc.name testGetAvailableIDs001
* @tc.desc get the getAvailableIDs value
* @tc.size MediumTest
* @tc.type Method
* @tc.level Level 2
*/
it('testGetAvailableIDs001', 0, function () {
console.log('testGetAvailableIDs001 ' + 'start');
let value = I18n.TimeZone.getAvailableIDs();
console.log('testGetAvailableIDs001 ' + value);
expect(value.length > 0).assertEqual(true);
})
})
}
{
"module": {
"name": "entry_test",
"type": "feature",
"description": "$string:module_test_desc",
"mainElement": "TestAbility",
"deviceTypes": [
"phone"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:test_pages",
"abilities": [
{
"name": "TestAbility",
"srcEntry": "./ets/TestAbility/TestAbility.ets",
"description": "$string:TestAbility_desc",
"icon": "$media:icon",
"label": "$string:TestAbility_label",
"exported": true,
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:start_window_background",
"skills": [
{
"actions": [
"action.system.home"
],
"entities": [
"entity.system.home"
]
}
]
}
]
}
}
{
"color": [
{
"name": "start_window_background",
"value": "#FFFFFF"
}
]
}
\ No newline at end of file
{
"string": [
{
"name": "module_test_desc",
"value": "test ability description"
},
{
"name": "TestAbility_desc",
"value": "the test ability"
},
{
"name": "TestAbility_label",
"value": "test label"
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "ohos.acts.global.crossplatform.resourceManager.normal",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name",
"minAPIVersion": 9,
"targetAPIVersion": 9,
"car": {
"apiCompatibleVersion": 9,
"singleUser": false
}
}
}
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("resourceManager_ets_test") {
hap_profile = "src/main/module.json"
deps = [
":windowStage_js_assets",
":windowStage_resources",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
# hap_name: HAP的名字,可选,默认为目标名
hap_name = "resourceManager_ets_test"
subsystem_name = "global"
part_name = "resource_management"
}
ohos_app_scope("windowStage_app_profile") {
# app_profile: HAP的AppScope中的app.json,只在Stage模型下使用
app_profile = "AppScope/app.json"
# sources: 资源文件路径
sources = [ "AppScope/resources" ]
}
ohos_js_assets("windowStage_js_assets") {
# source_dir: js或ets代码路径,兼容FA模型的单ability配置到ability目录
source_dir = "src/main/ets"
}
ohos_resources("windowStage_resources") {
# sources: 资源文件路径
sources = [ "src/main/resources" ]
# deps: 当前目标的依赖
deps = [ ":windowStage_app_profile" ]
# hap_profile: HAP的config.json,Stage模型对应module.json
hap_profile = "src/main/module.json"
}
\ No newline at end of file
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "60000",
"shell-timeout": "60000",
"bundle-name": "ohos.acts.global.crossplatform.resourceManager.normal",
"module-name": "entry_test"
},
"kits": [
{
"test-file-name": [
"resourceManager_ets_test.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
import UIAbility from '@ohos.app.ability.UIAbility';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
import hilog from '@ohos.hilog';
import { Hypium } from '@ohos/hypium';
import testsuite from '../test/List.test';
import window from '@ohos.window';
export default class TestAbility extends UIAbility {
onCreate(want, launchParam) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate');
hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? '');
hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? '');
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy');
}
onWindowStageCreate(windowStage: window.WindowStage) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate');
globalThis.abilityContext = this.context;
windowStage.loadContent('TestAbility/pages/Index', (err, data) => {
if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s',
JSON.stringify(data) ?? '');
});
}
onWindowStageDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy');
}
onForeground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground');
}
onBackground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground');
}
}
\ No newline at end of file
import hilog from '@ohos.hilog';
@Entry
@Component
struct Index {
aboutToAppear() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear');
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
import hilog from '@ohos.hilog';
import TestRunner from '@ohos.application.testRunner';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
var abilityDelegator = undefined
var abilityDelegatorArguments = undefined
async function onAbilityCreateCallback() {
hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback');
}
async function addAbilityMonitorCallback(err: any) {
hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? '');
}
export default class OpenHarmonyTestRunner implements TestRunner {
constructor() {
}
onPrepare() {
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare ');
}
async onRun() {
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run');
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'
let lMonitor = {
abilityName: testAbilityName,
onAbilityCreate: onAbilityCreateCallback,
};
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName
var debug = abilityDelegatorArguments.parameters['-D']
if (debug == 'true')
{
cmd += ' -D'
}
hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd);
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? '');
hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? '');
hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? '');
})
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end');
}
}
\ No newline at end of file
import resourceManagerTest from './resourceManager.test.ets'
export default function testsuite() {
resourceManagerTest()
}
\ 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.
*/
import resourceManager from '@ohos.resourceManager'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
export default function resourceManagerTest() {
describe('resourceManagerTest', function () {
console.log('*************start resourceManagerTest*************');
/* *
* @tc.number TEST_DIRECTION_VERTICAL_001
* @tc.name testDirectionVertical001
* @tc.desc get the configuration in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 0
*/
it('testDirectionVertical001', 0, async function (done) {
console.log('testDirectionVertical001 0');
expect(resourceManager.Direction.DIRECTION_VERTICAL).assertEqual(0);
console.log('testDirectionVertical001 1');
done();
})
/* *
* @tc.number TEST_DIRECTION_HORIZONTAL_001
* @tc.name testDirectionHorizontal001
* @tc.desc get the configuration in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 0
*/
it('testDirectionHorizontal001', 0, async function (done) {
console.log('testDirectionHorizontal001 0');
expect(resourceManager.Direction.DIRECTION_HORIZONTAL).assertEqual(1);
console.log('testDirectionHorizontal001 1');
done();
})
/* *
* @tc.number TEST_DEVICE_TYPE_PHONE_001
* @tc.name testDeviceTypePhone001
* @tc.desc get the device capability in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 0
*/
it('testDeviceTypePhone001', 0, async function (done) {
console.log('testDeviceTypePhone001 0');
expect(resourceManager.DeviceType.DEVICE_TYPE_PHONE).assertEqual(0);
console.log('testDeviceTypePhone001 1');
done();
})
/* *
* @tc.number TEST_DEVICE_TYPE_TABLET_001
* @tc.name testDeviceTypeTable001
* @tc.desc get the device capability in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 0
*/
it('testDeviceTypeTable001', 0, async function (done) {
console.log('testDeviceTypeTable001 0');
expect(resourceManager.DeviceType.DEVICE_TYPE_TABLET).assertEqual(1);
console.log('testDeviceTypeTable001 1');
done();
})
/* *
* @tc.number TEST_DEVICE_TYPE_CAR_001
* @tc.name testDeviceTypeCar001
* @tc.desc get the device capability in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 0
*/
it('testDeviceTypeCar001', 0, async function (done) {
console.log('testDeviceTypeCar001 0');
expect(resourceManager.DeviceType.DEVICE_TYPE_CAR).assertEqual(2);
console.log('testDeviceTypeCar001 1');
done();
})
/* *
* @tc.number TEST_DEVICE_TYPE_PC_001
* @tc.name testDeviceTypePC001
* @tc.desc get the device capability in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 0
*/
it('testDeviceTypePC001', 0, async function (done) {
console.log('testDeviceTypePC001 0');
expect(resourceManager.DeviceType.DEVICE_TYPE_PC).assertEqual(3);
console.log('testDeviceTypePC001 1');
done();
})
/* *
* @tc.number TEST_DEVICE_TYPE_TV_001
* @tc.name testDeviceTypeTV001
* @tc.desc get the device capability in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 0
*/
it('testDeviceTypeTV001', 0, async function (done) {
console.log('testDeviceTypeTV001 0');
expect(resourceManager.DeviceType.DEVICE_TYPE_TV).assertEqual(4);
console.log('testDeviceTypeTV001 1');
done();
})
/* *
* @tc.number TEST_DEVICE_TYPE_WEARABLE_001
* @tc.name testDeviceTypeWearable001
* @tc.desc get the device capability in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 0
*/
it('testDeviceTypeWearable001', 0, async function (done) {
console.log('testDeviceTypeWearable001 0');
expect(resourceManager.DeviceType.DEVICE_TYPE_WEARABLE).assertEqual(6);
console.log('testDeviceTypeWearable001 1');
done();
})
/* *
* @tc.number: TEST_SCREEN_SDIP_001
* @tc.name: testScreenSdip001
* @tc.desc: get the device capability in promise mode
* @tc.size: MediumTest
* @tc.type enum
* @tc.level level 0
*/
it('testScreenSdip001', 0, async function (done) {
console.log('testScreenSdip001 0');
expect(resourceManager.ScreenDensity.SCREEN_SDPI).assertEqual(120);
console.log('testScreenSdip001 1');
done();
})
/* *
* @tc.number TEST_SCREEN_MDPI_001
* @tc.name testScreenMdpi001
* @tc.desc get the device capability in promise mode
* @tc.size: MediumTest
* @tc.type enum
* @tc.level level 0
*/
it('testScreenMdpi001', 0, async function (done) {
console.log('testScreenMdpi001 0');
expect(resourceManager.ScreenDensity.SCREEN_MDPI).assertEqual(160);
console.log('testScreenMdpi001 1');
done();
})
/* *
* @tc.number TEST_SCREEN_LDPI-001
* @tc.name testScreenLdpi001
* @tc.desc get the device capability in promise mode
* @tc.size: MediumTest
* @tc.type enum
* @tc.level level 0
*/
it('testScreenLdpi001', 0, async function (done) {
console.log('testScreenLdpi001 0');
expect(resourceManager.ScreenDensity.SCREEN_LDPI).assertEqual(240);
console.log('testScreenLdpi001 1');
done();
})
/* *
* @tc.number TEST_SCREEN_XLDPI_001
* @tc.name testScreenXldpi001
* @tc.desc get the device capability in promise mode
* @tc.size: MediumTest
* @tc.type enum
* @tc.level level 0
*/
it('testScreenXldpi001', 0, async function (done) {
console.log('testScreenXldpi001 0');
expect(resourceManager.ScreenDensity.SCREEN_XLDPI).assertEqual(320);
console.log('testScreenXldpi001 1');
done();
})
/* *
* @tc.number TEST_SCREEN_XXLDPI_001
* @tc.name testScreenXxldpi001
* @tc.desc get the device capability in promise mode
* @tc.size: MediumTest
* @tc.type enum
* @tc.level level 0
*/
it('testScreenXxldpi001', 0, async function (done) {
console.log('testScreenXxldpi001 0');
expect(resourceManager.ScreenDensity.SCREEN_XXLDPI).assertEqual(480);
console.log('testScreenXxldpi001 1');
done();
})
/* *
* @tc.number TEST_SCREEN_XXXLDPI_001
* @tc.name testScreenXxxldpi001
* @tc.desc get the device capability in promise mode
* @tc.size: MediumTest
* @tc.type enum
* @tc.level level 0
*/
it('testScreenXxxldpi001', 0, async function (done) {
console.log('testScreenXxxldpi001 0');
expect(resourceManager.ScreenDensity.SCREEN_XXXLDPI).assertEqual(640);
console.log('testScreenXxxldpi001 1');
done();
})
/* *
* @tc.number TEST_GETSTRINGVALUERERESOURCECALLBACK_001
* @tc.name testGetStringValueResourceCallback001
* @tc.desc get the string in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringValueResourceCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getStringValue({ bundleName:"ohos.acts.global.crossplatform.resourceManager.normal",
moduleName:"entry_test",
id:$r('app.string.test_1').id}, (err, value) => {
expect(value !== null).assertTrue();
console.log('testGetStringValueResourceCallback001 ' + value);
done();
})
})
/* *
* @tc.number TEST_GETSTRINGVALUERESOURCEPROMISE_001
* @tc.name testGetStringValueResourcePromise001
* @tc.desc get the string in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringValueResourcePromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getStringValue({ bundleName:"ohos.acts.global.crossplatform.resourceManager.normal",
moduleName:"entry_test",
id:$r('app.string.test_1').id}).then(value => {
console.info(`testGetStringValueResourcePromise001 ${JSON.stringify(Error)}`)
expect(value !== null).assertTrue();
console.log('testGetStringValueResourcePromise001 ' + value);
})
done();
})
/* *
* @tc.number TEST_GETSTRINGVALUERESIDCALLBACK_001
* @tc.name testGetStringValueResIdCallback001
* @tc.desc get the string in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringValueResIdCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getStringValue($r('app.string.test_1').id, (err, value) => {
expect(value !==null).assertTrue();
console.log('testGetStringValueResIdCallback001 ' + value);
expect(value).assertEqual('Test1');
done();
})
})
/* *
* @tc.number TEST_GETSTRINGVALUERESIDCallback_002
* @tc.name testGetStringValueResIdCallback002
* @tc.desc get the string in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringValueResIdCallback002', 0, async function (done) {
try{
// 0x1001 id not exist,throw 9001001 error code
globalThis.abilityContext.resourceManager.getStringValue(0x1001, (err, value) => {
if(err){
console.log('testGetStringValueResIdCallback002 err.code' + err.code);
console.log('testGetStringValueResIdCallback002 err.message' + err.message);
expect(err.code == 9001001).assertTrue();
done();
}else{
console.log('testGetStringValueResIdCallback002 2');
expect(value !== null).assertTrue();
console.log('testGetStringValueResIdCallback002 ' + value);
done();
}
})
}catch(e){
console.log('testGetStringValueResIdCallback002 e.code' + e.code);
console.log('testGetStringValueResIdCallback002 e.message' + e.message);
}
})
/* *
* @tc.number TEST_GETSTRINGVALUERESIDCALLBACK_003
* @tc.name testGetStringValueResIdCallback003
* @tc.desc get the string in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringValueResIdCallback003', 0, async function (done) {
try{
// 0x01000000 id is integer resource,throw 9001002 error code
globalThis.abilityContext.resourceManager.getStringValue($r('app.integer.integer_1').id, (err, value) => {
if(err){
console.log('testGetStringValueResIdCallback003 err.code' + err.code);
console.log('testGetStringValueResIdCallback003 err.message' + err.message);
expect(err.code == 9001002).assertTrue();
done();
}else{
expect(value !== null).assertTrue();
console.log('testGetStringValueResIdCallback003 ' + value);
done();
}
})
}catch(e){
console.log('testGetStringValueResIdCallback003 e.code' + e.code);
console.log('testGetStringValueResIdCallback003 e.message' + e.message);
}
})
/* *
* @tc.number TEST_GETSTRINGVALUERESIDCALLBACK_004
* @tc.name testGetStringValueResIdCallback004
* @tc.desc get the string in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringValueResIdCallback004', 0, async function (done) {
try{
// 0x01000006 id re-ref,throw 9001006 error code
globalThis.abilityContext.resourceManager.getStringValue($r('app.string.Test_name1').id, (err, value) => {
if(err){
console.log('testGetStringValueResIdCallback004 err.code' + err.code);
console.log('testGetStringValueResIdCallback004 err.message' + err.message);
expect(err.code == 9001006).assertTrue();
done();
}else{
expect(value !== null).assertTrue();
console.log('testGetStringValueResIdCallback004 ' + value);
done();
}
})
}catch(e){
console.log('testGetStringValueResIdCallback004 e.code' + e.code);
console.log('testGetStringValueResIdCallback004 e.message' + e.message);
}
})
/* *
* @tc.number TEST_GETSTRINGVALUERESIDCALLBACK_005
* @tc.name testGetStringValueResIdCallback005
* @tc.desc get the string in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringValueResIdCallback005', 0, async function (done) {
try{
// param type not correct,throw 401 error code
globalThis.abilityContext.resourceManager.getStringValue('name', (err, value) => {
if(err){
console.log('testGetStringValueResIdCallback005 err.code:' + err.code);
console.log('testGetStringValueResIdCallback005 err.message:' + err.message);
done();
}else{
expect(value !== null).assertTrue();
console.log('testGetStringValueResIdCallback005 ' + value);
done();
}
})
}catch(e){
console.log('testGetStringValueResIdCallback005 e.code:' + e.code);
console.log('testGetStringValueResIdCallback005 e.message' + e.message);
expect(e.code == 401).assertTrue();
done();
}
})
/* *
* @tc.number TEST_GETSTRINGVALUERESIDPROMISE_001
* @tc.name testGetStringValueResIdPromise001
* @tc.desc get the string in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringValueResIdPromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getStringValue($r('app.string.test_1').id).then(value => {
expect(value !== null).assertTrue();
console.log('testGetStringValueResIdPromise001 ' + value);
expect(value).assertEqual('Test1');
done();
})
})
/* *
* @tc.number TEST_GETSTRINGVALUERESIDPROMISE_002
* @tc.name testGetStringValueResIdPromise002
* @tc.desc get the string in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringValueResIdPromise002', 0, async function (done) {
try{
// 0x1001 id not exist,throw 9001001 error code
globalThis.abilityContext.resourceManager.getStringValue(0x1001).then(value => {
expect(value !== null).assertTrue();
console.log('testGetStringValueResIdPromise002 ' + value);
expect(value).assertEqual('Test1');
done();
}).catch(error => {
console.log('testGetStringValueResIdPromise002 error.code' + error.code);
console.log('testGetStringValueResIdPromise002 error.message' + error.message);
expect(error.code == 9001001).assertTrue();
done();
})
} catch (err){
console.log('testGetStringValueResIdPromise002 err.code' + err.code);
console.log('testGetStringValueResIdPromise002 err.message' + err.message);
done();
}
})
/* *
* @tc.number TEST_GETSTRINGVALUERESIDPROMISE_003
* @tc.name testGetStringValueResIdPromise003
* @tc.desc get the string in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringValueResIdPromise003', 0, async function (done) {
try{
// 0x01000000 id is integer resource,throw 9001002 error code
console.log('testGetStringValueResIdPromise003 promise start');
globalThis.abilityContext.resourceManager.getStringValue($r('app.integer.integer_1').id).then(value => {
console.log('testGetStringValueResIdPromise003 promise try' + value);
expect(value !== null).assertTrue();
console.log('testGetStringValueResIdPromise003 ' + value);
expect(value).assertEqual('Test1');
done();
}).catch(error => {
console.log('testGetStringValueResIdPromise003 promise catch');
console.log('testGetStringValueResIdPromise003 error.code' + error.code);
console.log('testGetStringValueResIdPromise003 error.message' + error.message);
expect(error.code == 9001002).assertTrue();
done();
})
} catch (err){
console.log('testGetStringValueResIdPromise003 err.code' + err.code);
console.log('testGetStringValueResIdPromise003 err.message' + err.message);
done();
}
console.log('testGetStringValueResIdPromise003 promise end');
})
/* *
* @tc.number TEST_GETSTRINGVALUERESIDPROMISE_004
* @tc.name testGetStringValueResIdPromise004
* @tc.desc get the string in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringValueResIdPromise004', 0, async function (done) {
try{
// 0x01000006 id re-ref,throw 9001006 error code
globalThis.abilityContext.resourceManager.getStringValue($r('app.string.Test_name1').id).then(value => {
expect(value !== null).assertTrue();
console.log('testGetStringValueResId009 ' + value);
expect(value).assertEqual('Test1');
done();
}).catch(error => {
console.log('testGetStringValueResIdPromise004 error.code' + error.code);
console.log('testGetStringValueResIdPromise004 error.message' + error.message);
expect(error.code == 9001006).assertTrue();
done();
})
} catch (err){
console.log('testGetStringValueResIdPromise004 err.code' + err.code);
console.log('testGetStringValueResIdPromise004 err.message' + err.message);
done();
}
})
/* *
* @tc.number TEST_GETSTRINGVALUERESIDPROMISE_005
* @tc.name testGetStringValueResIdPromise005
* @tc.desc get the string in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringValueResIdPromise005', 0, async function (done) {
try{
// param type not correct,throw 401 error code
globalThis.abilityContext.resourceManager.getStringValue('name').then(value => {
expect(value !== null).assertTrue();
console.log('testGetStringValueResIdPromise005 ' + value);
expect(value).assertEqual('Test1');
done();
}).catch(error => {
console.log('testGetStringValueResIdPromise005 error.code' + error.code);
console.log('testGetStringValueResIdPromise005 error.message' + error.message);
expect(error.code == 401).assertTrue();
done();
})
} catch (err){
console.log('testGetStringValueResIdPromise005 err.code' + err.code);
console.log('testGetStringValueResIdPromise005 err.message' + err.message);
done();
}
})
/* *
* @tc.number TEST_GETSTRINGARRAYVALUERESOURCECALLBACK_001
* @tc.name testGetStartArrayValueResourceCallback001
* @tc.desc get the string array in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStartArrayValueResourceCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getStringArrayValue({bundleName:"ohos.acts.global.crossplatform.resourceManager.normal",
moduleName:"entry_test",
id:$r('app.strarray.sizeList').id}, (err, value) => {
expect(value !== null).assertTrue();
console.log('testGetStartArrayValueResourceCallback001 ' + value);
done();
})
})
/* *
* @tc.number TEST_GETSTRINGARRAYVALUERESOURCEPROMISE_001
* @tc.name testGetStartArrayValueResourcePromise001
* @tc.desc get the string array in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStartArrayValueResourcePromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getStringArrayValue({bundleName:"ohos.acts.global.crossplatform.resourceManager.normal",
moduleName:"entry_test",
id:$r('app.strarray.sizeList').id}).then(value => {
expect(value !== null).assertTrue();
console.log('testGetStartArrayValueResourcePromise001 ' + value);
})
done();
})
/* *
* @tc.number TEST_GETSTARTARRAYVALUERESIDCALLBACK_001
* @tc.name testGetStartArrayValueResIdCallback001
* @tc.desc get the string array in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStartArrayValueResIdCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getStringArrayValue($r('app.strarray.sizeList').id, (err, value) => {
expect(value !== null).assertTrue();
console.log('testGetStartArrayValueResIdCallback001 ' + value);
console.log('testGetStartArrayValueResIdCallback001 ' + value.length);
console.log('testGetStartArrayValueResIdCallback001 ' + value[0]);
expect(value.length).assertEqual(4);
expect(value[0]).assertEqual('small');
expect(value[1]).assertEqual('middle');
expect(value[2]).assertEqual('large');
expect(value[3]).assertEqual('extra large');
done();
})
})
/* *
* @tc.number TEST_GETSTARTARRAYVALUERESIDPROMISE_001
* @tc.name testGetStartArrayValueResIdPromise001
* @tc.desc get the string array in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStartArrayValueResIdPromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getStringArrayValue($r('app.strarray.sizeList').id).then(value => {
expect(value !== null).assertTrue();
console.log('testGetStartArrayValueResIdPromise001 ' + value);
console.log('testGetStartArrayValueResIdPromise001 ' + value.length);
console.log('testGetStartArrayValueResIdPromise001 ' + value[0]);
expect(value.length).assertEqual(4);
expect(value[0]).assertEqual('small');
expect(value[1]).assertEqual('middle');
expect(value[2]).assertEqual('large');
expect(value[3]).assertEqual('extra large');
done();
})
})
/* *
* @tc.number TEST_GETMEDIACONTENTRESOURCECALLBACK_001
* @tc.name testGetMediaContentResourceCallback001
* @tc.desc get the media in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetMediaContentResourceCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getMediaContent({bundleName:"ohos.acts.global.crossplatform.resourceManager.normal",
moduleName:"entry_test",
id:$r('app.media.icon').id}, (err, value) => {
expect(value !== null).assertTrue();
console.log('testGetMediaContentResourceCallback001 ' + value);
done();
})
})
/* *
* @tc.number TEST_GETMEDIACONTENTRESOURCEPROMISE_001
* @tc.name testGetMediaContentResourcePromise001
* @tc.desc get the media in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetMediaContentResourcePromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getMediaContent({bundleName:"ohos.acts.global.crossplatform.resourceManager.normal",
moduleName:"entry_test",
id:$r('app.media.icon').id}).then(value => {
expect(value !== null).assertTrue();
console.log('testGetMediaContentResourcePromise001 ' + value);
})
done();
})
/* *
* @tc.number TEST_GETMEDIACONTENTRESIDCALLBACK_001
* @tc.name testGetMediaContentResIdCallback001
* @tc.desc get the media in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetMediaContentResIdCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getMediaContent($r('app.media.icon').id, (err, value) => {
console.log('testGetMediaContentResIdCallback001 ' + value.length);
expect(value.length > 0).assertTrue();
done();
})
})
/* *
* @tc.number TEST_GETMEDIACONTENTRESIDPROMISE_001
* @tc.name testGetMediaContentResIdPromise001
* @tc.desc get the media in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetMediaContentResIdPromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getMediaContent($r('app.media.icon').id).then(value => {
console.log('testGetMediaContentResIdPromise001 ' + value.length);
expect(value.length > 0).assertTrue();
done();
})
})
/* *
* @tc.number TEST_GETMEDIACONTENTBASE64RESOURCECALLBACK_001
* @tc.name testGetMediaContentBase64ResourceCallback001
* @tc.desc get the media base64 in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetMediaContentBase64ResourceCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getMediaContentBase64({bundleName:"ohos.acts.global.crossplatform.resourceManager.normal",
moduleName:"entry_test",
id:$r('app.media.icon').id}, (err, value) => {
expect(value !== null).assertTrue();
console.log('testGetMediaContentBase64ResourceCallback001 ' + value);
done();
})
})
/* *
* @tc.number TEST_GETMEDIACONTENTBASE64RESOURCEPROMISE_001
* @tc.name testGetMediaContentBase64ResourcePromise001
* @tc.desc get the media base64 in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetMediaContentBase64ResourcePromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getMediaContentBase64({bundleName:"ohos.acts.global.crossplatform.resourceManager.normal",
moduleName:"entry_test",
id:$r('app.media.icon').id}).then(value => {
expect(value !== null).assertTrue();
console.log('testGetMediaContentBase64ResourcePromise001 ' + value);
})
done();
})
/* *
* @tc.number TEST_GETMEDIACONTENTBASE64RESIDCALLBACK_001
* @tc.name testGetMediaContentBase64ResIdCallback001
* @tc.desc get the media base64 in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetMediaContentBase64ResIdCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getMediaContentBase64($r('app.media.icon').id, (err, value) => {
expect(value.length > 0).assertTrue();
console.log('testGetMediaContentBase64ResIdCallback001 ' + value);
done();
})
})
/* *
* @tc.number TEST_GETMEDIACONTENTBASE64RESIDPROMISE_001
* @tc.name testGetMediaContentBase64ResIdPromise001
* @tc.desc get the media base64 in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetMediaContentBase64ResIdPromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getMediaContentBase64($r('app.media.icon').id).then(value => {
expect(value.length > 0).assertTrue();
console.log('testGetMediaContentBase64ResIdPromise001 ' + value);
done();
})
})
/* *
* @tc.number TEST_GETDEVICECAPABILITYCALLBACK_001
* @tc.name testGetDeviceCapabilityCallback001
* @tc.desc get the device capability in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetDeviceCapabilityCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getDeviceCapability((error, dc) => {
if(dc.deviceType == resourceManager.DeviceType.DEVICE_TYPE_PHONE){
console.log('testGetDeviceCapabilityCallback001 DEVICE_TYPE_PHONE');
}else if(dc.deviceType == resourceManager.DeviceType.DEVICE_TYPE_TABLET){
console.log('testGetDeviceCapabilityCallback001 DEVICE_TYPE_TABLET');
}else if(dc.deviceType == resourceManager.DeviceType.DEVICE_TYPE_CAR){
console.log('testGetDeviceCapabilityCallback001 DEVICE_TYPE_CAR');
}else if(dc.deviceType == resourceManager.DeviceType.DEVICE_TYPE_PC){
console.log('testGetDeviceCapabilityCallback001 DEVICE_TYPE_PC');
}else if(dc.deviceType == resourceManager.DeviceType.DEVICE_TYPE_TV){
console.log('testGetDeviceCapabilityCallback001 DEVICE_TYPE_TV');
}else if(dc.deviceType == resourceManager.DeviceType.DEVICE_TYPE_WEARABLE){
console.log('testGetDeviceCapabilityCallback001 DEVICE_TYPE_WEARABLE');
}
expect(dc !== null).assertTrue();
console.log('testGetDeviceCapabilityCallback001 ' + JSON.stringify(dc));
done();
})
})
/* *
* @tc.number TEST_GETDEVICECAPABILITYPROMISE_001
* @tc.name testGetDeviceCapabilityPromise001
* @tc.desc get the device capability in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetDeviceCapabilityPromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getDeviceCapability().then(dc => {
if(dc.deviceType == resourceManager.DeviceType.DEVICE_TYPE_PHONE){
console.log('testGetDeviceCapabilityPromise001 DEVICE_TYPE_PHONE');
}
if(dc.screenDensity == resourceManager.ScreenDensity.SCREEN_LDPI){
console.log('testGetDeviceCapabilityPromise001 SCREEN_LDPI');
}
expect(dc !== null).assertTrue();
console.log('testGetDeviceCapabilityPromise001 ' + JSON.stringify(dc));
done();
})
})
/* *
* @tc.number TEST-GETCONFIGURATIONCALLBACK_001
* @tc.name testGetConfigurationCallback001
* @tc.desc get the configuration in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetConfigurationCallback001', 0, async function (done) {
console.log('testGetConfigurationCallback001 0');
globalThis.abilityContext.resourceManager.getConfiguration((error, cfg) => {
console.log('testGetConfigurationCallback001 1');
expect(cfg.direction !== null).assertTrue();
console.log('testGetConfigurationCallback001 1' + cfg.direction);
expect(cfg.locale !== null).assertTrue();
console.log('testGetConfigurationCallback001 1' + cfg.locale);
console.log('testGetConfigurationCallback001 1' + resourceManager.Direction.DIRECTION_HORIZONTAL);
console.log('testGetConfigurationCallback001 11');
if(cfg.direction == resourceManager.Direction.DIRECTION_VERTICAL){
console.log('testGetConfigurationCallback001 DIRECTION_VERTICAL');
}else if(cfg.direction == resourceManager.Direction.DIRECTION_HORIZONTAL){
console.log('testGetConfigurationCallback001 DIRECTION_HORIZONTAL');
}
expect(cfg !== null).assertTrue();
console.log('testGetConfigurationCallback001 ' + JSON.stringify(cfg));
done();
})
})
/* *
* @tc.number TEST_GETCONFIGURATIONPROMISE_001
* @tc.name testGetConfigurationPromise001
* @tc.desc get the configuration in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetConfigurationPromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getConfiguration().then(cfg => {
console.log('testGetConfigurationPromise001 ' + resourceManager.Direction.DIRECTION_HORIZONTAL);
if(cfg.direction == resourceManager.Direction.DIRECTION_VERTICAL){
console.log('testGetConfigurationPromise001 DIRECTION_VERTICAL');
}else if(cfg.direction == resourceManager.Direction.DIRECTION_HORIZONTAL){
console.log('testGetConfigurationPromise001 DIRECTION_HORIZONTAL');
}
expect(cfg !== null).assertTrue();
console.log('testGetConfigurationPromise001 ' + JSON.stringify(cfg));
done();
})
})
/* *
* @tc.number TEST_GETPLURALSTRINGVALUERESOURCECALLBACK_001
* @tc.name testGetPluralStringValueResourceCallback001
* @tc.desc get the plural string in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetPluralStringValueResourceCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getPluralStringValue({bundleName:"ohos.acts.global.crossplatform.resourceManager.normal",
moduleName:"entry_test",
id:$r('app.plural.plural_name').id}, 1, (error, value) => {
expect(value !== null).assertTrue();
console.log('testGetPluralStringValueResourceCallback001 ' + value);
done();
})
})
/* *
* @tc.number TEST_GETPLURALSTRINGVALUERESOURCEPROMISE_001
* @tc.name testGetPluralStringValueResourcePromise001
* @tc.desc get the plural string in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetPluralStringValueResourcePromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getPluralStringValue({bundleName:"ohos.acts.global.crossplatform.resourceManager.normal",
moduleName:"entry_test",
id:$r('app.plural.plural_name').id}, 1).then(value => {
expect(value !== null).assertTrue();
console.log('testGetPluralStringValueResourcePromise001 ' + value);
})
done();
})
/* *
* @tc.number TEST_GETPLURALSTRINGVALUERESIDCALLBACK_001
* @tc.name testGetPluralStringValueResIdCallback001
* @tc.desc get the plural string in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetPluralStringValueResIdCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getPluralStringValue($r('app.plural.plural_name').id, 1, (error, value) => {
expect(value !== null).assertTrue();
console.log('testGetPluralStringValueResIdCallback001 ' + value);
expect(value).assertEqual('1 test other');
done();
})
})
/* *
* @tc.number TEST_GETPLURALSTRINGVALUERESIDPROMISE_001
* @tc.name testGetPluralStringValueResIdPromise001
* @tc.desc get the plural string in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetPluralStringValueResIdPromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getPluralStringValue($r('app.plural.plural_name').id, 1).then(value => {
expect(value !== null).assertTrue();
console.log('testGetPluralStringValueResIdPromise001 ' + value);
expect(value).assertEqual('1 test other');
done();
})
})
/* *
* @tc.number TEST_GETSTRINGBYNAMECALLBACK_001
* @tc.name testGetStringByNameCallback001
* @tc.desc get the string in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringByNameCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getStringByName('test_1', (err, value) => {
expect(value !== null).assertTrue();
console.log('testGetStringByNameCallback001 ' + value);
expect(value).assertEqual('Test1');
done();
})
})
/* *
* @tc.number TEST_GETSTRINGBYNAMEPromise_001
* @tc.name testGetStringByNamePromise001
* @tc.desc get the string in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringByNamePromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getStringByName('test_1').then(value => {
expect(value !== null).assertTrue();
console.log('testGetStringByNamePromise001 ' + value);
expect(value).assertEqual('Test1');
done();
})
})
/* *
* @tc.number TEST_GETSTRINGARRAYBYNAMECALLBACK_001
* @tc.name testGetStringArrayByNameCallback001
* @tc.desc get the string array in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringArrayByNameCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getStringArrayByName('sizeList', (err, value) => {
expect(value !== null).assertTrue();
console.log('testGetStringArrayByNameCallback001 ' + value);
console.log('testGetStringArrayByNameCallback001 ' + value.length);
console.log('testGetStringArrayByNameCallback001 ' + value[0]);
expect(value.length).assertEqual(4);
expect(value[0]).assertEqual('small');
expect(value[1]).assertEqual('middle');
expect(value[2]).assertEqual('large');
expect(value[3]).assertEqual('extra large');
done();
})
})
/* *
* @tc.number TEST_GETSTRINGARRAYBYNAMEPROMISE_001
* @tc.name testGetStringArrayByNamePromise001
* @tc.desc get the string array in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringArrayByNamePromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getStringArrayByName('sizeList').then(value => {
expect(value !== null).assertTrue();
console.log('testGetStringArrayByNamePromise001 ' + value);
console.log('testGetStringArrayByNamePromise001 ' + value.length);
console.log('testGetStringArrayByNamePromise001 ' + value[0]);
expect(value.length).assertEqual(4);
expect(value[0]).assertEqual('small');
expect(value[1]).assertEqual('middle');
expect(value[2]).assertEqual('large');
expect(value[3]).assertEqual('extra large');
done();
})
})
/* *
* @tc.number TEST_GETMEDIABYNAMECALLBACK_001
* @tc.name testGetMediaByNameCallback001
* @tc.desc get the media in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetMediaByNameCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getMediaByName('icon', (err, value) => {
expect(value.length > 0).assertTrue();
done();
})
})
/* *
* @tc.number TEST_GETMEDIABYNAMEPROMISE_001
* @tc.name testGetMediaByNamePromise001
* @tc.desc get the media in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetMediaByNamePromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getMediaByName('icon').then(value => {
expect(value.length > 0).assertTrue();
done();
})
})
/* *
* @tc.number TEST_GETMEDIABASE64BYNAMECALLBACK_001
* @tc.name testGetMediaBase64ByNameCallback001
* @tc.desc get the media base64 in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetMediaBase64ByNameCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getMediaBase64ByName('icon', (err, value) => {
expect(value.length > 0).assertTrue();
console.log('testGetMediaBase64ByNameCallback001 ' + value);
done();
})
})
/* *
* @tc.number TEST_GETMEDIABASE64BYNAMEPROMISE_001
* @tc.name testGetMediaBase64ByNamePromise001
* @tc.desc get the media base64 in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetMediaBase64ByNamePromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getMediaBase64ByName('icon').then(value => {
expect(value.length > 0).assertTrue();
console.log('testGetMediaBase64ByNamePromise001 ' + value);
done();
})
})
/* *
* @tc.number TEST_GETPLURALSTRINGBYNAMECALLBACK_001
* @tc.name testGetPluralStringByNameCallback001
* @tc.desc get the plural string in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetPluralStringByNameCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getPluralStringByName('plural_name', 1, (error, value) => {
expect(value !== null).assertTrue();
console.log('testGetPluralStringByNameCallback001 ' + value);
expect(value).assertEqual('1 test other');
done();
})
})
/* *
* @tc.number TEST_GETPLURALSTRINGBYNAMEPROMISE_001
* @tc.name testGetPluralStringByNamePromise001
* @tc.desc get the plural string in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetPluralStringByName002', 0, async function (done) {
globalThis.abilityContext.resourceManager.getPluralStringByName('plural_name', 1).then(value => {
expect(value !== null).assertTrue();
console.log('testGetPluralStringByName002 ' + value);
expect(value).assertEqual('1 test other');
done();
})
})
/* *
* @tc.number TEST_GETSTRINGSYNCRESID_001
* @tc.name testGetStringSyncResId001
* @tc.desc get the string in sync mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringSyncResId001', 0, async function (done) {
let value = globalThis.abilityContext.resourceManager.getStringSync($r('app.string.test_1').id);
expect(value !== null).assertTrue();
console.log('testGetStringSyncResId001 ' + value);
expect(value).assertEqual('Test1');
done();
})
/* *
* @tc.number TEST_GETSTRINGSYNCRESIDARGS_001
* @tc.name testGetStringSyncResIdArgs001
* @tc.desc get the string in sync mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringSyncResIdArgs001', 0, async function (done) {
let value = globalThis.abilityContext.resourceManager.getStringSync($r('app.string.test_2').id,2);
expect(value !== null).assertTrue();
console.log('testGetStringSyncResIdArgs001 ' + value);
expect(value).assertEqual('Test2');
done();
})
/* *
* @tc.number TEST_GETSTRINGSYNCRESOURCE_001
* @tc.name testGetStringSyncResource001
* @tc.desc get the string in sync mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringSyncResource001', 0, async function (done) {
let value = globalThis.abilityContext.resourceManager.getStringSync({bundleName:"ohos.acts.global.crossplatform.resourceManager.normal",
moduleName:"entry_test",
id:$r('app.string.test_1').id});
expect(value !== null).assertTrue();
console.log('testGetStringSyncResource001 ' + value);
done();
})
/* *
* @tc.number TEST_GETSTRINGSYNCRESOURCEARGS_001
* @tc.name testGetStringSyncResourceArgs001
* @tc.desc get the string in sync mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringSyncResourceArgs001', 0, async function (done) {
let value = globalThis.abilityContext.resourceManager.getStringSync({bundleName:"ohos.acts.global.crossplatform.resourceManager.normal",
moduleName:"entry_test",
id:$r('app.string.test_2').id},
2);
expect(value !== null).assertTrue();
console.log('testGetStringSyncResourceArgs001 ' + value);
done();
})
/* *
* @tc.number TEST-GETSTRINGBYNAMESYNC_001
* @tc.name testGetStringByNameSync001
* @tc.desc get the string in sync mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringByNameSync001', 0, async function (done) {
try{
let value = globalThis.abilityContext.resourceManager.getStringByNameSync('notexist');
console.log('testGetStringByNameSync001 value');
expect(value !== null).assertTrue();
console.log('testGetStringByNameSync001 ' + value);
done();
}catch(e){
console.log('testGetStringByNameSync001 err.code' + e.code);
console.log('testGetStringByNameSync001 err.message' + e.message);
expect(e.code == 9001003).assertTrue();
done();
}
})
/* *
* @tc.number TEST-GETSTRINGBYNAMESYNC_002
* @tc.name testGetStringByNameSync002
* @tc.desc get the string in sync mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringByNameSync002', 0, async function (done) {
let value = globalThis.abilityContext.resourceManager.getStringByNameSync('test_1');
expect(value !== null).assertTrue();
expect(value).assertEqual('Test1');
console.log('testGetStringByNameSync002 ' + value);
done();
})
/* *
* @tc.number TEST-GETSTRINGBYNAMESYNCARGS_001
* @tc.name testGetStringByNameSyncArgs001
* @tc.desc get the string in sync mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetStringByNameSyncArgs001', 0, async function (done) {
let value = globalThis.abilityContext.resourceManager.getStringByNameSync('test_2',2);
expect(value !== null).assertTrue();
expect(value).assertEqual('Test2');
console.log('testGetStringByNameSyncArgs001 ' + value);
done();
})
/* *
* @tc.number TEST-GETBOOLEANRESID_001
* @tc.name testGetBooleanResId001
* @tc.desc get the boolean value
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetBooleanResId001', 0, async function (done) {
let value = globalThis.abilityContext.resourceManager.getBoolean($r('app.boolean.boolean_1').id);
console.log('testGetBooleanResId001 ' + value);
expect(value!==null).assertTrue();
done();
})
/* *
* @tc.number TEST_GETBOOLEANRESOURCE_001
* @tc.name testGetBooleanResource001
* @tc.desc get the boolean value
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetBooleanResource001', 0, async function (done) {
let value = globalThis.abilityContext.resourceManager.getBoolean({bundleName:"ohos.acts.global.crossplatform.resourceManager.normal",
moduleName:"entry_test",
id:$r('app.boolean.boolean_1').id});
console.log('testGetBooleanResource001 ' + value);
expect(value !== null).assertTrue();
done();
})
/* *
* @tc.number TEST_GETBOOLEANBYNAME_001
* @tc.name testGetBooleanByName001
* @tc.desc get the boolean value
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetBooleanByName001', 0, async function (done) {
let value = globalThis.abilityContext.resourceManager.getBooleanByName('boolean_1');
console.log('testGetBooleanByName001 ' + value);
expect(value).assertTrue();
done();
})
/* *
* @tc.number TEST_GETNUMBERRESID_001
* @tc.name testGetNumberResId001
* @tc.desc get the interger value
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetNumberResId001', 0, async function (done) {
console.log('testGetNumberResId001 0');
let value = globalThis.abilityContext.resourceManager.getNumber($r('app.integer.integer_1').id);
console.log('testGetNumberResId001 1');
console.log('testGetNumberResId001 ' + value);
expect(value).assertEqual(100);
done();
})
/* *
* @tc.number TEST_GETNUMBERRESID_002
* @tc.name testGetNumberResId002
* @tc.desc get the float value
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetNumberResId002', 0, async function (done) {
let value = globalThis.abilityContext.resourceManager.getNumber($r('app.float.float_1').id);
console.log('testGetNumberResId002 ' + value);
expect(value > 0).assertTrue();
done();
})
/* *
* @tc.number TEST_GETNUMBERRESOURCE_001
* @tc.name testGetNumberResource001
* @tc.desc get the interger value
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetNumberResource001', 0, async function (done) {
let value = globalThis.abilityContext.resourceManager.getNumber({bundleName:"ohos.acts.global.crossplatform.resourceManager.normal",
moduleName:"entry_test",
id:$r('app.integer.integer_1').id});
console.log('testGetNumberResource001 ' + value);
expect(value !== null).assertTrue();
done();
})
/* *
* @tc.number TEST_GETNUMBERRESOURCE_002
* @tc.name testGetNumberResource002
* @tc.desc get the float value
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetNumberResource002', 0, async function (done) {
let value = globalThis.abilityContext.resourceManager.getNumber({bundleName:"ohos.acts.global.crossplatform.resourceManager.normal",
moduleName:"entry_test",
id:$r('app.float.float_1').id});
console.log('testGetNumberResource002 ' + value);
expect(value !== null).assertTrue();
done();
})
/* *
* @tc.number TEST_GETNUMBERBYNAME_001
* @tc.name testGetNumberByName001
* @tc.desc get the interger value
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetNumberByName001', 0, async function (done) {
let value = globalThis.abilityContext.resourceManager.getNumberByName('integer_1');
console.log('testGetNumberByName001 ' + value);
expect(value).assertEqual(100);
done();
})
/* *
* @tc.number TEST_GETNUMBERBYNAME_002
* @tc.name testGetNumberByName002
* @tc.desc get the float value
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetNumberByName002', 0, async function (done) {
let value = globalThis.abilityContext.resourceManager.getNumberByName('float_1');
console.log('testGetNumberByName002 ' + value);
expect(value > 0).assertTrue();
done();
})
/* *
* @tc.number TEST_RELEASE_001
* @tc.name testRelease001
* @tc.desc get the release function
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testRelease001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getString($r('app.string.test_1').id, (err, value) => {
expect(value !== null).assertTrue();
done();
})
globalThis.abilityContext.resourceManager.release();
})
/* *
* @tc.number TEST_GETRAWFILECONTENTCALLBACK_001
* @tc.name testGetRawFileContentCallback001
* @tc.desc get the getRawFile in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetRawFileContentCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getRawFileContent('rawfile/rawfiletest.xml', (error, value) => {
expect(value !== null).assertTrue();
console.log('testGetRawFileContentCallback001 ' + value);
done();
})
})
/* *
* @tc.number TEST_GETRAWFILECONTENTPROMISE_001
* @tc.name testGetRawFileContentPromise001
* @tc.desc get the getRawFile in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetRawFileContentPromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getRawFileContent('rawfile/rawfiletest.xml').then(value => {
expect(value !== null).assertTrue();
console.log('testGetRawFileContentPromise001 ' + value);
done();
})
})
/* *
* @tc.number TEST-GETRAWFDCALLBACK_001
* @tc.name testGetRawFdCallback001
* @tc.desc get the RawFileDescriptor in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetRawFdCallback001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getRawFd('rawfiletest.xml', (error, rawfile) => {
let fdValue = rawfile.fd;
let offsetValue = rawfile.offset;
let lengthValue = rawfile.length;
expect(rawfile !== null).assertTrue();
console.log('testGetRawFdCallback001--'
+'fd:' + fdValue
+ ' offset:' + offsetValue
+ ' length:' + lengthValue);
done();
})
})
/* *
* @tc.number TEST-GETRAWFDPROMISE_001
* @tc.name testGetRawFdPromise001
* @tc.desc get the RawFileDescriptor in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testGetRawFdPromise001', 0, async function (done) {
globalThis.abilityContext.resourceManager.getRawFd('rawfiletest.xml').then(rawfile => {
rawfile.fd = 2000;
rawfile.offset = 20;
rawfile.length = 200;
expect(rawfile !== null).assertTrue();
console.log('testGetRawFdPromise001--' + JSON.stringify(rawfile));
console.log('testGetRawFdPromise001--'
+'fd:' + rawfile.fd
+ ' offset:' + rawfile.offset
+ ' length:' + rawfile.length);
done();
})
})
/* *
* @tc.number TEST_CLOSERAWFDCALLBACK_001
* @tc.name testCloseRawFdCallback001
* @tc.desc get the closeRawFileDescriptor in callback mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testCloseRawFdCallback001', 0, async function (done) {
try{
globalThis.abilityContext.resourceManager.closeRawFd('notexist.xml', (error, value) => {
if(error){
console.log('testCloseRawFdCallback001 err.code:' + error.code);
console.log('testCloseRawFdCallback001 err.message:' + error.message);
expect(error.code == 9001005).assertTrue();
done();
}else{
expect(value !== null).assertTrue();
console.log('testCloseRawFdCallback001 ' + value);
done();
}
})
}catch(e){
console.log('testCloseRawFdCallback001 e.code' + e.code);
console.log('testCloseRawFdCallback001 e.message' + e.message);
}
})
/* *
* @tc.number TEST_CLOSERAWFDPROMISE_001
* @tc.name testCloseRawFdPromise001
* @tc.desc get the closeRawFd in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testCloseRawFdPromise001', 0, async function (done) {
try {
// param not exist throw 9001005 error code
globalThis.abilityContext.resourceManager.closeRawFd('notexist.xml').then(value => {
console.log('testCloseRawFdPromise001 ' + value);
done();
}).catch(error => {
console.log('testCloseRawFdPromise001 error.code' + error.code);
console.log('testCloseRawFdPromise001 error.message' + error.message);
expect(error.code == 9001005).assertTrue();
done();
})
} catch (err) {
console.log('testCloseRawFdPromise001 err.code' + err.code);
console.log('testCloseRawFdPromise001 err.message' + err.message);
done();
}
})
/*
* @tc.number TEST_CLOSERAWFDPROMISE_002
* @tc.name testCloseRawFdPromise002
* @tc.desc get the closeRawFd in promise mode
* @tc.size: MediumTest
* @tc.type method
* @tc.level level 2
*/
it('testCloseRawFdPromise002', 0, async function (done) {
try {
// param type not correct,throw 401 error code
globalThis.abilityContext.resourceManager.closeRawFd($r('app.integer.integer_1').id).then(value => {
console.log('testCloseRawFdPromise002 ' + value);
done();
}).catch(error => {
console.log('testCloseRawFdPromise002 error.code' + error.code);
console.log('testCloseRawFdPromise002 error.message' + error.message);
expect(error.code == 401).assertTrue();
done();
})
} catch (err) {
console.log('testCloseRawFdPromise002 err.code' + err.code);
console.log('testCloseRawFdPromise002 err.message' + err.message);
done();
}
})
console.log('*************end ResmgrTest*************');
})}
{
"module": {
"name": "entry_test",
"type": "feature",
"description": "$string:module_test_desc",
"mainElement": "TestAbility",
"deviceTypes": [
"phone"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:test_pages",
"abilities": [
{
"name": "TestAbility",
"srcEntry": "./ets/TestAbility/TestAbility.ets",
"description": "$string:TestAbility_desc",
"icon": "$media:icon",
"label": "$string:TestAbility_label",
"exported": true,
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:start_window_background",
"skills": [
{
"actions": [
"action.system.home"
],
"entities": [
"entity.system.home"
]
}
]
}
]
}
}
{
"boolean": [
{
"name": "boolean_1",
"value": true
},
{
"name": "boolean_2",
"value": false
},
{
"name": "boolean_3",
"value": "$boolean:boolean_4"
},
{
"name": "boolean_4",
"value": "$boolean:boolean_3"
}
]
}
\ No newline at end of file
{
"color": [
{
"name": "start_window_background",
"value": "#FFFFFF"
}
]
}
\ No newline at end of file
{
"float": [
{
"name": "float_1",
"value": "48vp"
},
{
"name": "float_2",
"value": "24vp"
}
]
}
\ No newline at end of file
{
"integer": [
{
"name": "integer_1",
"value": 100
},
{
"name": "integer_2",
"value": 200
}
]
}
\ No newline at end of file
{
"plural":[
{
"name":"plural_name",
"value":[
{
"quantity":"zero",
"value":"%d test zero"
},
{
"quantity":"one",
"value":"%d test one"
},
{
"quantity":"two",
"value":"%d test two"
},
{
"quantity":"few",
"value":"%d test few"
},
{
"quantity":"many",
"value":"%d test many"
},
{
"quantity":"other",
"value":"%d test other"
}
]
},
{
"name":"plural_name2",
"value":[
{
"quantity": "one",
"value": "$string:Test_name1"
},
{
"quantity":"other",
"value":"$string:Test_name1"
}
]
},
{
"name":"plural_name3",
"value":[
{
"quantity": "one",
"value": "$theme:app_theme"
},
{
"quantity":"other",
"value":"$theme:app_theme"
}
]
}
]
}
\ No newline at end of file
{
"strarray": [
{
"name": "sizeList",
"value":[
{
"value":"small"
},
{
"value":"middle"
},
{
"value":"large"
},
{
"value":"extra large"
}
]
},
{
"name": "sizeList2",
"value":[
{
"value":"$string:Test_name1"
}
]
}
]
}
\ No newline at end of file
{
"string": [
{
"name": "test_1",
"value": "Test1"
},
{
"name": "test_2",
"value": "Test%d"
},
{
"name": "Test_name1",
"value": "$string:Test_name2"
},
{
"name": "Test_name2",
"value": "$string:Test_name1"
},
{
"name": "module_test_desc",
"value": "test ability description"
},
{
"name": "TestAbility_desc",
"value": "the test ability"
},
{
"name": "TestAbility_label",
"value": "test label"
}
]
}
\ No newline at end of file
{
"theme":[
{
"name":"app_theme",
"value":[
{
"name":"colorbar",
"value":"#FF00FF00"
},
{
"name":"noWindow",
"value":"true"
},
{
"name":"layout_width",
"value":"100dp"
},
{
"name":"background",
"value":"#FF00FF00"
},
{
"name":"background111",
"value":"#FF00FF00"
},
{
"name":"background222",
"value":"#FF00FF00"
},
{
"name":"background333",
"value":"$media:icon"
}
]
},
{
"name":"test_theme",
"parent":"app_theme",
"value":[
{
"name":"color",
"value":"#FFFFFF00"
},
{
"name":"layout_width",
"value":"50dp"
},
{
"name":"colorbar",
"value":"#FFFFFF11"
},
{
"name":"hasWindow",
"value":"true"
}
]
}
]
}
\ No newline at end of file
{
"stratified-image":{
"background":"$media:icon",
"foreground":"$media:wp"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<mirror>
<id>maven-default-http-blocker</id>
<mirrorOf>external:http:*</mirrorOf>
<name>Pseudo repository to mirror external repositories initially using HTTP.</name>
<url>http://0.0.0.0/</url>
<blocked>true</blocked>
</mirror>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册