diff --git a/demo/hjsunit/Assertion/README_zh.md b/demo/hjsunit/Assertion/README_zh.md
new file mode 100755
index 0000000000000000000000000000000000000000..e4bedae2772d019d51aa2992b81174927e31f275
--- /dev/null
+++ b/demo/hjsunit/Assertion/README_zh.md
@@ -0,0 +1,3 @@
+# Assertion
+
+- Assertion,HJSUnit测试框架提供的断言能力,通过expect(XXX).assertXX的断言方式检查结果。
\ No newline at end of file
diff --git a/demo/hjsunit/Assertion/entry/src/main/js/default/app.js b/demo/hjsunit/Assertion/entry/src/main/js/default/app.js
new file mode 100755
index 0000000000000000000000000000000000000000..4b241cccbaa71f0c5cbd9e7dc437a0feb224c7d5
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/main/js/default/app.js
@@ -0,0 +1,22 @@
+/*
+ * 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');
+ }
+};
diff --git a/demo/hjsunit/Assertion/entry/src/main/js/default/pages/index/index.css b/demo/hjsunit/Assertion/entry/src/main/js/default/pages/index/index.css
new file mode 100755
index 0000000000000000000000000000000000000000..2b1965821483f4f8c8b97c86ef07fe87ea767d01
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/main/js/default/pages/index/index.css
@@ -0,0 +1,44 @@
+.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;
+ }
+}
diff --git a/demo/hjsunit/Assertion/entry/src/main/js/default/pages/index/index.hml b/demo/hjsunit/Assertion/entry/src/main/js/default/pages/index/index.hml
new file mode 100755
index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/main/js/default/pages/index/index.hml
@@ -0,0 +1,5 @@
+
+
+ {{ $t('strings.hello') }} {{ title }}
+
+
diff --git a/demo/hjsunit/Assertion/entry/src/main/js/default/pages/index/index.js b/demo/hjsunit/Assertion/entry/src/main/js/default/pages/index/index.js
new file mode 100755
index 0000000000000000000000000000000000000000..49eb46a053db5a2da9542526b61eed164fa44d26
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/main/js/default/pages/index/index.js
@@ -0,0 +1,22 @@
+/*
+ * 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 {
+ data: {
+ title: ""
+ },
+ onInit() {
+ this.title = this.$t('strings.world');
+ }
+}
diff --git a/demo/hjsunit/Assertion/entry/src/ohosTest/js/default/app.js b/demo/hjsunit/Assertion/entry/src/ohosTest/js/default/app.js
new file mode 100755
index 0000000000000000000000000000000000000000..044bffa75e29d7a5fe32644e19cc1bbbc5e9a7b1
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/ohosTest/js/default/app.js
@@ -0,0 +1,22 @@
+/*
+ * 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('TestApplication onCreate');
+ },
+ onDestroy() {
+ console.info('TestApplication onDestroy');
+ }
+};
diff --git a/demo/hjsunit/Assertion/entry/src/ohosTest/js/default/pages/index/index.css b/demo/hjsunit/Assertion/entry/src/ohosTest/js/default/pages/index/index.css
new file mode 100755
index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/ohosTest/js/default/pages/index/index.css
@@ -0,0 +1,9 @@
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+
+.title {
+ font-size: 100px;
+}
diff --git a/demo/hjsunit/Assertion/entry/src/ohosTest/js/default/pages/index/index.hml b/demo/hjsunit/Assertion/entry/src/ohosTest/js/default/pages/index/index.hml
new file mode 100755
index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/ohosTest/js/default/pages/index/index.hml
@@ -0,0 +1,5 @@
+
+
+ {{ $t('strings.hello') }} {{ title }}
+
+
diff --git a/demo/hjsunit/Assertion/entry/src/ohosTest/js/default/pages/index/index.js b/demo/hjsunit/Assertion/entry/src/ohosTest/js/default/pages/index/index.js
new file mode 100755
index 0000000000000000000000000000000000000000..793667c97f947fdfc22f424847e85718bad72c49
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/ohosTest/js/default/pages/index/index.js
@@ -0,0 +1,55 @@
+/*
+ * 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, Constant, ExpectExtend, ReportExtend, InstrumentLog} from 'deccjsunit/index'
+
+export default {
+ data: {
+ title: ""
+ },
+ onInit() {
+ this.title = this.$t('strings.world');
+ },
+ onShow() {
+ console.info('onShow finish')
+ const core = Core.getInstance()
+ const expectExtend = new ExpectExtend({
+ 'id': 'extend'
+ })
+ const reportExtend = new ReportExtend(file)
+ const instrumentLog = new InstrumentLog({
+ 'id': 'report',
+ 'version': '1.0.3'
+ })
+ core.addService('expect', expectExtend)
+ core.addService('report', reportExtend)
+ core.addService('report', instrumentLog)
+ core.init()
+ core.subscribeEvent('spec', instrumentLog)
+ core.subscribeEvent('suite', instrumentLog)
+ core.subscribeEvent('task', instrumentLog)
+
+ const configService = core.getDefaultService('config')
+ configService.setConfig(this)
+
+ require('../../../test/List.test')
+ core.execute()
+ },
+ onReady() {
+ },
+}
\ No newline at end of file
diff --git a/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/ExampleJsunit.test.js b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/ExampleJsunit.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..bdc0912bf7939add431943ded7146f3940144f13
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/ExampleJsunit.test.js
@@ -0,0 +1,24 @@
+/*
+ * 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.versionName).assertEqual('1.0')
+ expect(info.versionCode).assertEqual('3')
+ })
+})
\ No newline at end of file
diff --git a/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertClose.test.js b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertClose.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..c082d4bd454032b2ad394e3cc0b35fe82d28c579
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertClose.test.js
@@ -0,0 +1,36 @@
+/*
+ * 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 {describe, it, expect} from 'deccjsunit/index'
+
+describe('assertClose', function () {
+ it('assertCloseSuccess001', 0, function () {
+ let a = 100;
+ let b = 0.1
+ expect(a).assertClose(99, b)
+ })
+ it('assertCloseFail002', 0, function () {
+ let a = 100;
+ let b = 0.1
+ expect(a).assertClose(1, b)
+ })
+ it('assertCloseFail003', 0, function () {
+ let a = 100;
+ let b = 0.1
+ expect(a).assertClose(null, b)
+ })
+ it('assertCloseFail004', 0, function () {
+ expect(null).assertClose(null, 0)
+ })
+})
\ No newline at end of file
diff --git a/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertContain.test.js b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertContain.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..9c5713a1e9a1858b9d8f1e0ee694b583988ec641
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertContain.test.js
@@ -0,0 +1,38 @@
+/*
+ * 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 {describe, it, expect} from 'deccjsunit/index'
+
+describe('assertContain', function () {
+ it('assertContainSuccessOnString', 0, function () {
+ let a = 'abc';
+ let b = 'b'
+ expect(a).assertContain(b)
+ })
+ it('assertContainSuccessOnArray', 0, function () {
+ let a = ['a', 'b', 'c'];
+ let b = 'b'
+ expect(a).assertContain(b)
+ })
+ it('assertContainFailOnString', 0, function () {
+ let a = 'abc';
+ let b = 'd'
+ expect(a).assertContain(b)
+ })
+ it('assertContainFailOnArray', 0, function () {
+ let a = ['a', 'b', 'c'];
+ let b = 'd'
+ expect(a).assertContain(b)
+ })
+})
\ No newline at end of file
diff --git a/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertFail.test.js b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertFail.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..c09318bf0cf9b960925d7ca5329237a4c57db338
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertFail.test.js
@@ -0,0 +1,22 @@
+/*
+ * 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 {describe, it, expect} from 'deccjsunit/index'
+
+describe('assertFail', function () {
+ it('assertFail', 0, function () {
+ let a = null
+ expect(a).assertFail()
+ })
+})
\ No newline at end of file
diff --git a/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertFalse.test.js b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertFalse.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..f5cb010066369d406d1510dbff106158df2cae2a
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertFalse.test.js
@@ -0,0 +1,26 @@
+/*
+ * 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 {describe, it, expect} from 'deccjsunit/index'
+
+describe('assertFalse', function () {
+ it('assertFalseSuccess', 0, function () {
+ let d = false
+ expect(d).assertFalse()
+ })
+ it('assertFalseFail', 0, function () {
+ let d = true
+ expect(d).assertFalse()
+ })
+})
\ No newline at end of file
diff --git a/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertInstantceOf.test.js b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertInstantceOf.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..8c41cbecaf2c859dd4f3e5830dab4d3c10dc3beb
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertInstantceOf.test.js
@@ -0,0 +1,27 @@
+/*
+ * 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 {describe, it, expect} from 'deccjsunit/index'
+
+describe('assertInstanceOf', function () {
+ it('assertInstanceOfSuccessOnNumber', 0, function () {
+ let a = 12;
+ expect(a).assertInstanceOf('Number')
+ })
+ it('assertInstanceOfFailOnNumber', 0, function () {
+ let a = "abc";
+ expect(a).assertInstanceOf('String');
+ expect(a).assertInstanceOf('Number');
+ })
+})
diff --git a/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertLarger.test.js b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertLarger.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..48de09018de0968fd39b7b2402042afc95fb3d63
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertLarger.test.js
@@ -0,0 +1,28 @@
+/*
+ * 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 {describe, it, expect} from 'deccjsunit/index'
+
+describe('assertLarger', function () {
+ it('assertLargerSuccess', 0, function () {
+ let a = 12;
+ let b = 10;
+ expect(a).assertLarger(b)
+ })
+ it('assertLargerFail', 0, function () {
+ let a = 12;
+ let b = 13;
+ expect(a).assertLarger(b);
+ })
+})
\ No newline at end of file
diff --git a/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertLess.test.js b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertLess.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..5e404524cdc6b69d65a22a1884542757f4901ed8
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertLess.test.js
@@ -0,0 +1,28 @@
+/*
+ * 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 {describe, it, expect} from 'deccjsunit/index'
+
+describe('assertLess', function () {
+ it('assertLessSuccess', 0, function () {
+ let a = 12;
+ let b = 15;
+ expect(a).assertLess(b)
+ })
+ it('assertLessFail', 0, function () {
+ let a = 12;
+ let b = 10;
+ expect(a).assertLess(b);
+ })
+})
\ No newline at end of file
diff --git a/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertNull.test.js b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertNull.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..0e774c6edbfe8a8c763bfbc2d6e9fa0f98f31ba7
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertNull.test.js
@@ -0,0 +1,26 @@
+/*
+ * 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 {describe, it, expect} from 'deccjsunit/index'
+
+describe('assertNull', function () {
+ it('assertNullSuccess', 0, function () {
+ let d
+ expect(d).assertNull()
+ })
+ it('assertNullFail', 0, function () {
+ let d = 100
+ expect(d).assertNull()
+ })
+})
\ No newline at end of file
diff --git a/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertThrowError.test.js b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertThrowError.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..7aba149a470d80a8d340d8fc9f857008eff0bb4e
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertThrowError.test.js
@@ -0,0 +1,36 @@
+/*
+ * 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 {describe, it, expect} from 'deccjsunit/index'
+
+describe('assertThrowError', function () {
+ it('assertThrowErrorFail001', 0, function () {
+ let a = 12;
+ expect(a).assertThrowError()
+ })
+ it('assertThrowErrorSuccess', 0, function () {
+ let a = test
+ function test() {
+ throw Error("exception")
+ }
+ expect(a).assertThrowError("exception");
+ })
+ it('assertThrowErrorFail002', 0, function () {
+ let a = test
+ function test() {
+ throw Error("exception")
+ }
+ expect(a).assertThrowError("test");
+ })
+})
\ No newline at end of file
diff --git a/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertUndefined.test.js b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertUndefined.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..3c00a513c85eff8e8af56a366e1c2a8f86fa15c5
--- /dev/null
+++ b/demo/hjsunit/Assertion/entry/src/ohosTest/js/test/assertUndefined.test.js
@@ -0,0 +1,26 @@
+/*
+ * 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 {describe, it, expect} from 'deccjsunit/index'
+
+describe('assertUndefined', function () {
+ it('assertUndefinedSuccess', 0, function () {
+ let a = undefined
+ expect(a).assertUndefined()
+ })
+ it('assertUndefinedFail', 0, function () {
+ let a = 100
+ expect(a).assertUndefined()
+ })
+})
\ No newline at end of file
diff --git a/demo/hjsunit/Async/README_zh.md b/demo/hjsunit/Async/README_zh.md
new file mode 100755
index 0000000000000000000000000000000000000000..0bec3ed89f86af8a999afa357e3cc221971a064a
--- /dev/null
+++ b/demo/hjsunit/Async/README_zh.md
@@ -0,0 +1,3 @@
+# Async
+
+- 异步,HJSUnit测试框架针对测试用例提供的异步能力。测试框架识别异步用例的关键字为async,用法如下:在回调函数function前加“async”关键字,调用异步接口时需加上“await”前缀;回调函数中添加“done”参数和用例结尾的加上“done()”,保证可以在执行该异步用例时强制获取到用例执行结果。
\ No newline at end of file
diff --git a/demo/hjsunit/Async/entry/src/main/js/default/app.js b/demo/hjsunit/Async/entry/src/main/js/default/app.js
new file mode 100755
index 0000000000000000000000000000000000000000..4b241cccbaa71f0c5cbd9e7dc437a0feb224c7d5
--- /dev/null
+++ b/demo/hjsunit/Async/entry/src/main/js/default/app.js
@@ -0,0 +1,22 @@
+/*
+ * 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');
+ }
+};
diff --git a/demo/hjsunit/Async/entry/src/main/js/default/pages/index/index.css b/demo/hjsunit/Async/entry/src/main/js/default/pages/index/index.css
new file mode 100755
index 0000000000000000000000000000000000000000..2b1965821483f4f8c8b97c86ef07fe87ea767d01
--- /dev/null
+++ b/demo/hjsunit/Async/entry/src/main/js/default/pages/index/index.css
@@ -0,0 +1,44 @@
+.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;
+ }
+}
diff --git a/demo/hjsunit/Async/entry/src/main/js/default/pages/index/index.hml b/demo/hjsunit/Async/entry/src/main/js/default/pages/index/index.hml
new file mode 100755
index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184
--- /dev/null
+++ b/demo/hjsunit/Async/entry/src/main/js/default/pages/index/index.hml
@@ -0,0 +1,5 @@
+
+
+ {{ $t('strings.hello') }} {{ title }}
+
+
diff --git a/demo/hjsunit/Async/entry/src/main/js/default/pages/index/index.js b/demo/hjsunit/Async/entry/src/main/js/default/pages/index/index.js
new file mode 100755
index 0000000000000000000000000000000000000000..49eb46a053db5a2da9542526b61eed164fa44d26
--- /dev/null
+++ b/demo/hjsunit/Async/entry/src/main/js/default/pages/index/index.js
@@ -0,0 +1,22 @@
+/*
+ * 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 {
+ data: {
+ title: ""
+ },
+ onInit() {
+ this.title = this.$t('strings.world');
+ }
+}
diff --git a/demo/hjsunit/Async/entry/src/ohosTest/js/default/app.js b/demo/hjsunit/Async/entry/src/ohosTest/js/default/app.js
new file mode 100755
index 0000000000000000000000000000000000000000..044bffa75e29d7a5fe32644e19cc1bbbc5e9a7b1
--- /dev/null
+++ b/demo/hjsunit/Async/entry/src/ohosTest/js/default/app.js
@@ -0,0 +1,22 @@
+/*
+ * 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('TestApplication onCreate');
+ },
+ onDestroy() {
+ console.info('TestApplication onDestroy');
+ }
+};
diff --git a/demo/hjsunit/Async/entry/src/ohosTest/js/default/pages/index/index.css b/demo/hjsunit/Async/entry/src/ohosTest/js/default/pages/index/index.css
new file mode 100755
index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf
--- /dev/null
+++ b/demo/hjsunit/Async/entry/src/ohosTest/js/default/pages/index/index.css
@@ -0,0 +1,9 @@
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+
+.title {
+ font-size: 100px;
+}
diff --git a/demo/hjsunit/Async/entry/src/ohosTest/js/default/pages/index/index.hml b/demo/hjsunit/Async/entry/src/ohosTest/js/default/pages/index/index.hml
new file mode 100755
index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184
--- /dev/null
+++ b/demo/hjsunit/Async/entry/src/ohosTest/js/default/pages/index/index.hml
@@ -0,0 +1,5 @@
+
+
+ {{ $t('strings.hello') }} {{ title }}
+
+
diff --git a/demo/hjsunit/Async/entry/src/ohosTest/js/default/pages/index/index.js b/demo/hjsunit/Async/entry/src/ohosTest/js/default/pages/index/index.js
new file mode 100755
index 0000000000000000000000000000000000000000..793667c97f947fdfc22f424847e85718bad72c49
--- /dev/null
+++ b/demo/hjsunit/Async/entry/src/ohosTest/js/default/pages/index/index.js
@@ -0,0 +1,55 @@
+/*
+ * 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, Constant, ExpectExtend, ReportExtend, InstrumentLog} from 'deccjsunit/index'
+
+export default {
+ data: {
+ title: ""
+ },
+ onInit() {
+ this.title = this.$t('strings.world');
+ },
+ onShow() {
+ console.info('onShow finish')
+ const core = Core.getInstance()
+ const expectExtend = new ExpectExtend({
+ 'id': 'extend'
+ })
+ const reportExtend = new ReportExtend(file)
+ const instrumentLog = new InstrumentLog({
+ 'id': 'report',
+ 'version': '1.0.3'
+ })
+ core.addService('expect', expectExtend)
+ core.addService('report', reportExtend)
+ core.addService('report', instrumentLog)
+ core.init()
+ core.subscribeEvent('spec', instrumentLog)
+ core.subscribeEvent('suite', instrumentLog)
+ core.subscribeEvent('task', instrumentLog)
+
+ const configService = core.getDefaultService('config')
+ configService.setConfig(this)
+
+ require('../../../test/List.test')
+ core.execute()
+ },
+ onReady() {
+ },
+}
\ No newline at end of file
diff --git a/demo/hjsunit/Async/entry/src/ohosTest/js/test/Callback.test.js b/demo/hjsunit/Async/entry/src/ohosTest/js/test/Callback.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..6b95d985aa91a130b816932fb55ea7fbe8c9beed
--- /dev/null
+++ b/demo/hjsunit/Async/entry/src/ohosTest/js/test/Callback.test.js
@@ -0,0 +1,28 @@
+/*
+ * 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 {describe, it} from 'deccjsunit/index'
+
+describe('callback', function () {
+ it('callbackDemo', 0, async function (done) {
+ await a()
+ })
+})
+
+function a(done){
+ setTimeout(function(){
+ console.log("run a after 1000ms")
+ },1000)
+ done()
+}
\ No newline at end of file
diff --git a/demo/hjsunit/Async/entry/src/ohosTest/js/test/List.test.js b/demo/hjsunit/Async/entry/src/ohosTest/js/test/List.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..e397df520f9e3dac80fe8bf7498c68e6379de420
--- /dev/null
+++ b/demo/hjsunit/Async/entry/src/ohosTest/js/test/List.test.js
@@ -0,0 +1,16 @@
+/*
+ * 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('./Callback.test.js')
+require('./Promise.test.js')
\ No newline at end of file
diff --git a/demo/hjsunit/Async/entry/src/ohosTest/js/test/Promise.test.js b/demo/hjsunit/Async/entry/src/ohosTest/js/test/Promise.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..785f3e87792b1fc7e40c90a41f3c90b4bbeb0739
--- /dev/null
+++ b/demo/hjsunit/Async/entry/src/ohosTest/js/test/Promise.test.js
@@ -0,0 +1,30 @@
+/*
+ * 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 {describe, it} from 'deccjsunit/index'
+
+describe('promise', function () {
+ it('promiseDemo', 0, async function (done) {
+ await new Promise(
+ function (resolve, reject) {
+ // 一段耗时的异步操作
+ resolve('成功') // 数据处理完成
+ // reject('失败') // 数据处理出错
+ }).then(
+ (res) => {console.log(res)}, // 成功
+ (err) => {console.log(err)} // 失败
+ )
+ done()
+ })
+})
\ No newline at end of file
diff --git a/demo/hjsunit/DataDriver/README_zh.md b/demo/hjsunit/DataDriver/README_zh.md
new file mode 100755
index 0000000000000000000000000000000000000000..0c3247bcde664ed2978666eca0f591f0b899b821
--- /dev/null
+++ b/demo/hjsunit/DataDriver/README_zh.md
@@ -0,0 +1,3 @@
+# DataDriver
+
+- DataDriver,HJSUnit测试框架提供的数据驱动能力。通过配置data.json文件,实现针对指定测试套、测试用例的参数传递,亦或是根据指定测试套、测试用例的执行次数做压力测试。
\ No newline at end of file
diff --git a/demo/hjsunit/DataDriver/entry/src/main/js/default/app.js b/demo/hjsunit/DataDriver/entry/src/main/js/default/app.js
new file mode 100755
index 0000000000000000000000000000000000000000..4b241cccbaa71f0c5cbd9e7dc437a0feb224c7d5
--- /dev/null
+++ b/demo/hjsunit/DataDriver/entry/src/main/js/default/app.js
@@ -0,0 +1,22 @@
+/*
+ * 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');
+ }
+};
diff --git a/demo/hjsunit/DataDriver/entry/src/main/js/default/pages/index/index.css b/demo/hjsunit/DataDriver/entry/src/main/js/default/pages/index/index.css
new file mode 100755
index 0000000000000000000000000000000000000000..2b1965821483f4f8c8b97c86ef07fe87ea767d01
--- /dev/null
+++ b/demo/hjsunit/DataDriver/entry/src/main/js/default/pages/index/index.css
@@ -0,0 +1,44 @@
+.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;
+ }
+}
diff --git a/demo/hjsunit/DataDriver/entry/src/main/js/default/pages/index/index.hml b/demo/hjsunit/DataDriver/entry/src/main/js/default/pages/index/index.hml
new file mode 100755
index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184
--- /dev/null
+++ b/demo/hjsunit/DataDriver/entry/src/main/js/default/pages/index/index.hml
@@ -0,0 +1,5 @@
+
+
+ {{ $t('strings.hello') }} {{ title }}
+
+
diff --git a/demo/hjsunit/DataDriver/entry/src/main/js/default/pages/index/index.js b/demo/hjsunit/DataDriver/entry/src/main/js/default/pages/index/index.js
new file mode 100755
index 0000000000000000000000000000000000000000..49eb46a053db5a2da9542526b61eed164fa44d26
--- /dev/null
+++ b/demo/hjsunit/DataDriver/entry/src/main/js/default/pages/index/index.js
@@ -0,0 +1,22 @@
+/*
+ * 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 {
+ data: {
+ title: ""
+ },
+ onInit() {
+ this.title = this.$t('strings.world');
+ }
+}
diff --git a/demo/hjsunit/DataDriver/entry/src/ohosTest/js/default/app.js b/demo/hjsunit/DataDriver/entry/src/ohosTest/js/default/app.js
new file mode 100755
index 0000000000000000000000000000000000000000..044bffa75e29d7a5fe32644e19cc1bbbc5e9a7b1
--- /dev/null
+++ b/demo/hjsunit/DataDriver/entry/src/ohosTest/js/default/app.js
@@ -0,0 +1,22 @@
+/*
+ * 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('TestApplication onCreate');
+ },
+ onDestroy() {
+ console.info('TestApplication onDestroy');
+ }
+};
diff --git a/demo/hjsunit/DataDriver/entry/src/ohosTest/js/default/pages/index/index.css b/demo/hjsunit/DataDriver/entry/src/ohosTest/js/default/pages/index/index.css
new file mode 100755
index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf
--- /dev/null
+++ b/demo/hjsunit/DataDriver/entry/src/ohosTest/js/default/pages/index/index.css
@@ -0,0 +1,9 @@
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+
+.title {
+ font-size: 100px;
+}
diff --git a/demo/hjsunit/DataDriver/entry/src/ohosTest/js/default/pages/index/index.hml b/demo/hjsunit/DataDriver/entry/src/ohosTest/js/default/pages/index/index.hml
new file mode 100755
index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184
--- /dev/null
+++ b/demo/hjsunit/DataDriver/entry/src/ohosTest/js/default/pages/index/index.hml
@@ -0,0 +1,5 @@
+
+
+ {{ $t('strings.hello') }} {{ title }}
+
+
diff --git a/demo/hjsunit/DataDriver/entry/src/ohosTest/js/default/pages/index/index.js b/demo/hjsunit/DataDriver/entry/src/ohosTest/js/default/pages/index/index.js
new file mode 100755
index 0000000000000000000000000000000000000000..4ada57fb31e4c492c605ec5a827878a01bc0cc10
--- /dev/null
+++ b/demo/hjsunit/DataDriver/entry/src/ohosTest/js/default/pages/index/index.js
@@ -0,0 +1,59 @@
+/*
+ * 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, Constant, DataDriver, ExpectExtend, ReportExtend, InstrumentLog} from 'deccjsunit/index'
+
+import data from '../../../test/data.json'
+
+export default {
+ data: {
+ title: ""
+ },
+ onInit() {
+ this.title = this.$t('strings.world');
+ },
+ onShow() {
+ console.info('onShow finish')
+ const core = Core.getInstance()
+ const dataDriver = new DataDriver({data:data})
+ const expectExtend = new ExpectExtend({
+ 'id': 'extend'
+ })
+ const reportExtend = new ReportExtend(file)
+ const instrumentLog = new InstrumentLog({
+ 'id': 'report',
+ 'version': '1.0.3'
+ })
+ core.addService('dataDriver',dataDriver)
+ core.addService('expect', expectExtend)
+ core.addService('report', reportExtend)
+ core.addService('report', instrumentLog)
+ core.init()
+ core.subscribeEvent('spec', instrumentLog)
+ core.subscribeEvent('suite', instrumentLog)
+ core.subscribeEvent('task', instrumentLog)
+
+ const configService = core.getDefaultService('config')
+ configService.setConfig(this)
+
+ require('../../../test/List.test')
+ core.execute()
+ },
+ onReady() {
+ },
+}
\ No newline at end of file
diff --git a/demo/hjsunit/DataDriver/entry/src/ohosTest/js/test/DataDriver.test.js b/demo/hjsunit/DataDriver/entry/src/ohosTest/js/test/DataDriver.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..a7c331fddc5bfc901302a63e93b7fc3ea1d4b67e
--- /dev/null
+++ b/demo/hjsunit/DataDriver/entry/src/ohosTest/js/test/DataDriver.test.js
@@ -0,0 +1,24 @@
+/*
+ * 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 {describe, it, expect} from 'deccjsunit/index'
+
+describe('testSuite01', function () {
+ it('testSpec01', function (data) {
+ console.info('testSpec01......' + JSON.stringify(data))
+ })
+ it('testSpec02', function (data) {
+ console.info('testSpec02......' + JSON.stringify(data))
+ })
+})
\ No newline at end of file
diff --git a/demo/hjsunit/DataDriver/entry/src/ohosTest/js/test/List.test.js b/demo/hjsunit/DataDriver/entry/src/ohosTest/js/test/List.test.js
new file mode 100755
index 0000000000000000000000000000000000000000..ee629d2674217d3e6f2beb14661afe07ce140ce4
--- /dev/null
+++ b/demo/hjsunit/DataDriver/entry/src/ohosTest/js/test/List.test.js
@@ -0,0 +1,15 @@
+/*
+ * 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('./DataDriver.test.js')
\ No newline at end of file
diff --git a/demo/hjsunit/DataDriver/entry/src/ohosTest/js/test/data.json b/demo/hjsunit/DataDriver/entry/src/ohosTest/js/test/data.json
new file mode 100755
index 0000000000000000000000000000000000000000..ab74ea0df4d7110e83deccf744fd07bcaccbe350
--- /dev/null
+++ b/demo/hjsunit/DataDriver/entry/src/ohosTest/js/test/data.json
@@ -0,0 +1,26 @@
+{
+ "suites": [{
+ "describe":["testSuite01"],
+ "params":{
+ "suiteParam01": "suiteParam"
+ }
+ },{
+ "describe":["testSuite01","testSpec02"],
+ "params":{
+ "suiteParam": "suiteParam"
+ }
+ },{
+ "describe":"testSuite01",
+ "stress": 8,
+ "items":[{
+ "it":"testSpec01",
+ "stress": 1,
+ "params":[{
+ "name":"tom"
+ }]
+ },{
+ "it":"testSpec02",
+ "stress": 2
+ }]
+ }]
+}
\ No newline at end of file
diff --git a/demo/hjsunit/README.md b/demo/hjsunit/README.md
new file mode 100755
index 0000000000000000000000000000000000000000..0cde70f22bf5b9a2be51b524a963b16d05979f1e
--- /dev/null
+++ b/demo/hjsunit/README.md
@@ -0,0 +1,19 @@
+# App Samples
+
+- [Introduction](#section_HJSUnit_001)
+- [Usage](#section_HJSUnit_002)
+- [Limitations](#section_HJSUnit_003)
+
+## Introduction
+
+We provide a series of app samples to help you quickly get familiar with the test capabilities and how to use of the HJSUnit. Each app sample is an independent project in DevEco Studio. You can import sample code from a project to a customized project to learn how to use APIs by browsing code, building the project, and installing and running the app.
+
+## Usage
+
+1. Development tool: Devco Studio 2.2.0.200 or later
+2. Procedure: Create a blank JS template project in Devco Studio, import the sample code in the ohosTest directory of the sample project to the ohosTest directory of the user-defined project, and compile, build, run, and debug the project.
+3. After HAP installation and execution, you can view the execution effect of the sample on the device and then conduct debugging.
+
+## Limitations
+
+Before installing and running the sample, check the **deviceType** field in the **config.json** file to obtain the device types supported by the sample. You can modify this field to enable the sample to run on your target device. \(The **config.json** file is generally stored in the **entry/src/main** directory, which may be different depending on the samples.\)
\ No newline at end of file
diff --git a/demo/hjsunit/README_zh.md b/demo/hjsunit/README_zh.md
new file mode 100755
index 0000000000000000000000000000000000000000..0b1b7d7188babfd7728e4f456fc75a67e4aa44ff
--- /dev/null
+++ b/demo/hjsunit/README_zh.md
@@ -0,0 +1,19 @@
+# 应用示例
+
+- [概要简介](#section_HJSUnit_001)
+- [使用说明](#section_HJSUnit_002)
+- [约束与限制](#section_HJSUnit_003)
+
+## 概要简介
+
+为帮助测试人员快速熟悉HJSUnit所提供的测试能力和如何使用,我们提供了一系列的应用示例,即Sample。每一个应用示例都是一个独立的DevEco Studio工程项目,测试人员可以将工程中的代码导入到自定义工程中,通过浏览代码、编译工程、安装和运行应用示例来了解应用示例中涉及测试能力的使用方法。
+
+## 使用说明
+
+1. 开发工具:2.2.0.200版本及以上的Deveco Studio
+2. 使用步骤:①在Deveco Studio中新建空白JS模板项目,将示例工程ohosTest目录下的示例代码导入到自定义工程的ohosTest目录下,进行编译构建及运行调试。
+3. 安装运行后,即可在设备上查看应用示例运行效果,以及进行相关调试。
+
+## 约束与限制
+
+安装运行应用示例之前,请先通过config.json文件中的"deviceType"字段来确认该应用示例支持的设备类型,可尝试通过修改该字段使其可以在相应类型的设备上运行(config.json文件一般在代码的entry/src/main路径下,不同的Sample可能会有不同)。
\ No newline at end of file