Browse Source

初始化

jiaxiaoqiang 8 tháng trước cách đây
commit
8af7104481
40 tập tin đã thay đổi với 710 bổ sung0 xóa
  1. 11 0
      .gitignore
  2. 10 0
      AppScope/app.json5
  3. 8 0
      AppScope/resources/base/element/string.json
  4. BIN
      AppScope/resources/base/media/HONDAK_LOGO.png
  5. BIN
      AppScope/resources/base/media/app_icon.png
  6. 49 0
      build-profile.json5
  7. 6 0
      entry/.gitignore
  8. 31 0
      entry/build-profile.json5
  9. 6 0
      entry/hvigorfile.ts
  10. 18 0
      entry/obfuscation-rules.txt
  11. 10 0
      entry/oh-package.json5
  12. 65 0
      entry/src/main/ets/entryability/EntryAbility.ets
  13. 42 0
      entry/src/main/ets/pages/Index.ets
  14. 68 0
      entry/src/main/module.json5
  15. 8 0
      entry/src/main/resources/base/element/color.json
  16. 16 0
      entry/src/main/resources/base/element/string.json
  17. BIN
      entry/src/main/resources/base/media/HONDAK_LOGO.png
  18. BIN
      entry/src/main/resources/base/media/icon.png
  19. 4 0
      entry/src/main/resources/base/media/shutdown.svg
  20. BIN
      entry/src/main/resources/base/media/startIcon.png
  21. 5 0
      entry/src/main/resources/base/profile/main_pages.json
  22. 16 0
      entry/src/main/resources/en_US/element/string.json
  23. 16 0
      entry/src/main/resources/zh_CN/element/string.json
  24. 35 0
      entry/src/ohosTest/ets/test/Ability.test.ets
  25. 5 0
      entry/src/ohosTest/ets/test/List.test.ets
  26. 49 0
      entry/src/ohosTest/ets/testability/TestAbility.ets
  27. 17 0
      entry/src/ohosTest/ets/testability/pages/Index.ets
  28. 50 0
      entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets
  29. 37 0
      entry/src/ohosTest/module.json5
  30. 8 0
      entry/src/ohosTest/resources/base/element/color.json
  31. 16 0
      entry/src/ohosTest/resources/base/element/string.json
  32. BIN
      entry/src/ohosTest/resources/base/media/HONDAK_LOGO.png
  33. BIN
      entry/src/ohosTest/resources/base/media/icon.png
  34. 5 0
      entry/src/ohosTest/resources/base/profile/test_pages.json
  35. 5 0
      entry/src/test/List.test.ets
  36. 33 0
      entry/src/test/LocalUnit.test.ets
  37. 21 0
      hvigor/hvigor-config.json5
  38. 6 0
      hvigorfile.ts
  39. 20 0
      oh-package-lock.json5
  40. 14 0
      oh-package.json5

+ 11 - 0
.gitignore

@@ -0,0 +1,11 @@
+/node_modules
+/oh_modules
+/local.properties
+/.idea
+**/build
+/.hvigor
+.cxx
+/.clangd
+/.clang-format
+/.clang-tidy
+**/.test

+ 10 - 0
AppScope/app.json5

@@ -0,0 +1,10 @@
+{
+  "app": {
+    "bundleName": "com.example.rearendapp",
+    "vendor": "example",
+    "versionCode": 1000000,
+    "versionName": "1.0.0",
+    "icon": "$media:HONDAK_LOGO",
+    "label": "$string:app_name"
+  }
+}

+ 8 - 0
AppScope/resources/base/element/string.json

@@ -0,0 +1,8 @@
+{
+  "string": [
+    {
+      "name": "app_name",
+      "value": "一体机终端"
+    }
+  ]
+}

BIN
AppScope/resources/base/media/HONDAK_LOGO.png


BIN
AppScope/resources/base/media/app_icon.png


+ 49 - 0
build-profile.json5

