diff --git a/entry/build.gradle b/entry/build.gradle index b8ea0ae84e631f4a941a26fb69c4bdda146a3650..1b14223d2275c753cbf902a8965cf25dc16001df 100644 --- a/entry/build.gradle +++ b/entry/build.gradle @@ -9,4 +9,5 @@ ohos { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) implementation project(path: ':lib') + implementation 'junit:junit:4.12' } diff --git a/entry/src/ohosTest/config.json b/entry/src/ohosTest/config.json new file mode 100644 index 0000000000000000000000000000000000000000..c9da8b427ae602a994eba163055714922ddafcfc --- /dev/null +++ b/entry/src/ohosTest/config.json @@ -0,0 +1,41 @@ +{ + "app": { + "bundleName": "com.justinangel.hijckrsampleapp", + "vendor": "justinangel", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 5, + "target": 5, + "releaseType": "Release" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.justinangel.hijckrsampleapp", + "name": "testModule", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry_test", + "moduleType": "feature", + "installationFree": true + }, + "abilities": [ + { + "name": "decc.testkit.runner.EntryAbility", + "description": "Test Entry Ability", + "icon": "$media:icon", + "label": "$string:app_name", + "launchType": "standard", + "orientation": "landscape", + "visible": true, + "type": "page" + } + ] + } +} \ No newline at end of file diff --git a/entry/src/ohosTest/java/com/justinangel/hijckrsampleapp/ExampleOhosTest.java b/entry/src/ohosTest/java/com/justinangel/hijckrsampleapp/ExampleOhosTest.java new file mode 100644 index 0000000000000000000000000000000000000000..2deb4ed1404ca7154750d295283432ae9129af0a --- /dev/null +++ b/entry/src/ohosTest/java/com/justinangel/hijckrsampleapp/ExampleOhosTest.java @@ -0,0 +1,14 @@ +package com.justinangel.hijckrsampleapp; + +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(); + } +} \ No newline at end of file diff --git a/entry/src/test/java/com/lid/labelview/ExampleTest.java b/entry/src/test/java/com/lid/labelview/ExampleTest.java deleted file mode 100644 index 6d0a06bc0be038e15b5d76dfd5a97e7bfc9a2e1c..0000000000000000000000000000000000000000 --- a/entry/src/test/java/com/lid/labelview/ExampleTest.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.lid.labelview; - -import org.junit.Test; - -public class ExampleTest { - @Test - public void onStart() { - } -}