diff --git a/build.gradle b/build.gradle index 2368e1d63380a3fe53798b21625a9e8dc5b1f91a..ca5f81b6b3cce46bf2393862d409abea3a8a4748 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 cbfbe310a1526b7d6e11b71c8ddd426c28fe2db2..678a65b9cb393218cc6441e86830b55365a932b6 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 dda9679612b3ed626f9619a858b49792c9d1c6cf..7b338b5a74b4cf0da986f624874b4c72551f1abe 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 0000000000000000000000000000000000000000..7e3083a179f83719c420e1b5f0bce6798694a627 --- /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 0000000000000000000000000000000000000000..086c92cbfebc56f70e778d190ea1006d2078ff7a --- /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 adada0e704e62d0eb9bd4509326943358951f230..ed17026792c079bc0631b41d1d8f977201c36439 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 63712b9822b418e83f5cfe6aeccdf9c21a303048..0a2d38ce67bd639047fd996ad97883badb5fca9f 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 312bc1c336a2b750048a182991e5872344e45dbf..4872111d7f8e964591ce54cb46cd2f30fda61087 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 f741d7b9d297e89840e09ddbcfce085f9100f7ad..30ef1654857a84e24a82cb540fe33527f12843b0 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": {},