@@ -0,0 +1,49 @@
+{
+  "app": {
+    "signingConfigs": [
+      {
+        "name": "default",
+        "material": {
+          "certpath": "C:/Users/yxj23/.ohos/config/openharmony/default_RearEndApp_jPGGC8QYDU_I4915h83y2DqA1lzHoKEksjug1v4qmLA=.cer",
+          "storePassword": "0000001B33BC198BCE3899851210D0EDDFAB1B1703D13356941D2891FEA02FBB3F9E2C6AF4EC0A8262BBEF",
+          "keyAlias": "debugKey",
+          "keyPassword": "0000001B1C28025910FEA58D750B3DDD22B92C93B1FCBDF5BEB16CBD0F66A69098B5CE637A562566517048",
+          "profile": "C:/Users/yxj23/.ohos/config/openharmony/default_RearEndApp_jPGGC8QYDU_I4915h83y2DqA1lzHoKEksjug1v4qmLA=.p7b",
+          "signAlg": "SHA256withECDSA",
+          "storeFile": "C:/Users/yxj23/.ohos/config/openharmony/default_RearEndApp_jPGGC8QYDU_I4915h83y2DqA1lzHoKEksjug1v4qmLA=.p12"
+        }
+      }
+    ],
+    "products": [
+      {
+        "name": "default",
+        "signingConfig": "default",
+        "compileSdkVersion": 10,
+        "compatibleSdkVersion": 10,
+        "runtimeOS": "OpenHarmony",
+      }
+    ],
+    "buildModeSet": [
+      {
+        "name": "debug",
+      },
+      {
+        "name": "release"
+      }
+    ]
+  },
+  "modules": [
+    {
+      "name": "entry",
+      "srcPath": "./entry",
+      "targets": [
+        {
+          "name": "default",
+          "applyToProducts": [
+            "default"
+          ]
+        }
+      ]
+    }
+  ]
+}

+ 6 - 0
entry/.gitignore

@@ -0,0 +1,6 @@
+/node_modules
+/oh_modules
+/.preview
+/build
+/.cxx
+/.test

+ 31 - 0
entry/build-profile.json5

@@ -0,0 +1,31 @@
+{
+  "apiType": "stageMode",
+  "buildOption": {
+    "arkOptions": {
+      // "apPath": "./modules.ap"  /* Profile used for profile-guided optimization (PGO), a compiler optimization technique to improve app runtime performance. */
+    }
+  },
+  "buildOptionSet": [
+    {
+      "name": "release",
+      "arkOptions": {
+        "obfuscation": {
+          "ruleOptions": {
+            "enable": true,
+            "files": [
+              "./obfuscation-rules.txt"
+            ]
+          }
+        }
+      }
+    },
+  ],
+  "targets": [
+    {
+      "name": "default"
+    },
+    {
+      "name": "ohosTest",
+    }
+  ]
+}

+ 6 - 0
entry/hvigorfile.ts

@@ -0,0 +1,6 @@
+import { hapTasks } from '@ohos/hvigor-ohos-plugin';
+
+export default {
+    system: hapTasks,  /* Built-in plugin of Hvigor. It cannot be modified. */
+    plugins:[]         /* Custom plugin to extend the functionality of Hvigor. */
+}

+ 18 - 0
entry/obfuscation-rules.txt

@@ -0,0 +1,18 @@
+# Define project specific obfuscation rules here.
+# You can include the obfuscation configuration files in the current module's build-profile.json5.
+#
+# For more details, see
+#   https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
+
+# Obfuscation options:
+# -disable-obfuscation: disable all obfuscations
+# -enable-property-obfuscation: obfuscate the property names
+# -enable-toplevel-obfuscation: obfuscate the names in the global scope
+# -compact: remove unnecessary blank spaces and all line feeds
+# -remove-log: remove all console.* statements
+# -print-namecache: print the name cache that contains the mapping from the old names to new names
+# -apply-namecache: reuse the given cache file
+
+# Keep options:
+# -keep-property-name: specifies property names that you want to keep
+# -keep-global-name: specifies names that you want to keep in the global scope

+ 10 - 0
entry/oh-package.json5

@@ -0,0 +1,10 @@
+{
+  "name": "entry",
+  "version": "1.0.0",
+  "description": "Please describe the basic information.",
+  "main": "",
+  "author": "",
+  "license": "",
+  "dependencies": {}
+}
+

+ 65 - 0
entry/src/main/ets/entryability/EntryAbility.ets

