From 2ae07f4f6d417afb91b6b64c8cc0bda5747a44c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=8C=A5=E5=88=AB=E6=98=A8=E5=A4=A9=E7=9A=84=E6=88=91?= <838119225@qq.com> Date: Wed, 2 Jun 2021 17:20:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 3 +- entry/build.gradle | 4 +- entry/src/main/config.json | 7 ++-- entry/src/ohosTest/config.json | 39 +++++++++++++++++++ .../java/com/demo/aty/ExampleOhosTest.java | 15 +++++++ guideview/build.gradle | 3 +- guideview/src/main/config.json | 9 ++--- lottie/build.gradle | 2 +- lottie/src/main/config.json | 9 ++--- 9 files changed, 72 insertions(+), 19 deletions(-) create mode 100644 entry/src/ohosTest/config.json create mode 100644 entry/src/ohosTest/java/com/demo/aty/ExampleOhosTest.java diff --git a/build.gradle b/build.gradle index 2368e1d..ca5f81b 100644 --- a/build.gradle +++ b/build.gradle @@ -20,8 +20,7 @@ buildscript { } dependencies { classpath 'com.huawei.ohos:hap:2.4.2.7' - classpath 'com.huawei.ohos:decctest:1.0.0.6' - } + classpath 'com.huawei.ohos:decctest:1.0.0.7' } } allprojects { diff --git a/entry/build.gradle b/entry/build.gradle index cbfbe31..678a65b 100644 --- a/entry/build.gradle +++ b/entry/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'com.huawei.ohos.hap' +apply plugin: 'com.huawei.ohos.decctest' ohos { compileSdkVersion 5 defaultConfig { @@ -9,7 +10,8 @@ ohos { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) - testCompile 'junit:junit:4.12' + testImplementation 'junit:junit:4.13' implementation project(':lottie') implementation project(':guideview') + ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100' } diff --git a/entry/src/main/config.json b/entry/src/main/config.json index dda9679..7b338b5 100644 --- a/entry/src/main/config.json +++ b/entry/src/main/config.json @@ -3,12 +3,13 @@ "bundleName": "com.demo.aty", "vendor": "demo", "version": { - "code": 1, - "name": "1.0" + "code": 1000000, + "name": "1.0.0" }, "apiVersion": { "compatible": 4, - "target": 5} + "target": 5 + } }, "deviceConfig": {}, "module": { diff --git a/entry/src/ohosTest/config.json b/entry/src/ohosTest/config.json new file mode 100644 index 0000000..7e3083a --- /dev/null +++ b/entry/src/ohosTest/config.json @@ -0,0 +1,39 @@ +{ + "app": { + "bundleName": "com.demo.aty", + "vendor": "demo", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Release" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.demo.aty", + "name": "testModule", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry_test", + "moduleType": "feature", + "installationFree": true + }, + "abilities": [ + { + "name": "decc.testkit.runner.EntryAbility", + "description": "Test Entry Ability", + "launchType": "standard", + "orientation": "landscape", + "visible": true, + "type": "page" + } + ] + } +} \ No newline at end of file diff --git a/entry/src/ohosTest/java/com/demo/aty/ExampleOhosTest.java b/entry/src/ohosTest/java/com/demo/aty/ExampleOhosTest.java new file mode 100644 index 0000000..086c92c --- /dev/null +++ b/entry/src/ohosTest/java/com/demo/aty/ExampleOhosTest.java @@ -0,0 +1,15 @@ +package com.demo.aty; + +import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class ExampleOhosTest { + //UI组件,不涉及单元测试 + @Test + public void testBundleName() { + final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName(); + assertEquals("com.demo.aty", actualBundleName); + } +} \ No newline at end of file diff --git a/guideview/build.gradle b/guideview/build.gradle index adada0e..ed17026 100644 --- a/guideview/build.gradle +++ b/guideview/build.gradle @@ -10,5 +10,4 @@ ohos { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - testCompile 'junit:junit:4.12' -} + testImplementation 'junit:junit:4.13'} diff --git a/guideview/src/main/config.json b/guideview/src/main/config.json index 63712b9..0a2d38c 100644 --- a/guideview/src/main/config.json +++ b/guideview/src/main/config.json @@ -3,13 +3,12 @@ "bundleName": "com.demo.aty", "vendor": "demo", "version": { - "code": 1, - "name": "1.0" + "code": 1000000, + "name": "1.0.0" }, "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" + "compatible": 4, + "target": 5 } }, "deviceConfig": {}, diff --git a/lottie/build.gradle b/lottie/build.gradle index 312bc1c..4872111 100644 --- a/lottie/build.gradle +++ b/lottie/build.gradle @@ -9,5 +9,5 @@ ohos { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - testCompile 'junit:junit:4.12' + testImplementation 'junit:junit:4.13' } diff --git a/lottie/src/main/config.json b/lottie/src/main/config.json index f741d7b..30ef165 100644 --- a/lottie/src/main/config.json +++ b/lottie/src/main/config.json @@ -3,13 +3,12 @@ "bundleName": "com.demo.aty", "vendor": "airbnb", "version": { - "code": 1, - "name": "1.0" + "code": 1000000, + "name": "1.0.0" }, "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" + "compatible": 4, + "target": 5 } }, "deviceConfig": {}, -- Gitee