提交 a62f8b22 编写于 作者: L liuganlin

Add Containers XTS Tests

Signed-off-by: Nliuganlin <liuganlin@huawei.com>
上级 832f8872
......@@ -17,6 +17,8 @@ group("compileruntime") {
if (is_standard_system) {
deps = [
"ark_intl_standard/intljs:intljs_test",
"containerLine_lib_standard:containerLine_js_test",
"containerRelation_lib_standard:containerRelation_js_test",
"convertxml_lib_standard:convertxml_js_test",
"uri_lib_standard:uri_js_test",
"url_lib_standard:url_js_test",
......
# Copyright (C) 2021 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("containerLine_js_test") {
hap_profile = "./src/main/config.json"
js2abc = true
deps = [
":containerLine_js_assets",
":containerLine_resources",
]
# shared_libraries = [
# "//third_party/giflib:libgif",
# "//third_party/libpng:libpng",
# ]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsContainerLineJsTest"
# part_name = "prebuilt_hap"
# subsystem_name = "xts"
}
ohos_js_assets("containerLine_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("containerLine_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for startup util js api Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "com.example.containerLine",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsContainerLineJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.containerLine",
"vendor": "example",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 4,
"target": 5
}
},
"deviceConfig": {},
"module": {
"package": "com.example.containerLine",
"name": ".MyApplication",
"mainAbility": "com.example.containerLine.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"visible": true,
"name": "com.example.containerLine.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("../../common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<div class="container" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{title}}
</text>
</div>
\ No newline at end of file
/*
* Copyright (C) 2021 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 file from '@system.file'
import app from '@system.app'
import device from '@system.device'
import router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
core.init()
require('../../../test/Main.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
......@@ -348,7 +348,7 @@ describe("ArraylistTest", function () {
try {
let res = arrayList.insert(8, -1);
} catch (err) {
expect(err).assertEqual("Error: ArrayList: get out-of-bounds");
expect(err).assertEqual("RangeError: ArrayList: set out-of-bounds");
}
});
it("SR000GGR44_testInsert0028", 0, function () {
......@@ -360,7 +360,7 @@ describe("ArraylistTest", function () {
try {
let res = arrayList.insert(8, 10);
} catch (err) {
expect(err).assertEqual("Error: ArrayList: set out-of-bounds");
expect(err).assertEqual("RangeError: ArrayList: set out-of-bounds");
}
});
it("SR000GGR44_testInsert029", 0, function () {
......@@ -372,7 +372,7 @@ describe("ArraylistTest", function () {
try {
let res = arrayList.insert(8, 11);
} catch (err) {
expect(err).assertEqual("Error: ArrayList: set out-of-bounds");
expect(err).assertEqual("RangeError: ArrayList: set out-of-bounds");
}
});
it("SR000GGR44_testisEmpty030", 0, function () {
......@@ -457,7 +457,7 @@ describe("ArraylistTest", function () {
try {
let res = arrayList.removeByIndex(5);
} catch (err) {
expect(err).assertEqual("Error: removeByIndex is out-of-bounds");
expect(err).assertEqual("RangeError: removeByIndex is out-of-bounds");
}
});
it("SR000GGR44_testRemoveByRange037", 0, function () {
......@@ -473,9 +473,7 @@ describe("ArraylistTest", function () {
try {
let res = arrayList.removeByRange(3, 1);
} catch (err) {
expect(err).assertEqual(
"Error: fromIndex cannot be less than or equal to toIndex"
);
expect(err).assertEqual("RangeError: fromIndex cannot be less than or equal to toIndex");
}
});
it("SR000GGR44_testRemoveByRange038", 0, function () {
......@@ -488,7 +486,7 @@ describe("ArraylistTest", function () {
try {
let res = arrayList.removeByRange(6, 8);
} catch (err) {
expect(err).assertEqual("Error: ArrayList: set out-of-bounds");
expect(err).assertEqual("RangeError: ArrayList: set out-of-bounds");
}
});
it("SR000GGR44_testRemoveByRange039", 0, function () {
......@@ -517,9 +515,7 @@ describe("ArraylistTest", function () {
try {
let subArr = arrayList.subArrayList(4, 2);
} catch (err) {
expect(err).assertEqual(
"Error: fromIndex cannot be less than or equal to toIndex"
);
expect(err).assertEqual("RangeError: fromIndex cannot be less than or equal to toIndex");
}
});
it("SR000GGR44_testSubArrayList041", 0, function () {
......@@ -549,7 +545,7 @@ describe("ArraylistTest", function () {
try {
let subArr = arrayList.subArrayList(6, 9);
} catch (err) {
expect(err).assertEqual("Error: fromIndex or toIndex is out-of-bounds");
expect(err).assertEqual("RangeError: fromIndex or toIndex is out-of-bounds");
}
});
it("SR000GGR44_testIncreaseCapacityTo043", 0, function () {
......@@ -573,7 +569,7 @@ describe("ArraylistTest", function () {
try {
let res = arrayList.increaseCapacityTo();
} catch (err) {
expect(err).assertEqual("ArrayList: set out-of-bounds");
expect(err).assertEqual("TypeError: newCapacity is not Integer");
}
});
it("SR000GGR44_testAdd045", 0, function () {
......
/*
* Copyright (C) 2021 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 app from '@system.app'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('appInfoTest', function () {
it('app_info_test_001', 0, function () {
var info = app.getInfo()
expect(info.versionCode).assertEqual('1000000')
})
})
\ No newline at end of file
/*
* Copyright (C) 2021 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.
*/
require('./ExampleJsunit.test.js');
require('./Deque.test.js');
require('./ArrayList.test.js');
require('./Queue.test.js');
require('./Stack.test.js');
require('./List.test.js');
require('./LinkedList.test.js');
require('./Vector.test.js');
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
}
\ No newline at end of file
# Copyright (C) 2021 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("containerRelation_js_test") {
hap_profile = "./src/main/config.json"
js2abc = true
deps = [
":containerRelation_js_assets",
":containerRelation_resources",
]
# shared_libraries = [
# "//third_party/giflib:libgif",
# "//third_party/libpng:libpng",
# ]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsContainerRelationJsTest"
# part_name = "prebuilt_hap"
# subsystem_name = "xts"
}
ohos_js_assets("containerRelation_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("containerRelation_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for startup util js api Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "com.example.containerRelation",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsContainerRelationJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.containerRelation",
"vendor": "example",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 4,
"target": 5
}
},
"deviceConfig": {},
"module": {
"package": "com.example.containerRelation",
"name": ".MyApplication",
"mainAbility": "com.example.containerRelation.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"visible": true,
"name": "com.example.containerRelation.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("../../common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<div class="container" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{title}}
</text>
</div>
\ No newline at end of file
/*
* Copyright (C) 2021 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 file from '@system.file'
import app from '@system.app'
import device from '@system.device'
import router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
core.init()
require('../../../test/Main.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
/*
* Copyright (C) 2021 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 app from '@system.app'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('appInfoTest', function () {
it('app_info_test_001', 0, function () {
var info = app.getInfo()
expect(info.versionCode).assertEqual('1000000')
})
})
\ No newline at end of file
......@@ -95,9 +95,9 @@ describe("HashMapTest", function () {
});
it("SR000GGR4B_testSet002_12", 0, function () {
let hashMap = new HashMap();
hashMap.set(1, null);
hashMap.set(1, undefined);
let res = hashMap.get(1);
expect(res).assertEqual(null);
expect(res).assertEqual(undefined);
});
it("SR000GGR4B_testSet002_13", 0, function () {
let hashMap = new HashMap();
......
/*
* Copyright (C) 2021 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.
*/
require('./ExampleJsunit.test.js');
require('./LightWeightMap.test.js');
require('./LightWeightSet.test.js');
require('./HashMap.test.js');
require('./HashSet.test.js');
require('./PlainArray.test.js');
require('./TreeMap.test.js');
require('./TreeSet.test.js');
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册