@@ -0,0 +1,65 @@
+import AbilityConstant from '@ohos.app.ability.AbilityConstant';
+import hilog from '@ohos.hilog';
+import UIAbility from '@ohos.app.ability.UIAbility';
+import Want from '@ohos.app.ability.Want';
+import window from '@ohos.window';
+
+export default class EntryAbility extends UIAbility {
+  onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
+  }
+
+  onDestroy(): void {
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy');
+  }
+
+
+  onWindowStageCreate(windowStage: window.WindowStage): void {
+    // Main window is created, set main page for this ability
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
+    // 1.获取应用主窗口。
+    let windowClass: window.Window
+    windowStage.getMainWindow((err, data) => {
+
+      if (err.code) {
+        console.error('Failed to obtain the main window. Cause: ' + JSON.stringify(err));
+        return;
+      }
+      windowClass = data;
+      console.info('Succeeded in obtaining the main window. Data: ' + JSON.stringify(data));
+      // 2.实现沉浸式效果:设置导航栏、状态栏不显示。
+      let names:[] = [];
+      windowClass.setWindowSystemBarEnable(names, (err) => {
+        if (err.code) {
+          console.error('Failed to set the system bar to be visible. Cause:' + JSON.stringify(err));
+          return;
+        }
+        console.info('Succeeded in setting the system bar to be visible.');
+      });
+
+      windowClass.setWindowLayoutFullScreen(true)
+    })
+    windowStage.loadContent('pages/Index', (err) => {
+      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.');
+    });
+  }
+
+  onWindowStageDestroy(): void {
+    // Main window is destroyed, release UI related resources
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
+  }
+
+  onForeground(): void {
+    // Ability has brought to foreground
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
+  }
+
+  onBackground(): void {
+    // Ability has back to background
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
+  }
+}

+ 42 - 0
entry/src/main/ets/pages/Index.ets

@@ -0,0 +1,42 @@
+import web_webview from '@ohos.web.webview';
+import business_error from '@ohos.base';
+import process from '@ohos.process'
+@Entry
+@Component
+struct Index {
+  controller: web_webview.WebviewController = new web_webview.WebviewController();
+  @State mode: MixedMode = MixedMode.All
+  build() {
+    Column() {
+      Stack(){
+        // 组件创建时,加载www.example.com
+       // Web({ src: 'http://apm.jgiot.com:7012/login', controller: this.controller})
+        Web({ src: 'http://10.88.19.200:10000/login', controller: this.controller})
+          .mixedMode(this.mode)
+          .onlineImageAccess(true)
+          .javaScriptAccess(true)
+          .overviewModeAccess(true)
+          .databaseAccess(true)
+          .domStorageAccess(true)
+        Row(){
+          Image($r('app.media.shutdown'))
+            .width(px2vp(80))
+            .height(px2vp(80))
+            .onClick(()=>{
+              let pro = new process.ProcessManager();
+              pro.exit(0);
+            })
+
+        }.width(px2vp(1920))
+        .height(px2vp(80))
+        .justifyContent(FlexAlign.End)
+      }.width(px2vp(1920))
+      .height(px2vp(1080))
+      .align(Alignment.BottomEnd)
+
+
+    }
+    .width(px2vp(1920))
+    .height(px2vp(1080))
+  }
+}

+ 68 - 0
entry/src/main/module.json5

@@ -0,0 +1,68 @@
+{
+  "module": {
+    "name": "entry",
+    "type": "entry",
+    "description": "$string:module_desc",
+    "mainElement": "EntryAbility",
+    "deviceTypes": [
+      "default",
+      "tablet"
+    ],
+    "deliveryWithInstall": true,
+    "installationFree": false,
+    "pages": "$profile:main_pages",
+    "abilities": [
+      {
+        "name": "EntryAbility",
+        "srcEntry": "./ets/entryability/EntryAbility.ets",
+        "description": "$string:EntryAbility_desc",
+        "icon": "$media:HONDAK_LOGO",
+        "label": "$string:EntryAbility_label",
+        "startWindowIcon": "$media:HONDAK_LOGO",
+        "startWindowBackground": "$color:start_window_background",
+        "exported": true,
+        "skills": [
+          {
+            "entities": [
+              "entity.system.home"
+            ],
+            "actions": [
+              "action.system.home"
+            ]
+          }
+
+        ],
+
+      }
+    ],
+    "requestPermissions": [
+
+
+      {
+        "name": "ohos.permission.INTERNET",
+        "usedScene": {
+          "abilities": [
+            "EntryAbility"
+          ],
+          "when": "inuse"
+        }
+      },
+      {
+        "name": "ohos.permission.ACCESS_SERVICE_DM"
+      },
+      {
+        "name": "ohos.permission.GET_NETWORK_INFO"
+      }
+
+      //      {
+      //        "name": "ohos.permission.STORAGE_MANAGER",
+      //        "usedScene": {
+      //          "abilities": [
+      //            "FormAbility"
+      //          ],
+      //          "when":"always"
+      //        }
+      //      }
+    ]
+  }
+}

