From b662aef6620b46b1d7fe4b36e3752d14b019f59d Mon Sep 17 00:00:00 2001 From: raoxian Date: Mon, 24 Jan 2022 10:57:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4storage=E4=B8=8B=E6=B2=A1?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: raoxian --- storage/BUILD.gn | 11 - storage/storagedsmjstest/BUILD.gn | 31 -- storage/storagedsmjstest/Test.json | 18 - .../signature/openharmony_sx.p7b | Bin 3437 -> 0 bytes storage/storagedsmjstest/src/main/config.json | 61 -- .../src/main/js/default/app.js | 23 - .../src/main/js/default/i18n/en-US.json | 6 - .../src/main/js/default/i18n/zh-CN.json | 6 - .../src/main/js/default/pages/index/index.css | 9 - .../src/main/js/default/pages/index/index.hml | 5 - .../src/main/js/default/pages/index/index.js | 40 -- .../src/main/js/default/test/Common.js | 192 ------- .../src/main/js/default/test/Dsm.test.js | 527 ------------------ .../src/main/js/default/test/DsmError.test.js | 514 ----------------- .../src/main/js/default/test/List.test.js | 17 - .../main/resources/base/element/string.json | 12 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes storage/storagedsmstabilityjstest/BUILD.gn | 31 -- storage/storagedsmstabilityjstest/Test.json | 18 - .../signature/openharmony_sx.p7b | Bin 3437 -> 0 bytes .../src/main/config.json | 61 -- .../src/main/js/default/app.js | 23 - .../src/main/js/default/i18n/en-US.json | 6 - .../src/main/js/default/i18n/zh-CN.json | 6 - .../src/main/js/default/pages/index/index.css | 9 - .../src/main/js/default/pages/index/index.hml | 5 - .../src/main/js/default/pages/index/index.js | 40 -- .../src/main/js/default/test/Common.js | 180 ------ .../js/default/test/DsmPerformance.test.js | 372 ------------- .../js/default/test/DsmReliability.test.js | 224 -------- .../src/main/js/default/test/List.test.js | 17 - .../main/resources/base/element/string.json | 12 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes storage/storagefileconcurrentjstest/BUILD.gn | 31 -- storage/storagefileconcurrentjstest/Test.json | 18 - .../signature/openharmony_sx.p7b | Bin 3437 -> 0 bytes .../src/main/config.json | 61 -- .../src/main/js/default/app.js | 23 - .../src/main/js/default/i18n/en-US.json | 6 - .../src/main/js/default/i18n/zh-CN.json | 6 - .../src/main/js/default/pages/index/index.css | 9 - .../src/main/js/default/pages/index/index.hml | 5 - .../src/main/js/default/pages/index/index.js | 41 -- .../src/main/js/default/test/Common.js | 170 ------ .../js/default/test/FileConcurrent.test.js | 474 ---------------- .../src/main/js/default/test/List.test.js | 16 - .../main/resources/base/element/string.json | 12 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes .../storagefileioperformancejstest/BUILD.gn | 31 -- .../storagefileioperformancejstest/Test.json | 18 - .../signature/openharmony_sx.p7b | Bin 3437 -> 0 bytes .../src/main/config.json | 61 -- .../src/main/js/default/app.js | 23 - .../src/main/js/default/i18n/en-US.json | 6 - .../src/main/js/default/i18n/zh-CN.json | 6 - .../src/main/js/default/pages/index/index.css | 9 - .../src/main/js/default/pages/index/index.hml | 5 - .../src/main/js/default/pages/index/index.js | 41 -- .../src/main/js/default/test/Common.js | 170 ------ .../main/js/default/test/FileIOPerformance.js | 495 ---------------- .../main/js/default/test/FilePerformance.js | 505 ----------------- .../src/main/js/default/test/List.test.js | 17 - .../main/resources/base/element/string.json | 12 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes .../storagefileioreliabilityjstest/BUILD.gn | 31 -- .../storagefileioreliabilityjstest/Test.json | 18 - .../signature/openharmony_sx.p7b | Bin 3437 -> 0 bytes .../src/main/config.json | 61 -- .../src/main/js/default/app.js | 23 - .../src/main/js/default/i18n/en-US.json | 6 - .../src/main/js/default/i18n/zh-CN.json | 6 - .../src/main/js/default/pages/index/index.css | 9 - .../src/main/js/default/pages/index/index.hml | 5 - .../src/main/js/default/pages/index/index.js | 37 -- .../src/main/js/default/test/Common.js | 170 ------ .../main/js/default/test/FileIOReliability.js | 189 ------- .../src/main/js/default/test/List.test.js | 16 - .../main/resources/base/element/string.json | 12 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes storage/storagefileiostabilityjstest/BUILD.gn | 31 -- .../storagefileiostabilityjstest/Test.json | 18 - .../signature/openharmony_sx.p7b | Bin 3437 -> 0 bytes .../src/main/config.json | 61 -- .../src/main/js/default/app.js | 23 - .../src/main/js/default/i18n/en-US.json | 6 - .../src/main/js/default/i18n/zh-CN.json | 6 - .../src/main/js/default/pages/index/index.css | 9 - .../src/main/js/default/pages/index/index.hml | 5 - .../src/main/js/default/pages/index/index.js | 37 -- .../src/main/js/default/test/Common.js | 170 ------ .../main/js/default/test/FileIOStability.js | 198 ------- .../src/main/js/default/test/List.test.js | 16 - .../main/resources/base/element/string.json | 12 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes storage/storagefilestabilityjstest/BUILD.gn | 31 -- storage/storagefilestabilityjstest/Test.json | 18 - .../signature/openharmony_sx.p7b | Bin 3437 -> 0 bytes .../src/main/config.json | 61 -- .../src/main/js/default/app.js | 23 - .../src/main/js/default/i18n/en-US.json | 6 - .../src/main/js/default/i18n/zh-CN.json | 6 - .../src/main/js/default/pages/index/index.css | 9 - .../src/main/js/default/pages/index/index.hml | 5 - .../src/main/js/default/pages/index/index.js | 40 -- .../src/main/js/default/test/Common.js | 170 ------ .../main/js/default/test/FileReliability.js | 292 ---------- .../src/main/js/default/test/FileStability.js | 302 ---------- .../src/main/js/default/test/List.test.js | 17 - .../main/resources/base/element/string.json | 12 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes storage/storagefmspublicjstest/BUILD.gn | 31 -- storage/storagefmspublicjstest/Test.json | 18 - .../signature/openharmony_sx.p7b | Bin 3437 -> 0 bytes .../src/main/config.json | 61 -- .../src/main/js/default/app.js | 23 - .../src/main/js/default/i18n/en-US.json | 6 - .../src/main/js/default/i18n/zh-CN.json | 6 - .../src/main/js/default/pages/index/index.css | 9 - .../src/main/js/default/pages/index/index.hml | 5 - .../src/main/js/default/pages/index/index.js | 40 -- .../src/main/js/default/test/Common.js | 192 ------- .../js/default/test/FmsPerformance.test.js | 238 -------- .../main/js/default/test/FmsPublic.test.js | 400 ------------- .../js/default/test/FmsPublicError.test.js | 428 -------------- .../src/main/js/default/test/List.test.js | 17 - .../main/resources/base/element/string.json | 12 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes storage/storagefmssharejstest/BUILD.gn | 31 -- storage/storagefmssharejstest/Test.json | 18 - .../signature/openharmony_sx.p7b | Bin 3437 -> 0 bytes .../src/main/config.json | 72 --- .../src/main/js/default/app.js | 23 - .../src/main/js/default/i18n/en-US.json | 6 - .../src/main/js/default/i18n/zh-CN.json | 6 - .../src/main/js/default/pages/index/index.css | 9 - .../src/main/js/default/pages/index/index.hml | 5 - .../src/main/js/default/pages/index/index.js | 40 -- .../src/main/js/default/test/Common.js | 180 ------ .../src/main/js/default/test/FmsShare.test.js | 408 -------------- .../default/test/FmsSharePerformance.test.js | 90 --- .../js/default/test/FmsShareStability.test.js | 85 --- .../src/main/js/default/test/List.test.js | 16 - .../main/resources/base/element/string.json | 12 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes 144 files changed, 9401 deletions(-) delete mode 100644 storage/storagedsmjstest/BUILD.gn delete mode 100644 storage/storagedsmjstest/Test.json delete mode 100755 storage/storagedsmjstest/signature/openharmony_sx.p7b delete mode 100644 storage/storagedsmjstest/src/main/config.json delete mode 100644 storage/storagedsmjstest/src/main/js/default/app.js delete mode 100644 storage/storagedsmjstest/src/main/js/default/i18n/en-US.json delete mode 100644 storage/storagedsmjstest/src/main/js/default/i18n/zh-CN.json delete mode 100644 storage/storagedsmjstest/src/main/js/default/pages/index/index.css delete mode 100644 storage/storagedsmjstest/src/main/js/default/pages/index/index.hml delete mode 100644 storage/storagedsmjstest/src/main/js/default/pages/index/index.js delete mode 100644 storage/storagedsmjstest/src/main/js/default/test/Common.js delete mode 100644 storage/storagedsmjstest/src/main/js/default/test/Dsm.test.js delete mode 100644 storage/storagedsmjstest/src/main/js/default/test/DsmError.test.js delete mode 100644 storage/storagedsmjstest/src/main/js/default/test/List.test.js delete mode 100644 storage/storagedsmjstest/src/main/resources/base/element/string.json delete mode 100644 storage/storagedsmjstest/src/main/resources/base/media/icon.png delete mode 100644 storage/storagedsmstabilityjstest/BUILD.gn delete mode 100644 storage/storagedsmstabilityjstest/Test.json delete mode 100755 storage/storagedsmstabilityjstest/signature/openharmony_sx.p7b delete mode 100644 storage/storagedsmstabilityjstest/src/main/config.json delete mode 100644 storage/storagedsmstabilityjstest/src/main/js/default/app.js delete mode 100644 storage/storagedsmstabilityjstest/src/main/js/default/i18n/en-US.json delete mode 100644 storage/storagedsmstabilityjstest/src/main/js/default/i18n/zh-CN.json delete mode 100644 storage/storagedsmstabilityjstest/src/main/js/default/pages/index/index.css delete mode 100644 storage/storagedsmstabilityjstest/src/main/js/default/pages/index/index.hml delete mode 100644 storage/storagedsmstabilityjstest/src/main/js/default/pages/index/index.js delete mode 100644 storage/storagedsmstabilityjstest/src/main/js/default/test/Common.js delete mode 100644 storage/storagedsmstabilityjstest/src/main/js/default/test/DsmPerformance.test.js delete mode 100644 storage/storagedsmstabilityjstest/src/main/js/default/test/DsmReliability.test.js delete mode 100644 storage/storagedsmstabilityjstest/src/main/js/default/test/List.test.js delete mode 100644 storage/storagedsmstabilityjstest/src/main/resources/base/element/string.json delete mode 100644 storage/storagedsmstabilityjstest/src/main/resources/base/media/icon.png delete mode 100644 storage/storagefileconcurrentjstest/BUILD.gn delete mode 100644 storage/storagefileconcurrentjstest/Test.json delete mode 100644 storage/storagefileconcurrentjstest/signature/openharmony_sx.p7b delete mode 100644 storage/storagefileconcurrentjstest/src/main/config.json delete mode 100644 storage/storagefileconcurrentjstest/src/main/js/default/app.js delete mode 100644 storage/storagefileconcurrentjstest/src/main/js/default/i18n/en-US.json delete mode 100644 storage/storagefileconcurrentjstest/src/main/js/default/i18n/zh-CN.json delete mode 100644 storage/storagefileconcurrentjstest/src/main/js/default/pages/index/index.css delete mode 100644 storage/storagefileconcurrentjstest/src/main/js/default/pages/index/index.hml delete mode 100644 storage/storagefileconcurrentjstest/src/main/js/default/pages/index/index.js delete mode 100644 storage/storagefileconcurrentjstest/src/main/js/default/test/Common.js delete mode 100644 storage/storagefileconcurrentjstest/src/main/js/default/test/FileConcurrent.test.js delete mode 100644 storage/storagefileconcurrentjstest/src/main/js/default/test/List.test.js delete mode 100644 storage/storagefileconcurrentjstest/src/main/resources/base/element/string.json delete mode 100644 storage/storagefileconcurrentjstest/src/main/resources/base/media/icon.png delete mode 100644 storage/storagefileioperformancejstest/BUILD.gn delete mode 100644 storage/storagefileioperformancejstest/Test.json delete mode 100644 storage/storagefileioperformancejstest/signature/openharmony_sx.p7b delete mode 100644 storage/storagefileioperformancejstest/src/main/config.json delete mode 100644 storage/storagefileioperformancejstest/src/main/js/default/app.js delete mode 100644 storage/storagefileioperformancejstest/src/main/js/default/i18n/en-US.json delete mode 100644 storage/storagefileioperformancejstest/src/main/js/default/i18n/zh-CN.json delete mode 100644 storage/storagefileioperformancejstest/src/main/js/default/pages/index/index.css delete mode 100644 storage/storagefileioperformancejstest/src/main/js/default/pages/index/index.hml delete mode 100644 storage/storagefileioperformancejstest/src/main/js/default/pages/index/index.js delete mode 100644 storage/storagefileioperformancejstest/src/main/js/default/test/Common.js delete mode 100644 storage/storagefileioperformancejstest/src/main/js/default/test/FileIOPerformance.js delete mode 100644 storage/storagefileioperformancejstest/src/main/js/default/test/FilePerformance.js delete mode 100644 storage/storagefileioperformancejstest/src/main/js/default/test/List.test.js delete mode 100644 storage/storagefileioperformancejstest/src/main/resources/base/element/string.json delete mode 100644 storage/storagefileioperformancejstest/src/main/resources/base/media/icon.png delete mode 100644 storage/storagefileioreliabilityjstest/BUILD.gn delete mode 100644 storage/storagefileioreliabilityjstest/Test.json delete mode 100644 storage/storagefileioreliabilityjstest/signature/openharmony_sx.p7b delete mode 100644 storage/storagefileioreliabilityjstest/src/main/config.json delete mode 100644 storage/storagefileioreliabilityjstest/src/main/js/default/app.js delete mode 100644 storage/storagefileioreliabilityjstest/src/main/js/default/i18n/en-US.json delete mode 100644 storage/storagefileioreliabilityjstest/src/main/js/default/i18n/zh-CN.json delete mode 100644 storage/storagefileioreliabilityjstest/src/main/js/default/pages/index/index.css delete mode 100644 storage/storagefileioreliabilityjstest/src/main/js/default/pages/index/index.hml delete mode 100644 storage/storagefileioreliabilityjstest/src/main/js/default/pages/index/index.js delete mode 100644 storage/storagefileioreliabilityjstest/src/main/js/default/test/Common.js delete mode 100644 storage/storagefileioreliabilityjstest/src/main/js/default/test/FileIOReliability.js delete mode 100644 storage/storagefileioreliabilityjstest/src/main/js/default/test/List.test.js delete mode 100644 storage/storagefileioreliabilityjstest/src/main/resources/base/element/string.json delete mode 100644 storage/storagefileioreliabilityjstest/src/main/resources/base/media/icon.png delete mode 100644 storage/storagefileiostabilityjstest/BUILD.gn delete mode 100644 storage/storagefileiostabilityjstest/Test.json delete mode 100644 storage/storagefileiostabilityjstest/signature/openharmony_sx.p7b delete mode 100644 storage/storagefileiostabilityjstest/src/main/config.json delete mode 100644 storage/storagefileiostabilityjstest/src/main/js/default/app.js delete mode 100644 storage/storagefileiostabilityjstest/src/main/js/default/i18n/en-US.json delete mode 100644 storage/storagefileiostabilityjstest/src/main/js/default/i18n/zh-CN.json delete mode 100644 storage/storagefileiostabilityjstest/src/main/js/default/pages/index/index.css delete mode 100644 storage/storagefileiostabilityjstest/src/main/js/default/pages/index/index.hml delete mode 100644 storage/storagefileiostabilityjstest/src/main/js/default/pages/index/index.js delete mode 100644 storage/storagefileiostabilityjstest/src/main/js/default/test/Common.js delete mode 100644 storage/storagefileiostabilityjstest/src/main/js/default/test/FileIOStability.js delete mode 100644 storage/storagefileiostabilityjstest/src/main/js/default/test/List.test.js delete mode 100644 storage/storagefileiostabilityjstest/src/main/resources/base/element/string.json delete mode 100644 storage/storagefileiostabilityjstest/src/main/resources/base/media/icon.png delete mode 100644 storage/storagefilestabilityjstest/BUILD.gn delete mode 100644 storage/storagefilestabilityjstest/Test.json delete mode 100644 storage/storagefilestabilityjstest/signature/openharmony_sx.p7b delete mode 100644 storage/storagefilestabilityjstest/src/main/config.json delete mode 100644 storage/storagefilestabilityjstest/src/main/js/default/app.js delete mode 100644 storage/storagefilestabilityjstest/src/main/js/default/i18n/en-US.json delete mode 100644 storage/storagefilestabilityjstest/src/main/js/default/i18n/zh-CN.json delete mode 100644 storage/storagefilestabilityjstest/src/main/js/default/pages/index/index.css delete mode 100644 storage/storagefilestabilityjstest/src/main/js/default/pages/index/index.hml delete mode 100644 storage/storagefilestabilityjstest/src/main/js/default/pages/index/index.js delete mode 100644 storage/storagefilestabilityjstest/src/main/js/default/test/Common.js delete mode 100644 storage/storagefilestabilityjstest/src/main/js/default/test/FileReliability.js delete mode 100644 storage/storagefilestabilityjstest/src/main/js/default/test/FileStability.js delete mode 100644 storage/storagefilestabilityjstest/src/main/js/default/test/List.test.js delete mode 100644 storage/storagefilestabilityjstest/src/main/resources/base/element/string.json delete mode 100644 storage/storagefilestabilityjstest/src/main/resources/base/media/icon.png delete mode 100644 storage/storagefmspublicjstest/BUILD.gn delete mode 100644 storage/storagefmspublicjstest/Test.json delete mode 100644 storage/storagefmspublicjstest/signature/openharmony_sx.p7b delete mode 100644 storage/storagefmspublicjstest/src/main/config.json delete mode 100644 storage/storagefmspublicjstest/src/main/js/default/app.js delete mode 100644 storage/storagefmspublicjstest/src/main/js/default/i18n/en-US.json delete mode 100644 storage/storagefmspublicjstest/src/main/js/default/i18n/zh-CN.json delete mode 100644 storage/storagefmspublicjstest/src/main/js/default/pages/index/index.css delete mode 100644 storage/storagefmspublicjstest/src/main/js/default/pages/index/index.hml delete mode 100644 storage/storagefmspublicjstest/src/main/js/default/pages/index/index.js delete mode 100644 storage/storagefmspublicjstest/src/main/js/default/test/Common.js delete mode 100644 storage/storagefmspublicjstest/src/main/js/default/test/FmsPerformance.test.js delete mode 100644 storage/storagefmspublicjstest/src/main/js/default/test/FmsPublic.test.js delete mode 100644 storage/storagefmspublicjstest/src/main/js/default/test/FmsPublicError.test.js delete mode 100644 storage/storagefmspublicjstest/src/main/js/default/test/List.test.js delete mode 100644 storage/storagefmspublicjstest/src/main/resources/base/element/string.json delete mode 100755 storage/storagefmspublicjstest/src/main/resources/base/media/icon.png delete mode 100644 storage/storagefmssharejstest/BUILD.gn delete mode 100644 storage/storagefmssharejstest/Test.json delete mode 100644 storage/storagefmssharejstest/signature/openharmony_sx.p7b delete mode 100644 storage/storagefmssharejstest/src/main/config.json delete mode 100644 storage/storagefmssharejstest/src/main/js/default/app.js delete mode 100644 storage/storagefmssharejstest/src/main/js/default/i18n/en-US.json delete mode 100644 storage/storagefmssharejstest/src/main/js/default/i18n/zh-CN.json delete mode 100644 storage/storagefmssharejstest/src/main/js/default/pages/index/index.css delete mode 100644 storage/storagefmssharejstest/src/main/js/default/pages/index/index.hml delete mode 100644 storage/storagefmssharejstest/src/main/js/default/pages/index/index.js delete mode 100644 storage/storagefmssharejstest/src/main/js/default/test/Common.js delete mode 100644 storage/storagefmssharejstest/src/main/js/default/test/FmsShare.test.js delete mode 100644 storage/storagefmssharejstest/src/main/js/default/test/FmsSharePerformance.test.js delete mode 100644 storage/storagefmssharejstest/src/main/js/default/test/FmsShareStability.test.js delete mode 100644 storage/storagefmssharejstest/src/main/js/default/test/List.test.js delete mode 100644 storage/storagefmssharejstest/src/main/resources/base/element/string.json delete mode 100755 storage/storagefmssharejstest/src/main/resources/base/media/icon.png diff --git a/storage/BUILD.gn b/storage/BUILD.gn index cab4212f6..38431d513 100644 --- a/storage/BUILD.gn +++ b/storage/BUILD.gn @@ -16,19 +16,8 @@ group("storage") { testonly = true if (is_standard_system) { deps = [ - #"storagedsmjstest:storagedsm_js_test", - # "storagedsmstabilityjstest:storagedsmstability_js_test", - #"storagefileconcurrentjstest:storagefileconcurrent_js_test", "storagefileioerrorjstest:storagefileioerror_js_test", "storagefileiojstest:storagefileio_js_test", - - # "storagefmspublicjstest:storagefmspublic_js_test", - # "storagefmssharejstest:storagefmsshare_js_test", - - # "storagefileioperformancejstest:storagefileioperformance_js_test", - # "storagefileioreliabilityjstest:storagefileioreliability_js_test", - # "storagefileiostabilityjstest:storagefileiostability_js_test", - # "storagefilestabilityjstest:storagefilestability_js_test", ] } } diff --git a/storage/storagedsmjstest/BUILD.gn b/storage/storagedsmjstest/BUILD.gn deleted file mode 100644 index 4275032b4..000000000 --- a/storage/storagedsmjstest/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# 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("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("storagedsm_js_test") { - hap_profile = "./src/main/config.json" - deps = [ - ":storagedsm_js_assets", - ":storagedsm_js_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsStorageFmsPublicJsTest" -} -ohos_js_assets("storagedsm_js_assets") { - source_dir = "./src/main/js/default" -} -ohos_resources("storagedsm_js_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/storage/storagedsmjstest/Test.json b/storage/storagedsmjstest/Test.json deleted file mode 100644 index 910be0d9c..000000000 --- a/storage/storagedsmjstest/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for storage file and fileio Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "ohos.acts.stroage.fileio", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsStorageFmsPublicJsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/storage/storagedsmjstest/signature/openharmony_sx.p7b b/storage/storagedsmjstest/signature/openharmony_sx.p7b deleted file mode 100755 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3437 zcmcgvX>b$g8MY4FF(5FQyMT=#m||qU)nQ9cId-MBB-<-lvSdq&snM}IENNF>t+bK| zgowuF2vC|SxSZxNN5eHhV%(WPpbeB9Fc3;JDMtzMBv1-XAc2N~c2_tCXW&OCGw6qQ z-s9VS-tT?h=bI0tMS+~WDXqHJyCPmLzdbE-fV8Nd&*MRZfG8(#POFZG3xs@Lb{0ry z=R8j3wWo!5g=yjKx#BoZMFS)uA)H}cTp@-^K`9VV?RC3J59@}eik*>n|pRKOLZ zxdn7G!Yv@9O#y<&eUy{)vMXb;fQR)ffVAADQsEMXm;IBMDLfLD0w^U;6%HVo-0Q_5 zCHEa?DBuauNpZzoF+tK27w#n~?u%toS-DhR4k@Q*{7x^8Q=D6&kd^_~J#VVG2LXkL zaAy=}U*?Jto)9hx5MGjdp9hcQAu@tfk_;l!PeyxPY<8b&+&D!CyaBh9=8BSVKLpk4 z4Ml3yY|&Th)vyK4cpC{!uU8v2YBlVV`d~(nz&<@{G1oe*DHub1z7~J5*;s2bX<)_* zV_GbsPQg`(&rpxRb_*Od7}++3+liSw-$!1 zs5*g}EHWhI3i|!-FcfzYL0`SL-rq>LENC;PMl)G(0(1U2%Va|smp0UFx0xd@soZA* zD5LYc4OlbE7@ARt#h}rr3>K@bf%B#^-c+xz8Hr)0D5ExIFltezN@Hn8>o5d~bSfYtkc+_Z&kI#-N5_GhCg*V-^TSO=!G~ z(fXy{n2XV+k}6w_W`dTOP2a4u0ly;ANZ>4OxSKAzFB!yBzdo`gX zO?o|H@WiAw$y6l?=^3jA_Hy0S)nTYs12;4hKE&ekQ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_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b diff --git a/storage/storagedsmjstest/src/main/config.json b/storage/storagedsmjstest/src/main/config.json deleted file mode 100644 index 9b7cfe5d0..000000000 --- a/storage/storagedsmjstest/src/main/config.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "app": { - "bundleName": "ohos.acts.stroage.fileio", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5 - } - }, - "deviceConfig": {}, - "module": { - "package": "ohos.acts.stroage.fileio", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "ohos.acts.stroage.fileio.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/storage/storagedsmjstest/src/main/js/default/app.js b/storage/storagedsmjstest/src/main/js/default/app.js deleted file mode 100644 index 60ee141c8..000000000 --- a/storage/storagedsmjstest/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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('ohos.acts.distributeddatamgr.distributedfile onCreate'); - }, - onDestroy() { - console.info('ohos.acts.distributeddatamgr.distributedfile onCreate'); - } -}; diff --git a/storage/storagedsmjstest/src/main/js/default/i18n/en-US.json b/storage/storagedsmjstest/src/main/js/default/i18n/en-US.json deleted file mode 100644 index ead52ed2e..000000000 --- a/storage/storagedsmjstest/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "Test" - } -} \ No newline at end of file diff --git a/storage/storagedsmjstest/src/main/js/default/i18n/zh-CN.json b/storage/storagedsmjstest/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index 3f48f2585..000000000 --- a/storage/storagedsmjstest/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "测试" - } -} \ No newline at end of file diff --git a/storage/storagedsmjstest/src/main/js/default/pages/index/index.css b/storage/storagedsmjstest/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda79275..000000000 --- a/storage/storagedsmjstest/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/storage/storagedsmjstest/src/main/js/default/pages/index/index.hml b/storage/storagedsmjstest/src/main/js/default/pages/index/index.hml deleted file mode 100644 index f64b040a5..000000000 --- a/storage/storagedsmjstest/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/storage/storagedsmjstest/src/main/js/default/pages/index/index.js b/storage/storagedsmjstest/src/main/js/default/pages/index/index.js deleted file mode 100644 index f7894a722..000000000 --- a/storage/storagedsmjstest/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 {Core} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: '' - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - require('../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/storage/storagedsmjstest/src/main/js/default/test/Common.js b/storage/storagedsmjstest/src/main/js/default/test/Common.js deleted file mode 100644 index c7b15f7ce..000000000 --- a/storage/storagedsmjstest/src/main/js/default/test/Common.js +++ /dev/null @@ -1,192 +0,0 @@ -/* - * 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 fileio from '@system.fileio' -export const FILE_CONTENT = 'hello world' -export function prepareFile(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o666) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareFile1(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareEmptyFile(fpath) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function fileToReadOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o444) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadOnly for ' + e); - return false - } -} -export function fileToWriteOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o2) - fileio.fchmodSync(fd, 0o222) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToWriteOnly ' + e) - return false - } -} -export function fileToReadAndWrite(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o777) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadAndWrite ' + e); - return false - } -} -export function filePickerName(testName,deviceID) { - const BASE_PATH = '/data/ss/'+deviceID+'/fms_test/' - return BASE_PATH + testName -} -export function filePickerName1(testName,deviceID) { - const BASE_PATH = '/data/ss/'+ deviceID +'/fms_test/' - return BASE_PATH + testName -} -export function filePickerName2(testName,deviceID) { - const BASE_PATH = '/data/ss/'+ deviceID - return BASE_PATH + testName -} -export function appName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/' - return BASE_PATH + testName -} -export function nextFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/cache/' - return BASE_PATH + testName -} -export function fileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/' - return BASE_PATH + testName -} -export function cacheFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/cache/' - return BASE_PATH + testName -} -export function differentFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/' - return BASE_PATH + testName -} -export function differentCacheName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/cache/' - return BASE_PATH + testName -} -export function fmsFileName(testName) { - const BASE_PATH = "/data/accounts/account_0/appdata/ohos.acts.test/files/" - return BASE_PATH + testName -} -export function fmsCacheName(testName) { - const BASE_PATH = "/data/accounts/account_0/appdata/ohos.acts.test/cache/" - return BASE_PATH + testName -} -export function fmsPublic(testName) { - const BASE_PATH = '/data/ss/files/' - return BASE_PATH + testName -} - -export function getFileTextLen(fpath) { - let ss - try { - ss = fileio.Stream.createStreamSync(fpath, 'r+') - expect(ss !== null).assertTrue() - let len = ss.readSync(new ArrayBuffer(4096)) - console.log('file:' + fpath) - console.log('file lenth:' + len) - expect(ss.closeSync() !== null).assertTrue() - return len - } - catch (e) { - console.log('Failed to getFileTextLen ' + e) - expect(ss.closeSync() == null).assertTrue() - return null - } -} -export function isFileExist(fpath) { - try { - expect(fileio.accessSync(fpath) !== null).assertTrue() - console.log('file:' + fpath) - console.log('status:exist') - return true - } - catch (e) { - console.log('file:' + fpath) - console.log('status:non-existen') - return false - } -} -export function sleep(n) { - var start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > n) { - break; - } - } -} -export function randomString(num) { - let len= num; - var $chars = 'aaaabbbbcccc'; - var maxPos = $chars.length; - var pwd = ''; - for (var i = 0; i < len; i++) { - pwd += $chars.charAt(Math.floor(Math.random() * maxPos)); - } - return pwd; -} diff --git a/storage/storagedsmjstest/src/main/js/default/test/Dsm.test.js b/storage/storagedsmjstest/src/main/js/default/test/Dsm.test.js deleted file mode 100644 index e6ec59b2f..000000000 --- a/storage/storagedsmjstest/src/main/js/default/test/Dsm.test.js +++ /dev/null @@ -1,527 +0,0 @@ -/* - * 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 devicesmgr from '@system.devicesmgr'; -import { - describe, - beforeAll, - beforeEach, - afterEach, - afterAll, - it, - expect -} -from 'deccjsunit/index' - -describe('dsmTest', function () { - let mid = 0; - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_0000 - * @tc.name DSM_JS_Function_0000 - * @tc.desc Insert SD card to start up in shutdown state - */ - it('DSM_JS_Function_0000', 0, function () { - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_0000 call getVolumes success. data:' + JSON.stringify(data)); - mid = data.volumeInfos[2].mId; - expect(data.volumeInfos[2].mId !== null).assertTrue(); - expect(data.volumeInfos[2].mState == 2).assertTrue(); - }, - fail: function (data, code) { - console.log('DSM_JS_Function_0000 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_0100 - * @tc.name DSM_JS_Function_0100 - * @tc.desc Insert SD card in power on state - */ - it('DSM_JS_Function_0100', 0, function () { - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_0100 call getVolumes success. data:' + JSON.stringify(data)); - expect(data.volumeInfos[2].mId !== null).assertTrue(); - expect(data.volumeInfos[2].mState == 2).assertTrue(); - }, - fail: function (data, code) { - console.log('DSM_JS_Function_0100 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_0200 - * @tc.name DSM_JS_Function_0200 - * @tc.desc Unplug the SD card in the power on state - */ - it('DSM_JS_Function_0200', 0, function () { - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_0200 call getVolumes success. data:' + JSON.stringify(data)); - for (let i = 0; i < data.volumeInfos.length; i++) { - expect(typeof(data.volumeInfos[i].mId) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].mDiskId) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].mPartGuid) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].mFsUuid) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].mType) == 'number').assertTrue(); - expect(typeof(data.volumeInfos[i].mMountFlags) == 'number').assertTrue(); - expect(typeof(data.volumeInfos[i].mMountUserId) == 'number').assertTrue(); - expect(typeof(data.volumeInfos[i].mState) == 'number').assertTrue(); - expect(typeof(data.volumeInfos[i].mPath) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].mInternalPath) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].mFsLabel) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].Description) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].IsVisibleForUser) == 'boolean').assertTrue(); - expect(typeof(data.volumeInfos[i].IsEmulated) == 'boolean').assertTrue(); - expect(typeof(data.volumeInfos[i].IsPrimaryEmulatedForUser) == 'boolean').assertTrue(); - expect(typeof(data.volumeInfos[i].IsRemovable) == 'boolean').assertTrue(); - expect(typeof(data.volumeInfos[i].IsPrimary) == 'boolean').assertTrue(); - } - }, - fail: function (data, code) { - console.log('DSM_JS_Function_0200 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_0300 - * @tc.name DSM_JS_Function_0300 - * @tc.desc Uninstall SD card. - */ - it('DSM_JS_Function_0300', 0, function () { - let mId = 0; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_0300 call getVolumes success.' + JSON.stringify(data)); - mId = data.volumeInfos[2].mId; - }, - fail: function (data, code) { - console.log('DSM_JS_Function_0300 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - devicesmgr.unMount({ - volId: mId, - success: function () { - console.log('DSM_JS_Function_0300 call unMount success.'); - }, - fail: function (data, code) { - console.log('DSM_JS_Function_0300 call unMount fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - } - }) - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_0300 call getVolumes success.' + JSON.stringify(data)); - for (let i = 0; i < data.getDisks.length; i++) { - expect(data.volumeInfos[i].mId !== 'public:179,33').assertTrue(); - expect(data.volumeInfos[i].mState !== 2).assertTrue(); - } - }, - fail: function (data, code) { - console.log('DSM_JS_Function_0300 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_0400 - * @tc.name DSM_JS_Function_0400 - * @tc.desc Mount SD card. - */ - it('DSM_JS_Function_0400', 0, function () { - devicesmgr.mount({ - volId: mid, - success: function () { - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_0400 call getVolumes success. data:' + JSON.stringify(data)); - expect(data.volumeInfos[2].mState == 2).assertTure() - expect(data.volumeInfos[2].mInternalPath !== null).assertTure() - }, - fail: function (data, code) { - console.log('DSM_JS_Function_0400 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_0800 - * @tc.name DSM_JS_Function_0800 - * @tc.desc Find the corresponding volume information through the volume ID - */ - it('DSM_JS_Function_0800', 0, function () { - let mId; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_0800 call getVolumes success' + JSON.stringify(data)); - mId = data.volumeInfos[2].mId; - }, - fail: function (data, code) { - console.log('DSM_JS_Function_0800 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - devicesmgr.findVolumeById({ - volId: mId, - success: function (vol) { - console.log('DSM_JS_Function_0800 call findVolumeById success' + JSON.stringify(vol)) - expect(vol.volumeInfos[2].mId !== null).assertTrue(); - expect(vol.volumeInfos[2].mState == 2).assertTrue(); - }, - fail: function (data, code) { - console.log('DSM_JS_Function_0800 call findVolumeById fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_0900 - * @tc.name DSM_JS_Function_0900 - * @tc.desc Find the corresponding volume information through the volume ID - */ - it('DSM_JS_Function_0900', 0, function () { - let mId; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_0900 call getVolumes success' + JSON.stringify(data)); - mId = data.volumeInfos[0].mId; - }, - fail: function (data, code) { - console.log('DSM_JS_Function_0900 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - devicesmgr.findVolumeById({ - volId: mId, - success: function (vol) { - console.log('DSM_JS_Function_0900 call findVolumeById success' + JSON.stringify(vol)) - expect(vol.volumeInfos[0].mId == 'emulated;0').assertTrue(); - expect(vol.volumeInfos[0].mInternalPath !== null).assertTrue(); - }, - fail: function (data, code) { - console.log('DSM_JS_Function_0900 call findVolumeById fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_1000 - * @tc.name DSM_JS_Function_1000 - * @tc.desc Find the corresponding volume information through the volume ID - */ - it('DSM_JS_Function_1000', 0, function () { - let mId; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_0900 call getVolumes success' + JSON.stringify(data)); - mId = data.volumeInfos[1].mId; - }, - fail: function (data, code) { - console.log('DSM_JS_Function_0900 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - devicesmgr.findVolumeById({ - volId: mId, - success: function (vol) { - console.log('DSM_JS_Function_1000 call findVolumeById success' + JSON.stringify(vol)) - expect(vol.volumeInfos[1].mId == 'private').assertTrue(); - expect(vol.volumeInfos[1].mState == 2).assertTrue(); - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1000 call findVolumeById fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_1100 - * @tc.name DSM_JS_Function_1100 - * @tc.desc Obtain the corresponding volume information through the UUID of the volume - */ - it('DSM_JS_Function_1100', 0, function () { - let mFsUuid; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_1100 call getVolumes success' + JSON.stringify(data)); - mFsUuid = data.volumeInfos[2].mFsUuid; - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1100 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - devicesmgr.findVolumeByUuid({ - volumeUuid: mFsUuid, - success: function (vol) { - console.log('DSM_JS_Function_1100 call findVolumeByUuid success' + JSON.stringify(vol)) - expect(vol.volumeInfos[2].mId !== null).assertTrue(); - expect(vol.volumeInfos[2].mState == 2).assertTrue(); - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1100 call findVolumeByUuid fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_1200 - * @tc.name DSM_JS_Function_1200 - * @tc.desc Get information about writable volumes - */ - it('DSM_JS_Function_1200', 0, function () { - devicesmgr.getWritableVolumes({ - success: function (data) { - console.log('DSM_JS_Function_1200 call getWritableVolumes success. data:' + JSON.stringify(data)); - for (let i = 0; i < data.volumeInfos.length; i++) { - expect(typeof(data.volumeInfos[i].mId) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].mDiskId) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].mPartGuid) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].mFsUuid) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].mType) == 'number').assertTrue(); - expect(typeof(data.volumeInfos[i].mMountFlags) == 'number').assertTrue(); - expect(typeof(data.volumeInfos[i].mMountUserId) == 'number').assertTrue(); - expect(typeof(data.volumeInfos[i].mState) == 'number').assertTrue(); - expect(typeof(data.volumeInfos[i].mPath) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].mInternalPath) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].mFsLabel) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].Description) == 'string').assertTrue(); - expect(typeof(data.volumeInfos[i].IsVisibleForUser) == 'boolean').assertTrue(); - expect(typeof(data.volumeInfos[i].IsEmulated) == 'boolean').assertTrue(); - expect(typeof(data.volumeInfos[i].IsPrimaryEmulatedForUser) == 'boolean').assertTrue(); - expect(typeof(data.volumeInfos[i].IsRemovable) == 'boolean').assertTrue(); - expect(typeof(data.volumeInfos[i].IsPrimary) == 'boolean').assertTrue(); - } - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1200 call getWritableVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_1300 - * @tc.name DSM_JS_Function_1300 - * @tc.desc Obtain the corresponding disk information through the disk ID - */ - it('DSM_JS_Function_1300', 0, function () { - let mDiskId; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_1300 call getVolumes success' + data); - mDiskId = data.volumeInfos[2].mDiskId; - console.log('DSM_JS_Function_1300---' + data.volumeInfos[2].mDiskId); - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1300 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - devicesmgr.findDiskById({ - diskId: mDiskId, - success: function (disk) { - console.log('DSM_JS_Function_1300 call findDiskById success' + JSON.stringify(disk)) - expect(disk.findDiskById[0].mId == mDiskId).assertTrue(); - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1300 call findDiskById fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_1400 - * @tc.name DSM_JS_Function_1400 - * @tc.desc Get UUID of primary storage - */ - it('DSM_JS_Function_1400', 0, function () { - devicesmgr.getPrimaryStorageUuid({ - success: function (primaryUuid) { - console.log('DSM_JS_Function_1400 call getPrimaryStorageUuid success.' + JSON.stringify(primaryUuid)); - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1400 call getPrimaryStorageUuid fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_1500 - * @tc.name DSM_JS_Function_1500 - * @tc.desc Find its corresponding private volume through simulate volume - */ - it('DSM_JS_Function_1500', 0, function () { - let emuVol; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_1500 call getVolumes success' + data); - emuVol = data.volumeInfos[0] - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1500 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - devicesmgr.findPrivateForEmulate({ - emuVol: emuVol, - success: function (priVol) { - console.log('DSM_JS_Function_1500 call findPrivateForEmulate success' + JSON.stringify(priVol)) - expect(priVol.volumeInfos[1].mId == 'private').assertTrue(); - expect(priVol.volumeInfos[1].mState == 2).assertTrue(); - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1500 call findPrivateForEmulate fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_1600 - * @tc.name DSM_JS_Function_1600 - * @tc.desc Find its corresponding emulated volume through private volume - */ - it('DSM_JS_Function_1600', 0, function () { - var priVol; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_1600 call getVolumes success' + data); - priVol = data.volumeInfos[1] - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1600 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - devicesmgr.findEmulateForPrivate({ - priVol: priVol, - success: function (emuVol) { - console.log('DSM_JS_Function_1600 call findEmulateForPrivate success' + JSON.stringify(emuVol)) - expect(priVol.volumeInfos[0].mId == 'emulated;0').assertTrue(); - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1600 call findEmulateForPrivate fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_1700 - * @tc.name DSM_JS_Function_1700 - * @tc.desc Get the name of the volume (SD card) - */ - it('DSM_JS_Function_1700', 0, function () { - var vol; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_1700 call getVolumes success' + data); - vol = data.volumeInfos[2] - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1700 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - devicesmgr.getBestVolumeDescription({ - vol: vol, - success: function (desCription) { - console.log('DSM_JS_Function_1700 call getBestVolumeDescription success' +JSON.stringify(desCription)) - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1700 call getBestVolumeDescription fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_1800 - * @tc.name DSM_JS_Function_1800 - * @tc.desc Get the name of the volume (Internal storage public) - */ - it('DSM_JS_Function_1800', 0, function () { - var vol; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_1800 call getVolumes success' + data); - vol = data.volumeInfos[0] - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1800 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - devicesmgr.getBestVolumeDescription({ - vol: vol, - success: function (desCription) { - console.log('DSM_JS_Function_1800 call getBestVolumeDescription success' + JSON.stringify(desCription)) - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1800 call getBestVolumeDescription fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_Function_1900 - * @tc.name DSM_JS_Function_1900 - * @tc.desc Get the name of the volume (Internal storage private) - */ - it('DSM_JS_Function_1900', 0, function () { - var vol; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_Function_1900 call getVolumes success' + data); - vol = data.volumeInfos[1] - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1900 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - devicesmgr.getBestVolumeDescription({ - vol: vol, - success: function (desCription) { - console.log('DSM_JS_Function_1900 call getBestVolumeDescription success' + JSON.stringify(desCription)) - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1900 call getBestVolumeDescription fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - -}) diff --git a/storage/storagedsmjstest/src/main/js/default/test/DsmError.test.js b/storage/storagedsmjstest/src/main/js/default/test/DsmError.test.js deleted file mode 100644 index 69f810373..000000000 --- a/storage/storagedsmjstest/src/main/js/default/test/DsmError.test.js +++ /dev/null @@ -1,514 +0,0 @@ -/* - * 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 devicesmgr from '@system.devicesmgr'; -import { - describe, - beforeAll, - beforeEach, - afterEach, - afterAll, - it, - expect -} -from 'deccjsunit/index' - -describe('dsmErrorTest', function () { - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_0100 - * @tc.name DSM_JS_ERROR_0100 - * @tc.desc Verify that the mount volume ID is null successfully. - */ - it('DSM_JS_ERROR_0100', 0, function () { - devicesmgr.mount({ - volId: '', - success: function () { - console.log('DSM_JS_ERROR_0100 call mount success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_0100 call mount pass, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_0200 - * @tc.name DSM_JS_ERROR_0200 - * @tc.desc Verify that the mount does not exist and the volume ID is successful. - */ - it('DSM_JS_ERROR_0200', 0, function () { - devicesmgr.mount({ - volId: '123', - success: function () { - console.log('DSM_JS_ERROR_0200 call mount success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_0200 call mount pass, code: ' + code + ', data: ' + data); - expect(code == 300).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_0300 - * @tc.name DSM_JS_ERROR_0300 - * @tc.desc Verify that the unmount does not exist and the volume ID is successful. - */ - it('DSM_JS_ERROR_0300', 0, function () { - devicesmgr.unMount({ - volId: '123', - success: function () { - console.log('DSM_JS_ERROR_0300 call unMount success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_0300 call unMount pass, code: ' + code + ', data: ' + data); - expect(code == 300).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_0400 - * @tc.name DSM_JS_ERROR_0400 - * @tc.desc Verify that the unmount volume ID is null successfully. - */ - it('DSM_JS_ERROR_0400', 0, function () { - devicesmgr.unMount({ - volId: '', - success: function () { - console.log('DSM_JS_ERROR_0400 call unMount success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_0400 call unMount pass, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_0500 - * @tc.name DSM_JS_ERROR_0500 - * @tc.desc Verify that the format does not exist and whether the volume ID is successful. - */ - it('DSM_JS_ERROR_0500', 0, function () { - devicesmgr.format({ - volId: '123', - success: function () { - console.log('DSM_JS_ERROR_0500 call format success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_0500 call format pass, code: ' + code + ', data: ' + data); - expect(code == 300).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_0600 - * @tc.name DSM_JS_ERROR_0600 - * @tc.desc Verify that the ID of the formatted volume is null successfully. - */ - it('DSM_JS_ERROR_0600', 0, function () { - devicesmgr.format({ - volId: '', - success: function () { - console.log('DSM_JS_ERROR_0600 call format success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_0600 call format pass, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_0700 - * @tc.name DSM_JS_ERROR_0700 - * @tc.desc Verify that the SD card is successfully copied and mounted.. - */ - it('DSM_JS_ERROR_0700', 0, function () { - let mId; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_JS_ERROR_0900 call getVolumes success. data:' + JSON.stringify(data)); - for (let i = 0; i < data.volumeInfos.length; i++) { - if (data.volumeInfos[i].mState == 2 && data.volumeInfos[i].mId.indexOf('public:179') != -1) { - mId = data.volumeInfos[i].mId; - break; - } - } - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_0700 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - devicesmgr.mount({ - volId: mId, - success: function () { - console.log('DSM_JS_ERROR_0700 call mount success'); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_0700 call mount fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_0800 - * @tc.name DSM_JS_ERROR_0800 - * @tc.desc Verify that volId is empty - */ - it('DSM_JS_ERROR_0800', 0, function () { - devicesmgr.findVolumeById({ - volId: '', - success: function () { - console.log('DSM_JS_ERROR_0800 call findVolumeById success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_0800 call findVolumeById pass, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_0900 - * @tc.name DSM_JS_ERROR_0900 - * @tc.desc Invalid volId validation - */ - it('DSM_JS_ERROR_0900', 0, function () { - devicesmgr.findVolumeById({ - volId: '1234', - success: function () { - console.log('DSM_JS_ERROR_0900 call findVolumeById success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_0900 call findVolumeById pass, code: ' + code + ', data: ' + data); - expect(code == 300).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_1000 - * @tc.name DSM_JS_ERROR_1000 - * @tc.desc Verify that volumeUuid is null - */ - it('DSM_JS_ERROR_1000', 0, function () { - devicesmgr.findVolumeByUuid({ - volumeUuid: '', - success: function () { - console.log('DSM_JS_ERROR_1000 call findVolumeByUuid success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_1000 call findVolumeByUuid pass, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_1100 - * @tc.name DSM_JS_ERROR_1100 - * @tc.desc Invalid volumeUuid validation - */ - it('DSM_JS_ERROR_1100', 0, function () { - devicesmgr.findVolumeByUuid({ - volumeUuid: '321', - success: function () { - console.log('DSM_JS_ERROR_1100 call findVolumeByUuid success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_1100 call findVolumeByUuid pass, code: ' + code + ', data: ' + data); - expect(code == 300).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_1200 - * @tc.name DSM_JS_ERROR_1200 - * @tc.desc Verify that diskId is empty - */ - it('DSM_JS_ERROR_1200', 0, function () { - devicesmgr.findDiskById({ - diskId: '', - success: function () { - console.log('DSM_JS_ERROR_1200 call findDiskById success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_1200 call findDiskById pass, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_1300 - * @tc.name DSM_JS_ERROR_1300 - * @tc.desc Invalid DiskID verified - */ - it('DSM_JS_ERROR_1300', 0, function () { - devicesmgr.findDiskById({ - diskId: '789', - success: function () { - console.log('DSM_JS_ERROR_1300 call findDiskById success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_1300 call findDiskById pass, code: ' + code + ', data: ' + data); - expect(code == 300).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_1400 - * @tc.name DSM_JS_ERROR_1400 - * @tc.desc Verify that the value of the incoming simulate collection is null - */ - it('DSM_JS_ERROR_1400', 0, function () { - devicesmgr.findPrivateForEmulate({ - emuVol: { - mId: '', - mDiskId: '', - mPartGuid: '', - mFsUuid: '', - mType: '', - mMountFlags: '', - mMountUserId: '', - mState: '', - mPath: '', - mInternalPath: '', - mFsLabel: '', - Description: '', - IsVisibleForUser: '', - IsEmulated: '', - IsPrimaryEmulatedForUser: '', - IsRemovable: '', - IsPrimary: '' - }, - success: function () { - console.log('DSM_JS_ERROR_1400 call findPrivateForEmulate success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_1400 call findPrivateForEmulate pass, code: ' + code + ', data: ' + data); - expect(code == 300).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_1500 - * @tc.name DSM_JS_ERROR_1500 - * @tc.desc Verify that an invalid simulate set value was passed in - */ - it('DSM_JS_ERROR_1500', 0, function () { - devicesmgr.findPrivateForEmulate({ - emuVol: { - mId: '1234', - mDiskId: '321', - mPartGuid: '1357', - mFsUuid: '7890', - mType: 2, - mMountFlags: 3, - mMountUserId: 0, - mState: 6, - mPath: '/storage/emulated', - mInternalPath: '/data/media', - mFsLabel: '123', - Description: true, - IsVisibleForUser: true, - IsEmulated: true, - IsPrimaryEmulatedForUser: true, - IsRemovable: true, - IsPrimary: true - }, - success: function () { - console.log('DSM_JS_ERROR_1500 call findPrivateForEmulate success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_1500 call findPrivateForEmulate pass, code: ' + code + ', data: ' + data); - expect(code == 300).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_1600 - * @tc.name DSM_JS_ERROR_1600 - * @tc.desc Verify that the value of the incoming private collection is empty - */ - it('DSM_JS_ERROR_1600', 0, function () { - devicesmgr.findEmulateForPrivate({ - priVol: { - mId: '', - mDiskId: '', - mPartGuid: '', - mFsUuid: '', - mType: '', - mMountFlags: '', - mMountUserId: '', - mState: '', - mPath: '', - mInternalPath: '', - mFsLabel: '', - Description: '', - IsVisibleForUser: '', - IsEmulated: '', - IsPrimaryEmulatedForUser: '', - IsRemovable: '', - IsPrimary: '' - }, - success: function () { - console.log('DSM_JS_ERROR_1600 call findEmulateForPrivate success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_1600 call findEmulateForPrivate pass, code: ' + code + ', data: ' + data); - expect(code == 300).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_1700 - * @tc.name DSM_JS_ERROR_1700 - * @tc.desc Verify that an invalid private collection value was passed in - */ - it('DSM_JS_ERROR_1700', 0, function () { - devicesmgr.findEmulateForPrivate({ - priVol: { - mId: '1234', - mDiskId: '321', - mPartGuid: '456', - mFsUuid: '789', - mType: 1, - mMountFlags: 0, - mMountUserId: 0, - mState: 2, - mPath: 'data', - mInternalPath: '', - mFsLabel: '', - Description: true, - IsVisibleForUser: true, - IsEmulated: true, - IsPrimaryEmulatedForUser: true, - IsRemovable: true, - IsPrimary: true - }, - success: function () { - console.log('DSM_JS_ERROR_1700 call findEmulateForPrivate success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_1700 call findEmulateForPrivate pass, code: ' + code + ', data: ' + data); - expect(code == 300).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_1800 - * @tc.name DSM_JS_ERROR_1800 - * @tc.desc Verify that the vol set value is empty - */ - it('DSM_JS_ERROR_1800', 0, function () { - devicesmgr.getBestVolumeDescription({ - vol: { - mId: '', - mDiskId: '', - mPartGuid: '', - mFsUuid: '', - mType: '', - mMountFlags: '', - mMountUserId: '', - mState: '', - mPath: '', - mInternalPath: '', - mFsLabel: '', - Description: '', - IsVisibleForUser: '', - IsEmulated: '', - IsPrimaryEmulatedForUser: '', - IsRemovable: '', - IsPrimary: '' - }, - success: function () { - console.log('DSM_JS_ERROR_1800 call getBestVolumeDescription success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_1800 call getBestVolumeDescription pass, code: ' + code + ', data: ' + data); - expect(code == 300).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_DSM_JS_ERROR_1900 - * @tc.name DSM_JS_ERROR_1900 - * @tc.desc Validate invalid vol set value - */ - it('DSM_JS_ERROR_1900', 0, function () { - devicesmgr.getBestVolumeDescription({ - vol: { - mId: 'public:177,25', - mDiskId: 'disk:178,24', - mPartGuid: '', - mFsUuid: 'd87ba2fe-828f-4237-8006-c6dc6c2910e7', - mType: 0, - mMountFlags: 2, - mMountUserId: 0, - mState: 2, - mPath: '/storage/d87ba2fe-828f-4237-8006-c6dc6c2910e7', - mInternalPath: '/data/ss/d87ba2fe-828f-4237-8006-c6dc6c2910e7', - mFsLabel: '', - Description: true, - IsVisibleForUser: true, - IsEmulated: true, - IsPrimaryEmulatedForUser: true, - IsRemovable: true, - IsPrimary: true - }, - success: function () { - console.log('DSM_JS_ERROR_1900 call getBestVolumeDescription success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('DSM_JS_ERROR_1900 call getBestVolumeDescription pass, code: ' + code + ', data: ' + data); - expect(code == 300).assertTrue(); - }, - }) - }) - -}) diff --git a/storage/storagedsmjstest/src/main/js/default/test/List.test.js b/storage/storagedsmjstest/src/main/js/default/test/List.test.js deleted file mode 100644 index 8435a4c99..000000000 --- a/storage/storagedsmjstest/src/main/js/default/test/List.test.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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('./Dsm.test.js') -require('./DsmError.test.js') diff --git a/storage/storagedsmjstest/src/main/resources/base/element/string.json b/storage/storagedsmjstest/src/main/resources/base/element/string.json deleted file mode 100644 index 4b5a8bbc0..000000000 --- a/storage/storagedsmjstest/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "storagefilestabilityjstest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/storage/storagedsmjstest/src/main/resources/base/media/icon.png b/storage/storagedsmjstest/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&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jiFwa!eE^p8jc$sy$vB+8i25lI~6KPFFh$!o$avA~rj#L6xvR|Z83 z*WD6T9e+5Pyy=F+)pNTf{ny3cy>7Rkd3o*TS?TZJ`NS^NF2%HMkyS{?uJ$`!P4_L^ z1`NFDUbNyg_qREifgktnp1_v{Jbb`7m}2PTyUdOmtJj~m z9bB=ecw4_^rw1IW=of+>nrW5=d3k`3qHCxsIN_F{T1A545};;+fsyC&qChi+YV zr~M63H8ZLCPYmsjY>ls9cL%I)F|JIW-#+48$+lD4k*(P*kDM%zx_fvu4u5ZYUnI}5 zdrycFq>xFU)&X3p@pP2u%$o}}YcRn(MhJ&B2o?KS@cIVz>Ye%o^xV?CB{_Qhu z;}_q1bvO^g{8<3!gYbo4Di{8qzV+(9 zdlmksohQmRTs@qB;(Wo?dER_ux6XQb@q$tQPW?CMu6GVQd;R=iR;-S{Kr%Zks7>b1 zNs{|-+jhObYE}NR&`TGGr^h^4bjh%c>R#@=8nM&Md>_a+zVulsl;){flFekV1t9ob z+SqfV_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b diff --git a/storage/storagedsmstabilityjstest/src/main/config.json b/storage/storagedsmstabilityjstest/src/main/config.json deleted file mode 100644 index 9b7cfe5d0..000000000 --- a/storage/storagedsmstabilityjstest/src/main/config.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "app": { - "bundleName": "ohos.acts.stroage.fileio", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5 - } - }, - "deviceConfig": {}, - "module": { - "package": "ohos.acts.stroage.fileio", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "ohos.acts.stroage.fileio.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/storage/storagedsmstabilityjstest/src/main/js/default/app.js b/storage/storagedsmstabilityjstest/src/main/js/default/app.js deleted file mode 100644 index 60ee141c8..000000000 --- a/storage/storagedsmstabilityjstest/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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('ohos.acts.distributeddatamgr.distributedfile onCreate'); - }, - onDestroy() { - console.info('ohos.acts.distributeddatamgr.distributedfile onCreate'); - } -}; diff --git a/storage/storagedsmstabilityjstest/src/main/js/default/i18n/en-US.json b/storage/storagedsmstabilityjstest/src/main/js/default/i18n/en-US.json deleted file mode 100644 index ead52ed2e..000000000 --- a/storage/storagedsmstabilityjstest/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "Test" - } -} \ No newline at end of file diff --git a/storage/storagedsmstabilityjstest/src/main/js/default/i18n/zh-CN.json b/storage/storagedsmstabilityjstest/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index 3f48f2585..000000000 --- a/storage/storagedsmstabilityjstest/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "测试" - } -} \ No newline at end of file diff --git a/storage/storagedsmstabilityjstest/src/main/js/default/pages/index/index.css b/storage/storagedsmstabilityjstest/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda79275..000000000 --- a/storage/storagedsmstabilityjstest/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/storage/storagedsmstabilityjstest/src/main/js/default/pages/index/index.hml b/storage/storagedsmstabilityjstest/src/main/js/default/pages/index/index.hml deleted file mode 100644 index f64b040a5..000000000 --- a/storage/storagedsmstabilityjstest/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/storage/storagedsmstabilityjstest/src/main/js/default/pages/index/index.js b/storage/storagedsmstabilityjstest/src/main/js/default/pages/index/index.js deleted file mode 100644 index f7894a722..000000000 --- a/storage/storagedsmstabilityjstest/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 {Core} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: '' - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - require('../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/storage/storagedsmstabilityjstest/src/main/js/default/test/Common.js b/storage/storagedsmstabilityjstest/src/main/js/default/test/Common.js deleted file mode 100644 index e94e7f404..000000000 --- a/storage/storagedsmstabilityjstest/src/main/js/default/test/Common.js +++ /dev/null @@ -1,180 +0,0 @@ -/* - * 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 fileio from '@system.fileio' -export const FILE_CONTENT = 'hello world' -export function prepareFile(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o666) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareFile1(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareEmptyFile(fpath) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function fileToReadOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o444) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadOnly for ' + e); - return false - } -} -export function fileToWriteOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o2) - fileio.fchmodSync(fd, 0o222) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToWriteOnly ' + e) - return false - } -} -export function fileToReadAndWrite(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o777) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadAndWrite ' + e); - return false - } -} -export function filePickerName(testName,deviceID) { - const BASE_PATH = '/data/ss/'+deviceID+'/fms_test/' - return BASE_PATH + testName -} -export function appName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/' - return BASE_PATH + testName -} -export function nextFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/cache/' - return BASE_PATH + testName -} -export function fileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/' - return BASE_PATH + testName -} -export function cacheFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/cache/' - return BASE_PATH + testName -} -export function differentFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/' - return BASE_PATH + testName -} -export function differentCacheName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/cache/' - return BASE_PATH + testName -} -export function fmsFileName(testName) { - const BASE_PATH = "/data/accounts/account_0/appdata/ohos.acts.test/files/" - return BASE_PATH + testName -} -export function fmsCacheName(testName) { - const BASE_PATH = "/data/accounts/account_0/appdata/ohos.acts.test/cache/" - return BASE_PATH + testName -} - -export function getFileTextLen(fpath) { - let ss - try { - ss = fileio.Stream.createStreamSync(fpath, 'r+') - expect(ss !== null).assertTrue() - let len = ss.readSync(new ArrayBuffer(4096)) - console.log('file:' + fpath) - console.log('file lenth:' + len) - expect(ss.closeSync() !== null).assertTrue() - return len - } - catch (e) { - console.log('Failed to getFileTextLen ' + e) - expect(ss.closeSync() == null).assertTrue() - return null - } -} -export function isFileExist(fpath) { - try { - expect(fileio.accessSync(fpath) !== null).assertTrue() - console.log('file:' + fpath) - console.log('status:exist') - return true - } - catch (e) { - console.log('file:' + fpath) - console.log('status:non-existen') - return false - } -} -export function sleep(n) { - var start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > n) { - break; - } - } -} -export function randomString(num) { - let len= num; - var $chars = 'aaaabbbbcccc'; - var maxPos = $chars.length; - var pwd = ''; - for (var i = 0; i < len; i++) { - pwd += $chars.charAt(Math.floor(Math.random() * maxPos)); - } - return pwd; -} diff --git a/storage/storagedsmstabilityjstest/src/main/js/default/test/DsmPerformance.test.js b/storage/storagedsmstabilityjstest/src/main/js/default/test/DsmPerformance.test.js deleted file mode 100644 index 1a5f4dfb9..000000000 --- a/storage/storagedsmstabilityjstest/src/main/js/default/test/DsmPerformance.test.js +++ /dev/null @@ -1,372 +0,0 @@ -/* - * 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 devicesmgr from '@system.devicesmgr'; -import { - describe, - beforeAll, - beforeEach, - afterEach, - afterAll, - it, - expect -} -from 'deccjsunit/index' - -describe('dsmPerformanceTest', function () { - - /** - * @tc.number SUB_STORAGE_DSM_Performance_0000 - * @tc.name DSM_Performance_0000 - * @tc.desc getVolumes Performance test - */ - it('DSM_Performance_0000', 0, function () { - for (let i = 0; i < 1000; i++) { - var start = new Date().getTime(); - devicesmgr.getVolumes({ - success: function (data) { - var end = new Date().getTime(); - console.log('DSM_Performance_0000 call getVolumes success' + JSON.stringify(data)); - console.log('---DSM_Performance_0000---time:-' + (end - start) + '-----' + i); - }, - fail: function (data, code) { - console.log('DSM_Performance_0000 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - } - }); - } - }) - - /** - * @tc.number SUB_STORAGE_DSM_Performance_0100 - * @tc.name DSM_Performance_0100 - * @tc.desc unMount mount Performance test - */ - it('DSM_Performance_0100', 0, function () { - let mId; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_Performance_0100 call getVolumes success' + data); - mId = data.volumeInfos[2].mId; - }, - fail: function (data, code) { - console.log('DSM_Performance_0100 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - for (let i = 0; i < 1000; i++) { - var start = new Date().getTime(); - if (mId != null) { - devicesmgr.unMount({ - volId: mId, - success: function () { - console.log('DSM_Performance_0100 call unMount success.'); - var end = new Date().getTime(); - console.log('---DSM_Performance_0100---time:-' + (end - start) + '-----' + i); - }, - fail: function (data, code) { - console.log('DSM_Performance_0100 call unMount fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - } - }) - var start1 = new Date().getTime(); - devicesmgr.mount({ - volId: mId, - success: function () { - var end1 = new Date().getTime(); - console.log('---DSM_Performance_0200---time:-' + (end1 - start1) + '-----' + i); - }, - fail: function (data, code) { - console.log('DSM_Performance_0200 call mount fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - } else { - expect(null).assertFail(); - } - } - }) - - /** - * @tc.number SUB_STORAGE_DSM_Performance_0300 - * @tc.name DSM_Performance_0300 - * @tc.desc getDisks Performance test - */ - it('DSM_Performance_0300', 0, function () { - for (let i = 0; i < 1000; i++) { - var start = new Date().getTime(); - devicesmgr.getDisks({ - success: function (data) { - console.log('DSM_Performance_0300 call getDisks success.' + JSON.stringify(data)); - var end = new Date().getTime(); - console.log('---DSM_Performance_0300---time:-' + (end - start) + '-----' + i); - }, - fail: function (data, code) { - console.log('DSM_Performance_0300 call getDisks fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - } - }) - - /** - * @tc.number SUB_STORAGE_DSM_Performance_0400 - * @tc.name DSM_Performance_0400 - * @tc.desc findVolumeById Performance test - */ - it('DSM_Performance_0400', 0, function () { - for (let i = 0; i < 1000; i++) { - let mId; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_Performance_0400 call getVolumes success' + JSON.stringify(data)); - mId = data.volumeInfos[2].mId; - }, - fail: function (data, code) { - console.log('DSM_Performance_0400 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - var start = new Date().getTime(); - devicesmgr.findVolumeById({ - volId: mId, - success: function (data) { - console.log('DSM_Performance_0400 call findVolumeById success' + JSON.stringify(data)) - var end = new Date().getTime(); - console.log('---DSM_Performance_0400---time:-' + (end - start) + '-----' + i); - }, - fail: function (data, code) { - console.log('DSM_Performance_0400 call findVolumeById fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - } - }) - - /** - * @tc.number SUB_STORAGE_DSM_Performance_0500 - * @tc.name DSM_Performance_0500 - * @tc.desc findVolumeByUuid Performance test - */ - it('DSM_Performance_0500', 0, function () { - let mFsUuid; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_Performance_0500 call getVolumes success' + JSON.stringify(data)); - mFsUuid = data.volumeInfos[2].mFsUuid; - }, - fail: function (data, code) { - console.log('DSM_Performance_0500 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - for (let i = 0; i < 1000; i++) { - var start = new Date().getTime(); - devicesmgr.findVolumeByUuid({ - volumeUuid: mFsUuid, - success: function (vol) { - console.log('DSM_Performance_0500 call findVolumeByUuid success' + JSON.stringify(vol)); - var end = new Date().getTime(); - console.log('---DSM_Performance_0500---time:-' + (end - start) + '-----' + i); - }, - fail: function (data, code) { - console.log('DSM_Performance_0500 call findVolumeByUuid fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - } - }) - - /** - * @tc.number SUB_STORAGE_DSM_Performance_0600 - * @tc.name DSM_Performance_0600 - * @tc.desc getWritableVolumes Performance test - */ - it('DSM_Performance_0600', 0, function () { - for (let i = 0; i < 1000; i++) { - var start = new Date().getTime(); - devicesmgr.getWritableVolumes({ - success: function (data) { - console.log('DSM_Performance_0600 call getWritableVolumes success. data:' + JSON.stringify(data)); - var end = new Date().getTime(); - console.log('---DSM_Performance_0600---time:-' + (end - start) + '-----' + i); - }, - fail: function (data, code) { - console.log('DSM_Performance_0600 call getWritableVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - }) - - /** - * @tc.number SUB_STORAGE_DSM_Performance_0700 - * @tc.name DSM_Performance_0700 - * @tc.desc findDiskById Performance test - */ - it('DSM_Performance_0700', 0, function () { - let mDiskId; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_Performance_0700 call getVolumes success' + JSON.stringify(data)); - mDiskId = data.volumeInfos[2].mDiskId; - }, - fail: function (data, code) { - console.log('DSM_Performance_0700 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - for (let i = 0; i < 1000; i++) { - var start = new Date().getTime(); - devicesmgr.findDiskById({ - diskId: mDiskId, - success: function (disk) { - console.log('DSM_Performance_0700 call findDiskById success' + JSON.stringify(disk)) - var end = new Date().getTime(); - console.log('---DSM_Performance_0700---time:-' + (end - start) + '-----' + i); - }, - fail: function (data, code) { - console.log('DSM_Performance_0700 call findDiskById fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - } - }) - - /** - * @tc.number SUB_STORAGE_DSM_Performance_0800 - * @tc.name DSM_Performance_0800 - * @tc.desc getPrimaryStorageUuid Performance test - */ - it('DSM_Performance_0800', 0, function () { - for (let i = 0; i < 1000; i++) { - var start = new Date().getTime(); - devicesmgr.getPrimaryStorageUuid({ - success: function (primaryUuid) { - console.log('DSM_Performance_0800 call getPrimaryStorageUuid success.' + JSON.stringify(primaryUuid)); - var end = new Date().getTime(); - console.log('---DSM_Performance_0800---time:-' + (end - start) + '-----' + i); - }, - fail: function (data, code) { - console.log('DSM_Performance_0800 call getPrimaryStorageUuid fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - }) - - /** - * @tc.number SUB_STORAGE_DSM_Performance_0900 - * @tc.name DSM_Performance_0900 - * @tc.desc findPrivateForEmulate Performance test - */ - it('DSM_Performance_0900', 0, function () { - let emuVol; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_Performance_0900 call getVolumes success' + JSON.stringify(data)); - emuVol = data.volumeInfos[0] - }, - fail: function (data, code) { - console.log('DSM_Performance_0900 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - for (let i = 0; i < 1000; i++) { - var start = new Date().getTime(); - devicesmgr.findPrivateForEmulate({ - emuVol: emuVol, - success: function (priVol) { - console.log('DSM_Performance_0900 call findPrivateForEmulate success' + JSON.stringify(priVol)) - var end = new Date().getTime(); - console.log('---DSM_Performance_0900---time:-' + (end - start) + '-----' + i); - }, - fail: function (data, code) { - console.log('DSM_Performance_0900 call findPrivateForEmulate fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - } - }) - - /** - * @tc.number SUB_STORAGE_DSM_Performance_1000 - * @tc.name DSM_Performance_1000 - * @tc.desc findPrivateForEmulate Performance test - */ - it('DSM_Performance_1000', 0, function () { - let emuVol ; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_Performance_1000 call getVolumes success' + JSON.stringify(data)); - emuVol = data.volumeInfos[1] - }, - fail: function (data, code) { - console.log('DSM_Performance_1000 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - for (let i = 0; i < 1000; i++) { - var start = new Date().getTime(); - devicesmgr.findEmulateForPrivate({ - priVol: emuVol, - success: function (emuVol) { - console.log('DSM_Performance_1000 call findEmulateForPrivate success' + JSON.stringify(emuVol)) - var end = new Date().getTime(); - console.log('---DSM_Performance_1000---time:-' + (end - start) + '-----' + i); - }, - fail: function (data, code) { - console.log('DSM_Performance_1000 call findEmulateForPrivate fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - } - }) - - /** - * @tc.number SUB_STORAGE_DSM_Performance_1100 - * @tc.name DSM_Performance_1100 - * @tc.desc findPrivateForEmulate Performance test - */ - it('DSM_Performance_1100', 0, function () { - let emuVol; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_Performance_1100 call getVolumes success' + JSON.stringify(data)); - emuVol = data.volumeInfos[2] - }, - fail: function (data, code) { - console.log('DSM_Performance_1100 call getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - for (let i = 0; i < 1000; i++) { - var start = new Date().getTime(); - devicesmgr.getBestVolumeDescription({ - vol: emuVol, - success: function (desCription) { - console.log('DSM_JS_Function_1100 call getBestVolumeDescription success' + desCription) - var end = new Date().getTime(); - console.log('---DSM_Performance_1100---time:-' + (end - start) + '-----' + i); - }, - fail: function (data, code) { - console.log('DSM_JS_Function_1100 call getBestVolumeDescription fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - } - }) - -}) diff --git a/storage/storagedsmstabilityjstest/src/main/js/default/test/DsmReliability.test.js b/storage/storagedsmstabilityjstest/src/main/js/default/test/DsmReliability.test.js deleted file mode 100644 index aa6139bc7..000000000 --- a/storage/storagedsmstabilityjstest/src/main/js/default/test/DsmReliability.test.js +++ /dev/null @@ -1,224 +0,0 @@ -/* - * 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 devicesmgr from '@system.devicesmgr'; -import { - describe, - beforeAll, - beforeEach, - afterEach, - afterAll, - it, - expect -} -from 'deccjsunit/index' -describe('dsmReliabilityTest', function () { - - /** - * @tc.number SUB_STORAGE_DSM_Reliability_0000 - * @tc.name DSM_Reliability_0000 - * @tc.desc Reliability test - */ - it('DSM_Reliability_0000', 0, function () { - for (let i = 0; i < 100000; i++) { - let mId; - let mFsUuid; - let mDiskId; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_Reliability_0000 getVolumes success' + JSON.stringify(data) + i); - mId = data.volumeInfos[2].mId; - mFsUuid = data.volumeInfos[2].mFsUuid; - mDiskId = data.volumeInfos[2].mDiskId; - }, - fail: function (data, code) { - console.log('DSM_Reliability_0000 getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - } - }); - devicesmgr.getDisks({ - success: function () { - console.log('DSM_Reliability_0300 getDisks success.' + i); - }, - fail: function (data, code) { - console.log('DSM_Reliability_0300 getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - devicesmgr.findVolumeById({ - volId: mId, - success: function () { - console.log('DSM_Reliability_0400 findVolumeById success' + i) - }, - fail: function (data, code) { - console.log('DSM_Reliability_0400 findVolumeById fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - devicesmgr.findVolumeByUuid({ - volumeUuid: mFsUuid, - success: function () { - console.log('DSM_Reliability_0500 findVolumeByUuid success' + i); - }, - fail: function (data, code) { - console.log('DSM_Reliability_0500 findVolumeByUuid fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - devicesmgr.getWritableVolumes({ - success: function () { - console.log('DSM_Reliability_0600 getWritableVolumes success. data:' + i); - }, - fail: function (data, code) { - console.log('DSM_Reliability_0600 getWritableVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - devicesmgr.findDiskById({ - diskId: mDiskId, - success: function () { - console.log('DSM_Reliability_0700 findDiskById success' + i) - }, - fail: function (data, code) { - console.log('DSM_Reliability_0700 findDiskById fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - devicesmgr.getPrimaryStorageUuid({ - success: function () { - console.log('DSM_Reliability_0800 getPrimaryStorageUuid success.' + i); - }, - fail: function (data, code) { - console.log('DSM_Reliability_0800 getPrimaryStorageUuid fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - devicesmgr.unMount({ - volId: mId, - success: function () { - console.log('DSM_Reliability_0100 unMount success.' + i); - }, - fail: function (data, code) { - console.log('DSM_Reliability_0100 unMount fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - } - }) - devicesmgr.mount({ - volId: mId, - success: function () { - console.log('DSM_Reliability_0200 mount success.' + i); - }, - fail: function (data, code) { - console.log('DSM_Reliability_0200 mount fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - } - }) - - /** - * @tc.number SUB_STORAGE_DSM_Reliability_0900 - * @tc.name DSM_Reliability_0900 - * @tc.desc Reliability test - */ - it('DSM_Reliability_0900', 0, function () { - let emuVol; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_Reliability_0900 getVolumes success'); - emuVol = data.volumeInfos[0] - }, - fail: function (data, code) { - console.log('DSM_Reliability_0900 getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - for (let i = 0; i < 100000; i++) { - devicesmgr.findPrivateForEmulate({ - emuVol: emuVol, - success: function () { - console.log('DSM_Reliability_0900 findPrivateForEmulate success' + i) - }, - fail: function (data, code) { - console.log('DSM_Reliability_0900 findPrivateForEmulate fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - } - }) - - /** - * @tc.number SUB_STORAGE_DSM_Reliability_1000 - * @tc.name DSM_Reliability_1000 - * @tc.desc Reliability test - */ - it('DSM_Reliability_1000', 0, function () { - let emuVol; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_Reliability_1000 getVolumes success'); - emuVol = data.volumeInfos[1] - }, - fail: function (data, code) { - console.log('DSM_Reliability_1000 getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - for (let i = 0; i < 100000; i++) { - devicesmgr.findEmulateForPrivate({ - emuVol: emuVol, - success: function () { - console.log('DSM_Reliability_1000 findPrivateForEmulate success' + i) - }, - fail: function (data, code) { - console.log('DSM_Reliability_1000 findPrivateForEmulate fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - } - }) - - /** - * @tc.number SUB_STORAGE_DSM_Reliability_1100 - * @tc.name DSM_Reliability_1100 - * @tc.desc Reliability test - */ - it('DSM_Reliability_1100', 0, function () { - let vol; - devicesmgr.getVolumes({ - success: function (data) { - console.log('DSM_Reliability_1100 getVolumes success'); - vol = data.volumeInfos[0] - }, - fail: function (data, code) { - console.log('DSM_Reliability_1100 getVolumes fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - for (let i = 0; i < 100000; i++) { - devicesmgr.getBestVolumeDescription({ - vol: vol, - success: function (desCription) { - console.log('DSM_Reliability_1100 call getBestVolumeDescription success' + desCription) - }, - fail: function (data, code) { - console.log('DSM_Reliability_1100 call getBestVolumeDescription fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - } - }) - -}) diff --git a/storage/storagedsmstabilityjstest/src/main/js/default/test/List.test.js b/storage/storagedsmstabilityjstest/src/main/js/default/test/List.test.js deleted file mode 100644 index 79bcbec42..000000000 --- a/storage/storagedsmstabilityjstest/src/main/js/default/test/List.test.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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('./DsmPerformance.test.js') -require('./DsmReliability.test.js') diff --git a/storage/storagedsmstabilityjstest/src/main/resources/base/element/string.json b/storage/storagedsmstabilityjstest/src/main/resources/base/element/string.json deleted file mode 100644 index 4b5a8bbc0..000000000 --- a/storage/storagedsmstabilityjstest/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "storagefilestabilityjstest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/storage/storagedsmstabilityjstest/src/main/resources/base/media/icon.png b/storage/storagedsmstabilityjstest/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4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xE&jodk~tNHwl%LBMMDbrk=(^b diff --git a/storage/storagefileconcurrentjstest/src/main/config.json b/storage/storagefileconcurrentjstest/src/main/config.json deleted file mode 100644 index 9b7cfe5d0..000000000 --- a/storage/storagefileconcurrentjstest/src/main/config.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "app": { - "bundleName": "ohos.acts.stroage.fileio", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5 - } - }, - "deviceConfig": {}, - "module": { - "package": "ohos.acts.stroage.fileio", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "ohos.acts.stroage.fileio.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/storage/storagefileconcurrentjstest/src/main/js/default/app.js b/storage/storagefileconcurrentjstest/src/main/js/default/app.js deleted file mode 100644 index 60ee141c8..000000000 --- a/storage/storagefileconcurrentjstest/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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('ohos.acts.distributeddatamgr.distributedfile onCreate'); - }, - onDestroy() { - console.info('ohos.acts.distributeddatamgr.distributedfile onCreate'); - } -}; diff --git a/storage/storagefileconcurrentjstest/src/main/js/default/i18n/en-US.json b/storage/storagefileconcurrentjstest/src/main/js/default/i18n/en-US.json deleted file mode 100644 index ead52ed2e..000000000 --- a/storage/storagefileconcurrentjstest/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "Test" - } -} \ No newline at end of file diff --git a/storage/storagefileconcurrentjstest/src/main/js/default/i18n/zh-CN.json b/storage/storagefileconcurrentjstest/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index 3f48f2585..000000000 --- a/storage/storagefileconcurrentjstest/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "测试" - } -} \ No newline at end of file diff --git a/storage/storagefileconcurrentjstest/src/main/js/default/pages/index/index.css b/storage/storagefileconcurrentjstest/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda79275..000000000 --- a/storage/storagefileconcurrentjstest/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/storage/storagefileconcurrentjstest/src/main/js/default/pages/index/index.hml b/storage/storagefileconcurrentjstest/src/main/js/default/pages/index/index.hml deleted file mode 100644 index f64b040a5..000000000 --- a/storage/storagefileconcurrentjstest/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/storage/storagefileconcurrentjstest/src/main/js/default/pages/index/index.js b/storage/storagefileconcurrentjstest/src/main/js/default/pages/index/index.js deleted file mode 100644 index 61921cf3b..000000000 --- a/storage/storagefileconcurrentjstest/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 {Core} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: '' - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - require('../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/storage/storagefileconcurrentjstest/src/main/js/default/test/Common.js b/storage/storagefileconcurrentjstest/src/main/js/default/test/Common.js deleted file mode 100644 index c5bc08482..000000000 --- a/storage/storagefileconcurrentjstest/src/main/js/default/test/Common.js +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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 fileio from '@system.fileio' - -export const FILE_CONTENT = 'hello world' - -export function prepareFile(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o666) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareFile1(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareEmptyFile(fpath) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function fileToReadOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o444) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadOnly for ' + e); - return false - } -} -export function fileToWriteOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o2) - fileio.fchmodSync(fd, 0o222) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToWriteOnly ' + e) - return false - } -} -export function fileToReadAndWrite(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o777) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadAndWrite ' + e); - return false - } -} -export function appName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/' - return BASE_PATH + testName -} -export function nextFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/cache/' - return BASE_PATH + testName -} -export function fileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/' - return BASE_PATH + testName -} -export function cacheFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/cache/' - return BASE_PATH + testName -} -export function differentFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/' - return BASE_PATH + testName -} -export function differentCacheName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/cache/' - return BASE_PATH + testName -} - -export function getFileTextLen(fpath) { - let ss - try { - ss = fileio.Stream.createStreamSync(fpath, 'r+') - expect(ss !== null).assertTrue() - let len = ss.readSync(new ArrayBuffer(4096)) - console.log('file:' + fpath) - console.log('file lenth:' + len) - expect(ss.closeSync() !== null).assertTrue() - return len - } - catch (e) { - console.log('Failed to getFileTextLen ' + e) - expect(ss.closeSync() !== null).assertTrue() - return null - } -} -export function isFileExist(fpath) { - try { - expect(fileio.accessSync(fpath) !== null).assertTrue() - console.log('file:' + fpath) - console.log('status:exist') - return true - } - catch (e) { - console.log('file:' + fpath) - console.log('status:non-existen') - return false - } -} -export function sleep(n) { - var start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > n) { - break; - } - } -} -export function randomString(num) { - let len= num; - var $chars = 'aaaabbbbcccc'; - var maxPos = $chars.length; - var pwd = ''; - for (var i = 0; i < len; i++) { - pwd += $chars.charAt(Math.floor(Math.random() * maxPos)); - } - return pwd; -} diff --git a/storage/storagefileconcurrentjstest/src/main/js/default/test/FileConcurrent.test.js b/storage/storagefileconcurrentjstest/src/main/js/default/test/FileConcurrent.test.js deleted file mode 100644 index 4a9489e9d..000000000 --- a/storage/storagefileconcurrentjstest/src/main/js/default/test/FileConcurrent.test.js +++ /dev/null @@ -1,474 +0,0 @@ -/* - * 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 fileio from '@system.fileio' -import file from '@system.file'; -import { - describe, - beforeAll, - beforeEach, - afterEach, - afterAll, - it, - expect -} - from 'deccjsunit/index' - -describe('fileconcurrent', function () { - - /** - * @tc.number SUB_STORAGE_file_test_0000 - * @tc.name file_test_0000 Function of API, out of package, Virtual path(create and give 777 authority). - * @tc.desc Function of API, Simultaneous write. - */ - it('file_test_000', 0, async function (done) { - for (let i = 0; i < 10; i++) { - file.writeText({ - uri: 'internal://app/file_test_000', - text: 'Text', - success: function () { - console.log('file_test_000 => pass, call writeText success. '); - done(); - }, - fail: function (data, code) { - console.log('file_test_000 => call writeText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - file.writeText({ - uri: 'internal://app/file_test_000', - text: 'Text1', - success: function () { - console.log('file_test_000 => pass, call writeText success. '); - done(); - }, - fail: function (data, code) { - console.log('file_test_000 => call writeText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - file.writeText({ - uri: 'internal://app/file_test_000', - text: 'Text2', - success: function () { - console.log('file_test_000 => pass, call writeText success. '); - done(); - }, - fail: function (data, code) { - console.log('file_test_000 => call writeText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_File_readText_0100 - * @tc.name file_test_001 - * @tc.desc Function of API Simultaneous reading. - */ - it('file_test_001', 0, async function (done) { - file.writeText({ - uri: 'internal://app/file_test_001', - text: 'Text', - success: function () { - console.log('file_test_001 call writeText success.'); - done(); - }, - fail: function (data, code) { - console.log('file_test_001 call writeText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - for (let i = 0; i < 10; i++) { - file.readText({ - uri: 'internal://app/file_test_001', - success: function () { - console.log('file_test_001 => pass, call readText success. data.text: ' ); - done(); - }, - fail: function (data, code) { - console.log('file_test_001 => call readText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - file.readText({ - uri: 'internal://app/file_test_001', - success: function () { - console.log('file_test_001 => pass, call readText success. data.text: ' ); - done(); - }, - fail: function (data, code) { - console.log('file_test_001 => call readText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - file.readText({ - uri: 'internal://app/file_test_001', - success: function () { - console.log('file_test_001 => pass, call readText success. data.text: ' ); - done(); - }, - fail: function (code, data) { - console.log('file_test_001 => call readText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_file_test_0200 - * @tc.name file_test_002 - * @tc.desc Function of API Simultaneous copying. - */ - it('file_test_002', 0, async function (done) { - file.writeText({ - uri: 'internal://app/file_test_002', - text: 'Text', - append: true, - success: function () { - console.log('file_test_002 call writeText success.'); - done(); - }, - fail: function (data, code) { - console.log('file_test_002 call writeText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - for (let i = 0; i < 10; i++) { - file.copy({ - srcUri: 'internal://app/file_test_002', - dstUri: 'internal://app/file_test_002', - success: function () { - console.log('file_test_002 => pass,call copy success. uri:' ); - done(); - }, - fail: function (data, code) { - console.log('file_test_002 => call copy fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - file.copy({ - srcUri: 'internal://app/file_test_002', - dstUri: 'internal://app/file_test_002' + '100', - success: function () { - console.log('file_test_002 => pass,call copy success. uri:' ); - done(); - }, - fail: function (data, code) { - console.log('file_test_002 => call copy fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - file.copy({ - srcUri: 'internal://app/file_test_002', - dstUri: 'internal://app/file_test_002' + '200', - success: function () { - console.log('file_test_002 => pass,call copy success. uri:' ); - done(); - }, - fail: function (data, code) { - console.log('file_test_002 => call copy fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_file_test_0300 - * @tc.name file_test_003 - * @tc.desc Function of API, Move files while writing to them continuously - */ - it('file_test_003', 0, async function (done) { - for (let i = 0; i < 10; i++) { - file.writeText({ - uri: 'internal://app/file_test_003', - text: 'Text', - append: true, - success: function () { - console.log('file_test_003 => pass,call writeText success.'); - done(); - }, - fail: function (data, code) { - console.log('file_test_003 => call writeText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - file.move({ - srcUri: 'internal://app/file_test_003', - dstUri: 'internal://file_test_003', - success: function () { - console.log('file_test_003 => pass,call move success. uri:' ); - done(); - }, - fail: function (data, code) { - console.log('file_test_003 =>call move fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_file_test_0400 - * @tc.name file_test_004 - * @tc.desc Function of API,Continuous reading - */ - it('file_test_004', 0, async function (done) { - let buf = new Uint8Array([48, 49, 50, 51, 65, 66, 67, 68, 32, 33]); - file.writeArrayBuffer({ - uri: 'internal://app/file_test_004', - buffer: buf, - success: function () { - console.log('file_test_004 call writeArrayBuffer success.'); - done(); - }, - fail: function (data, code) { - console.error('file_test_004 call writeArrayBuffer fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - for (let i = 0; i < 10; i++) { - file.readArrayBuffer({ - uri: 'internal://app/file_test_004', - success: function () { - console.log('file_test_004 => pass,call readArrayBuffer success. '); - done(); - }, - fail: function (data, code) { - console.log('file_test_004 => call readArrayBuffer fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - file.readArrayBuffer({ - uri: 'internal://app/file_test_004', - success: function () { - console.log('file_test_004 => pass,call readArrayBuffer success. '); - done(); - }, - fail: function (data, code) { - console.log('file_test_004 => call readArrayBuffer fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - file.readArrayBuffer({ - uri: 'internal://app/file_test_004', - success: function () { - console.log('file_test_004 => pass,call readArrayBuffer success. '); - done(); - }, - fail: function (data, code) { - console.log('file_test_004 => call readArrayBuffer fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_file_test_0500 - * @tc.name file_test_005 - * @tc.desc Function of API,Continuous writeing - */ - it('file_test_005', 0, async function (done) { - let buf = new Uint8Array([48, 49, 50, 51, 65, 66, 67, 68, 32, 33]); - for (let i = 0; i < 10; i++) { - file.writeArrayBuffer({ - uri: 'internal://app/file_test_005', - buffer: buf, - success: function () { - console.log('file_test_005 => pass,call writeArrayBuffer success.'); - done(); - }, - fail: function (data, code) { - console.log('file_test_005 => call writeArrayBuffer fail, code: ' + code); - expect(null).assertFail(); - }, - }); - file.writeArrayBuffer({ - uri: 'internal://app/file_test_005', - buffer: buf, - success: function () { - console.log('file_test_005 => pass,call writeArrayBuffer success.'); - done(); - }, - fail: function (data, code) { - console.log('file_test_005 => call writeArrayBuffer fail, code: ' + code); - expect(null).assertFail(); - }, - }); - file.writeArrayBuffer({ - uri: 'internal://app/file_test_005', - buffer: buf, - success: function () { - console.log('file_test_005 => pass,call writeArrayBuffer success.'); - done(); - }, - fail: function (data, code) { - console.log('file_test_005 => call writeArrayBuffer fail, code: ' + code); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_file_test_0600 - * @tc.name file_test_006 - * @tc.desc Function of API,Write and read simultaneously for one file - */ - it('file_test_006', 0, async function (done) { - for (let i = 0; i < 10; i++) { - file.writeText({ - uri: 'internal://app/file_test_006', - text: 'Text', - success: function () { - console.log('file_test_006 => pass,call writeText success.'); - done(); - }, - fail: function (data, code) { - console.log('file_test_006 => call fail callback fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - file.readText({ - uri: 'internal://app/file_test_006', - success: function () { - console.log('file_test_006 => pass,call readText success: '); - done(); - }, - fail: function (data, code) { - console.log('file_test_006 => call readText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_file_test_0700 - * @tc.name file_test_007 - * @tc.desc Function of API,Write and read simultaneously for one file - */ - it('file_test_007', 0, async function (done) { - let buf = new Uint8Array([48, 49, 50, 51, 65, 66, 67, 68, 32, 33]); - for (let i = 0; i < 10; i++) { - file.writeArrayBuffer({ - uri: 'internal://app/file_test_007', - buffer: buf, - success: function () { - console.log('file_test_007 => pass,call writeArrayBuffer success.'); - done(); - }, - fail: function (data, code) { - console.log('file_test_007 => call writeArrayBuffer fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - file.readArrayBuffer({ - uri: 'internal://app/file_test_007', - success: function () { - console.log('file_test_007 => pass,call readArrayBuffer success: '); - done(); - }, - fail: function (data, code) { - console.log('file_test_007 => call readArrayBuffer fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_file_test_0800 - * @tc.name file_test_008 - * @tc.desc Function of API, Copy files while writing - */ - it('file_test_008', 0, async function (done) { - for (let i = 0; i < 10; i++) { - file.writeText({ - uri: 'internal://app/file_test_008', - text: 'Text', - success: function () { - console.log('file_test_008 => pass, call writeText success.'); - done(); - }, - fail: function (data, code) { - console.log('file_test_008 => call writeText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - file.copy({ - srcUri: 'internal://app/file_test_008', - dstUri: 'internal://app/file_test_008', - success: function () { - console.log('file_test_008 => pass,call copy success. uri:'); - done(); - }, - fail: function (data, code) { - console.log('file_test_008 => call copy fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); -}); diff --git a/storage/storagefileconcurrentjstest/src/main/js/default/test/List.test.js b/storage/storagefileconcurrentjstest/src/main/js/default/test/List.test.js deleted file mode 100644 index af95f8754..000000000 --- a/storage/storagefileconcurrentjstest/src/main/js/default/test/List.test.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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('./FileConcurrent.test.js') diff --git a/storage/storagefileconcurrentjstest/src/main/resources/base/element/string.json b/storage/storagefileconcurrentjstest/src/main/resources/base/element/string.json deleted file mode 100644 index 7c3790708..000000000 --- a/storage/storagefileconcurrentjstest/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "storagefileconcurrentjstest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/storage/storagefileconcurrentjstest/src/main/resources/base/media/icon.png b/storage/storagefileconcurrentjstest/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=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ZLCPYmsjY>ls9cL%I)F|JIW-#+48$+lD4k*(P*kDM%zx_fvu4u5ZYUnI}5 zdrycFq>xFU)&X3p@pP2u%$o}}YcRn(MhJ&B2o?KS@cIVz>Ye%o^xV?CB{_Qhu z;}_q1bvO^g{8<3!gYbo4Di{8qzV+(9 zdlmksohQmRTs@qB;(Wo?dER_ux6XQb@q$tQPW?CMu6GVQd;R=iR;-S{Kr%Zks7>b1 zNs{|-+jhObYE}NR&`TGGr^h^4bjh%c>R#@=8nM&Md>_a+zVulsl;){flFekV1t9ob z+SqfV_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b diff --git a/storage/storagefileioperformancejstest/src/main/config.json b/storage/storagefileioperformancejstest/src/main/config.json deleted file mode 100644 index 9b7cfe5d0..000000000 --- a/storage/storagefileioperformancejstest/src/main/config.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "app": { - "bundleName": "ohos.acts.stroage.fileio", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5 - } - }, - "deviceConfig": {}, - "module": { - "package": "ohos.acts.stroage.fileio", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "ohos.acts.stroage.fileio.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/storage/storagefileioperformancejstest/src/main/js/default/app.js b/storage/storagefileioperformancejstest/src/main/js/default/app.js deleted file mode 100644 index 60ee141c8..000000000 --- a/storage/storagefileioperformancejstest/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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('ohos.acts.distributeddatamgr.distributedfile onCreate'); - }, - onDestroy() { - console.info('ohos.acts.distributeddatamgr.distributedfile onCreate'); - } -}; diff --git a/storage/storagefileioperformancejstest/src/main/js/default/i18n/en-US.json b/storage/storagefileioperformancejstest/src/main/js/default/i18n/en-US.json deleted file mode 100644 index ead52ed2e..000000000 --- a/storage/storagefileioperformancejstest/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "Test" - } -} \ No newline at end of file diff --git a/storage/storagefileioperformancejstest/src/main/js/default/i18n/zh-CN.json b/storage/storagefileioperformancejstest/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index 3f48f2585..000000000 --- a/storage/storagefileioperformancejstest/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "测试" - } -} \ No newline at end of file diff --git a/storage/storagefileioperformancejstest/src/main/js/default/pages/index/index.css b/storage/storagefileioperformancejstest/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda79275..000000000 --- a/storage/storagefileioperformancejstest/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/storage/storagefileioperformancejstest/src/main/js/default/pages/index/index.hml b/storage/storagefileioperformancejstest/src/main/js/default/pages/index/index.hml deleted file mode 100644 index f64b040a5..000000000 --- a/storage/storagefileioperformancejstest/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/storage/storagefileioperformancejstest/src/main/js/default/pages/index/index.js b/storage/storagefileioperformancejstest/src/main/js/default/pages/index/index.js deleted file mode 100644 index 61921cf3b..000000000 --- a/storage/storagefileioperformancejstest/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 {Core} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: '' - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - require('../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/storage/storagefileioperformancejstest/src/main/js/default/test/Common.js b/storage/storagefileioperformancejstest/src/main/js/default/test/Common.js deleted file mode 100644 index c5bc08482..000000000 --- a/storage/storagefileioperformancejstest/src/main/js/default/test/Common.js +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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 fileio from '@system.fileio' - -export const FILE_CONTENT = 'hello world' - -export function prepareFile(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o666) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareFile1(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareEmptyFile(fpath) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function fileToReadOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o444) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadOnly for ' + e); - return false - } -} -export function fileToWriteOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o2) - fileio.fchmodSync(fd, 0o222) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToWriteOnly ' + e) - return false - } -} -export function fileToReadAndWrite(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o777) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadAndWrite ' + e); - return false - } -} -export function appName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/' - return BASE_PATH + testName -} -export function nextFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/cache/' - return BASE_PATH + testName -} -export function fileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/' - return BASE_PATH + testName -} -export function cacheFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/cache/' - return BASE_PATH + testName -} -export function differentFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/' - return BASE_PATH + testName -} -export function differentCacheName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/cache/' - return BASE_PATH + testName -} - -export function getFileTextLen(fpath) { - let ss - try { - ss = fileio.Stream.createStreamSync(fpath, 'r+') - expect(ss !== null).assertTrue() - let len = ss.readSync(new ArrayBuffer(4096)) - console.log('file:' + fpath) - console.log('file lenth:' + len) - expect(ss.closeSync() !== null).assertTrue() - return len - } - catch (e) { - console.log('Failed to getFileTextLen ' + e) - expect(ss.closeSync() !== null).assertTrue() - return null - } -} -export function isFileExist(fpath) { - try { - expect(fileio.accessSync(fpath) !== null).assertTrue() - console.log('file:' + fpath) - console.log('status:exist') - return true - } - catch (e) { - console.log('file:' + fpath) - console.log('status:non-existen') - return false - } -} -export function sleep(n) { - var start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > n) { - break; - } - } -} -export function randomString(num) { - let len= num; - var $chars = 'aaaabbbbcccc'; - var maxPos = $chars.length; - var pwd = ''; - for (var i = 0; i < len; i++) { - pwd += $chars.charAt(Math.floor(Math.random() * maxPos)); - } - return pwd; -} diff --git a/storage/storagefileioperformancejstest/src/main/js/default/test/FileIOPerformance.js b/storage/storagefileioperformancejstest/src/main/js/default/test/FileIOPerformance.js deleted file mode 100644 index 46903945c..000000000 --- a/storage/storagefileioperformancejstest/src/main/js/default/test/FileIOPerformance.js +++ /dev/null @@ -1,495 +0,0 @@ -/* - * 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 fileio from '@system.fileio' -import { - describe, - it, -} - from 'deccjsunit/index' -import { - FILE_CONTENT, - prepareFile, - nextFileName, - sleep, - randomString -} - from './Common' - -describe('fileTest', function () { - - /** - * @tc.number SUB_STORAGE_fileioPerformance_Dir_Dirent - * @tc.name fileioPerformance_Dir_Dirent - * @tc.desc Dirent Perform 1000 performance tests - */ - it('fileioPerformance_Dir_Dirent', 0, function () { - for (let i = 0; i < 1000; i++) { - let dpath = nextFileName('fileioPerformance_Dir') + 'd' - let fpath = dpath + '/f0' - fileio.mkdirSync(dpath); - prepareFile(fpath, FILE_CONTENT); - let start = new Date().getTime(); - let dd = fileio.opendirSync(dpath); - let end = new Date().getTime(); - let time = end - start; - console.log('fileioPerformance_Dir,opendirSync:' + dd + ', time:' + time + ',' + i); - let start1 = new Date().getTime(); - let dirent = dd.readSync(); - let end1 = new Date().getTime(); - let time1 = end1 - start1; - console.log('fileioPerformance_Dir,readSync:' + dirent + ', time1:' + time1 + ',' + i); - let start5 = new Date().getTime(); - let isBlockDevice = dirent.isBlockDevice(); - let end5 = new Date().getTime(); - let time5 = end5 - start5; - console.log('fileioPerformance_Dirent,isBlockDevice:' + isBlockDevice + ', time5:' + time5 + ',' + i); - let start6 = new Date().getTime(); - let isCharacterDevice = dirent.isCharacterDevice(); - let end6 = new Date().getTime(); - let time6 = end6 - start6; - console.log('fileioPerformance_Dirent,isCharacterDevice:' + isCharacterDevice + ', time6:' + time6 + ',' + i); - let start7 = new Date().getTime(); - let isDirectory = dirent.isDirectory(); - let end7 = new Date().getTime(); - let time7 = end7 - start7; - console.log('fileioPerformance_Dirent,isDirectory:' + isDirectory + ', time7:' + time7 + ',' + i); - let start8 = new Date().getTime(); - let isFIFO = dirent.isFIFO(); - let end8 = new Date().getTime(); - let time8 = end8 - start8; - console.log('fileioPerformance_Dirent,isFIFO:' + isFIFO + ', time8:' + time8 + ',' + i); - let start9 = new Date().getTime(); - let isFile = dirent.isFile(); - let end9 = new Date().getTime(); - let time9 = end9 - start9; - console.log('fileioPerformance_Dirent,isFile:' + isFile + ', time9:' + time9 + ',' + i); - let start1000 = new Date().getTime(); - let isSocket = dirent.isSocket(); - let end1000 = new Date().getTime(); - let time1000 = end1000 - start1000; - console.log('fileioPerformance_Dirent,isSocket:' + isSocket + ', time1000:' + time1000 + ',' + i); - let start12 = new Date().getTime(); - let isSymbolicLink = dirent.isSymbolicLink(); - let end12 = new Date().getTime(); - let time12 = end12 - start12; - console.log('fileioPerformance_Dirent,isSymbolicLink:' + isSymbolicLink + ', time12:' + time12 + ',' + i); - let start2 = new Date().getTime(); - let result = dd.closeSync(); - let end2 = new Date().getTime(); - let time2 = end2 - start2; - console.log('fileioPerformance_Dir,closeSync:' + result + ', time2:' + time2 + ',' + i); - let start3 = new Date().getTime(); - let unlinkSync = fileio.unlinkSync(fpath); - let end3 = new Date().getTime(); - let time3 = end3 - start3; - console.log('fileioPerformance_prop,unlinkSync:' + unlinkSync + ', time3:' + time3 + ',' + i); - let start4 = new Date().getTime(); - let rmdirSync = fileio.rmdirSync(dpath); - let end4 = new Date().getTime(); - let time4 = end4 - start4 - console.log('fileioPerformance_prop,rmdirSync:' + rmdirSync + ', time4:' + time4 + ',' + i); - } - sleep(3000); - }); - - /** - * @tc.number SUB_STORAGE_fileioPerformance_stat - * @tc.name fileioPerformance_stat - * @tc.desc Stat Perform 1000 performance tests - */ - it('fileioPerformance_stat', 0, function () { - for (let i = 0; i < 1000; i++) { - let fpath = nextFileName('fileioPerformance_stat-4k'); - let txt = randomString(4096); - prepareFile(fpath, txt); - let start0 = new Date().getTime(); - let stat = fileio.statSync(fpath); - let end0 = new Date().getTime(); - let time0 = end0 - start0; - console.log('stat,statSync:' + stat + ', time0:' + time0 + ',' + i); - let start = new Date().getTime(); - let isBlockDevice = stat.isBlockDevice(); - let end = new Date().getTime(); - let time = end - start; - console.log('stat,isBlockDevice:' + isBlockDevice + ', time:' + time + ',' + i); - let start1 = new Date().getTime(); - let isCharacterDevice = stat.isCharacterDevice(); - let end1 = new Date().getTime(); - let time1 = end1 - start1; - console.log('stat,isCharacterDevice:' + isCharacterDevice + ', time1:' + time1 + ',' + i); - let start2 = new Date().getTime(); - let isDirectory = stat.isDirectory(); - let end2 = new Date().getTime(); - let time2 = end2 - start2; - console.log('stat,isDirectory:' + isDirectory + ', time2:' + time2 + ',' + i); - let start3 = new Date().getTime(); - let isFIFO = stat.isFIFO(); - let end3 = new Date().getTime(); - let time3 = end3 - start3; - console.log('stat,isFIFO:' + isFIFO + ', time3:' + time3 + ',' + i); - let start4 = new Date().getTime(); - let isFile = stat.isFile(); - let end4 = new Date().getTime(); - let time4 = end4 - start4; - console.log('stat,isFile:' + isFile + ', time4:' + time4 + ',' + i); - let start5 = new Date().getTime(); - let isSocket = stat.isSocket(); - let end5 = new Date().getTime(); - let time5 = end5 - start5; - console.log('stat,isSocket:' + isSocket + ', time5:' + time5 + ',' + i); - let start6 = new Date().getTime(); - let isSymbolicLink = stat.isSymbolicLink(); - let end6 = new Date().getTime(); - let time6 = end6 - start6; - console.log('stat,isSymbolicLink:' + isSymbolicLink + ', time6:' + time6 + ',' + i); - } - sleep(3000); - }); - - /** - * @tc.number SUB_STORAGE_fileioPerformance_prop - * @tc.name fileioPerformance_prop - * @tc.desc Prop Perform 1000 performance tests - */ - it('fileioPerformance_prop', 0, function () { - let dpath = nextFileName('fileioPerformance_Dir') + 'd' - for (let i = 0; i < 1000; i++) { - let start0 = new Date().getTime(); - let mkdirSync = fileio.mkdirSync(dpath + i); - let end0 = new Date().getTime(); - let time0 = end0 - start0; - console.log('fileioPerformance_prop_mkdirSync,mkdirSync:' + mkdirSync + ', time0:' + time0 + ',' + i); - } - for (let i = 0; i < 1000; i++) { - prepareFile(dpath + '999/f0' + i, randomString(4096)); - } - let fd; - for (let i = 0; i < 1000; i++) { - let start = new Date().getTime(); - fd = fileio.openSync(dpath + '999/f0' + i, 0o102, 0o666); - let end = new Date().getTime(); - let time = end - start - console.log('fileioPerformance_prop_openSync,openSync:' + fd + ', time:' + time + ',' + i); - } - for (let i = 0; i < 1000; i++) { - let accessSync; - let start1 = new Date().getTime(); - accessSync = fileio.accessSync(dpath + '999/f0' + i); - let end1 = new Date().getTime(); - let time1 = end1 - start1; - console.log('fileioPerformance_prop_accessSync,accessSync:' + accessSync + ', time1:' + time1 + ',' + i); - } - for (let i = 0; i < 1000; i++) { - let chmodSync; - let start5 = new Date().getTime(); - chmodSync = fileio.chmodSync(dpath + '999/f0' + i, 0o660); - let end5 = new Date().getTime(); - let time5 = end5 - start5; - console.log('fileioPerformance_prop_chmodSync,chmodSync:' + chmodSync + ', time5:' + time5 + ',' + i); - } - let stat = fileio.Stat.statSync(dpath + '999/f0999'); - for (let i = 0; i < 1000; i++) { - let chownSync; - let start6 = new Date().getTime(); - chownSync = fileio.chownSync(dpath + '999/f0' + i, stat.uid, stat.gid); - let end6 = new Date().getTime(); - let time6 = end6 - start6; - console.log('fileioPerformance_prop_chownSync,chownSync:' + chownSync + ', time6:' + time6 + ',' + i); - } - for (let i = 0; i < 1000; i++) { - let copyFileSync; - let start7 = new Date().getTime(); - copyFileSync = fileio.copyFileSync(dpath + '999/f0' + i, dpath + '998/f0' + i); - let end7 = new Date().getTime(); - let time7 = end7 - start7; - console.log('fileioPerformance_prop_copyFileSync,copyFileSync:' + copyFileSync + ', time7:' + time7 + ',' + i); - } - for (let i = 0; i < 1000; i++) { - let fchmodSync; - let start8 = new Date().getTime(); - fchmodSync = fileio.fchmodSync(fd, 0o660); - let end8 = new Date().getTime(); - let time8 = end8 - start8; - console.log('fileioPerformance_prop_fchmodSync,fchmodSync:' + fchmodSync + ', time8:' + time8 + ',' + i); - } - for (let i = 0; i < 1000; i++) { - let fchownSync; - let start9 = new Date().getTime(); - fchownSync = fileio.fchownSync(fd, stat.uid, stat.gid); - let end9 = new Date().getTime(); - let time9 = end9 - start9; - console.log('fileioPerformance_prop_fchownSync,fchownSync:' + fchownSync + ', time9:' + time9 + ',' + i); - } - for (let i = 0; i < 1000; i++) { - let fstatSync; - let start1000 = new Date().getTime(); - fstatSync = fileio.fstatSync(fd); - let end1000 = new Date().getTime(); - let time1000 = end1000 - start1000; - console.log('fileioPerformance_prop_fstatSync,fstatSync:' + fstatSync + ', time1000:' + time1000 + ',' + i); - } - for (let i = 0; i < 1000; i++) { - let ftruncateSync; - let start12 = new Date().getTime(); - ftruncateSync = fileio.ftruncateSync(fd); - let end12 = new Date().getTime(); - let time12 = end12 - start12; - console.log('fileioPerformance_prop_ftruncateSync,:' + ftruncateSync + ', time12:' + time12 + ',' + i); - } - for (let i = 0; i < 1000; i++) { - let renameSync; - let start13 = new Date().getTime(); - renameSync = fileio.renameSync(dpath + '998/f0' + i, dpath + '998/f0' + i + 'a'); - let end13 = new Date().getTime(); - let time13 = end13 - start13; - console.log('fileioPerformance_prop_renameSync,renameSync:' + renameSync + ', time13:' + time13 + ',' + i); - } - for (let i = 0; i < 1000; i++) { - let truncateSync; - let start14 = new Date().getTime(); - truncateSync = fileio.truncateSync(dpath + '998/f0' + i + 'a', 1000); - let end14 = new Date().getTime(); - let time14 = end14 - start14; - console.log('fileioPerformance_prop_truncateSync,truncateSync:' + truncateSync + ', time14:' + time14 + ',' + i); - } - for (let i = 0; i < 1000; i++) { - let fsyncSync; - let start16 = new Date().getTime(); - fsyncSync = fileio.fsyncSync(fd); - let end16 = new Date().getTime(); - let time16 = end16 - start16; - console.log('fileioPerformance_prop_fsyncSync,fsyncSync:' + fsyncSync + ', time16:' + time16 + ',' + i); - } - for (let i = 0; i < 1000; i++) { - let closeSync; - let start2 = new Date().getTime(); - let fd1 = fileio.openSync(dpath + '999/f0' + i, 0o102, 0o666); - closeSync = fileio.closeSync(fd1); - let end2 = new Date().getTime(); - let time2 = end2 - start2; - console.log('fileioPerformance_prop_closeSync,closeSync:' + closeSync + ', time2:' + time2 + ',' + i); - } - sleep(3000); - }); - - /** - * @tc.number SUB_STORAGE_fileioPerformance_prop_write_read - * @tc.name fileioPerformance_prop_write_read - * @tc.desc Prop_write_read Perform 1000 performance tests - */ - it('fileioPerformance_prop_write_read', 0, function () { - for (let i = 0; i < 1000; i++) { - let dpath = nextFileName('prop_write_read') + 'd'; - let fpath = dpath + '/prop_write_read'; - fileio.mkdirSync(dpath); - prepareFile(fpath, 'a'); - let fd = fileio.openSync(fpath, 0o102, 0o666); - let data = randomString(4096); - let start17 = new Date().getTime(); - let writeSync = fileio.writeSync(fd, data); - let end17 = new Date().getTime(); - let time17 = end17 - start17; - console.log('fileioPerformance_prop_write,4K_prop_writeSync:' + writeSync + ', time17:' + time17 + ',' + i); - let readSync; - let start18 = new Date().getTime(); - writeSync = fileio.readSync(fd, new ArrayBuffer(4096)); - let end18 = new Date().getTime(); - let time18 = end18 - start18; - console.log('fileioPerformance_prop_readSync,4K_prop_readSync:' + readSync + ', time18:' + time18 + ',' + i); - fileio.closeSync(fd); - fileio.unlinkSync(fpath); - fileio.rmdirSync(dpath); - } - }); - - /** - * @tc.number SUB_STORAGE_fileioPerformance_stream - * @tc.name fileioPerformance_stream - * @tc.desc Stream Perform 1000 performance tests - */ - it('fileioPerformance_stream', 0, function () { - let fpath = nextFileName('fileioPerformance_stream4K'); - let txt = randomString(4096); - prepareFile(fpath, txt); - for (let i = 0; i < 1000; i++) { - let fd = fileio.openSync(fpath, 0o2); - let start = new Date().getTime(); - let ss = fileio.fdopenStreamSync(fd, 'r+'); - let end = new Date().getTime(); - let time = end - start; - console.log('fileioPerformance_stream,fdopenStreamSync(r+):' + ss + ', time:' + time + ',' + i); - fileio.closeSync(fd); - ss.closeSync(); - } - for (let i = 0; i < 1000; i++) { - let fd0 = fileio.openSync(fpath, 0o2); - let start0 = new Date().getTime(); - let ss0 = fileio.fdopenStreamSync(fd0, 'rb+'); - let end0 = new Date().getTime(); - let time0 = end0 - start0; - console.log('fileioPerformance_stream,fdopenStreamSync(rb+):' + ss0 + ', time0:' + time0 + ',' + i); - fileio.closeSync(fd0); - ss0.closeSync(); - } - for (let i = 0; i < 1000; i++) { - let start1 = new Date().getTime(); - let createFlag0 = fileio.createStreamSync(fpath, 'r+'); - let end1 = new Date().getTime(); - let time1 = end1 - start1; - console.log('fileioPerformance_stream,createStreamSync(r+):' + createFlag0 + ', time1:' + time1 + ',' + i); - createFlag0.closeSync(); - } - for (let i = 0; i < 1000; i++) { - let start2 = new Date().getTime(); - let createFlag = fileio.createStreamSync(fpath, 'rb+'); - let end2 = new Date().getTime(); - let time2 = end2 - start2; - console.log('fileioPerformance_stream,createStreamSync(rb+):' + createFlag + ', time2:' + time2 + ',' + i); - } - for (let i = 0; i < 1000; i++) { - let createFlag = fileio.createStreamSync(fpath, 'r+'); - let start3 = new Date().getTime(); - let readSync = createFlag.readSync(new ArrayBuffer(4096)); - let end3 = new Date().getTime(); - let time3 = end3 - start3 - console.log('fileioPerformance_stream,readSync:' + readSync + ', time3:' + time3 + ',' + i); - createFlag.closeSync(); - } - for (let i = 0; i < 1000; i++) { - let createFlag = fileio.createStreamSync(fpath, 'r+'); - let start4 = new Date().getTime(); - let flushSync = createFlag.flushSync(); - let end4 = new Date().getTime(); - let time4 = end4 - start4 - console.log('fileioPerformance_stream,flushSync:' + flushSync + ', time4:' + time4 + ',' + i); - createFlag.closeSync(); - } - for (let i = 0; i < 1000; i++) { - let createFlag = fileio.createStreamSync(fpath, 'r+'); - let start5 = new Date().getTime(); - let closeSync = createFlag.closeSync(); - let end5 = new Date().getTime(); - let time5 = end5 - start5 - console.log('fileioPerformance_stream,closeSync:' + closeSync + ', time5:' + time5 + ',' + i); - } - sleep(3000); - }); - - /** - * @tc.number SUB_STORAGE_fileioPerformance_stream_write_read - * @tc.name fileioPerformance_stream_write_read - * @tc.desc Stream_write_read Perform 1000 performance tests - */ - it('fileioPerformance_stream_write_read_4K', 0, function () { - let fpath = nextFileName('stream_write_read'); - for (let i = 0; i < 1000; i++) { - let ws = fileio.createStreamSync(fpath, 'w'); - let data = randomString(4096); - let start1 = new Date().getTime(); - let writeSync = ws.writeSync(data); - let end1 = new Date().getTime(); - let time1 = end1 - start1 - console.log('fileioPerformance_stream_write,4K_stream_writeSync:' + writeSync + ', time1:' + time1 + ',' + i); - ws.closeSync(); - } - sleep(3000); - for (let i = 0; i < 1000; i++) { - let rs = fileio.createStreamSync(fpath, 'r'); - let start2 = new Date().getTime(); - let readSync = rs.readSync(new ArrayBuffer(4096)); - let end2 = new Date().getTime(); - let time2 = end2 - start2 - console.log('fileioPerformance_stream_readSync,4K_stream_readSync:' + readSync + ', time2:' + time2 + ',' + i); - rs.closeSync(); - } - sleep(3000); - }); - - /** - * @tc.number SUB_STORAGE_fileioPerformance_stream_write_read - * @tc.name fileioPerformance_stream_write_read - * @tc.desc Stream_write_read Perform ROM remaining less than 10% of the total - */ - it('fileioPerformance_stream_write_read', 0, function () { - let fpath = nextFileName('stream_write_read'); - let data; - for (let i = 0; i < 1024; i++) { - data = data + randomString(1024); - } - for (let i = 0; i < 1000; i++) { - let ws = fileio.createStreamSync(fpath, 'w'); - let start1 = new Date().getTime(); - let writeSync = ws.writeSync(data); - let end1 = new Date().getTime(); - let time1 = end1 - start1; - console.log('fileioPerformance_stream_write,1M_stream_writeSync:' + writeSync + ', time1:' + time1 + ',' + i); - let rs = fileio.createStreamSync(fpath, 'r'); - let start2 = new Date().getTime(); - let readSync = rs.readSync(new ArrayBuffer(1048576)); - let end2 = new Date().getTime(); - let time2 = end2 - start2 - console.log('fileioPerformance_stream_readSync,1M_stream_readSync:' + readSync + ', time2:' + time2 + ',' + i); - ws.closeSync(); - fileio.unlinkSync(fpath); - } - }); - - /** - * @tc.number SUB_STORAGE_fileioPerformance_prop_copyFile - * @tc.name fileioPerformance_prop_copyFile - * @tc.desc 0.5G Synchronous opening performance test of test files - * The path needs to be manually placed in advance - * data/accounts/account_0/appdata/ohos.acts.distributeddatamgr.distributedfile/cache/p1'的0.5g文件) - */ - it('fileioPerformance_prop_copyFile', 0, function () { - console.log('---fileioPerformance_prop_copyFile 0.5G---start---'); - let fpath = nextFileName('p1'); - let fpathTarget = nextFileName('p2'); - for (let i = 0; i < 1000; i++) { - let start2 = new Date().getTime(); - let copyFileSync = fileio.copyFileSync(fpath, fpathTarget); - let end2 = new Date().getTime(); - let time2 = end2 - start2 - console.log('fileioPerformance_prop_copyFileSync,copyFileSync:' + copyFileSync + ', time2:' + time2 + ',' + i); - fileio.unlinkSync(fpathTarget); - sleep(300); - } - fileio.closeSync(fd); - sleep(3000); - }); - - /** - * @tc.number SUB_STORAGE_fileioPerformance_prop_openSync - * @tc.name fileioPerformance_prop_openSync - * @tc.desc 0.5G Synchronous opening performance test of test files - * The path needs to be manually placed in advance - * data/accounts/account_0/appdata/ohos.acts.distributeddatamgr.distributedfile/cache/p1'的0.5g文件) - */ - it('fileioPerformance_prop_openSync', 0, function () { - console.log('---fileioPerformance_prop_openSync 0.5G---start---'); - let fpath = nextFileName('p1'); - let fd - for (let i = 0; i < 1000; i++) { - let start = new Date().getTime(); - fd = fileio.openSync(fpath, 0o2002); - let end = new Date().getTime(); - let time = end - start - console.log('fileioPerformance_prop_openSync,openSync:' + fd + ', time:' + time + ',' + i); - } - fileio.closeSync(fd); - sleep(3000); - }); -}); diff --git a/storage/storagefileioperformancejstest/src/main/js/default/test/FilePerformance.js b/storage/storagefileioperformancejstest/src/main/js/default/test/FilePerformance.js deleted file mode 100644 index 21db7a37a..000000000 --- a/storage/storagefileioperformancejstest/src/main/js/default/test/FilePerformance.js +++ /dev/null @@ -1,505 +0,0 @@ -/* - * 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 fileio from '@ohos.fileio'; -import { - describe, - it, - expect -} - from 'deccjsunit/index' -import { - randomString -} - from './Common' - -describe('fileTest', function () { - - /** - * @tc.number SUB_STORAGE_File_mkdir_1100 - * @tc.name File_mkdir_011 - * @tc.desc Function of API, Run 1000 times to obtain each running time. - */ - it('File_mkdir_011', 0, async function (done) { - let start = new Date().getTime(); - for (let i = 0; i < 1000; i++) { - file.mkdir({ - uri: 'internal://app/File_mkdir_011' + i, - success: function () { - let end = new Date().getTime(); - let time = end - start; - console.log('-------File_mkdir_011 call mkdir success, time:' + time + ',' + i); - start = new Date().getTime(); - done(); - }, - fail: function (data, code) { - console.log('-------File_mkdir_011 call mkdir fail! code:' + code + ', data' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_File_access_1100 - * @tc.name File_access_011 - * @tc.desc Function of API, Run 1000 times to obtain each running time. - */ - it('File_access_011', 0, async function (done) { - let start = new Date().getTime(); - for (let i = 0; i < 1000; i++) { - file.access({ - uri: 'internal://app/File_mkdir_011' + i, - success: function () { - let end = new Date().getTime(); - let time = end - start; - console.log('-------File_access_011 call access success, time:' + time + ',' + i); - start = new Date().getTime(); - done(); - }, - fail: function (data, code) { - console.log('-------File_access_011 call access fail! code:' + code + ', data' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_File_rmdir_1100 - * @tc.name File_rmdir_011 - * @tc.desc Function of API, Run 1000 times to obtain each running time. - */ - it('File_rmdir_011', 0, async function (done) { - let start = new Date().getTime(); - for (let i = 0; i < 1000; i++) { - file.rmdir({ - uri: 'internal://app/File_mkdir_011' + i, - success: function () { - let end = new Date().getTime(); - let time = end - start; - console.log('-------File_rmdir_011 call rmdir success, time:' + time + ',' + i); - start = new Date().getTime(); - done(); - }, - fail: function (data, code) { - console.log('-------File_rmdir_011 call rmdir fail! code:' + code + ', data' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_File_Copy_1500 - * @tc.name File_Copy_015 - * @tc.desc Function of API, Run 1000 times to obtain each running time. - */ - it('File_Copy_015', 0, function (done) { - file.writeText({ - uri: 'internal://app/File_Copy_015', - text: 'hello', - success: function () { - console.log('File_Copy_015 call writeText success'); - done(); - }, - fail: function (data, code) { - console.log('File_Copy_015 call writeText fail! code:' + code + ', data' + data); - expect(null).assertFail(); - }, - }); - let start = new Date().getTime(); - for (let i = 0; i < 1000; i++) { - file.copy({ - srcUri: 'internal://app/File_Copy_015', - dstUri: 'internal://app/File_Copy_015_1' + i, - success: function () { - let end = new Date().getTime(); - let time = end - start; - console.log('-------File_Copy_015 call copy success, time:' + time + ',' + i); - start = new Date().getTime(); - done(); - }, - fail: function (data, code) { - console.log('-------File_Copy_015 call copy fail! code:' + code + ', data' + data); - expect(null).assertFail(); - }, - }); - } - file.delete({ - uri: 'internal://app/File_Copy_015', - success: function () { - console.log('-------File_Copy_015 call delete success.'); - done(); - }, - fail: function (data, code) { - console.log('-------File_Copy_015 call delete fail! code:' + code + ', data' + data); - expect(null).assertFail(); - }, - }); - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_File_Delete_1100 - * @tc.name File_Delete_011 - * @tc.desc Function of API, Run 1000 times to obtain each running time. - */ - it('File_Delete_011', 0, function (done) { - let start = new Date().getTime(); - for (let i = 0; i < 1000; i++) { - file.delete({ - uri: 'internal://app/File_Copy_015_1' + i, - success: function () { - let end = new Date().getTime(); - let time = end - start; - console.log('-------File_Delete_011 call delete success, time:' + time + ',' + i); - start = new Date().getTime(); - done(); - }, - fail: function (data, code) { - console.log('-------File_Delete_011 call delete fail! code:' + code + ', data' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_File_List_1300 - * @tc.name File_List_013 - * @tc.desc Function of API, Run 1000 times to obtain each running time. - */ - it('File_List_013', 0, async function (done) { - file.writeText({ - uri: 'internal://app/File_List_013', - text: 'Text that just for test.', - success: function () { - console.log('File_List_013 call writeText success.'); - done(); - }, - fail: function (data, code) { - console.error('File_List_013 call writeText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - let start = new Date().getTime(); - for (let i = 0; i <= 1000; i++) { - file.list({ - uri: 'internal://app/', - success: function () { - let end = new Date().getTime(); - let time = end - start; - console.log('File_List_013 Difference time:' + time + ',' + i); - start = new Date().getTime(); - done(); - }, - fail: function (data, code) { - console.error('File_List_013 call list fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_File_List_1400 - * @tc.name File_List_014 - * @tc.desc Function of API, Run 1000 times to obtain each running time. - */ - it('File_List_014', 0, async function (done) { - for (let i = 0; i < 1000; i++) { - file.writeText({ - uri: 'internal://app/File_List_014' + i, - text: 'Text that just for test.', - success: function () { - console.log('File_List_014 call writeText success.'); - done(); - }, - fail: function (data, code) { - console.error('File_List_014 call writeText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - let start = new Date().getTime(); - for (let i = 0; i <= 1000; i++) { - file.list({ - uri: 'internal://app/', - success: function () { - let end = new Date().getTime(); - let time = end - start; - console.log('File_List_014 Difference time:' + time + ',' + i); - start = new Date().getTime(); - done(); - }, - fail: function (data, code) { - console.error('File_List_014 call list fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_File_Get_1500 - * @tc.name File_Get_015 - * @tc.desc Function of API, Run 1000 times to obtain each running time. - */ - it('File_Get_015', 0, async function (done) { - file.writeText({ - uri: 'internal://app/File_Get_015', - text: 'Text that just for test.', - success: function () { - console.log('File_Get_015 call writeText success.'); - done(); - }, - fail: function (data, code) { - console.error('File_Get_015 call writeText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - let start = new Date().getTime(); - for (let i = 0; i <= 1000; i++) { - file.get({ - uri: 'internal://app/File_Get_015', - success: function () { - let end = new Date().getTime(); - let time = end - start; - console.log('File_Get_015 Difference time:' + time + ',' + i); - start = new Date().getTime(); - done(); - }, - fail: function (data, code) { - console.error('File_Get_015 call get fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_File_Get_1600 - * @tc.name File_Get_016 - * @tc.desc Function of API, Run 1000 times to obtain each running time. - */ - it('File_Get_016', 0, async function (done) { - for (let i = 0; i < 1000; i++) { - file.writeText({ - uri: 'internal://app/File_Get_016' + i, - text: 'Text that just for test.', - success: function () { - console.log('File_Get_016 call writeText success.'); - done(); - }, - fail: function (data, code) { - console.error('File_Get_016 call writeText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - let start = new Date().getTime(); - for (let i = 0; i <= 1000; i++) { - file.get({ - uri: 'internal://app/File_Get_016' + i, - success: function (data) { - console.log(data.uri); - let end = new Date().getTime(); - let time = end - start; - console.log('File_Get_016 Difference time:' + time + ',' + i); - start = new Date().getTime(); - done(); - }, - fail: function (data, code) { - console.error('File_Get_016 call get fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_File_writeText_1400 - * @tc.name File_writeText_014 - * @tc.desc Function of API, Run 1000 times to obtain each running time. - */ - it('File_writeText_014', 0, async function (done) { - let text = randomString(4096); - let start = new Date().getTime(); - for (let i = 0; i <= 1000; i++) { - file.writeText({ - uri: 'internal://app/File_writeText_014', - text: text, - success: function () { - let end = new Date().getTime(); - let time = end - start; - console.log('File_writeText_014 4K Difference time:' + time + ',' + i); - start = new Date().getTime(); - done(); - }, - fail: function (data, code) { - console.error('File_writeText_014 call writeText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_File_readText_1000 - * @tc.name File_readText_010 - * @tc.desc Function of API, Run 1000 times to obtain each running time. - */ - it('File_readText_010', 0, async function (done) { - let start = new Date().getTime(); - for (let i = 0; i <= 1000; i++) { - file.readText({ - uri: 'internal://app/File_writeText_014', - success: function () { - let end = new Date().getTime(); - let time = end - start; - console.log('File_readText_010 4K Difference time:' + time + ',' + i); - start = new Date().getTime(); - done(); - }, - fail: function (data, code) { - console.log('File_readText_010 call readText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_File_writeArrayBuffer_1300 - * @tc.name File_writeArrayBuffer_013 - * @tc.desc Function of API, Run 1000 times to obtain each running time. - */ - it('File_writeArrayBuffer_013', 0, async function (done) { - let buf = new Uint8Array(4096); - for (let i = 0; i < 4096; i++) { - buf[i] = 100 - } - let start = new Date().getTime(); - for (let i = 0; i <= 1000; i++) { - file.writeArrayBuffer({ - uri: 'internal://app/File_writeArrayBuffer_013', - buffer: buf, - success: function () { - console.log('call writeArrayBuffer success.'); - let end = new Date().getTime(); - let time = end - start; - console.log('File_writeArrayBuffer_013 4K Difference time:' + time + ',' + i); - start = new Date().getTime(); - done(); - }, - fail: function (data, code) { - console.error('File_writeArrayBuffer_013 call writeArrayBuffer fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); - - /** - * @tc.number SUB_STORAGE_File_readArrayBuffer_1200 - * @tc.name File_readArrayBuffer_012 - * @tc.desc Function of API, Run 1000 times to obtain each running time. - */ - it('File_readArrayBuffer_012', 0, async function (done) { - let start = new Date().getTime(); - for (let i = 0; i <= 1000; i++) { - file.readArrayBuffer({ - uri: 'internal://app/File_writeArrayBuffer_013', - success: function () { - let end = new Date().getTime(); - let time = end - start; - console.log('File_readArrayBuffer_012 4K Difference time:' + time + ',' + i); - start = new Date().getTime(); - done(); - }, - fail: function (data, code) { - console.error('File_readArrayBuffer_012 call readArrayBuffer fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - } - setTimeout( - function(){ - expect(null).assertFail(); - done(); - },30) - }); -}); diff --git a/storage/storagefileioperformancejstest/src/main/js/default/test/List.test.js b/storage/storagefileioperformancejstest/src/main/js/default/test/List.test.js deleted file mode 100644 index 2d7e8c31e..000000000 --- a/storage/storagefileioperformancejstest/src/main/js/default/test/List.test.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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('./FileIOPerformance.js') -require('./FilePerformance.js') diff --git a/storage/storagefileioperformancejstest/src/main/resources/base/element/string.json b/storage/storagefileioperformancejstest/src/main/resources/base/element/string.json deleted file mode 100644 index 925ea00ed..000000000 --- a/storage/storagefileioperformancejstest/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "storagefileioperformancejstest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/storage/storagefileioperformancejstest/src/main/resources/base/media/icon.png b/storage/storagefileioperformancejstest/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOqSxyuN1x;Is@8~m?*>}** znrRFArP!K_52RpX*&JHMR<^lVdm8ypJ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zR50O$mDXw6P>i7B(TJ)ciPzTE>XY%X6HAa)b#OBRXv&~%Bw|J#Y><i4=e%95bjtw|cJp=#P#Pf#*luqI_wR;fISDCJhAqSG6R%xItn%~QtZ@m%&u zjGGLX;t6Ls62eQvNmf@v+}J%54^CygxRZ`?8X#r|wkev7(s;Ou4T#y1XNNf)h;o7z z8a^Lfq<1uH`E{G9E z*(=)Css_LSk=>E9jr)s5^2-!+MN=Ds}>1hRma4`uCIz9%p3O77839E{xf z4c_I?**|1`K2tg4!Hvyrou4BsJQuv*UfF)<%CelYIS>D^o?X)3+MK%la6kooW8&G@BU)Y0hT`+mOm$Z_%rB=a%o>I z!2c6lHyKQN)VjiFwa!eE^p8jc$sy$vB+8i25lI~6KPFFh$!o$avA~rj#L6xvR|Z83 z*WD6T9e+5Pyy=F+)pNTf{ny3cy>7Rkd3o*TS?TZJ`NS^NF2%HMkyS{?uJ$`!P4_L^ z1`NFDUbNyg_qREifgktnp1_v{Jbb`7m}2PTyUdOmtJj~m z9bB=ecw4_^rw1IW=of+>nrW5=d3k`3qHCxsIN_F{T1A545};;+fsyC&qChi+YV zr~M63H8ZLCPYmsjY>ls9cL%I)F|JIW-#+48$+lD4k*(P*kDM%zx_fvu4u5ZYUnI}5 zdrycFq>xFU)&X3p@pP2u%$o}}YcRn(MhJ&B2o?KS@cIVz>Ye%o^xV?CB{_Qhu z;}_q1bvO^g{8<3!gYbo4Di{8qzV+(9 zdlmksohQmRTs@qB;(Wo?dER_ux6XQb@q$tQPW?CMu6GVQd;R=iR;-S{Kr%Zks7>b1 zNs{|-+jhObYE}NR&`TGGr^h^4bjh%c>R#@=8nM&Md>_a+zVulsl;){flFekV1t9ob z+SqfV_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b diff --git a/storage/storagefileioreliabilityjstest/src/main/config.json b/storage/storagefileioreliabilityjstest/src/main/config.json deleted file mode 100644 index 9b7cfe5d0..000000000 --- a/storage/storagefileioreliabilityjstest/src/main/config.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "app": { - "bundleName": "ohos.acts.stroage.fileio", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5 - } - }, - "deviceConfig": {}, - "module": { - "package": "ohos.acts.stroage.fileio", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "ohos.acts.stroage.fileio.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/storage/storagefileioreliabilityjstest/src/main/js/default/app.js b/storage/storagefileioreliabilityjstest/src/main/js/default/app.js deleted file mode 100644 index 60ee141c8..000000000 --- a/storage/storagefileioreliabilityjstest/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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('ohos.acts.distributeddatamgr.distributedfile onCreate'); - }, - onDestroy() { - console.info('ohos.acts.distributeddatamgr.distributedfile onCreate'); - } -}; diff --git a/storage/storagefileioreliabilityjstest/src/main/js/default/i18n/en-US.json b/storage/storagefileioreliabilityjstest/src/main/js/default/i18n/en-US.json deleted file mode 100644 index ead52ed2e..000000000 --- a/storage/storagefileioreliabilityjstest/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "Test" - } -} \ No newline at end of file diff --git a/storage/storagefileioreliabilityjstest/src/main/js/default/i18n/zh-CN.json b/storage/storagefileioreliabilityjstest/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index 3f48f2585..000000000 --- a/storage/storagefileioreliabilityjstest/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "测试" - } -} \ No newline at end of file diff --git a/storage/storagefileioreliabilityjstest/src/main/js/default/pages/index/index.css b/storage/storagefileioreliabilityjstest/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda79275..000000000 --- a/storage/storagefileioreliabilityjstest/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/storage/storagefileioreliabilityjstest/src/main/js/default/pages/index/index.hml b/storage/storagefileioreliabilityjstest/src/main/js/default/pages/index/index.hml deleted file mode 100644 index f64b040a5..000000000 --- a/storage/storagefileioreliabilityjstest/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/storage/storagefileioreliabilityjstest/src/main/js/default/pages/index/index.js b/storage/storagefileioreliabilityjstest/src/main/js/default/pages/index/index.js deleted file mode 100644 index 36886d2e9..000000000 --- a/storage/storagefileioreliabilityjstest/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 {Core} from 'deccjsunit/index' -export default { - data: { - title: '' - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - require('../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/storage/storagefileioreliabilityjstest/src/main/js/default/test/Common.js b/storage/storagefileioreliabilityjstest/src/main/js/default/test/Common.js deleted file mode 100644 index c5bc08482..000000000 --- a/storage/storagefileioreliabilityjstest/src/main/js/default/test/Common.js +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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 fileio from '@system.fileio' - -export const FILE_CONTENT = 'hello world' - -export function prepareFile(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o666) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareFile1(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareEmptyFile(fpath) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function fileToReadOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o444) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadOnly for ' + e); - return false - } -} -export function fileToWriteOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o2) - fileio.fchmodSync(fd, 0o222) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToWriteOnly ' + e) - return false - } -} -export function fileToReadAndWrite(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o777) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadAndWrite ' + e); - return false - } -} -export function appName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/' - return BASE_PATH + testName -} -export function nextFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/cache/' - return BASE_PATH + testName -} -export function fileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/' - return BASE_PATH + testName -} -export function cacheFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/cache/' - return BASE_PATH + testName -} -export function differentFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/' - return BASE_PATH + testName -} -export function differentCacheName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/cache/' - return BASE_PATH + testName -} - -export function getFileTextLen(fpath) { - let ss - try { - ss = fileio.Stream.createStreamSync(fpath, 'r+') - expect(ss !== null).assertTrue() - let len = ss.readSync(new ArrayBuffer(4096)) - console.log('file:' + fpath) - console.log('file lenth:' + len) - expect(ss.closeSync() !== null).assertTrue() - return len - } - catch (e) { - console.log('Failed to getFileTextLen ' + e) - expect(ss.closeSync() !== null).assertTrue() - return null - } -} -export function isFileExist(fpath) { - try { - expect(fileio.accessSync(fpath) !== null).assertTrue() - console.log('file:' + fpath) - console.log('status:exist') - return true - } - catch (e) { - console.log('file:' + fpath) - console.log('status:non-existen') - return false - } -} -export function sleep(n) { - var start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > n) { - break; - } - } -} -export function randomString(num) { - let len= num; - var $chars = 'aaaabbbbcccc'; - var maxPos = $chars.length; - var pwd = ''; - for (var i = 0; i < len; i++) { - pwd += $chars.charAt(Math.floor(Math.random() * maxPos)); - } - return pwd; -} diff --git a/storage/storagefileioreliabilityjstest/src/main/js/default/test/FileIOReliability.js b/storage/storagefileioreliabilityjstest/src/main/js/default/test/FileIOReliability.js deleted file mode 100644 index 73fd508a5..000000000 --- a/storage/storagefileioreliabilityjstest/src/main/js/default/test/FileIOReliability.js +++ /dev/null @@ -1,189 +0,0 @@ -/* - * 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 fileio from '@system.fileio' -import { - describe, - it, - expect -} - from 'deccjsunit/index' -import { - FILE_CONTENT, - prepareFile, - nextFileName, - sleep -} - from './Common' - -describe('fileIOReliability', function () { - - /** - * @tc.number SUB_STORAGE_fileIOReliability_dir - * @tc.name fileIOReliability_dir - * @tc.desc Dir Reliability Test - */ - it('fileIOReliability_dir', 0, function () { - for (let i = 0; i < 100000; i++) { - try { - let dpath = nextFileName('fileIOReliability') + 'd'; - fileio.mkdirSync(dpath); - let fpath = dpath + '/f1'; - prepareFile(fpath, FILE_CONTENT); - let dd = fileio.opendirSync(dpath); - dd.readSync(); - dd.closeSync(); - fileio.unlinkSync(fpath); - fileio.rmdirSync(dpath); - sleep(300); - } - catch (e) { - console.log('fileIOReliability_dir has failed for ' + e); - expect(null).assertFail(); - } - } - }); - - /** - * @tc.number SUB_STORAGE_fileIOReliability_dirent - * @tc.name fileIOReliability_dirent - * @tc.desc Dirent Reliability Test - */ - it('fileIOReliability_dirent', 0, function () { - for (let i = 0; i < 100000; i++) { - try { - let dpath = nextFileName('fileIOReliability') + 'd'; - fileio.mkdirSync(dpath); - let fpath = dpath + '/f1'; - prepareFile(fpath, FILE_CONTENT); - let dd = fileio.opendirSync(dpath); - let dirent = dd.readSync(); - dirent.isBlockDevice(); - dirent.isCharacterDevice(); - dirent.isDirectory(); - dirent.isFIFO(); - dirent.isSocket(); - dirent.isSymbolicLink(); - dd.closeSync(); - fileio.unlinkSync(fpath); - fileio.rmdirSync(dpath); - sleep(300); - } - catch (e) { - console.log('fileIOReliability_dirent has failed for ' + e); - expect(null).assertFail(); - } - } - }); - - /** - * @tc.number SUB_STORAGE_fileIOReliability_stat - * @tc.name fileIOReliability_stat - * @tc.desc Stat Reliability Test - */ - it('fileIOReliability_stat', 0, function () { - for (let i = 0; i < 100000; i++) { - try { - let dpath = nextFileName('fileIOReliability') + 'd'; - fileio.mkdirSync(dpath); - let fpath = dpath + '/f1'; - prepareFile(fpath, FILE_CONTENT); - let stat = fileio.statSync(fpath); - stat.isBlockDevice(); - stat.isCharacterDevice(); - stat.isDirectory(); - stat.isFIFO(); - stat.isSocket(); - stat.isSymbolicLink(); - fileio.unlinkSync(fpath); - fileio.rmdirSync(dpath); - sleep(300); - } - catch (e) { - console.log('fileIOReliability_stat has failed for ' + e); - expect(null).assertFail(); - } - } - }); - - /** - * @tc.number SUB_STORAGE_fileIOReliability_stream - * @tc.name fileIOReliability_stream - * @tc.desc Stream Reliability Test - */ - it('fileIOReliability_stream', 0, function () { - for (let i = 0; i < 100000; i++) { - let fpath = nextFileName('fileIOReliability_stream'); - expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); - let ss; - try { - let fd = fileio.openSync(fpath, 0o2); - ss = fileio.fdopenStreamSync(fd, 'r+'); - ss.writeSync(FILE_CONTENT); - ss.flushSync(); - ss.closeSync(); - ss = fileio.createStreamSync(fpath, 'r+'); - ss.readSync(new ArrayBuffer(4096)); - ss.closeSync(); - fileio.unlinkSync(fpath); - sleep(300); - } - catch (e) { - console.log('fileIOReliability_stream has failed for ' + e); - expect(null).assertFail(); - } - } - }); - - /** - * @tc.number SUB_STORAGE_fileIOReliability_prop - * @tc.name fileIOReliability_prop - * @tc.desc Prop Reliability Test - */ - it('fileIOReliability_prop', 0, function () { - for (let i = 0; i < 100000; i++) { - try { - let dpath = nextFileName('fileIOReliability') + 'd'; - fileio.mkdirSync(dpath); - let fpath = nextFileName('fileIOReliability'); - let fpathTarget = fpath + 'tgt'; - let fpathTarget1 = fpath + 'tgtt'; - let ff = fileio.openSync(fpath, 0o102, 0o666); - fileio.accessSync(fpath); - fileio.chmodSync(fpath, 0o660); - let stat = fileio.statSync(fpath); - fileio.chownSync(fpath, stat.uid, stat.gid); - fileio.copyFileSync(fpath, fpathTarget); - fileio.fchmodSync(ff, 0o660); - fileio.fchownSync(ff, stat.uid, stat.gid); - fileio.fstatSync(ff); - fileio.ftruncateSync(ff); - fileio.renameSync(fpath, fpathTarget1); - fileio.fsyncSync(ff); - fileio.truncateSync(fpathTarget1); - fileio.writeSync(ff, FILE_CONTENT); - fileio.closeSync(ff); - fileio.unlinkSync(fpathTarget1); - fileio.unlinkSync(fpathTarget); - fileio.rmdirSync(dpath); - sleep(300); - } - catch (e) { - console.log('fileIOReliability_prop has failed for ' + e); - expect(null).assertFail(); - } - } - }); -}); diff --git a/storage/storagefileioreliabilityjstest/src/main/js/default/test/List.test.js b/storage/storagefileioreliabilityjstest/src/main/js/default/test/List.test.js deleted file mode 100644 index c04e4626b..000000000 --- a/storage/storagefileioreliabilityjstest/src/main/js/default/test/List.test.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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('./FileIOReliability.js') diff --git a/storage/storagefileioreliabilityjstest/src/main/resources/base/element/string.json b/storage/storagefileioreliabilityjstest/src/main/resources/base/element/string.json deleted file mode 100644 index 7184b7893..000000000 --- a/storage/storagefileioreliabilityjstest/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "storagefileioreliabilityjstest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/storage/storagefileioreliabilityjstest/src/main/resources/base/media/icon.png b/storage/storagefileioreliabilityjstest/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJ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bB=ecw4_^rw1IW=of+>nrW5=d3k`3qHCxsIN_F{T1A545};;+fsyC&qChi+YV zr~M63H8ZLCPYmsjY>ls9cL%I)F|JIW-#+48$+lD4k*(P*kDM%zx_fvu4u5ZYUnI}5 zdrycFq>xFU)&X3p@pP2u%$o}}YcRn(MhJ&B2o?KS@cIVz>Ye%o^xV?CB{_Qhu z;}_q1bvO^g{8<3!gYbo4Di{8qzV+(9 zdlmksohQmRTs@qB;(Wo?dER_ux6XQb@q$tQPW?CMu6GVQd;R=iR;-S{Kr%Zks7>b1 zNs{|-+jhObYE}NR&`TGGr^h^4bjh%c>R#@=8nM&Md>_a+zVulsl;){flFekV1t9ob z+SqfV_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b diff --git a/storage/storagefileiostabilityjstest/src/main/config.json b/storage/storagefileiostabilityjstest/src/main/config.json deleted file mode 100644 index 9b7cfe5d0..000000000 --- a/storage/storagefileiostabilityjstest/src/main/config.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "app": { - "bundleName": "ohos.acts.stroage.fileio", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5 - } - }, - "deviceConfig": {}, - "module": { - "package": "ohos.acts.stroage.fileio", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "ohos.acts.stroage.fileio.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/storage/storagefileiostabilityjstest/src/main/js/default/app.js b/storage/storagefileiostabilityjstest/src/main/js/default/app.js deleted file mode 100644 index 60ee141c8..000000000 --- a/storage/storagefileiostabilityjstest/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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('ohos.acts.distributeddatamgr.distributedfile onCreate'); - }, - onDestroy() { - console.info('ohos.acts.distributeddatamgr.distributedfile onCreate'); - } -}; diff --git a/storage/storagefileiostabilityjstest/src/main/js/default/i18n/en-US.json b/storage/storagefileiostabilityjstest/src/main/js/default/i18n/en-US.json deleted file mode 100644 index ead52ed2e..000000000 --- a/storage/storagefileiostabilityjstest/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "Test" - } -} \ No newline at end of file diff --git a/storage/storagefileiostabilityjstest/src/main/js/default/i18n/zh-CN.json b/storage/storagefileiostabilityjstest/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index 3f48f2585..000000000 --- a/storage/storagefileiostabilityjstest/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "测试" - } -} \ No newline at end of file diff --git a/storage/storagefileiostabilityjstest/src/main/js/default/pages/index/index.css b/storage/storagefileiostabilityjstest/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda79275..000000000 --- a/storage/storagefileiostabilityjstest/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/storage/storagefileiostabilityjstest/src/main/js/default/pages/index/index.hml b/storage/storagefileiostabilityjstest/src/main/js/default/pages/index/index.hml deleted file mode 100644 index f64b040a5..000000000 --- a/storage/storagefileiostabilityjstest/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/storage/storagefileiostabilityjstest/src/main/js/default/pages/index/index.js b/storage/storagefileiostabilityjstest/src/main/js/default/pages/index/index.js deleted file mode 100644 index 36886d2e9..000000000 --- a/storage/storagefileiostabilityjstest/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 {Core} from 'deccjsunit/index' -export default { - data: { - title: '' - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - require('../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/storage/storagefileiostabilityjstest/src/main/js/default/test/Common.js b/storage/storagefileiostabilityjstest/src/main/js/default/test/Common.js deleted file mode 100644 index c5bc08482..000000000 --- a/storage/storagefileiostabilityjstest/src/main/js/default/test/Common.js +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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 fileio from '@system.fileio' - -export const FILE_CONTENT = 'hello world' - -export function prepareFile(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o666) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareFile1(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareEmptyFile(fpath) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function fileToReadOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o444) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadOnly for ' + e); - return false - } -} -export function fileToWriteOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o2) - fileio.fchmodSync(fd, 0o222) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToWriteOnly ' + e) - return false - } -} -export function fileToReadAndWrite(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o777) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadAndWrite ' + e); - return false - } -} -export function appName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/' - return BASE_PATH + testName -} -export function nextFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/cache/' - return BASE_PATH + testName -} -export function fileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/' - return BASE_PATH + testName -} -export function cacheFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/cache/' - return BASE_PATH + testName -} -export function differentFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/' - return BASE_PATH + testName -} -export function differentCacheName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/cache/' - return BASE_PATH + testName -} - -export function getFileTextLen(fpath) { - let ss - try { - ss = fileio.Stream.createStreamSync(fpath, 'r+') - expect(ss !== null).assertTrue() - let len = ss.readSync(new ArrayBuffer(4096)) - console.log('file:' + fpath) - console.log('file lenth:' + len) - expect(ss.closeSync() !== null).assertTrue() - return len - } - catch (e) { - console.log('Failed to getFileTextLen ' + e) - expect(ss.closeSync() !== null).assertTrue() - return null - } -} -export function isFileExist(fpath) { - try { - expect(fileio.accessSync(fpath) !== null).assertTrue() - console.log('file:' + fpath) - console.log('status:exist') - return true - } - catch (e) { - console.log('file:' + fpath) - console.log('status:non-existen') - return false - } -} -export function sleep(n) { - var start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > n) { - break; - } - } -} -export function randomString(num) { - let len= num; - var $chars = 'aaaabbbbcccc'; - var maxPos = $chars.length; - var pwd = ''; - for (var i = 0; i < len; i++) { - pwd += $chars.charAt(Math.floor(Math.random() * maxPos)); - } - return pwd; -} diff --git a/storage/storagefileiostabilityjstest/src/main/js/default/test/FileIOStability.js b/storage/storagefileiostabilityjstest/src/main/js/default/test/FileIOStability.js deleted file mode 100644 index 003c0351c..000000000 --- a/storage/storagefileiostabilityjstest/src/main/js/default/test/FileIOStability.js +++ /dev/null @@ -1,198 +0,0 @@ -/* - * 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 fileio from '@system.fileio' -import { - describe, - it, - expect -} - from 'deccjsunit/index' -import { - FILE_CONTENT, - prepareFile, - nextFileName, - sleep -} - from './Common' - -describe('fileIOStability', function () { - - /** - * @tc.number SUB_STORAGE_fileIOStability_dir - * @tc.name fileIOStability_dir - * @tc.desc Function of API, 7*24 - */ - it('fileIOStability_dir', 0, function () { - for (let i = 0; i <= 100000; i++) { - try { - let dpath = nextFileName('fileIOStability') + 'd'; - fileio.mkdirSync(dpath); - let fpath = dpath + '/f1'; - prepareFile(fpath, FILE_CONTENT); - let dd = fileio.opendirSync(dpath); - dd.readSync(); - dd.closeSync(); - fileio.unlinkSync(fpath); - fileio.rmdirSync(dpath); - } - catch (e) { - console.log('fileIOStability_dir has failed for ' + e); - expect(null).assertFail(); - } - } - }); - - /** - * @tc.number SUB_STORAGE_fileIOStability_dirent - * @tc.name fileIOStability_dirent - * @tc.desc Function of API, 7*24 - */ - it('fileIOStability_dirent', 0, function () { - for (let i = 0; i <= 100000; i++) { - try { - let dpath = nextFileName('fileIOStability') + 'd'; - fileio.mkdirSync(dpath); - let fpath = dpath + '/f1'; - prepareFile(fpath, FILE_CONTENT); - let dd = fileio.opendirSync(dpath); - let dirent = dd.readSync(); - dirent.isBlockDevice(); - dirent.isCharacterDevice(); - dirent.isDirectory(); - dirent.isFIFO(); - dirent.isSocket(); - dirent.isSymbolicLink(); - dd.closeSync(); - fileio.unlinkSync(fpath); - fileio.rmdirSync(dpath); - } - catch (e) { - console.log('fileIOStability_dirent has failed for ' + e); - expect(null).assertFail(); - } - } - }); - - /** - * @tc.number SUB_STORAGE_fileIOStability_stat - * @tc.name fileIOStability_stat - * @tc.desc Function of API, 7*24 - */ - it('fileIOStability_stat', 0, function () { - for (let i = 0; i <= 100000; i++) { - try { - let dpath = nextFileName('fileIOStability') + 'd'; - fileio.mkdirSync(dpath); - let fpath = dpath + '/f1'; - prepareFile(fpath, FILE_CONTENT); - let stat = fileio.statSync(fpath); - stat.isBlockDevice(); - stat.isCharacterDevice(); - stat.isDirectory(); - stat.isFIFO(); - stat.isSocket(); - stat.isSymbolicLink(); - stat.dev; - stat.uid; - stat.ino; - stat.mode; - stat.nlink; - stat.gid; - stat.rdev; - stat.size; - stat.blocks; - stat.atime; - stat.mtime; - stat.ctime; - fileio.unlinkSync(fpath); - fileio.rmdirSync(dpath); - } - catch (e) { - console.log('fileIOStability_stat has failed for ' + e); - expect(null).assertFail(); - } - } - }); - - /** - * @tc.number SUB_STORAGE_fileIOStability_stream - * @tc.name fileIOStability_stream - * @tc.desc Function of API, 7*24 - */ - it('fileIOStability_stream', 0, function () { - for (let i = 0; i <= 100000; i++) { - let fpath = nextFileName('fileIOStability_stream'); - expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); - let ss; - try { - let fd = fileio.openSync(fpath, 0o2); - ss = fileio.fdopenStreamSync(fd, 'r+'); - ss.writeSync(FILE_CONTENT); - ss.flushSync(); - ss.closeSync(); - ss = fileio.createStreamSync(fpath, 'r+'); - ss.readSync(new ArrayBuffer(4096)); - ss.closeSync(); - fileio.unlinkSync(fpath); - } - catch (e) { - console.log('fileIOStability_stream has failed for ' + e); - expect(null).assertFail(); - } - } - }); - - /** - * @tc.number SUB_STORAGE_fileIOStability_prop - * @tc.name fileIOStability_prop - * @tc.desc Function of API, 7*24 - */ - it('fileIOStability_prop', 0, function () { - for (let i = 0; i <= 100000; i++) { - try { - let dpath = nextFileName('fileIOStability') + 'd'; - fileio.mkdirSync(dpath); - let fpath = nextFileName('fileIOStability'); - let fpathTarget = fpath + 'tgt'; - let fpathTarget1 = fpath + 'tgtt'; - let ff = fileio.openSync(fpath, 0o102, 0o666); - fileio.accessSync(fpath); - fileio.chmodSync(fpath, 0o660); - let stat = fileio.statSync(fpath); - fileio.chownSync(fpath, stat.uid, stat.gid); - fileio.copyFileSync(fpath, fpathTarget); - fileio.fchmodSync(ff, 0o660); - fileio.fchownSync(ff, stat.uid, stat.gid); - fileio.fstatSync(ff); - fileio.ftruncateSync(ff); - fileio.renameSync(fpath, fpathTarget1); - fileio.fsyncSync(ff); - fileio.truncateSync(fpathTarget1); - fileio.writeSync(ff, FILE_CONTENT); - fileio.closeSync(ff); - fileio.unlinkSync(fpathTarget1); - fileio.unlinkSync(fpathTarget); - fileio.rmdirSync(dpath); - sleep(4000); - } - catch (e) { - console.log('fileIOStability_pop has failed for ' + e); - expect(null).assertFail(); - } - } - }); - -}); diff --git a/storage/storagefileiostabilityjstest/src/main/js/default/test/List.test.js b/storage/storagefileiostabilityjstest/src/main/js/default/test/List.test.js deleted file mode 100644 index 1e7de3ab0..000000000 --- a/storage/storagefileiostabilityjstest/src/main/js/default/test/List.test.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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('./FileIOStability.js') diff --git a/storage/storagefileiostabilityjstest/src/main/resources/base/element/string.json b/storage/storagefileiostabilityjstest/src/main/resources/base/element/string.json deleted file mode 100644 index 8bb43fe55..000000000 --- a/storage/storagefileiostabilityjstest/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "storagefileiostabilityjstest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/storage/storagefileiostabilityjstest/src/main/resources/base/media/icon.png b/storage/storagefileiostabilityjstest/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOqSxyuN1x;Is@8~m?*>}** znrRFArP!K_52RpX*&JHMR<^lVdm8ypJ}0R(SD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DXw6P>i7B(TJ)ciPzTE>XY%X6HAa)b#OBRXv&~%Bw|J#Y><i4=e%95bjtw|cJp=#P#Pf#*luqI_wR;fISDCJhAqSG6R%xItn%~QtZ@m%&u zjGGLX;t6Ls62eQvNmf@v+}J%54^CygxRZ`?8X#r|wkev7(s;Ou4T#y1XNNf)h;o7z z8a^Lfq<1uH`E{G9E z*(=)Css_LSk=>E9jr)s5^2-!+MN=Ds}>1hRma4`uCIz9%p3O77839E{xf z4c_I?**|1`K2tg4!Hvyrou4BsJQuv*UfF)<%CelYIS>D^o?X)3+MK%la6kooW8&G@BU)Y0hT`+mOm$Z_%rB=a%o>I z!2c6lHyKQN)VjiFwa!eE^p8jc$sy$vB+8i25lI~6KPFFh$!o$avA~rj#L6xvR|Z83 z*WD6T9e+5Pyy=F+)pNTf{ny3cy>7Rkd3o*TS?TZJ`NS^NF2%HMkyS{?uJ$`!P4_L^ z1`NFDUbNyg_qREifgktnp1_v{Jbb`7m}2PTyUdOmtJj~m z9bB=ecw4_^rw1IW=of+>nrW5=d3k`3qHCxsIN_F{T1A545};;+fsyC&qChi+YV zr~M63H8ZLCPYmsjY>ls9cL%I)F|JIW-#+48$+lD4k*(P*kDM%zx_fvu4u5ZYUnI}5 zdrycFq>xFU)&X3p@pP2u%$o}}YcRn(MhJ&B2o?KS@cIVz>Ye%o^xV?CB{_Qhu z;}_q1bvO^g{8<3!gYbo4Di{8qzV+(9 zdlmksohQmRTs@qB;(Wo?dER_ux6XQb@q$tQPW?CMu6GVQd;R=iR;-S{Kr%Zks7>b1 zNs{|-+jhObYE}NR&`TGGr^h^4bjh%c>R#@=8nM&Md>_a+zVulsl;){flFekV1t9ob z+SqfV_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b diff --git a/storage/storagefilestabilityjstest/src/main/config.json b/storage/storagefilestabilityjstest/src/main/config.json deleted file mode 100644 index 9b7cfe5d0..000000000 --- a/storage/storagefilestabilityjstest/src/main/config.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "app": { - "bundleName": "ohos.acts.stroage.fileio", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5 - } - }, - "deviceConfig": {}, - "module": { - "package": "ohos.acts.stroage.fileio", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "ohos.acts.stroage.fileio.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/storage/storagefilestabilityjstest/src/main/js/default/app.js b/storage/storagefilestabilityjstest/src/main/js/default/app.js deleted file mode 100644 index 2d73ffa82..000000000 --- a/storage/storagefilestabilityjstest/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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('ohos.acts.distributeddatamgr.distributedfile onCreate'); - }, - onDestroy() { - console.info('ohos.acts.distributeddatamgr.distributedfile onCreate'); - } -}; diff --git a/storage/storagefilestabilityjstest/src/main/js/default/i18n/en-US.json b/storage/storagefilestabilityjstest/src/main/js/default/i18n/en-US.json deleted file mode 100644 index ead52ed2e..000000000 --- a/storage/storagefilestabilityjstest/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "Test" - } -} \ No newline at end of file diff --git a/storage/storagefilestabilityjstest/src/main/js/default/i18n/zh-CN.json b/storage/storagefilestabilityjstest/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index 3f48f2585..000000000 --- a/storage/storagefilestabilityjstest/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "测试" - } -} \ No newline at end of file diff --git a/storage/storagefilestabilityjstest/src/main/js/default/pages/index/index.css b/storage/storagefilestabilityjstest/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda79275..000000000 --- a/storage/storagefilestabilityjstest/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/storage/storagefilestabilityjstest/src/main/js/default/pages/index/index.hml b/storage/storagefilestabilityjstest/src/main/js/default/pages/index/index.hml deleted file mode 100644 index f64b040a5..000000000 --- a/storage/storagefilestabilityjstest/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/storage/storagefilestabilityjstest/src/main/js/default/pages/index/index.js b/storage/storagefilestabilityjstest/src/main/js/default/pages/index/index.js deleted file mode 100644 index f7894a722..000000000 --- a/storage/storagefilestabilityjstest/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 {Core} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: '' - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - require('../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/storage/storagefilestabilityjstest/src/main/js/default/test/Common.js b/storage/storagefilestabilityjstest/src/main/js/default/test/Common.js deleted file mode 100644 index c5bc08482..000000000 --- a/storage/storagefilestabilityjstest/src/main/js/default/test/Common.js +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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 fileio from '@system.fileio' - -export const FILE_CONTENT = 'hello world' - -export function prepareFile(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o666) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareFile1(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareEmptyFile(fpath) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function fileToReadOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o444) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadOnly for ' + e); - return false - } -} -export function fileToWriteOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o2) - fileio.fchmodSync(fd, 0o222) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToWriteOnly ' + e) - return false - } -} -export function fileToReadAndWrite(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o777) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadAndWrite ' + e); - return false - } -} -export function appName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/' - return BASE_PATH + testName -} -export function nextFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/cache/' - return BASE_PATH + testName -} -export function fileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/' - return BASE_PATH + testName -} -export function cacheFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/cache/' - return BASE_PATH + testName -} -export function differentFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/' - return BASE_PATH + testName -} -export function differentCacheName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/cache/' - return BASE_PATH + testName -} - -export function getFileTextLen(fpath) { - let ss - try { - ss = fileio.Stream.createStreamSync(fpath, 'r+') - expect(ss !== null).assertTrue() - let len = ss.readSync(new ArrayBuffer(4096)) - console.log('file:' + fpath) - console.log('file lenth:' + len) - expect(ss.closeSync() !== null).assertTrue() - return len - } - catch (e) { - console.log('Failed to getFileTextLen ' + e) - expect(ss.closeSync() !== null).assertTrue() - return null - } -} -export function isFileExist(fpath) { - try { - expect(fileio.accessSync(fpath) !== null).assertTrue() - console.log('file:' + fpath) - console.log('status:exist') - return true - } - catch (e) { - console.log('file:' + fpath) - console.log('status:non-existen') - return false - } -} -export function sleep(n) { - var start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > n) { - break; - } - } -} -export function randomString(num) { - let len= num; - var $chars = 'aaaabbbbcccc'; - var maxPos = $chars.length; - var pwd = ''; - for (var i = 0; i < len; i++) { - pwd += $chars.charAt(Math.floor(Math.random() * maxPos)); - } - return pwd; -} diff --git a/storage/storagefilestabilityjstest/src/main/js/default/test/FileReliability.js b/storage/storagefilestabilityjstest/src/main/js/default/test/FileReliability.js deleted file mode 100644 index db2cfa80a..000000000 --- a/storage/storagefilestabilityjstest/src/main/js/default/test/FileReliability.js +++ /dev/null @@ -1,292 +0,0 @@ -/* - * 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 fileio from '@system.fileio' -import file from '@system.file'; -import { - describe, - it, - expect -} - from 'deccjsunit/index' -import { - FILE_CONTENT, - prepareFile, - nextFileName, - differentFileName -} - from './Common' - -describe('FileReliability', function () { - - /** - * @tc.number SUB_STORAGE_FileReliability - * @tc.name FileReliability - * @tc.desc Function of API, Reliability test 7*24. - */ - it('FileReliability', 0, async function (done) { - for (let i = 0; i < 100000; i++) { - let promiseMkdir = new Promise(function (resolve, reject) { - file.mkdir({ - uri: 'internal://app/fileStability' + i, - success: function () { - console.log(i + 'call mkdir success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call mkdir fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('mkdir success!'); - }, 10); - }); - promiseMkdir.then(function () { - console.log('mkdir success'); - }); - let promiseWriteText = new Promise(function (resolve, reject) { - file.writeText({ - uri: 'internal://app/fileStability' + i + '/fileStability01' + i, - text: 'Text that just for test.', - success: function () { - console.log(i + 'call writeText success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call writeText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('writeText success!'); - }, 15); - }); - promiseWriteText.then(function () { - console.log('writeText success'); - }); - let promiseReadText = new Promise(function (resolve, reject) { - file.readText({ - uri: 'internal://app/fileStability' + i + '/fileStability01' + i, - success: function (data) { - console.log(i + 'call readText success: ' + data.text); - done(); - }, - fail: function (data, code) { - console.log(i + 'call readText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('readText success!'); - }, 15); - }); - promiseReadText.then(function () { - console.log('readText success'); - }); - let promiseAccess = new Promise(function (resolve, reject) { - file.access({ - uri: 'internal://app/fileStability' + i + '/fileStability01' + i, - success: function () { - console.log(i + 'call access success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call access fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('access success!'); - }, 15); - }); - promiseAccess.then(function () { - console.log('access success'); - }); - let promiseGet = new Promise(function (resolve, reject) { - file.get({ - uri: 'internal://app/fileStability' + i + '/fileStability01' + i, - success: function (data) { - console.log(i + 'call readText success: ' + data.uri); - done(); - }, - fail: function (data, code) { - console.log(i + 'call callback fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('get success!'); - }, 15); - }); - promiseGet.then(function () { - console.log('get success'); - }); - let promiseList = new Promise(function (resolve, reject) { - file.list({ - uri: 'internal://app/fileStability' + i, - success: function (data) { - console.log(i + 'call readText success: ' + data.fileList); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail callback fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('list success!'); - }, 15); - }); - promiseList.then(function () { - console.log('list success'); - }); - let promiseCopy = new Promise(function (resolve, reject) { - file.copy({ - srcUri: 'internal://app/fileStability' + i + '/fileStability01' + i, - dstUri: 'internal://app/fileStability' + i + '/fileStability02' + i, - success: function (uri) { - console.log(i + 'call success copy success uri: ' + uri); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail copy fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('copy success!'); - }, 15); - }); - promiseCopy.then(function () { - console.log('copy success'); - }); - let promiseMove = new Promise(function (resolve, reject) { - file.move({ - srcUri: 'internal://app/fileStability' + i + '/fileStability01' + i, - dstUri: 'internal://app/fileStability01' + i, - success: function (uri) { - console.log(i + 'call success move success. uri: ' + uri); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail move fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('move success!'); - }, 15); - }); - promiseMove.then(function () { - console.log('move success'); - }); - file.delete({ - uri: 'internal://app/fileStability01' + i, - success: function () { - console.log(i + 'call delete success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail delete fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - file.delete({ - uri: 'internal://app/fileStability' + i + '/fileStability02' + i, - success: function () { - console.log(i + 'call delete success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail delete fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - let promiseWriteArrayBuffer = new Promise(function (resolve, reject) { - let buf = new Uint8Array([48, 49, 50, 51, 65, 66, 67, 68, 32, 33]); - file.writeArrayBuffer({ - uri: 'internal://app/fileStability' + i + '/fileStability02' + i, - buffer: buf, - success: function () { - console.log(i + 'call writeArrayBuffer success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail writeArrayBuffer fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('writeArrayBuffer success!'); - }, 15); - }); - promiseWriteArrayBuffer.then(function () { - console.log('writeArrayBuffer success'); - }); - let promiseReadArrayBuffer = new Promise(function (resolve, reject) { - file.readArrayBuffer({ - uri: 'internal://app/fileStability' + i + '/fileStability02' + i, - success: function (data) { - console.log(i + 'call readArrayBuffer success: ' + data.buffer); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail readArrayBuffer fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('readArrayBuffer success!'); - }, 15); - }); - promiseReadArrayBuffer.then(function () { - console.log('readArrayBuffer success'); - }); - file.delete({ - uri: 'internal://app/fileStability' + i + '/fileStability02' + i, - success: function () { - console.log(i + 'call delete success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail delete fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - let promiseRmdir = new Promise(function (resolve, reject) { - file.rmdir({ - uri: 'internal://app/fileStability' + i, - recursive: true, - success: function () { - console.log(i + 'call rmdir success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail rmdir fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('rmdir success!'); - }, 15); - }); - promiseReadArrayBuffer.then(function () { - console.log('rmdir success'); - }); - - } - }); -}); diff --git a/storage/storagefilestabilityjstest/src/main/js/default/test/FileStability.js b/storage/storagefilestabilityjstest/src/main/js/default/test/FileStability.js deleted file mode 100644 index ad451d79a..000000000 --- a/storage/storagefilestabilityjstest/src/main/js/default/test/FileStability.js +++ /dev/null @@ -1,302 +0,0 @@ -/* - * 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 fileio from '@system.fileio' -import file from '@system.file'; -import { - describe, - it, - expect -} - from 'deccjsunit/index' -import { - FILE_CONTENT, - prepareFile, - nextFileName, - differentFileName -} - from './Common' - -describe('FileReliability', function () { - - /** - * @tc.number SUB_STORAGE_FileReliability - * @tc.name FileReliability - * @tc.desc Function of API, Reliability test 7*24. - */ - it('FileReliability', 0, async function (done) { - for (let i = 0; i < 100000; i++) { - let promiseMkdir = new Promise(function (resolve, reject) { - file.mkdir({ - uri: 'internal://app/fileStability' + i, - success: function () { - console.log(i + 'call mkdir success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call mkdir fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('mkdir success!'); - done() - }, 250); - }); - promiseMkdir.then(function () { - console.log('mkdir success'); - }); - let promiseWriteText = new Promise(function (resolve, reject) { - file.writeText({ - uri: 'internal://app/fileStability' + i + '/fileStability01' + i, - text: 'Text that just for test.', - success: function () { - console.log(i + 'call writeText success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call writeText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('writeText success!'); - }, 250); - }); - promiseWriteText.then(function () { - console.log('writeText success'); - done(); - }); - let promiseReadText = new Promise(function (resolve, reject) { - file.readText({ - uri: 'internal://app/fileStability' + i + '/fileStability01' + i, - success: function (data) { - console.log(i + 'call readText success: ' + data.text); - done(); - }, - fail: function (data, code) { - console.log(i + 'call readText fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('readText success!'); - }, 250); - }); - promiseReadText.then(function () { - console.log('readText success'); - done(); - }); - let promiseAccess = new Promise(function (resolve, reject) { - file.access({ - uri: 'internal://app/fileStability' + i + '/fileStability01' + i, - success: function () { - console.log(i + 'call access success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call access fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('access success!'); - }, 250); - }); - promiseAccess.then(function () { - console.log('access success'); - done(); - }); - let promiseGet = new Promise(function (resolve, reject) { - file.get({ - uri: 'internal://app/fileStability' + i + '/fileStability01' + i, - success: function (data) { - console.log(i + 'call readText success: ' + data.uri); - done(); - }, - fail: function (data, code) { - console.log(i + 'call callback fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('get success!'); - }, 250); - }); - promiseGet.then(function () { - console.log('get success'); - done(); - }); - let promiseList = new Promise(function (resolve, reject) { - file.list({ - uri: 'internal://app/fileStability' + i, - success: function (data) { - console.log(i + 'call readText success: ' + data.fileList); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail callback fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('list success!'); - }, 250); - }); - promiseList.then(function () { - console.log('list success'); - done(); - }); - let promiseCopy = new Promise(function (resolve, reject) { - file.copy({ - srcUri: 'internal://app/fileStability' + i + '/fileStability01' + i, - dstUri: 'internal://app/fileStability' + i + '/fileStability02' + i, - success: function (uri) { - console.log(i + 'call success copy success uri: ' + uri); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail copy fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('copy success!'); - }, 250); - }); - promiseCopy.then(function () { - console.log('copy success'); - done(); - }); - let promiseMove = new Promise(function (resolve, reject) { - file.move({ - srcUri: 'internal://app/fileStability' + i + '/fileStability01' + i, - dstUri: 'internal://app/fileStability01' + i, - success: function (uri) { - console.log(i + 'call success move success. uri: ' + uri); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail move fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('move success!'); - }, 250); - }); - promiseMove.then(function () { - console.log('move success'); - done(); - }); - file.delete({ - uri: 'internal://app/fileStability01' + i, - success: function () { - console.log(i + 'call delete success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail delete fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - file.delete({ - uri: 'internal://app/fileStability' + i + '/fileStability02' + i, - success: function () { - console.log(i + 'call delete success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail delete fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - let promiseWriteArrayBuffer = new Promise(function (resolve, reject) { - let buf = new Uint8Array([48, 49, 50, 51, 65, 66, 67, 68, 32, 33]); - file.writeArrayBuffer({ - uri: 'internal://app/fileStability' + i + '/fileStability02' + i, - buffer: buf, - success: function () { - console.log(i + 'call writeArrayBuffer success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail writeArrayBuffer fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('writeArrayBuffer success!'); - }, 250); - }); - promiseWriteArrayBuffer.then(function () { - console.log('writeArrayBuffer success'); - done(); - }); - let promiseReadArrayBuffer = new Promise(function (resolve, reject) { - file.readArrayBuffer({ - uri: 'internal://app/fileStability' + i + '/fileStability02' + i, - success: function (data) { - console.log(i + 'call readArrayBuffer success: ' + data.buffer); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail readArrayBuffer fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('readArrayBuffer success!'); - }, 250); - }); - promiseReadArrayBuffer.then(function () { - done(); - console.log('readArrayBuffer success'); - }); - file.delete({ - uri: 'internal://app/fileStability' + i + '/fileStability02' + i, - success: function () { - console.log(i + 'call delete success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail delete fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - let promiseRmdir = new Promise(function (resolve, reject) { - file.rmdir({ - uri: 'internal://app/fileStability' + i, - recursive: true, - success: function () { - console.log(i + 'call rmdir success.'); - done(); - }, - fail: function (data, code) { - console.log(i + 'call fail rmdir fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('rmdir success!'); - }, 250); - }); - promiseRmdir.then(function () { - console.log('rmdir success'); - done(); - }); - - } - }); -}); diff --git a/storage/storagefilestabilityjstest/src/main/js/default/test/List.test.js b/storage/storagefilestabilityjstest/src/main/js/default/test/List.test.js deleted file mode 100644 index 177b4adfc..000000000 --- a/storage/storagefilestabilityjstest/src/main/js/default/test/List.test.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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('./FileReliability.js') -require('./FileStability.js') diff --git a/storage/storagefilestabilityjstest/src/main/resources/base/element/string.json b/storage/storagefilestabilityjstest/src/main/resources/base/element/string.json deleted file mode 100644 index 4b5a8bbc0..000000000 --- a/storage/storagefilestabilityjstest/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "storagefilestabilityjstest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/storage/storagefilestabilityjstest/src/main/resources/base/media/icon.png b/storage/storagefilestabilityjstest/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 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;o7z z8a^Lfq<1uH`E{G9E z*(=)Css_LSk=>E9jr)s5^2-!+MN=Ds}>1hRma4`uCIz9%p3O77839E{xf z4c_I?**|1`K2tg4!Hvyrou4BsJQuv*UfF)<%CelYIS>D^o?X)3+MK%la6kooW8&G@BU)Y0hT`+mOm$Z_%rB=a%o>I z!2c6lHyKQN)VjiFwa!eE^p8jc$sy$vB+8i25lI~6KPFFh$!o$avA~rj#L6xvR|Z83 z*WD6T9e+5Pyy=F+)pNTf{ny3cy>7Rkd3o*TS?TZJ`NS^NF2%HMkyS{?uJ$`!P4_L^ z1`NFDUbNyg_qREifgktnp1_v{Jbb`7m}2PTyUdOmtJj~m z9bB=ecw4_^rw1IW=of+>nrW5=d3k`3qHCxsIN_F{T1A545};;+fsyC&qChi+YV zr~M63H8ZLCPYmsjY>ls9cL%I)F|JIW-#+48$+lD4k*(P*kDM%zx_fvu4u5ZYUnI}5 zdrycFq>xFU)&X3p@pP2u%$o}}YcRn(MhJ&B2o?KS@cIVz>Ye%o^xV?CB{_Qhu z;}_q1bvO^g{8<3!gYbo4Di{8qzV+(9 zdlmksohQmRTs@qB;(Wo?dER_ux6XQb@q$tQPW?CMu6GVQd;R=iR;-S{Kr%Zks7>b1 zNs{|-+jhObYE}NR&`TGGr^h^4bjh%c>R#@=8nM&Md>_a+zVulsl;){flFekV1t9ob z+SqfV_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b diff --git a/storage/storagefmspublicjstest/src/main/config.json b/storage/storagefmspublicjstest/src/main/config.json deleted file mode 100644 index 9b7cfe5d0..000000000 --- a/storage/storagefmspublicjstest/src/main/config.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "app": { - "bundleName": "ohos.acts.stroage.fileio", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5 - } - }, - "deviceConfig": {}, - "module": { - "package": "ohos.acts.stroage.fileio", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "ohos.acts.stroage.fileio.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/storage/storagefmspublicjstest/src/main/js/default/app.js b/storage/storagefmspublicjstest/src/main/js/default/app.js deleted file mode 100644 index 60ee141c8..000000000 --- a/storage/storagefmspublicjstest/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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('ohos.acts.distributeddatamgr.distributedfile onCreate'); - }, - onDestroy() { - console.info('ohos.acts.distributeddatamgr.distributedfile onCreate'); - } -}; diff --git a/storage/storagefmspublicjstest/src/main/js/default/i18n/en-US.json b/storage/storagefmspublicjstest/src/main/js/default/i18n/en-US.json deleted file mode 100644 index ead52ed2e..000000000 --- a/storage/storagefmspublicjstest/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "Test" - } -} \ No newline at end of file diff --git a/storage/storagefmspublicjstest/src/main/js/default/i18n/zh-CN.json b/storage/storagefmspublicjstest/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index 3f48f2585..000000000 --- a/storage/storagefmspublicjstest/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "测试" - } -} \ No newline at end of file diff --git a/storage/storagefmspublicjstest/src/main/js/default/pages/index/index.css b/storage/storagefmspublicjstest/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda79275..000000000 --- a/storage/storagefmspublicjstest/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/storage/storagefmspublicjstest/src/main/js/default/pages/index/index.hml b/storage/storagefmspublicjstest/src/main/js/default/pages/index/index.hml deleted file mode 100644 index f64b040a5..000000000 --- a/storage/storagefmspublicjstest/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/storage/storagefmspublicjstest/src/main/js/default/pages/index/index.js b/storage/storagefmspublicjstest/src/main/js/default/pages/index/index.js deleted file mode 100644 index f7894a722..000000000 --- a/storage/storagefmspublicjstest/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 {Core} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: '' - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - require('../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/storage/storagefmspublicjstest/src/main/js/default/test/Common.js b/storage/storagefmspublicjstest/src/main/js/default/test/Common.js deleted file mode 100644 index c7b15f7ce..000000000 --- a/storage/storagefmspublicjstest/src/main/js/default/test/Common.js +++ /dev/null @@ -1,192 +0,0 @@ -/* - * 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 fileio from '@system.fileio' -export const FILE_CONTENT = 'hello world' -export function prepareFile(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o666) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareFile1(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareEmptyFile(fpath) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function fileToReadOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o444) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadOnly for ' + e); - return false - } -} -export function fileToWriteOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o2) - fileio.fchmodSync(fd, 0o222) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToWriteOnly ' + e) - return false - } -} -export function fileToReadAndWrite(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o777) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadAndWrite ' + e); - return false - } -} -export function filePickerName(testName,deviceID) { - const BASE_PATH = '/data/ss/'+deviceID+'/fms_test/' - return BASE_PATH + testName -} -export function filePickerName1(testName,deviceID) { - const BASE_PATH = '/data/ss/'+ deviceID +'/fms_test/' - return BASE_PATH + testName -} -export function filePickerName2(testName,deviceID) { - const BASE_PATH = '/data/ss/'+ deviceID - return BASE_PATH + testName -} -export function appName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/' - return BASE_PATH + testName -} -export function nextFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/cache/' - return BASE_PATH + testName -} -export function fileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/' - return BASE_PATH + testName -} -export function cacheFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/cache/' - return BASE_PATH + testName -} -export function differentFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/' - return BASE_PATH + testName -} -export function differentCacheName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/cache/' - return BASE_PATH + testName -} -export function fmsFileName(testName) { - const BASE_PATH = "/data/accounts/account_0/appdata/ohos.acts.test/files/" - return BASE_PATH + testName -} -export function fmsCacheName(testName) { - const BASE_PATH = "/data/accounts/account_0/appdata/ohos.acts.test/cache/" - return BASE_PATH + testName -} -export function fmsPublic(testName) { - const BASE_PATH = '/data/ss/files/' - return BASE_PATH + testName -} - -export function getFileTextLen(fpath) { - let ss - try { - ss = fileio.Stream.createStreamSync(fpath, 'r+') - expect(ss !== null).assertTrue() - let len = ss.readSync(new ArrayBuffer(4096)) - console.log('file:' + fpath) - console.log('file lenth:' + len) - expect(ss.closeSync() !== null).assertTrue() - return len - } - catch (e) { - console.log('Failed to getFileTextLen ' + e) - expect(ss.closeSync() == null).assertTrue() - return null - } -} -export function isFileExist(fpath) { - try { - expect(fileio.accessSync(fpath) !== null).assertTrue() - console.log('file:' + fpath) - console.log('status:exist') - return true - } - catch (e) { - console.log('file:' + fpath) - console.log('status:non-existen') - return false - } -} -export function sleep(n) { - var start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > n) { - break; - } - } -} -export function randomString(num) { - let len= num; - var $chars = 'aaaabbbbcccc'; - var maxPos = $chars.length; - var pwd = ''; - for (var i = 0; i < len; i++) { - pwd += $chars.charAt(Math.floor(Math.random() * maxPos)); - } - return pwd; -} diff --git a/storage/storagefmspublicjstest/src/main/js/default/test/FmsPerformance.test.js b/storage/storagefmspublicjstest/src/main/js/default/test/FmsPerformance.test.js deleted file mode 100644 index 4ed454112..000000000 --- a/storage/storagefmspublicjstest/src/main/js/default/test/FmsPerformance.test.js +++ /dev/null @@ -1,238 +0,0 @@ -/* - * 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 fileio from '@ohos.fileio'; -import filepicker from '@ohos.filepicker' -import { - describe, - beforeAll, - beforeEach, - afterEach, - afterAll, - it, - expect -} -from 'deccjsunit/index' -import { - FILE_CONTENT, - prepareFile, - fileName, - filePickerName, - filePickerName2, - sleep, - randomString, - cacheFileName, - prepareEmptyFile, - nextFileName -} -from './Common' -describe('FmsPerformanceTest', function () { - let deviceID = 0; - /** - * @tc.number SUB_STORAGE_FMS_Stability_0000 - * @tc.name FMS_Stability_0000 - * @tc.desc Function of API,Performance Test - */ - it('FMS_Performance_0000', 0, function (done) { - let start = new Date().getTime(); - for (let i = 0; i < 1000; i++){ - let progetDeviceInfo = new Promise(function (resolve, reject) { - for (let i = 0; i < 1000; i++){} - filepicker.getDeviceInfo({ - success: function (data) { - let end = new Date().getTime(); - let time = end - start; - console.log('-------FMS_Performance_0000 success, time:' + time + ',' + i); - start = new Date().getTime(); - console.log('FMS_Function_0000 success.' + JSON.stringify(data)); - deviceID = data.deviceList[0].deviceID; - done() - }, - fail: function (data, code) { - console.log('FMS_Function_0000 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - progetDeviceInfo.then(function () { - console.log('FMS_Function_0000 success'); - }); - } - }) - - /** - * @tc.number SUB_STORAGE_FMS_Performance_0100 - * @tc.name FMS_Performance_0100 - * @tc.desc Function of API,Performance Test - */ - it('FMS_Performance_0100', 0, function (done) { - let start = new Date().getTime(); - for (let i = 0; i < 1000; i++){ - let proMkdir = new Promise(function (resolve, reject) { - filepicker.mkdir({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/document/fms_test/leaf', - success: function () { - let end = new Date().getTime(); - let time = end - start; - console.log('-------FMS_Performance_0100 success, time:' + time + ',' + i); - start = new Date().getTime(); - console.log('FMS_Performance_0100 success.'); - done() - }, - fail: function (data, code) { - console.log('FMS_Performance_0100 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - proMkdir.catch(function () { - console.log('FMS_Performance_0100 success'); - }); - } - }) - - /** - * @tc.number SUB_STORAGE_FMS_Performance_0200 - * @tc.name FMS_Performance_0200 - * @tc.desc Function of API,Performance Test - */ - it('FMS_Performance_0200', 0, function (done) { - let start = new Date().getTime(); - for (let i = 0; i < 1000; i++){ - let proMkdir = new Promise(function (resolve, reject) { - filepicker.mkdir({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/document/a/b/c/leaf', - success: function () { - let end = new Date().getTime(); - let time = end - start; - console.log('-------FMS_Performance_0200 success, time:' + time + ',' + i); - start = new Date().getTime(); - console.log('FMS_Performance_0200 success.'); - done() - }, - fail: function (data, code) { - console.log('FMS_Performance_0200 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - proMkdir.catch(function () { - console.log('FMS_Performance_0200 success'); - }); - } - }) - - /** - * @tc.number SUB_STORAGE_FMS_Performance_0300 - * @tc.name FMS_Performance_0300 - * @tc.desc Function of API,Performance Test - */ - it('FMS_Performance_0300', 0, function (done) { - let fpath = filePickerName("a.txt", deviceID); - prepareFile(fpath, FILE_CONTENT) - let start = new Date().getTime(); - for (let i = 0; i < 1000; i++){ - let proMkdir = new Promise(function (resolve, reject) { - filepicker.saveFile({ - srcUri: ['dataability:///public.storage.ability/' + deviceID + '/document/fms_test/a.txt/leaf'], - dstUri: 'dataability:///public.storage.ability/' + deviceID + '/root', - success: function (data) { - let end = new Date().getTime(); - let time = end - start; - console.log('-------FMS_Performance_0300 success, time:' + time + ',' + i); - start = new Date().getTime(); - console.log('FMS_Performance_0300 success.' + data.saveFileList[0].status); - done() - }, - fail: function (data, code) { - console.log('FMS_Performance_0300 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - setTimeout(function () { - resolve('mkdir success!'); - done() - }, 250); - }) - proMkdir.then(function () { - console.log('FMS_Performance_0300 success'); - }); - } - }) - - /** - * @tc.number SUB_STORAGE_FMS_Performance_0400 - * @tc.name FMS_Performance_0400 - * @tc.desc Function of API,Performance Test - */ - it('FMS_Performance_0400', 0, function (done) { - let start = new Date().getTime(); - for (let i = 0; i < 1000; i++){ - let proMkdir = new Promise(function (resolve, reject) { - filepicker.searchFile({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/document/fms_test/leaf', - name: 'a.txt', - success: function (data) { - let end = new Date().getTime(); - let time = end - start; - console.log('-------FMS_Performance_0400 success, time:' + time + ',' + i); - start = new Date().getTime(); - console.log('FMS_Performance_0400 success.' + data.fileList[0].uri); - done() - }, - fail: function (data, code) { - console.log('FMS_Performance_0400 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - proMkdir.then(function () { - console.log('FMS_Performance_0400 success'); - }); - } - }) - - /** - * @tc.number SUB_STORAGE_FMS_Performance_0500 - * @tc.name FMS_Performance_0500 - * @tc.desc Function of API,Performance Test - */ - it('FMS_Performance_0500', 0, function (done) { - let start = new Date().getTime(); - for (let i = 0; i < 1000; i++){ - let proMkdir = new Promise(function (resolve, reject) { - filepicker.list({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/document/fms_test/leaf', - success: function (data) { - let end = new Date().getTime(); - let time = end - start; - console.log('-------FMS_Performance_0500 success, time:' + time + ',' + i); - start = new Date().getTime(); - console.log('FMS_Performance_0500 success.' + data.fileList[0].uri); - done() - }, - fail: function (data, code) { - console.log('FMS_Performance_0500 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - proMkdir.then(function () { - console.log('FMS_Performance_0500 success'); - }); - } - }) - -}) \ No newline at end of file diff --git a/storage/storagefmspublicjstest/src/main/js/default/test/FmsPublic.test.js b/storage/storagefmspublicjstest/src/main/js/default/test/FmsPublic.test.js deleted file mode 100644 index 222eaadba..000000000 --- a/storage/storagefmspublicjstest/src/main/js/default/test/FmsPublic.test.js +++ /dev/null @@ -1,400 +0,0 @@ -/* - * 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 fileio from '@ohos.fileio'; -import filepicker from '@ohos.filepicker' -import { - describe, - beforeAll, - beforeEach, - afterEach, - afterAll, - it, - expect -} -from 'deccjsunit/index' -import { - FILE_CONTENT, - prepareFile, - fileName, - filePickerName, - randomString, - cacheFileName, - prepareEmptyFile, - nextFileName -} -from './Common' -describe('FmsTest', function () { - let deviceID = 0; - - /** - * @tc.number SUB_STORAGE_FMS_Function_0000 - * @tc.name FMS_Function_0000 - * @tc.desc Function of API,Get current device information - */ - it('FMS_Function_0000', 0, async function (done) { - let progetDeviceInfo = new Promise(function (resolve, reject) { - filepicker.getDeviceInfo({ - success: function (data) { - console.log('FMS_Function_0000 success.' + JSON.stringify(data)); - if (data.deviceList.length == 0) { - console.log('FMS_Function_0000 fail'); - expect(null).assertFail(); - } else { - deviceID = data.deviceList[0].deviceID; - console.log("---FMS_Function_0000------" + deviceID); - done(); - } - }, - fail: function (data, code) { - console.log('FMS_Function_0000 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - progetDeviceInfo.then(function () { - console.log('FMS_Function_0000 success'); - }); - }) - - /** - * @tc.number SUB_STORAGE_FMS_Function_0100 - * @tc.name FMS_Function_0100 - * @tc.desc Function of API, Creates the specified directory recursively - */ - it('FMS_Function_0100', 0, async function (done) { - let proMkdir = new Promise(function (resolve, reject) { - filepicker.mkdir({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/document/fms_test/leaf', - success: function () { - console.log('FMS_Function_0100 mkdir success.'); - done() - }, - fail: function (data, code) { - console.log('FMS_Function_0100 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - proMkdir.then(function () { - console.log('FMS_Function_0100 success'); - }); - }) - - /** - * @tc.number SUB_STORAGE_FMS_Function_0200 - * @tc.name FMS_Function_0200 - * @tc.desc Function of API, Creates the specified directory recursively - */ - it('FMS_Function_0200', 0, async function (done) { - let proMkdir = new Promise(function (resolve, reject) { - filepicker.mkdir({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/document/你好/leaf', - success: function () { - console.log('FMS_Function_0200 mkdir success.'); - done() - }, - fail: function (data, code) { - console.log('FMS_Function_0200 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - proMkdir.then(function () { - console.log('FMS_Function_0200 success'); - }); - }) - - /** - * @tc.number SUB_STORAGE_FMS_Function_0300 - * @tc.name FMS_Function_0300 - * @tc.desc Function of API, Creates the specified directory recursively - */ - it('FMS_Function_0300', 0,async function (done) { - let proMkdir = new Promise(function (resolve, reject) { - filepicker.mkdir({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/document/a/b/c/leaf', - success: function () { - console.log('FMS_Function_0300 mkdir success.'); - done() - }, - fail: function (data, code) { - console.log('FMS_Function_0300 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - proMkdir.then(function () { - console.log('FMS_Function_0300 success'); - }); - }) - - /** - * @tc.number SUB_STORAGE_FMS_Function_0400 - * @tc.name FMS_Function_0400 - * @tc.desc Function of API, - */ - it('FMS_Function_0400', 0, async function (done) { - let proMkdir = new Promise(function (resolve, reject) { - filepicker.mkdir({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/root/files', - success: function () { - console.log('FMS_Function_0400 success.'); - done() - }, - fail: function (data, code) { - console.log('call fail callback fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - proMkdir.then(function () { - console.log('FMS_Function_0400 success'); - }); - }) - - /** - * @tc.number SUB_STORAGE_FMS_Function_0500 - * @tc.name FMS_Function_0500 - * @tc.desc Function of API, save file.The test file is exist. - */ - it('FMS_Function_0500', 0, async function (done) { - let fpath = filePickerName("a.txt", deviceID); - expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue(); - let proMkdir = new Promise(function (resolve, reject) { - filepicker.saveFile({ - srcUri: ['dataability:///public.storage.ability/' + deviceID + '/document/fms_test/a.txt/leaf'], - dstUri: 'dataability:///public.storage.ability/' + deviceID + '/root', - success: function (data) { - console.log('FMS_Function_0500 success.' + data.saveFileList[0].status); - done() - }, - fail: function (data, code) { - console.log('FMS_Function_0500 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - proMkdir.then(function () { - console.log('FMS_Function_0500 success'); - }); - }) - - /** - * @tc.number SUB_STORAGE_FMS_Function_0600 - * @tc.name FMS_Function_0600 - * @tc.desc Function of API, save file.The test file is exist. - */ - it('FMS_Function_0600', 0, async function (done) { - let fpath = filePickerName("b.txt", deviceID); - expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue(); - let proMkdir = new Promise(function (resolve, reject) { - filepicker.saveFile({ - srcUri: ['dataability:///public.storage.ability/' + deviceID + '/document/fms_test/a.txt/leaf', - 'dataability:///public.storage.ability/' + deviceID + '/document/fms_test/b.txt/leaf'], - dstUri: 'dataability:///public.storage.ability/' + deviceID + '/root', - success: function (data) { - console.log('FMS_Function_0600 success.' + data.saveFileList[0].status); - done() - }, - fail: function (data, code) { - console.log('FMS_Function_0600 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - proMkdir.then(function () { - console.log('FMS_Function_0600 success'); - }); - }) - - /** - * @tc.number SUB_STORAGE_FMS_Function_0700 - * @tc.name FMS_Function_0700 - * @tc.desc Function of API, save file.The test file is exist. - */ - it('FMS_Function_0700', 0, async function (done) { - let proMkdir = new Promise(function (resolve, reject) { - filepicker.saveFile({ - srcUri: ['dataability:///public.storage.ability/' + deviceID + '/document/fms_test/a.txt/leaf'], - dstUri: 'dataability:///public.storage.ability/' + deviceID + '/root/files', - success: function (data) { - console.log('FMS_Function_0700 success.' + data.saveFileList[0].status); - done() - }, - fail: function (data, code) { - console.log('FMS_Function_0700 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - proMkdir.then(function () { - console.log('FMS_Function_0700 success'); - }); - - }) - - /** - * @tc.number SUB_STORAGE_FMS_Function_0800 - * @tc.name FMS_Function_0800 - * @tc.desc Function of API, save file.The test file is exist. - */ - it('FMS_Function_0800', 0, async function (done) { - let proMkdir = new Promise(function (resolve, reject) { - filepicker.saveFile({ - srcUri: ['dataability:///public.storage.ability/' + deviceID + '/document/fms_test/a.txt/leaf', - 'dataability:///public.storage.ability/' + deviceID + '/document/fms_test/b.txt/leaf'], - dstUri: 'dataability:///public.storage.ability/' + deviceID + '/root/files', - success: function (data) { - console.log('FMS_Function_0800 success.' + data.saveFileList[0].status); - done() - }, - fail: function (data, code) { - console.log('FMS_Function_0800 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - proMkdir.then(function () { - console.log('FMS_Function_0800 success'); - }); - }) - - /** - * @tc.number SUB_STORAGE_FMS_Function_0900 - * @tc.name FMS_Function_0900 - * @tc.desc Function of API, search file.The test file is exist. - */ - it('FMS_Function_0900', 0, async function (done) { - let proMkdir = new Promise(function (resolve, reject) { - filepicker.searchFile({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/document/fms_test/leaf', - name: 'a.txt', - success: function (data) { - console.log('FMS_Function_0900 success.' + data.fileList[0].uri); - done() - }, - fail: function (data, code) { - console.log('FMS_Function_0900 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - proMkdir.then(function () { - console.log('FMS_Function_0900 success'); - }); - }) - - /** - * @tc.number SUB_STORAGE_FMS_Function_1000 - * @tc.name FMS_Function_1000 - * @tc.desc Function of API, search file.The test file is exist. - */ - it('FMS_Function_1000', 0, async function (done) { - let proMkdir = new Promise(function (resolve, reject) { - filepicker.searchFile({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/document/fms_test/leaf', - name: 'b.txt', - success: function (data) { - console.log('FMS_Function_1000 success.' + data.fileList[0].uri); - done() - }, - fail: function (data, code) { - console.log('FMS_Function_1000 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - proMkdir.then(function () { - console.log('FMS_Function_1000 success'); - }); - - }) - - /** - * @tc.number SUB_STORAGE_FMS_Function_1100 - * @tc.name FMS_Function_1100 - * @tc.desc Function of API, search file.The test file is exist. - */ - it('FMS_Function_1100', 0, async function (done) { - let proMkdir = new Promise(function (resolve, reject) { - filepicker.searchFile({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/root/files', - name: 'a.txt', - success: function (data) { - console.log('FMS_Function_1100 success.' + data.fileList[0].uri); - done() - }, - fail: function (data, code) { - console.log('FMS_Function_1100 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - proMkdir.then(function () { - console.log('FMS_Function_1100 success'); - }); - - }) - - /** - * @tc.number SUB_STORAGE_FMS_Function_1200 - * @tc.name FMS_Function_1200 - * @tc.desc Function of API, Get all file information in the specified directory - */ - it('FMS_Function_1200', 0, async function (done) { - let proMkdir = new Promise(function (resolve, reject) { - filepicker.list({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/document/fms_test/leaf', - success: function (data) { - console.log('FMS_Function_1200 success.' + data.fileList[0].uri); - done() - }, - fail: function (data, code) { - console.log('FMS_Function_1200 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - proMkdir.then(function () { - console.log('FMS_Function_1200 success'); - }); - }) - - /** - * @tc.number SUB_STORAGE_FMS_Function_1300 - * @tc.name FMS_Function_1300 - * @tc.desc Function of API, Get all file information in the specified directory - */ - it('FMS_Function_1300', 0, async function (done) { - let proMkdir = new Promise(function (resolve, reject) { - filepicker.list({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/root', - success: function (data) { - console.log('FMS_Function_1300 success.' + data.fileList[0].uri); - done() - }, - fail: function (data, code) { - console.log('FMS_Function_1300 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }); - }) - proMkdir.then(function () { - console.log('FMS_Function_1300 success'); - }); - }) - -}) diff --git a/storage/storagefmspublicjstest/src/main/js/default/test/FmsPublicError.test.js b/storage/storagefmspublicjstest/src/main/js/default/test/FmsPublicError.test.js deleted file mode 100644 index 23c2e7b83..000000000 --- a/storage/storagefmspublicjstest/src/main/js/default/test/FmsPublicError.test.js +++ /dev/null @@ -1,428 +0,0 @@ -/* - * 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 filepicker from '@ohos.filepicker'; -import { - describe, - it, - expect -} -from 'deccjsunit/index' -import { - prepareFile, - fmsPublic, -} -from './Common' - -describe('FilepickerTest', function () { - - let deviceID = 0; - - /** - * @tc.number SUB_STORAGE_File_Test_Error_0000 - * @tc.name File_Test_Error_0000 - * @tc.desc Error of API, . - */ - it('File_Test_Error_0000', 0, async function (done) { - filepicker.getDeviceInfo({ - success: function (data) { - console.log('File_Test_Error_0000_start call mkdir success.' + data.deviceList[0].deviceID); - deviceID = data.deviceList[0].deviceID; - done() - }, - fail: function (data, code) { - console.error('File_Test_Error_0000_start call fail callback fail, code: ' + code + ', data: ' + data); - done() - }, - }); - setTimeout( - function () { - expect(null).assertFail(); - done(); - }, 30) - }); - - /** - * @tc.number SUB_STORAGE_File_Test_Error_0100 - * @tc.name File_Test_Error_0100 - * @tc.desc Error of API, mkdir code = 202. - */ - it('File_Test_Error_0100', 0, async function (done) { - filepicker.mkdir({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/udocument/files/leaf', - success: function () { - console.log('File_Test_Error_0100 call mkdir success.'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.error('File_Test_Error_0100 call fail callback fail, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue(); - done() - }, - }); - setTimeout( - function () { - expect(null).assertFail(); - done(); - }, 30) - }); - - /* - * @tc.number SUB_STORAGE_File_Test_Error_0200 - * @tc.name File_Test_Error_0200 - * @tc.desc Error of API, mkdir code = 302 - */ - it('File_Test_Error_0200', 0, async function (done) { - filepicker.mkdir({ - uri: 'data123ability:///public.storage.ability/' + deviceID + '/document/files/leaf', - success: function () { - console.log('File_Test_Error_0200 call mkdir success.'); - expect(null).assertFail(); - done() - }, - fail: function (data, code) { - console.error('File_Test_Error_0200 call fail callback fail, code: ' + code + ', data: ' + data); - expect(code == 302).assertTrue() - done() - }, - }); - setTimeout( - function () { - expect(null).assertFail(); - done(); - }, 30) - }); - - /** - * @tc.number SUB_STORAGE_File_Test_Error_0300 - * @tc.name File_Test_Error_0300 - * @tc.desc Error of API, mkdir code = 202 - */ - it('File_Test_Error_0300', 0, async function (done) { - filepicker.mkdir({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/document/files/lea', - success: function () { - console.log('File_Test_Error_0300 call mkdir success.'); - expect(null).assertFail(); - done() - }, - fail: function (data, code) { - console.error('File_Test_Error_0300 call fail callback fail, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue() - done() - }, - }); - setTimeout( - function () { - expect(null).assertFail(); - done(); - }, 30) - }); - - /** - * @tc.number SUB_STORAGE_File_Test_Error_0400 - * @tc.name File_Test_Error_0400 - * @tc.desc Error of API, mkdir code = 202 - */ - it('File_Test_Error_0400', 0, async function (done) { - filepicker.mkdir({ - uri: '/data/ss/files' - }); - let fpath = fmsPublic('File_Test_Error_0400'); - prepareFile(fpath, 'hello'); - filepicker.saveFile({ - srcUri: ['dataability:///public.storage.ability/data/ss/files/File_Test_Error_0400'], - dstUri: 'dataability:///public.storage.ability/‘’/document/files/leaf', - success: function (data) { - console.log('File_Test_Error_0400 call mkdir success.' + data.saveFileList[0].status); - expect(null).assertFail(); - done() - }, - fail: function (data, code) { - console.error('File_Test_Error_0400 call fail callback fail, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue() - done() - }, - }); - setTimeout( - function () { - expect(null).assertFail(); - done(); - }, 30) - }); - - /** - * @tc.number SUB_STORAGE_File_Test_Error_0500 - * @tc.name File_Test_Error_0500 - * @tc.desc Error of API,saveFile code = 202 - */ - it('File_Test_Error_0500', 0, async function (done) { - let fpath = fmsPublic('File_Test_Error_0500'); - prepareFile(fpath, 'hello'); - filepicker.saveFile({ - srcUri: ['dataability:///public.storage.ability/data/ss/file/File_Test_Error_0500'], - dstUri: 'dataability:///public.storage.ability/' + deviceID + '/document/files/leaf', - success: function (data) { - console.log('File_Test_Error_0500 call mkdir success.' + data.saveFileList[0].status); - expect(null).assertFail(); - done() - }, - fail: function (data, code) { - console.error('File_Test_Error_0500 call fail callback fail, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue() - done() - }, - }); - setTimeout( - function () { - expect(null).assertFail(); - done(); - }, 30) - }); - - /** - * @tc.number SUB_STORAGE_File_Test_Error_0600 - * @tc.name File_Test_Error_0600 - * @tc.desc Error of API, saveFile code = 202 - */ - it('File_Test_Error_0600', 0, function (done) { - filepicker.saveFile({ - srcUri: ['dataability:///public.storage.ability/data/ss/file/A.txt'], - dstUri: 'dataability:///public.storage.ability/' + deviceID + '/document/files/leaf', - success: function (data) { - console.log('File_Test_Error_0600 call mkdir success.' + data.saveFileList[0].status); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.error('File_Test_Error_0600 call fail callback fail, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue() - done() - }, - }); - setTimeout( - function () { - expect(null).assertFail(); - done(); - }, 30) - }); - - /** - * @tc.number SUB_STORAGE_File_Test_Error_0700 - * @tc.name File_Test_Error_0700 - * @tc.desc Error of API,saveFile code = 202 - */ - it('File_Test_Error_0700', 0, function (done) { - filepicker.saveFile({ - srcUri: ['dataability:///public.storage.ability/data/ss/files/a.txt'], - dstUri: 'dataability:///public.storage.ability/' + deviceID + '/document/files/lea', - success: function (data) { - console.log('File_Test_Error_0700 call mkdir success.' + data.saveFileList[0].status); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.error('File_Test_Error_0700 call fail callback fail, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue() - done() - }, - }); - setTimeout( - function () { - expect(null).assertFail(); - done(); - }, 30) - }); - - /** - * @tc.number SUB_STORAGE_File_Test_Error_0800 - * @tc.name File_Test_Error_0800 - * @tc.desc Error of API,saveFile code = 202 - */ - it('File_Test_Error_0800', 0, function (done) { - filepicker.saveFile({ - srcUri: ['dataability:///public.storage.ability/data/ss/files/a.txt'], - dstUri: 'dataability:///public.storage.ability/' + deviceID + '/document/bb/aa/files/leaf', - success: function (data) { - console.log('File_Test_Error_0800 call mkdir success.' + data.saveFileList[0].status); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.error('File_Test_Error_0800 call fail callback fail, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue() - done() - }, - }); - - setTimeout( - function () { - expect(null).assertFail(); - done(); - }, 30) - }); - - /** - * @tc.number SUB_STORAGE_File_Test_Error_0900 - * @tc.name File_Test_Error_0900 - * @tc.desc Error of API, saveFile code = 302 - */ - it('File_Test_Error_0900', 0, function (done) { - filepicker.saveFile({ - srcUri: ['dataability:///public.storage.ability/data/ss/files/a.txt'], - dstUri: 'data123ability:///public.storage.ability/' + deviceID + '/document/files/leaf', - success: function (data) { - console.log('File_Test_Error_0900 call mkdir success.' + data.saveFileList[0].status); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.error('File_Test_Error_0900 call fail callback fail, code: ' + code + ', data: ' + data); - expect(code == 302).assertTrue() - done() - }, - }); - setTimeout( - function () { - expect(null).assertFail(); - done(); - }, 30) - }); - - /** - * @tc.number SUB_STORAGE_File_Test_Error_1000 - * @tc.name File_Test_Error_1000 - * @tc.desc Error of API, saveFile code = 202 - */ - it('File_Test_Error_1000', 0, function (done) { - filepicker.saveFile({ - srcUri: ['dataability:///public.storage.ability/data/ss/files/a.txt'], - srcUri1: ['dataability:///public.storage.ability/data/ss/files/a.txt'], - dstUri: 'dataability:///public.storage.ability/' + deviceID + '/document/files/leaf', - success: function (data) { - console.log('File_Test_Error_1000 call mkdir success.' + data.saveFileList[0].status); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.error('File_Test_Error_1000 call fail callback fail, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue() - done() - }, - }); - setTimeout( - function () { - expect(null).assertFail(); - done(); - }, 30) - }); - - /** - * @tc.number SUB_STORAGE_File_Test_Error_1400 - * @tc.name File_Test_Error_1400 - * @tc.desc Error of API, list code = 202 - */ - it('File_Test_Error_1400', 0, function (done) { - filepicker.list({ - uri: 'dataability:///public.storage.ability/device_id/udocument/files/leaf', - success: function (data) { - console.log('File_Test_Error_1400 call mkdir success.' + data.fileList[0].uri); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.error('File_Test_Error_1400 call fail callback fail, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue() - done() - }, - }); - setTimeout( - function () { - expect(null).assertFail(); - done(); - }, 30) - - }); - - /** - * @tc.number SUB_STORAGE_File_Test_Error_1500 - * @tc.name File_Test_Error_1500 - * @tc.desc Error of API, list code = 302 - * path:'' - */ - it('File_Test_Error_1500', 0, function (done) { - filepicker.list({ - uri: '', - success: function (data) { - console.log('File_Test_Error_1500 call mkdir success.' + data.fileList[0].uri); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.error('File_Test_Error_1500 call fail callback fail, code: ' + code + ', data: ' + data); - expect(code == 302).assertTrue() - done() - }, - }); - setTimeout( - function () { - expect(null).assertFail(); - done(); - }, 30) - }); - - /** - * @tc.number SUB_STORAGE_File_Test_Error_1600 - * @tc.name File_Test_Error_1600 - * @tc.desc Error of API, list code = 300 - */ - it('File_Test_Error_1600', 0, function (done) { - filepicker.list({ - uri: 'dataability:///public.storage.ability/' + deviceID + '/document/file/leaf', - success: function (data) { - console.log('File_Test_Error_1600 call mkdir success.' + data.fileList[0].uri); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.error('File_Test_Error_1600 call fail callback fail, code: ' + code + ', data: ' + data); - expect(code == 300).assertTrue() - done() - }, - }); - setTimeout( - function () { - expect(null).assertFail(); - done(); - }, 30) - }); - - /** - * @tc.number SUB_STORAGE_File_Test_Error_1700 - * @tc.name File_Test_Error_1700 - * @tc.desc Error of API, list code = 302 - */ - it('File_Test_Error_1700', 0, function (done) { - filepicker.list({ - uri: 'data123ability:///public.storage.ability/' + deviceID + '/document/file/leaf', - success: function (data) { - console.log('File_Test_Error_1700 call mkdir success.' + data.fileList[0].uri); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.error('File_Test_Error_1700 call fail callback fail, code: ' + code + ', data: ' + data); - expect(code == 302).assertTrue() - done() - }, - }); - setTimeout( - function () { - expect(null).assertFail(); - done(); - }, 30) - }); -}); \ No newline at end of file diff --git a/storage/storagefmspublicjstest/src/main/js/default/test/List.test.js b/storage/storagefmspublicjstest/src/main/js/default/test/List.test.js deleted file mode 100644 index f82e74526..000000000 --- a/storage/storagefmspublicjstest/src/main/js/default/test/List.test.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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('./FmsPublic.test.js') - diff --git a/storage/storagefmspublicjstest/src/main/resources/base/element/string.json b/storage/storagefmspublicjstest/src/main/resources/base/element/string.json deleted file mode 100644 index 4b5a8bbc0..000000000 --- a/storage/storagefmspublicjstest/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "storagefilestabilityjstest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/storage/storagefmspublicjstest/src/main/resources/base/media/icon.png b/storage/storagefmspublicjstest/src/main/resources/base/media/icon.png deleted file mode 100755 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOqSxyuN1x;Is@8~m?*>}** znrRFArP!K_52RpX*&JHMR<^lVdm8ypJ}0R(SD(51j;6@ni$6bQ+2XL+R^|NnSp5}(kzvMZ^(@4fD_{QVu$(&K6H|C37TG1Am9Re{<<3gd zh@`>;BqkXMW&p0T6rt|iB$)~Cv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%~QtZ@m%&u zjGGLX;t6Ls62eQvNmf@v+}J%54^CygxRZ`?8X#r|wkev7(s;Ou4T#y1XNNf)h;o7z z8a^Lfq<1uH`E{G9E z*(=)Css_LSk=>E9jr)s5^2-!+MN=Ds}>1hRma4`uCIz9%p3O77839E{xf z4c_I?**|1`K2tg4!Hvyrou4BsJQuv*UfF)<%CelYIS>D^o?X)3+MK%la6kooW8&G@BU)Y0hT`+mOm$Z_%rB=a%o>I z!2c6lHyKQN)VjiFwa!eE^p8jc$sy$vB+8i25lI~6KPFFh$!o$avA~rj#L6xvR|Z83 z*WD6T9e+5Pyy=F+)pNTf{ny3cy>7Rkd3o*TS?TZJ`NS^NF2%HMkyS{?uJ$`!P4_L^ z1`NFDUbNyg_qREifgktnp1_v{Jbb`7m}2PTyUdOmtJj~m z9bB=ecw4_^rw1IW=of+>nrW5=d3k`3qHCxsIN_F{T1A545};;+fsyC&qChi+YV zr~M63H8ZLCPYmsjY>ls9cL%I)F|JIW-#+48$+lD4k*(P*kDM%zx_fvu4u5ZYUnI}5 zdrycFq>xFU)&X3p@pP2u%$o}}YcRn(MhJ&B2o?KS@cIVz>Ye%o^xV?CB{_Qhu z;}_q1bvO^g{8<3!gYbo4Di{8qzV+(9 zdlmksohQmRTs@qB;(Wo?dER_ux6XQb@q$tQPW?CMu6GVQd;R=iR;-S{Kr%Zks7>b1 zNs{|-+jhObYE}NR&`TGGr^h^4bjh%c>R#@=8nM&Md>_a+zVulsl;){flFekV1t9ob z+SqfV_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b diff --git a/storage/storagefmssharejstest/src/main/config.json b/storage/storagefmssharejstest/src/main/config.json deleted file mode 100644 index 3b243aeb3..000000000 --- a/storage/storagefmssharejstest/src/main/config.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "app": { - "bundleName": "ohos.acts.test", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Release" - } - }, - "deviceConfig": {}, - "module": { - "package": "ohos.acts.test", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "installationFree": true, - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "ohos.acts.test.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": "default2", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/storage/storagefmssharejstest/src/main/js/default/app.js b/storage/storagefmssharejstest/src/main/js/default/app.js deleted file mode 100644 index 60ee141c8..000000000 --- a/storage/storagefmssharejstest/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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('ohos.acts.distributeddatamgr.distributedfile onCreate'); - }, - onDestroy() { - console.info('ohos.acts.distributeddatamgr.distributedfile onCreate'); - } -}; diff --git a/storage/storagefmssharejstest/src/main/js/default/i18n/en-US.json b/storage/storagefmssharejstest/src/main/js/default/i18n/en-US.json deleted file mode 100644 index ead52ed2e..000000000 --- a/storage/storagefmssharejstest/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "Test" - } -} \ No newline at end of file diff --git a/storage/storagefmssharejstest/src/main/js/default/i18n/zh-CN.json b/storage/storagefmssharejstest/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index 3f48f2585..000000000 --- a/storage/storagefmssharejstest/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "测试" - } -} \ No newline at end of file diff --git a/storage/storagefmssharejstest/src/main/js/default/pages/index/index.css b/storage/storagefmssharejstest/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda79275..000000000 --- a/storage/storagefmssharejstest/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/storage/storagefmssharejstest/src/main/js/default/pages/index/index.hml b/storage/storagefmssharejstest/src/main/js/default/pages/index/index.hml deleted file mode 100644 index f64b040a5..000000000 --- a/storage/storagefmssharejstest/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/storage/storagefmssharejstest/src/main/js/default/pages/index/index.js b/storage/storagefmssharejstest/src/main/js/default/pages/index/index.js deleted file mode 100644 index f7894a722..000000000 --- a/storage/storagefmssharejstest/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 {Core} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: '' - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - require('../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/storage/storagefmssharejstest/src/main/js/default/test/Common.js b/storage/storagefmssharejstest/src/main/js/default/test/Common.js deleted file mode 100644 index e94e7f404..000000000 --- a/storage/storagefmssharejstest/src/main/js/default/test/Common.js +++ /dev/null @@ -1,180 +0,0 @@ -/* - * 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 fileio from '@system.fileio' -export const FILE_CONTENT = 'hello world' -export function prepareFile(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o666) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareFile1(fpath, content) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.ftruncateSync(fd) - fileio.writeSync(fd, content) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function prepareEmptyFile(fpath) { - try { - let fd = fileio.openSync(fpath, 0o102, 0o777) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to prepareFile for ' + e) - return false - } -} -export function fileToReadOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o444) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadOnly for ' + e); - return false - } -} -export function fileToWriteOnly(fpath) { - try { - let fd = fileio.openSync(fpath, 0o2) - fileio.fchmodSync(fd, 0o222) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToWriteOnly ' + e) - return false - } -} -export function fileToReadAndWrite(fpath) { - try { - let fd = fileio.openSync(fpath, 0o1) - fileio.fchmodSync(fd, 0o777) - fileio.fsyncSync(fd) - fileio.closeSync(fd) - return true - } - catch (e) { - console.log('Failed to fileToReadAndWrite ' + e); - return false - } -} -export function filePickerName(testName,deviceID) { - const BASE_PATH = '/data/ss/'+deviceID+'/fms_test/' - return BASE_PATH + testName -} -export function appName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/' - return BASE_PATH + testName -} -export function nextFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/cache/' - return BASE_PATH + testName -} -export function fileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/' - return BASE_PATH + testName -} -export function cacheFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/appdata/ohos.acts.stroage.fileio/files/cache/' - return BASE_PATH + testName -} -export function differentFileName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/' - return BASE_PATH + testName -} -export function differentCacheName(testName) { - const BASE_PATH = '/data/accounts/account_0/ohos.acts.distributeddatamgr.distributedfile/cache/' - return BASE_PATH + testName -} -export function fmsFileName(testName) { - const BASE_PATH = "/data/accounts/account_0/appdata/ohos.acts.test/files/" - return BASE_PATH + testName -} -export function fmsCacheName(testName) { - const BASE_PATH = "/data/accounts/account_0/appdata/ohos.acts.test/cache/" - return BASE_PATH + testName -} - -export function getFileTextLen(fpath) { - let ss - try { - ss = fileio.Stream.createStreamSync(fpath, 'r+') - expect(ss !== null).assertTrue() - let len = ss.readSync(new ArrayBuffer(4096)) - console.log('file:' + fpath) - console.log('file lenth:' + len) - expect(ss.closeSync() !== null).assertTrue() - return len - } - catch (e) { - console.log('Failed to getFileTextLen ' + e) - expect(ss.closeSync() == null).assertTrue() - return null - } -} -export function isFileExist(fpath) { - try { - expect(fileio.accessSync(fpath) !== null).assertTrue() - console.log('file:' + fpath) - console.log('status:exist') - return true - } - catch (e) { - console.log('file:' + fpath) - console.log('status:non-existen') - return false - } -} -export function sleep(n) { - var start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > n) { - break; - } - } -} -export function randomString(num) { - let len= num; - var $chars = 'aaaabbbbcccc'; - var maxPos = $chars.length; - var pwd = ''; - for (var i = 0; i < len; i++) { - pwd += $chars.charAt(Math.floor(Math.random() * maxPos)); - } - return pwd; -} diff --git a/storage/storagefmssharejstest/src/main/js/default/test/FmsShare.test.js b/storage/storagefmssharejstest/src/main/js/default/test/FmsShare.test.js deleted file mode 100644 index 212178f22..000000000 --- a/storage/storagefmssharejstest/src/main/js/default/test/FmsShare.test.js +++ /dev/null @@ -1,408 +0,0 @@ -/* - * 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 fileio from '@system.fileio'; -import fileShareAbility from '@ohos.fileshare'; -import { - describe, - beforeAll, - it, - expect -} -from 'deccjsunit/index' -import { - prepareFile, - fmsFileName, - fmsCacheName -} -from './Common' - -describe('fmsShareTest', function () { - beforeAll(() => { - prepareFile(fmsFileName('music.mp3'), 'content'); - prepareFile(fmsFileName('f0.txt'), 'content'); - prepareFile(fmsFileName('picture.jpg'), 'content'); - prepareFile(fmsFileName('picture2.jpg'), 'content'); - prepareFile(fmsFileName('文件.doc'), 'content'); - prepareFile(fmsFileName('cross Fire.txt'), 'content'); - prepareFile(fmsCacheName('video.mp4'), 'content'); - prepareFile(fmsFileName('file.xlsx'), 'content'); - prepareFile(fmsFileName('f2.ppt'), 'content'); - prepareFile(fmsFileName('f3.doc'), 'content'); - fileio.mkdirSync(fmsFileName('folder')); - let text = '[{"type": "files-path", "name": "primary_leaf", "path": "/music.mp3"},' + - '{"type": "files-path", "name": "primary_leaf2", "path": "/f0.txt"},' + - '{"type": "files-path", "name": "primary_leaf3", "path": "/picture.jpg"},' + - '{"type": "files-path", "name": "primary_leaf4", "path": "/picture2.jpg"},' + - '{"type": "files-path", "name": "primary_leaf5", "path": "/文件.doc"},' + - '{"type": "files-path", "name": "primary_leaf6", "path": "/cross Fire.txt"},' + - '{"type": "cache-path", "name": "cacheprimary_leaf", "path": "/video.mp4"},' + - '{"type": "files-path", "name": "primary_leaf7", "path": "/file.xlsx"},' + - '{"type": "files-path", "name": "primary_leaf8", "path": "/f3.doc"},' + - '{"type": "files-path", "name": "primary_leaf9", "path": "/folder"' + - '}]'; - prepareFile(fmsFileName('test.json'), text); - }) - - /** - * @tc.number SUB_STORAGE_FMS_fuzzyFileToUri_100 - * @tc.name FMS_fuzzyFileToUri_100 - * @tc.desc Verify device ID,Call fuzzyfiletouri to - * judge whether the return value is correct. - */ - it('FMS_fuzzyFileToUri_100', 0, function () { - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: 'ohos.acts.test.ability', - uri: 'internal://app/f0.txt', - displayName: 'f1.txt', - success: function (uri) { - console.log('FMS_fuzzyFileToUri_100 call fuzzyFileToUri success. uri:' + uri); - expect(uri == 'dataability://440E-0906/ohos.acts.test.ability/primary/document/files' - +'/primary_leaf2/f0.txt/leaf?displayName=f1.txt#').assertTrue(); - }, - fail: function (data, code) { - console.log('FMS_fuzzyFileToUri_100 call fuzzyFileToUri fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - complete: function () { - console.log('FMS_fuzzyFileToUri_100 call fuzzyFileToUri in complete'); - } - }); - }) - - /** - * @tc.number SUB_STORAGE_FMS_fuzzyFileToUri_200 - * @tc.name FMS_fuzzyFileToUri_200 - * @tc.desc Verify app path,Call fuzzyfiletouri to - * judge whether the return value is correct. - */ - it('FMS_fuzzyFileToUri_200', 0, function () { - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: 'ohos.acts.test.ability', - uri: 'internal://app/picture.jpg', - displayName: 'picture.png', - success: function (uri) { - console.log('FMS_fuzzyFileToUri_200 call fuzzyFileToUri success. uri:' + uri); - expect(uri == 'dataability://440E-0906/ohos.acts.test.ability/primary/document/files' - +'/primary_leaf3/picture.jpg/leaf?displayName=picture.png#').assertTrue(); - }, - fail: function (data, code) { - console.log('FMS_fuzzyFileToUri_200 call fuzzyFileToUri fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_FMS_fuzzyFileToUri_300 - * @tc.name FMS_fuzzyFileToUri_300 - * @tc.desc Verify that the app path virtual path is an in package file,Call fuzzyfiletouri - * to judge whether the return value is correct. - */ - it('FMS_fuzzyFileToUri_300', 0, function () { - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: 'ohos.acts.test.ability', - uri: 'internal://app/../files/picture2.jpg', - displayName: 'picture2.png', - success: function (uri) { - console.log('FMS_fuzzyFileToUri_300 call fuzzyFileToUri success. uri:' + uri); - expect(uri == 'dataability://440E-0906/ohos.acts.test.ability/primary/document/files' - +'/primary_leaf4/picture2.jpg/leaf?displayName=picture2.png#').assertTrue(); - }, - fail: function (data, code) { - console.log('FMS_fuzzyFileToUri_300 call fuzzyFileToUri fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_FMS_fuzzyFileToUri_400 - * @tc.name FMS_fuzzyFileToUri_400 - * @tc.desc Verify the Chinese file name under the app path,Call fuzzyfiletouri - * to judge whether the return value is correct. - */ - it('FMS_fuzzyFileToUri_400', 0, function () { - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: 'ohos.acts.test.ability', - uri: 'internal://app/文件.doc', - displayName: 'file', - success: function (uri) { - console.log('FMS_fuzzyFileToUri_400 call fuzzyFileToUri success. uri:' + uri); - expect(uri == 'dataability://440E-0906/ohos.acts.test.ability/primary/document/files' - +'/primary_leaf5/文件.doc/leaf?displayName=file#').assertTrue(); - }, - fail: function (data, code) { - console.log('FMS_fuzzyFileToUri_400 call fuzzyFileToUri fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_FMS_fuzzyFileToUri_500 - * @tc.name FMS_fuzzyFileToUri_500 - * @tc.desc Verify the blurred Chinese file name,Call fuzzyfiletouri - * to judge whether the return value is correct. - */ - it('FMS_fuzzyFileToUri_500', 0, function () { - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: 'ohos.acts.test.ability', - uri: 'internal://app/cross Fire.txt', - displayName: '你好,世界', - success: function (uri) { - console.log('FMS_fuzzyFileToUri_500 call fuzzyFileToUri success. uri:' + uri); - expect(uri == 'dataability://440E-0906/ohos.acts.test.ability/primary/document/files' - +'/primary_leaf6/cross Fire.txt/leaf?displayName=你好,世界#').assertTrue(); - }, - fail: function (data, code) { - console.log('FMS_fuzzyFileToUri_500 call fuzzyFileToUri fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_FMS_fuzzyFileToUri_600 - * @tc.name FMS_fuzzyFileToUri_600 - * @tc.desc Verify cache path,Call fuzzyfiletouri - * to judge whether the return value is correct. - */ - it('FMS_fuzzyFileToUri_600', 0, function () { - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: 'ohos.acts.test.ability', - uri: 'internal://cache/video.mp4', - displayName: 'v1.mp4', - success: function (uri) { - console.log('FMS_fuzzyFileToUri_600 call fuzzyFileToUri success. uri:' + uri); - expect(uri == 'dataability://440E-0906/ohos.acts.test.ability/primary/document/cache' - +'/cacheprimary_leaf/video.mp4/leaf?displayName=v1.mp4#').assertTrue(); - }, - fail: function (data, code) { - console.log('FMS_fuzzyFileToUri_600 call fuzzyFileToUri fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_FMS_fuzzyFileToUri_700 - * @tc.name FMS_fuzzyFileToUri_700 - * @tc.desc Verify that displayName does not exist,Call fuzzyfiletouri - * to judge whether the return value is correct. - */ - it('FMS_fuzzyFileToUri_700', 0, function () { - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: 'ohos.acts.test.ability', - uri: 'internal://app/file.xlsx', - success: function (uri) { - console.log('FMS_fuzzyFileToUri_700 call fuzzyFileToUri success. uri:' + uri); - expect(uri == 'dataability://440E-0906/ohos.acts.test.ability/primary/document/files' - +'/primary_leaf7/file.xlsx/leaf').assertTrue(); - }, - fail: function (data, code) { - console.log('FMS_fuzzyFileToUri_700 call fuzzyFileToUri fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_FMS_fuzzyFileToUri_800 - * @tc.name FMS_fuzzyFileToUri_800 - * @tc.desc Verify that authority = null,Call the interface fuzzyfiletouri - * to check whether the interface call fails. - */ - it('FMS_fuzzyFileToUri_800', 0, function () { - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: '', - uri: 'internal://app/f2.ppt', - success: function () { - console.log('FMS_fuzzyFileToUri_800 call fuzzyFileToUri success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('FMS_fuzzyFileToUri_800 call fuzzyFileToUri pass, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_FMS_fuzzyFileToUri_900 - * @tc.name FMS_fuzzyFileToUri_900 - * @tc.desc Verify that authority is a different value,Call the interface fuzzyfiletouri - * to check whether the interface call fails. - */ - it('FMS_fuzzyFileToUri_900', 0, function () { - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: 'com.abc.test.ability', - uri: 'internal://app/f3.doc', - success: function () { - console.log('FMS_fuzzyFileToUri_900 call fuzzyFileToUri success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('FMS_fuzzyFileToUri_900 call fuzzyFileToUri pass, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_FMS_fuzzyFileToUri_1000 - * @tc.name FMS_fuzzyFileToUri_1000 - * @tc.desc Verify that uri = null,Call the interface fuzzyfiletouri - * to check whether the interface call fails. - */ - it('FMS_fuzzyFileToUri_1000', 0, function () { - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: 'ohos.acts.test.ability', - uri: '', - success: function () { - console.log('FMS_fuzzyFileToUri_1000 call fuzzyFileToUri success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('FMS_fuzzyFileToUri_1000 call fuzzyFileToUri pass, code: ' + code + ', data: ' + data); - expect(code == 302).assertTrue(); - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_FMS_fuzzyFileToUri_1100 - * @tc.name FMS_fuzzyFileToUri_1100 - * @tc.desc Verify that there is no file under the app path,Call the interface fuzzyfiletouri - * to check whether the interface call fails. - */ - it('FMS_fuzzyFileToUri_1100', 0, function () { - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: 'ohos.acts.test.ability', - uri: 'internal://app/f4', - success: function () { - console.log('FMS_fuzzyFileToUri_1100 call fuzzyFileToUri success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('FMS_fuzzyFileToUri_1100 call fuzzyFileToUri pass, code: ' + code + ', data: ' + data); - expect(code == 301).assertTrue(); - - }, - }) - }) - - /** - * @tc.number SUB_STORAGE_FMS_fuzzyFileToUri_1200 - * @tc.name FMS_fuzzyFileToUri_1200 - * @tc.desc Verify device ID=null,Call the interface fuzzyfiletouri - * to check whether the interface call fails. - */ - it('FMS_fuzzyFileToUri_1200', 0, function () { - fileShareAbility.fuzzyFileToUri({ - deviceId: '', - authority: 'ohos.acts.test.ability', - uri: 'internal://app/music.mp3', - displayName: 'helloworld', - success: function () { - console.log('FMS_fuzzyFileToUri_1200 call fuzzyFileToUri success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('FMS_fuzzyFileToUri_1200 call fuzzyFileToUri pass, code: ' + code + ', data: ' + data); - expect(code == 202).assertTrue(); - }, - }); - }) - - /** - * @tc.number SUB_STORAGE_FMS_fuzzyFileToUri_1300 - * @tc.name FMS_fuzzyFileToUri_1300 - * @tc.desc Verify the virtual path to an out of package file,Call the interface fuzzyfiletouri - * to check whether the interface call fails. - */ - it('FMS_fuzzyFileToUri_1300', 0, function () { - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: 'ohos.acts.test.ability', - uri: 'internal://app/../../../applications/com.ohos.settings/com.ohos.settings/config.json', - displayName: 'helloworld', - success: function () { - console.log('FMS_fuzzyFileToUri_1300 call fuzzyFileToUri success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('FMS_fuzzyFileToUri_1300 call fuzzyFileToUri pass, code: ' + code + ', data: ' + data); - expect(code == 302).assertTrue(); - }, - }); - }) - - /** - * @tc.number SUB_STORAGE_FMS_fuzzyFileToUri_1400 - * @tc.name FMS_fuzzyFileToUri_1400 - * @tc.desc Verify that the folder exists under the app path,Call the interface - * fuzzyfiletouri to check whether the interface call fails. - */ - it('FMS_fuzzyFileToUri_1400', 0, function () { - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: 'ohos.acts.test.ability', - uri: 'internal://app/folder', - displayName: 'helloworld', - success: function () { - console.log('FMS_fuzzyFileToUri_1400 call fuzzyFileToUri success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('FMS_fuzzyFileToUri_1400 call fuzzyFileToUri pass, code: ' + code + ', data: ' + data); - expect(code == 300).assertTrue(); - }, - }); - }) - - /** - * @tc.number SUB_STORAGE_FMS_fuzzyFileToUri_1500 - * @tc.name FMS_fuzzyFileToUri_1500 - * @tc.desc The shared file is not configured in JSON - */ - it('FMS_fuzzyFileToUri_1500', 0, function () { - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: 'ohos.acts.test.ability', - uri: 'internal://app/f2.ppt', - success: function () { - console.log('FMS_fuzzyFileToUri_1500 call fuzzyFileToUri success, fail!'); - expect(null).assertFail(); - }, - fail: function (data, code) { - console.log('FMS_fuzzyFileToUri_1500 call fuzzyFileToUri pass, code: ' + code + ', data: ' + data); - expect(code == 300).assertTrue(); - }, - }); - }) - -}) diff --git a/storage/storagefmssharejstest/src/main/js/default/test/FmsSharePerformance.test.js b/storage/storagefmssharejstest/src/main/js/default/test/FmsSharePerformance.test.js deleted file mode 100644 index 140a44c9c..000000000 --- a/storage/storagefmssharejstest/src/main/js/default/test/FmsSharePerformance.test.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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 fileio from '@system.fileio'; -import fileShareAbility from '@ohos.fileshare'; -import { - describe, - beforeAll, - it, - expect -} -from 'deccjsunit/index' -import { - prepareFile, - fmsFileName, - fmsCacheName -} -from './Common' - -describe('fmsPerformanceTest', function () { - beforeAll(() => { - prepareFile(fmsFileName('music.mp3'), 'content'); - prepareFile(fmsFileName('f0.txt'), 'content'); - prepareFile(fmsFileName('picture.jpg'), 'content'); - prepareFile(fmsFileName('picture2.jpg'), 'content'); - prepareFile(fmsFileName('文件.doc'), 'content'); - prepareFile(fmsFileName('cross Fire.txt'), 'content'); - prepareFile(fmsCacheName('video.mp4'), 'content'); - prepareFile(fmsFileName('file.xlsx'), 'content'); - prepareFile(fmsFileName('f2.ppt'), 'content'); - prepareFile(fmsFileName('f3.doc'), 'content'); - fileio.mkdirSync(fmsFileName('folder')); - let text = '[{"type": "files-path", "name": "primary_leaf", "path": "/music.mp3"},' + - '{"type": "files-path", "name": "primary_leaf2", "path": "/f0.txt"},' + - '{"type": "files-path", "name": "primary_leaf3", "path": "/picture.jpg"},' + - '{"type": "files-path", "name": "primary_leaf4", "path": "/picture2.jpg"},' + - '{"type": "files-path", "name": "primary_leaf5", "path": "/文件.doc"},' + - '{"type": "files-path", "name": "primary_leaf6", "path": "/cross Fire.txt"},' + - '{"type": "cache-path", "name": "cacheprimary_leaf", "path": "/video.mp4"},' + - '{"type": "files-path", "name": "primary_leaf7", "path": "/file.xlsx"},' + - '{"type": "files-path", "name": "primary_leaf8", "path": "/f3.doc"},' + - '{"type": "files-path", "name": "primary_leaf9", "path": "/folder"' + - '}]'; - prepareFile(fmsFileName('test.json'), text); - }) - - /** - * @tc.number SUB_STORAGE_FMS_Performance_0000 - * @tc.name FMS_Performance_0000 - * @tc.desc Performance test - */ - it('FMS_Performance_0000', 0, function () { - let start = new Date().getTime(); - for(let i = 0; i < 1000;i++){ - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: 'ohos.acts.test.ability', - uri: 'internal://app/f0.txt', - displayName: 'f1.txt', - success: function () { - let end = new Date().getTime(); - let time = end - start ; - start = new Date().getTime() - console.log('FMS_Performance_0000 call fuzzyFileToUri success. time:' +time+','+i); - }, - fail: function (data, code) { - console.log('FMS_Performance_0000 call fuzzyFileToUri fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - complete: function () { - console.log('FMS_Performance_0000 call fuzzyFileToUri in complete'); - } - }); - } - }) - - -}) diff --git a/storage/storagefmssharejstest/src/main/js/default/test/FmsShareStability.test.js b/storage/storagefmssharejstest/src/main/js/default/test/FmsShareStability.test.js deleted file mode 100644 index 56e197fe0..000000000 --- a/storage/storagefmssharejstest/src/main/js/default/test/FmsShareStability.test.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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 fileio from '@system.fileio'; -import fileShareAbility from '@ohos.fileshare'; -import { - describe, - beforeAll, - it, - expect -} -from 'deccjsunit/index' -import { - prepareFile, - fmsFileName, - fmsCacheName -} -from './Common' - -describe('fmsStabilityTest', function () { - beforeAll(() => { - prepareFile(fmsFileName('music.mp3'), 'content'); - prepareFile(fmsFileName('f0.txt'), 'content'); - prepareFile(fmsFileName('picture.jpg'), 'content'); - prepareFile(fmsFileName('picture2.jpg'), 'content'); - prepareFile(fmsFileName('文件.doc'), 'content'); - prepareFile(fmsFileName('cross Fire.txt'), 'content'); - prepareFile(fmsCacheName('video.mp4'), 'content'); - prepareFile(fmsFileName('file.xlsx'), 'content'); - prepareFile(fmsFileName('f2.ppt'), 'content'); - prepareFile(fmsFileName('f3.doc'), 'content'); - fileio.mkdirSync(fmsFileName('folder')); - let text = '[{"type": "files-path", "name": "primary_leaf", "path": "/music.mp3"},' + - '{"type": "files-path", "name": "primary_leaf2", "path": "/f0.txt"},' + - '{"type": "files-path", "name": "primary_leaf3", "path": "/picture.jpg"},' + - '{"type": "files-path", "name": "primary_leaf4", "path": "/picture2.jpg"},' + - '{"type": "files-path", "name": "primary_leaf5", "path": "/文件.doc"},' + - '{"type": "files-path", "name": "primary_leaf6", "path": "/cross Fire.txt"},' + - '{"type": "cache-path", "name": "cacheprimary_leaf", "path": "/video.mp4"},' + - '{"type": "files-path", "name": "primary_leaf7", "path": "/file.xlsx"},' + - '{"type": "files-path", "name": "primary_leaf8", "path": "/f3.doc"},' + - '{"type": "files-path", "name": "primary_leaf9", "path": "/folder"' + - '}]'; - prepareFile(fmsFileName('test.json'), text); - }) - - /** - * @tc.number SUB_STORAGE_FMS_Performance_0000 - * @tc.name FMS_Performance_0000 - * @tc.desc stability test - */ - it('FMS_stability_0000', 0, function () { - for(let i = 0; i < 100000;i++){ - fileShareAbility.fuzzyFileToUri({ - deviceId: '440E-0906', - authority: 'ohos.acts.test.ability', - uri: 'internal://app/f0.txt', - displayName: 'f1.txt', - success: function () { - console.log('FMS_stability_0000 success. '+i); - }, - fail: function (data, code) { - console.log('FMS_stability_0000 fail, code: ' + code + ', data: ' + data); - expect(null).assertFail(); - }, - complete: function () { - console.log('FMS_stability_0000 call fuzzyFileToUri in complete'); - } - }); - } - }) - -}) diff --git a/storage/storagefmssharejstest/src/main/js/default/test/List.test.js b/storage/storagefmssharejstest/src/main/js/default/test/List.test.js deleted file mode 100644 index 971a7603a..000000000 --- a/storage/storagefmssharejstest/src/main/js/default/test/List.test.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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('./FmsShare.test.js') diff --git a/storage/storagefmssharejstest/src/main/resources/base/element/string.json b/storage/storagefmssharejstest/src/main/resources/base/element/string.json deleted file mode 100644 index 4b5a8bbc0..000000000 --- a/storage/storagefmssharejstest/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "storagefilestabilityjstest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/storage/storagefmssharejstest/src/main/resources/base/media/icon.png b/storage/storagefmssharejstest/src/main/resources/base/media/icon.png deleted file mode 100755 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDV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