+ 8 - 0
entry/src/main/resources/base/element/color.json

@@ -0,0 +1,8 @@
+{
+  "color": [
+    {
+      "name": "start_window_background",
+      "value": "#FFFFFF"
+    }
+  ]
+}

+ 16 - 0
entry/src/main/resources/base/element/string.json

@@ -0,0 +1,16 @@
+{
+  "string": [
+    {
+      "name": "module_desc",
+      "value": "module description"
+    },
+    {
+      "name": "EntryAbility_desc",
+      "value": "一体机终端"
+    },
+    {
+      "name": "EntryAbility_label",
+      "value": "一体机终端"
+    }
+  ]
+}

BIN
entry/src/main/resources/base/media/HONDAK_LOGO.png


BIN
entry/src/main/resources/base/media/icon.png


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 4 - 0
entry/src/main/resources/base/media/shutdown.svg


BIN
entry/src/main/resources/base/media/startIcon.png


+ 5 - 0
entry/src/main/resources/base/profile/main_pages.json

@@ -0,0 +1,5 @@
+{
+  "src": [
+    "pages/Index"
+  ]
+}

+ 16 - 0
entry/src/main/resources/en_US/element/string.json

@@ -0,0 +1,16 @@
+{
+  "string": [
+    {
+      "name": "module_desc",
+      "value": "module description"
+    },
+    {
+      "name": "EntryAbility_desc",
+      "value": "description"
+    },
+    {
+      "name": "EntryAbility_label",
+      "value": "一体机终端"
+    }
+  ]
+}

+ 16 - 0
entry/src/main/resources/zh_CN/element/string.json

@@ -0,0 +1,16 @@
+{
+  "string": [
+    {
+      "name": "module_desc",
+      "value": "模块描述"
+    },
+    {
+      "name": "EntryAbility_desc",
+      "value": "description"
+    },
+    {
+      "name": "EntryAbility_label",
+      "value": "一体机终端"
+    }
+  ]
+}

+ 35 - 0
entry/src/ohosTest/ets/test/Ability.test.ets

@@ -0,0 +1,35 @@
+import hilog from '@ohos.hilog';
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+
+export default function abilityTest() {
+  describe('ActsAbilityTest', () => {
+    // Defines a test suite. Two parameters are supported: test suite name and test suite function.
+    beforeAll(() => {
+      // Presets an action, which is performed only once before all test cases of the test suite start.
+      // This API supports only one parameter: preset action function.
+    })
+    beforeEach(() => {
+      // Presets an action, which is performed before each unit test case starts.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: preset action function.
+    })
+    afterEach(() => {
+      // Presets a clear action, which is performed after each unit test case ends.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: clear action function.
+    })
+    afterAll(() => {
+      // Presets a clear action, which is performed after all test cases of the test suite end.
+      // This API supports only one parameter: clear action function.
+    })
+    it('assertContain', 0, () => {
+      // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
+      hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
+      let a = 'abc';
+      let b = 'b';
+      // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
+      expect(a).assertContain(b);
+      expect(a).assertEqual(a);
+    })
+  })
+}

+ 5 - 0
entry/src/ohosTest/ets/test/List.test.ets

@@ -0,0 +1,5 @@
+import abilityTest from './Ability.test';
+
+export default function testsuite() {
+  abilityTest();
+}

+ 49 - 0
entry/src/ohosTest/ets/testability/TestAbility.ets

@@ -0,0 +1,49 @@
+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';
+import Want from '@ohos.app.ability.Want';
+import AbilityConstant from '@ohos.app.ability.AbilityConstant';
+
+export default class TestAbility extends UIAbility {
+  onCreate(want: Want, launchParam: AbilityConstant.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) ?? '');
+    let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
+    abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
+    let abilityDelegatorArguments: AbilityDelegatorRegistry.AbilityDelegatorArgs;
+    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) => {
+      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.');
+    });
+  }
+
+  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');
+  }
+}

+ 17 - 0
entry/src/ohosTest/ets/testability/pages/Index.ets

@@ -0,0 +1,17 @@
+@Entry
+@Component
+struct Index {
+  @State message: string = 'Hello World';
+
+  build() {
+    Row() {
+      Column() {
+        Text(this.message)
+          .fontSize(50)
+          .fontWeight(FontWeight.Bold)
+      }
+      .width('100%')
+    }
+    .height('100%')
+  }
+}

+ 50 - 0
entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets

@@ -0,0 +1,50 @@
+import hilog from '@ohos.hilog';
+import TestRunner from '@ohos.application.testRunner';
+import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
+import Want from '@ohos.app.ability.Want';
+
+let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator | undefined = undefined
+let abilityDelegatorArguments: AbilityDelegatorRegistry.AbilityDelegatorArgs | undefined = undefined
+
+async function onAbilityCreateCallback() {
+  hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback');
+}
+
+async function addAbilityMonitorCallback(err : Error) {
+  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()
+    const bundleName = abilityDelegatorArguments.bundleName;
+    const testAbilityName = 'TestAbility';
+    const moduleName = abilityDelegatorArguments.parameters['-m'];
+    let lMonitor: AbilityDelegatorRegistry.AbilityMonitor = {
+      abilityName: testAbilityName,
+      onAbilityCreate: onAbilityCreateCallback,
+      moduleName: moduleName
+    };
+    abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
+    const want: Want = {
+      bundleName: bundleName,
+      abilityName: testAbilityName,
+      moduleName: moduleName
+    };
+    abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
+    abilityDelegator.startAbility(want, (err, data) => {
+      hilog.info(0x0000, 'testTag', 'startAbility : err : %{public}s', JSON.stringify(err) ?? '');
+      hilog.info(0x0000, 'testTag', 'startAbility : data : %{public}s',JSON.stringify(data) ?? '');
+    })
+    hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end');
+  }
+}

+ 37 - 0
entry/src/ohosTest/module.json5

@@ -0,0 +1,37 @@
+{
+  "module": {
+    "name": "entry_test",
+    "type": "feature",
+    "description": "$string:module_test_desc",
+    "mainElement": "TestAbility",
+    "deviceTypes": [
+      "default",
+      "tablet"
+    ],
+    "deliveryWithInstall": true,
+    "installationFree": false,
+    "pages": "$profile:test_pages",
+    "abilities": [
+      {
+        "name": "TestAbility",
+        "srcEntry": "./ets/testability/TestAbility.ets",
+        "description": "$string:TestAbility_desc",
+        "icon": "$media:HONDAK_LOGO",
+        "label": "$string:TestAbility_label",
+        "exported": true,
+        "startWindowIcon": "$media:HONDAK_LOGO",
+        "startWindowBackground": "$color:start_window_background",
+        "skills": [
+          {
+            "actions": [
+              "action.system.home"
+            ],
+            "entities": [
+              "entity.system.home"
+            ]
+          }
+        ]
+      }
+    ]
+  }
+}

+ 8 - 0
entry/src/ohosTest/resources/base/element/color.json

@@ -0,0 +1,8 @@
+{
+  "color": [
+    {
+      "name": "start_window_background",
+      "value": "#FFFFFF"
+    }
+  ]
+}

+ 16 - 0
entry/src/ohosTest/resources/base/element/string.json

@@ -0,0 +1,16 @@
+{
+  "string": [
+    {
+      "name": "module_test_desc",
+      "value": "test ability description"
+    },
+    {
+      "name": "TestAbility_desc",
+      "value": "一体机终端"
+    },
+    {
+      "name": "TestAbility_label",
+      "value": "一体机终端"
+    }
+  ]
+}

BIN
entry/src/ohosTest/resources/base/media/HONDAK_LOGO.png


BIN
entry/src/ohosTest/resources/base/media/icon.png


+ 5 - 0
entry/src/ohosTest/resources/base/profile/test_pages.json

@@ -0,0 +1,5 @@
+{
+  "src": [
+    "testability/pages/Index"
+  ]
+}

+ 5 - 0
entry/src/test/List.test.ets

@@ -0,0 +1,5 @@
+import localUnitTest from './LocalUnit.test';
+
+export default function testsuite() {
+  localUnitTest();
+}

+ 33 - 0
entry/src/test/LocalUnit.test.ets

@@ -0,0 +1,33 @@
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+
+export default function localUnitTest() {
+  describe('localUnitTest',() => {
+    // Defines a test suite. Two parameters are supported: test suite name and test suite function.
+    beforeAll(() => {
+      // Presets an action, which is performed only once before all test cases of the test suite start.
+      // This API supports only one parameter: preset action function.
+    });
+    beforeEach(() => {
+      // Presets an action, which is performed before each unit test case starts.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: preset action function.
+    });
+    afterEach(() => {
+      // Presets a clear action, which is performed after each unit test case ends.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: clear action function.
+    });
+    afterAll(() => {
+      // Presets a clear action, which is performed after all test cases of the test suite end.
+      // This API supports only one parameter: clear action function.
+    });
+    it('assertContain', 0, () => {
+      // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
+      let a = 'abc';
+      let b = 'b';
+      // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
+      expect(a).assertContain(b);
+      expect(a).assertEqual(a);
+    });
+  });
+}

+ 21 - 0
hvigor/hvigor-config.json5

@@ -0,0 +1,21 @@
+{
+  "modelVersion": "5.0.0",
+  "dependencies": {
+  },
+  "execution": {
+    // "analyze": "default",                    /* Define the build analyze mode. Value: [ "default" | "verbose" | false ]. Default: "default" */
+    // "daemon": true,                          /* Enable daemon compilation. Value: [ true | false ]. Default: true */
+    // "incremental": true,                     /* Enable incremental compilation. Value: [ true | false ]. Default: true */
+    // "parallel": true,                        /* Enable parallel compilation. Value: [ true | false ]. Default: true */
+    // "typeCheck": false,                      /* Enable typeCheck. Value: [ true | false ]. Default: false */
+  },
+  "logging": {
+    // "level": "info"                          /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
+  },
+  "debugging": {
+    // "stacktrace": false                      /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */
+  },
+  "nodeOptions": {
+    // "maxOldSpaceSize": 4096                  /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process */
+  }
+}

+ 6 - 0
hvigorfile.ts

@@ -0,0 +1,6 @@
+import { appTasks } from '@ohos/hvigor-ohos-plugin';
+
+export default {
+    system: appTasks,  /* Built-in plugin of Hvigor. It cannot be modified. */
+    plugins:[]         /* Custom plugin to extend the functionality of Hvigor. */
+}

+ 20 - 0
oh-package-lock.json5

@@ -0,0 +1,20 @@
+{
+  "meta": {
+    "stableOrder": true
+  },
+  "lockfileVersion": 3,
+  "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
+  "specifiers": {
+    "@ohos/hypium@1.0.13": "@ohos/hypium@1.0.13"
+  },
+  "packages": {
+    "@ohos/hypium@1.0.13": {
+      "name": "@ohos/hypium",
+      "version": "1.0.13",
+      "integrity": "sha512-d0+XvDeAYk5Vgl6JQ8Q1G+NPmTyJI8qgZ1PwPfcUbx/dfyKVAAv9lz1XtVNhYypyWEKqAzu8zMAC9GuHo2Y53Q==",
+      "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.13.tgz",
+      "shasum": "88d8dda420097efb98d770bf59616faef4682f06",
+      "registryType": "ohpm"
+    }
+  }
+}

+ 14 - 0
oh-package.json5

@@ -0,0 +1,14 @@
+{
+  "modelVersion": "5.0.0",
+  "name": "rearendapp",
+  "version": "1.0.0",
+  "description": "Please describe the basic information.",
+  "main": "",
+  "author": "",
+  "license": "",
+  "dependencies": {
+  },
+  "devDependencies": {
+    "@ohos/hypium": "1.0.13"
+  }
+}