提交 f972d4d5 编写于 作者: Z zhaoyuan17

Update xts code

Signed-off-by: Nzhaoyuan17 <zhaoyuan17@huawei.com>
上级 7a5ebac0
...@@ -27,6 +27,8 @@ group("actsabilitymanagertest") { ...@@ -27,6 +27,8 @@ group("actsabilitymanagertest") {
"actsamstestfourthscene:ActsAmsTestFourthSceneTest", "actsamstestfourthscene:ActsAmsTestFourthSceneTest",
"actsamstestsecondscene:ActsAmsTestSecondSceneTest", "actsamstestsecondscene:ActsAmsTestSecondSceneTest",
"actsamstestthirdscene:ActsAmsTestThirdSceneTest", "actsamstestthirdscene:ActsAmsTestThirdSceneTest",
"sceneProject/clearmissionscallback:ClearMissionsCallBack",
"sceneProject/clearmissionspromise:ClearMissionsPromise",
"sceneProject/simulateEAbility:simulateEAbility", "sceneProject/simulateEAbility:simulateEAbility",
"sceneProject/simulateFAbilityFir:simulateFAbilityFir", "sceneProject/simulateFAbilityFir:simulateFAbilityFir",
"sceneProject/simulateFAbilitySed:simulateFAbilitySed", "sceneProject/simulateFAbilitySed:simulateFAbilitySed",
......
...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index' ...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default { export default {
data: { data: {
title: "" title: ""
...@@ -26,20 +26,23 @@ export default { ...@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onShow() {
console.info('onShow finish') if (once) {
once = false
const core = Core.getInstance() console.info('onShow finish')
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test') const core = Core.getInstance()
core.execute() const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
}, },
onReady() { onReady() {
console.info('onReady'); console.info('onReady');
......
...@@ -18,6 +18,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index' ...@@ -18,6 +18,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default { export default {
data: { data: {
title: "" title: ""
...@@ -26,20 +27,23 @@ export default { ...@@ -26,20 +27,23 @@ export default {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onShow() {
console.info('onShow finish') if (once) {
once = false
console.info('onShow finish')
const core = Core.getInstance() const core = Core.getInstance()
const expectExtend = new ExpectExtend({ const expectExtend = new ExpectExtend({
'id': 'extend' 'id': 'extend'
}) })
core.addService('expect', expectExtend) core.addService('expect', expectExtend)
core.init() core.init()
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
configService.setConfig(this) configService.setConfig(this)
require('../../../test/List.test') require('../../../test/List.test')
core.execute() core.execute()
}
}, },
onReady() { onReady() {
console.info('onReady'); console.info('onReady');
......
...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index' ...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default { export default {
data: { data: {
title: "" title: ""
...@@ -26,20 +26,23 @@ export default { ...@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onShow() {
console.info('onShow finish') if (once) {
once = false
console.info('onShow finish')
const core = Core.getInstance() const core = Core.getInstance()
const expectExtend = new ExpectExtend({ const expectExtend = new ExpectExtend({
'id': 'extend' 'id': 'extend'
}) })
core.addService('expect', expectExtend) core.addService('expect', expectExtend)
core.init() core.init()
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
configService.setConfig(this) configService.setConfig(this)
require('../../../test/List.test') require('../../../test/List.test')
core.execute() core.execute()
}
}, },
onReady() { onReady() {
console.info('onReady'); console.info('onReady');
......
...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index' ...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default { export default {
data: { data: {
title: "" title: ""
...@@ -26,20 +26,23 @@ export default { ...@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onShow() {
console.info('onShow finish') if (once) {
once = false
const core = Core.getInstance() console.info('onShow finish')
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test') const core = Core.getInstance()
core.execute() const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
}, },
onReady() { onReady() {
console.info('onReady'); console.info('onReady');
......
...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index' ...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default { export default {
data: { data: {
title: "" title: ""
...@@ -26,20 +26,23 @@ export default { ...@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onShow() {
console.info('onShow finish') if (once) {
once = false
const core = Core.getInstance() console.info('onShow finish')
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test') const core = Core.getInstance()
core.execute() const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
}, },
onReady() { onReady() {
console.info('onReady'); console.info('onReady');
......
...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index' ...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default { export default {
data: { data: {
title: "" title: ""
...@@ -26,20 +26,23 @@ export default { ...@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onShow() {
console.info('onShow finish') if (once) {
once = false
console.info('onShow finish')
const core = Core.getInstance() const core = Core.getInstance()
const expectExtend = new ExpectExtend({ const expectExtend = new ExpectExtend({
'id': 'extend' 'id': 'extend'
}) })
core.addService('expect', expectExtend) core.addService('expect', expectExtend)
core.init() core.init()
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
configService.setConfig(this) configService.setConfig(this)
require('../../../test/List.test') require('../../../test/List.test')
core.execute() core.execute()
}
}, },
onReady() { onReady() {
console.info('onReady'); console.info('onReady');
......
...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index' ...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default { export default {
data: { data: {
title: "" title: ""
...@@ -26,20 +26,23 @@ export default { ...@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onShow() {
console.info('onShow finish') if (once) {
once = false
const core = Core.getInstance() console.info('onShow finish')
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test') const core = Core.getInstance()
core.execute() const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
}, },
onReady() { onReady() {
console.info('onReady'); console.info('onReady');
......
...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index' ...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default { export default {
data: { data: {
title: "" title: ""
...@@ -26,20 +26,23 @@ export default { ...@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onShow() {
console.info('onShow finish') if (once) {
once = false
const core = Core.getInstance() console.info('onShow finish')
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test') const core = Core.getInstance()
core.execute() const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
}, },
onReady() { onReady() {
console.info('onReady'); console.info('onReady');
......
...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index' ...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default { export default {
data: { data: {
title: "" title: ""
...@@ -26,20 +26,23 @@ export default { ...@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onShow() {
console.info('onShow finish') if (once) {
once = false
const core = Core.getInstance() console.info('onShow finish')
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test') const core = Core.getInstance()
core.execute() const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
}, },
onReady() { onReady() {
console.info('onReady'); console.info('onReady');
......
...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index' ...@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default { export default {
data: { data: {
title: "" title: ""
...@@ -26,20 +26,23 @@ export default { ...@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onShow() {
console.info('onShow finish') if (once) {
once = false
const core = Core.getInstance() console.info('onShow finish')
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test') const core = Core.getInstance()
core.execute() const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
}, },
onReady() { onReady() {
console.info('onReady'); console.info('onReady');
......
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "120000",
"package": "com.ohos.launcher",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ClearMissionsCallBack.hap",
"verifyIAbility.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "120000",
"package": "com.ohos.launcher",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ClearMissionsPromise.hap",
"verifyIAbility.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
...@@ -12,19 +12,23 @@ ...@@ -12,19 +12,23 @@
# limitations under the License. # limitations under the License.
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ClearMissionsCallBack") { ohos_hap("ClearMissionsCallBack") {
hap_profile = "./entry/src/main/config.json" hap_profile = "./src/main/config.json"
hap_name = "ClearMissionsCallBack"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [ deps = [
":hjs_demo_js_assets", ":hjs_demo_js_assets",
":hjs_demo_resources", ":hjs_demo_resources",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/systemui.p7b"
hap_name = "ClearMissionsCallBack"
} }
ohos_js_assets("hjs_demo_js_assets") { ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default" source_dir = "./src/main/js/default"
} }
ohos_resources("hjs_demo_resources") { ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ] sources = [ "./src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json" hap_profile = "./src/main/config.json"
} }
{
"description": "Configuration for hjunit demo Tests",
}
...@@ -37,6 +37,7 @@ describe('ActsAmsCallBackSixth Scene', function () { ...@@ -37,6 +37,7 @@ describe('ActsAmsCallBackSixth Scene', function () {
}, },
}, },
); );
sleep(5000)
}); });
/* /*
* @tc.number : Acts_Ams_test_12200 * @tc.number : Acts_Ams_test_12200
...@@ -44,14 +45,12 @@ describe('ActsAmsCallBackSixth Scene', function () { ...@@ -44,14 +45,12 @@ describe('ActsAmsCallBackSixth Scene', function () {
* @tc.desc : Clear Missions(by CallBack) * @tc.desc : Clear Missions(by CallBack)
*/ */
it('Acts_Ams_test_12200', 0, async function (done) { it('Acts_Ams_test_12200', 0, async function (done) {
setTimeout(function (){ abilitymanager.clearMissions(
abilitymanager.clearMissions( (error,info) => {
(error,info) => { console.info('Acts_Ams_test_12200 clearMissions error.code ' + error.code + ',data [' + info + ']' );
console.info('Acts_Ams_test_12200 clearMissions error.code ' + error.code + ',data [' + info + ']' ); expect(typeof(info)).assertEqual("number");
expect(typeof(info)).assertEqual("number"); expect(info).assertEqual(0);
expect(info).assertEqual(0); });
}); done();
done();
},5000)
}) })
}) })
...@@ -12,19 +12,23 @@ ...@@ -12,19 +12,23 @@
# limitations under the License. # limitations under the License.
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ClearMissionsPromise") { ohos_hap("ClearMissionsPromise") {
hap_profile = "./entry/src/main/config.json" hap_profile = "./src/main/config.json"
hap_name = "ClearMissionsPromise"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [ deps = [
":hjs_demo_js_assets", ":hjs_demo_js_assets",
":hjs_demo_resources", ":hjs_demo_resources",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/systemui.p7b"
hap_name = "ClearMissionsPromise"
} }
ohos_js_assets("hjs_demo_js_assets") { ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default" source_dir = "./src/main/js/default"
} }
ohos_resources("hjs_demo_resources") { ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ] sources = [ "./src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json" hap_profile = "./src/main/config.json"
} }
{
"description": "Configuration for hjunit demo Tests",
}
...@@ -37,19 +37,26 @@ describe('ActsAmsCallBackSixth Scene', function () { ...@@ -37,19 +37,26 @@ describe('ActsAmsCallBackSixth Scene', function () {
}, },
}, },
); );
sleep(5000)
}); });
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
}
}
/* /*
* @tc.number : Acts_Ams_test_12100 * @tc.number : Acts_Ams_test_12100
* @tc.name : clearMissions : Clear Missions * @tc.name : clearMissions : Clear Missions
* @tc.desc : Clear Missions(by Promise) * @tc.desc : Clear Missions(by Promise)
*/ */
it('Acts_Ams_test_12100', 0, async function (done) { it('Acts_Ams_test_12100', 0, async function (done) {
setTimeout(async function(){ var info = await abilitymanager.clearMissions();
var info = await abilitymanager.clearMissions(); console.info('Acts_Ams_test_12100 clearMissions data [' + info + ']');
console.info('Acts_Ams_test_12100 clearMissions data [' + info + ']'); expect(typeof(info)).assertEqual("number");
expect(typeof(info)).assertEqual("number"); expect(info).assertEqual(0);
expect(info).assertEqual(0); done();
done();
},5000);
}) })
}) })
...@@ -1432,8 +1432,8 @@ it('FWK_zipFile_3400', 0, async function (done) { ...@@ -1432,8 +1432,8 @@ it('FWK_zipFile_3400', 0, async function (done) {
*/ */
it('FWK_zipFile_3500', 0, async function (done) { it('FWK_zipFile_3500', 0, async function (done) {
console.log("==================FWK_zipFile_3500 start=================="); console.log("==================FWK_zipFile_3500 start==================");
var src = "/data/test/fefsef.txt"; var src = "/data/teste/fefsef.txt";
var dest = "/data/testA/ceshi.txt"; var dest = "/data/testA/sfefsfe.zip";
var options = {} var options = {}
...@@ -1458,6 +1458,7 @@ it('FWK_zipFile_3600', 0, async function (done) { ...@@ -1458,6 +1458,7 @@ it('FWK_zipFile_3600', 0, async function (done) {
console.log("==================FWK_zipFile_3600 start=================="); console.log("==================FWK_zipFile_3600 start==================");
var src = "/data/test/ceshi.txt"; var src = "/data/test/ceshi.txt";
var dest = ""; var dest = "";
var options = {}
zlib.zipFile(src, dest, options).then((data) => { zlib.zipFile(src, dest, options).then((data) => {
console.log("zipFilePromise_3600 data: " + data); console.log("zipFilePromise_3600 data: " + data);
......
...@@ -22,7 +22,6 @@ const STRESSLEVEL = 20; ...@@ -22,7 +22,6 @@ const STRESSLEVEL = 20;
const BUNDLE_NAME = 'com.example.actsbmskittest'; const BUNDLE_NAME = 'com.example.actsbmskittest';
const PERMISSION_NAME = 'com.permission.PERMISSION_A'; const PERMISSION_NAME = 'com.permission.PERMISSION_A';
const START_ABILITY_TIMEOUT = 3000; const START_ABILITY_TIMEOUT = 3000;
const EVENTTIMEOUT = 5000;
var subscriberInfo_0100 = { var subscriberInfo_0100 = {
events: ['ACTS_Third1_Publish_CommonEvent'], events: ['ACTS_Third1_Publish_CommonEvent'],
}; };
...@@ -167,9 +166,6 @@ describe('ActsBmsKitTest', function () { ...@@ -167,9 +166,6 @@ describe('ActsBmsKitTest', function () {
} }
} }
done(); done();
setTimeout(function () {
console.debug('===========ActsBmsKit_getModuleUsageRecordTest_0100===========end');
}, EVENTTIMEOUT)
}) })
/* /*
...@@ -207,13 +203,11 @@ describe('ActsBmsKitTest', function () { ...@@ -207,13 +203,11 @@ describe('ActsBmsKitTest', function () {
console.debug('=============bundleName is=========' + JSON.stringify(data[i].bundleName)); console.debug('=============bundleName is=========' + JSON.stringify(data[i].bundleName));
expect(data[i].bundleName.length).assertLarger(0); expect(data[i].bundleName.length).assertLarger(0);
console.debug('=============appLabelId==============' + JSON.stringify(data[i].appLabelId)); console.debug('=============appLabelId==============' + JSON.stringify(data[i].appLabelId));
if(data[i].bundleName == 'com.example.third1'){ expect(data[i].appLabelId >= 0).assertTrue();
expect(data[i].appLabelId).assertEqual(0); expect(data[i].labelId >= 0).assertTrue();
expect(data[i].labelId).assertEqual(0); expect(data[i].abilityLabelId >= 0).assertTrue();
expect(data[i].abilityLabelId).assertEqual(0); expect(data[i].abilityDescriptionId >= 0).assertTrue();
expect(data[i].abilityDescriptionId).assertEqual(0); expect(data[i].abilityIconId >= 0).assertTrue();
expect(data[i].abilityIconId).assertEqual(0);
}
console.debug('=============name==============' + JSON.stringify(data[i].name)); console.debug('=============name==============' + JSON.stringify(data[i].name));
expect(data[i].name.length).assertLarger(0); expect(data[i].name.length).assertLarger(0);
console.debug('=============labelId==============' + JSON.stringify(data[i].labelId)); console.debug('=============labelId==============' + JSON.stringify(data[i].labelId));
......
...@@ -83,6 +83,27 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -83,6 +83,27 @@ describe('ActsBmsModuleUsageRecordTest', function () {
) )
}); });
}) })
beforeEach(async (done) => {
bundle.getBundleInfo(BUNDLE_NAME, 1, async (err, data) => {
if (err.code != 0 && data.name.length == 0) {
let installer = await bundle.getBundleInstaller();
installer.install(['/data/test/bmsThirdBundleTest1.hap'], {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async (err, data) => {
console.debug('========install Finish========' + JSON.stringify(data));
done();
});
} else {
console.info("third1 is exist");
done();
}
});
})
/* /*
* @tc.number: bms_getModuleUsageRecordTest_0100 * @tc.number: bms_getModuleUsageRecordTest_0100
* @tc.name: getModuleUsageRecord(maxNum) * @tc.name: getModuleUsageRecord(maxNum)
...@@ -101,14 +122,14 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -101,14 +122,14 @@ describe('ActsBmsModuleUsageRecordTest', function () {
if (dataMap.has(BUNDLE_NAME)) { if (dataMap.has(BUNDLE_NAME)) {
let data = dataMap.get(BUNDLE_NAME); let data = dataMap.get(BUNDLE_NAME);
expect(data.bundleName).assertEqual('com.example.third1'); expect(data.bundleName).assertEqual('com.example.third1');
expect(data.appLabelId).assertEqual(0); expect(data.appLabelId >= 0).assertTrue();
expect(data.name).assertEqual('entry'); expect(data.name).assertEqual('entry');
expect(data.labelId).assertEqual(0); expect(data.labelId >= 0).assertTrue();
expect(data.descriptionId).assertEqual(0); expect(data.descriptionId).assertEqual(0);
expect(data.abilityName).assertEqual('com.example.third1.MainAbility'); expect(data.abilityName).assertEqual('com.example.third1.MainAbility');
expect(data.abilityLabelId).assertEqual(0); expect(data.abilityLabelId >= 0).assertTrue();
expect(data.abilityDescriptionId).assertEqual(0); expect(data.abilityDescriptionId >= 0).assertTrue();
expect(data.abilityIconId).assertEqual(0); expect(data.abilityIconId >= 0).assertTrue();
expect(data.launchedCount).assertEqual(START_COUNT); expect(data.launchedCount).assertEqual(START_COUNT);
expect(data.lastLaunchTime).assertLarger(0); expect(data.lastLaunchTime).assertLarger(0);
expect(data.isRemoved).assertEqual(false); expect(data.isRemoved).assertEqual(false);
...@@ -596,13 +617,11 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -596,13 +617,11 @@ describe('ActsBmsModuleUsageRecordTest', function () {
console.debug('=======All Info========' + JSON.stringify(data[i])); console.debug('=======All Info========' + JSON.stringify(data[i]));
console.debug('=============bundleName is=========' + JSON.stringify(data[i].bundleName)); console.debug('=============bundleName is=========' + JSON.stringify(data[i].bundleName));
expect(data[i].bundleName.length).assertLarger(0); expect(data[i].bundleName.length).assertLarger(0);
if (data[i].bundleName == BUNDLE_NAME) { expect(data[i].appLabelId >= 0).assertTrue();
expect(data[i].appLabelId).assertEqual(0); expect(data[i].labelId >= 0).assertTrue();
expect(data[i].labelId).assertEqual(0); expect(data[i].abilityLabelId >= 0).assertTrue();
expect(data[i].abilityLabelId).assertEqual(0); expect(data[i].abilityDescriptionId >= 0).assertTrue();
expect(data[i].abilityDescriptionId).assertEqual(0); expect(data[i].abilityIconId >= 0).assertTrue();
expect(data[i].abilityIconId).assertEqual(0);
}
console.debug('=============appLabelId==============' + JSON.stringify(data[i].appLabelId)); console.debug('=============appLabelId==============' + JSON.stringify(data[i].appLabelId));
console.debug('=============name==============' + JSON.stringify(data[i].name)); console.debug('=============name==============' + JSON.stringify(data[i].name));
expect(data[i].name.length).assertLarger(0); expect(data[i].name.length).assertLarger(0);
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
import notify from '@ohos.notification' import notify from '@ohos.notification'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
var time = 1000 var time = 500
describe('ActsAnsAllActiveTestOne', function () { describe('ActsAnsAllActiveTestOne', function () {
console.info("===========ActsAnsAllActiveTestOne start====================>"); console.info("===========ActsAnsAllActiveTestOne start====================>");
function getAllCallback(err, data){ function getAllCallback(err, data){
console.log("Ans_GetAllActive_0100 getAllCallback ============>"); console.log("Ans_GetAllActive_0100 getAllCallback ============>");
var i; var i;
...@@ -76,9 +76,9 @@ describe('ActsAnsAllActiveTestOne', function () { ...@@ -76,9 +76,9 @@ describe('ActsAnsAllActiveTestOne', function () {
console.debug("===============Ans_GetAllActive_0100 publish CurrentApp notify end==================>"); console.debug("===============Ans_GetAllActive_0100 publish CurrentApp notify end==================>");
notify.getAllActiveNotifications(getAllCallback); notify.getAllActiveNotifications(getAllCallback);
console.debug("===============Ans_GetAllActive_0100 getAllActiveNotifications end==================>"); console.debug("===============Ans_GetAllActive_0100 getAllActiveNotifications end==================>");
done(); setTimeout(function(){
setTimeout(async function(){ console.debug("===============Ans_GetAllActive_0100 setTimeout==================>");
console.debug("===============Ans_GetAllActive_0100 done==================>"); done();
}, time); }, time);
}) })
...@@ -134,9 +134,9 @@ describe('ActsAnsAllActiveTestOne', function () { ...@@ -134,9 +134,9 @@ describe('ActsAnsAllActiveTestOne', function () {
console.log("============Ans_GetAllActive_0200 label=====>"+promiseData[i].label) console.log("============Ans_GetAllActive_0200 label=====>"+promiseData[i].label)
} }
} }
done(); setTimeout(function(){
setTimeout(async function(){ console.debug("===============Ans_GetAllActive_0200 setTimeout==================>");
console.debug("===============Ans_GetAllActive_0200 done==================>"); done();
}, time); }, time);
}) })
...@@ -186,9 +186,9 @@ describe('ActsAnsAllActiveTestOne', function () { ...@@ -186,9 +186,9 @@ describe('ActsAnsAllActiveTestOne', function () {
await notify.cancel(1, "currentApp_0300"); await notify.cancel(1, "currentApp_0300");
notify.getAllActiveNotifications(getAllCallbackThree); notify.getAllActiveNotifications(getAllCallbackThree);
console.debug("===============Ans_GetAllActive_0300 getAllActiveNotifications end==================>"); console.debug("===============Ans_GetAllActive_0300 getAllActiveNotifications end==================>");
done(); setTimeout(function(){
setTimeout(async function(){ console.debug("===============Ans_GetAllActive_0300 setTimeout==================>");
console.debug("===============Ans_GetAllActive_0300 done==================>"); done();
}, time); }, time);
}) })
...@@ -232,9 +232,9 @@ describe('ActsAnsAllActiveTestOne', function () { ...@@ -232,9 +232,9 @@ describe('ActsAnsAllActiveTestOne', function () {
console.log("============Ans_GetAllActive_0400 label=====>"+promiseData[i].label) console.log("============Ans_GetAllActive_0400 label=====>"+promiseData[i].label)
} }
console.debug("===============Ans_GetAllActive_0400 getAllActiveNotifications end==================>"); console.debug("===============Ans_GetAllActive_0400 getAllActiveNotifications end==================>");
done();
setTimeout(function(){ setTimeout(function(){
console.debug("===============Ans_GetAllActive_0400 done==================>"); console.debug("===============Ans_GetAllActive_0400 setTimeout==================>");
done();
}, time); }, time);
}) })
...@@ -269,9 +269,9 @@ describe('ActsAnsAllActiveTestOne', function () { ...@@ -269,9 +269,9 @@ describe('ActsAnsAllActiveTestOne', function () {
await notify.removeAll(); await notify.removeAll();
notify.getAllActiveNotifications(getAllCallbackFive); notify.getAllActiveNotifications(getAllCallbackFive);
console.debug("===============Ans_GetAllActive_0500 getAllActiveNotifications end==================>"); console.debug("===============Ans_GetAllActive_0500 getAllActiveNotifications end==================>");
done(); setTimeout(function(){
setTimeout(async function(){ console.debug("===============Ans_GetAllActive_0500 setTimeout==================>");
console.debug("===============Ans_GetAllActive_0500 done==================>"); done();
}, time); }, time);
}) })
...@@ -303,9 +303,9 @@ describe('ActsAnsAllActiveTestOne', function () { ...@@ -303,9 +303,9 @@ describe('ActsAnsAllActiveTestOne', function () {
expect(promiseData.length).assertEqual(0); expect(promiseData.length).assertEqual(0);
console.debug("=======Ans_GetAllActive_0600 promiseData.length==========>"+promiseData.length); console.debug("=======Ans_GetAllActive_0600 promiseData.length==========>"+promiseData.length);
console.debug("=======Ans_GetAllActive_0600 promiseData==========>"+JSON.stringify(promiseData)); console.debug("=======Ans_GetAllActive_0600 promiseData==========>"+JSON.stringify(promiseData));
done(); setTimeout(function(){
setTimeout(async function(){ console.debug("===============Ans_GetAllActive_0600 setTimeout==================>");
console.debug("===============Ans_GetAllActive_0600 done==================>"); done();
}, time); }, time);
}) })
...@@ -324,9 +324,9 @@ describe('ActsAnsAllActiveTestOne', function () { ...@@ -324,9 +324,9 @@ describe('ActsAnsAllActiveTestOne', function () {
await notify.removeAll(); await notify.removeAll();
notify.getAllActiveNotifications(getAllCallbackSeven); notify.getAllActiveNotifications(getAllCallbackSeven);
console.debug("===============Ans_GetAllActive_0700 getAllActiveNotifications end==================>"); console.debug("===============Ans_GetAllActive_0700 getAllActiveNotifications end==================>");
done(); setTimeout(function(){
setTimeout(async function(){ console.debug("===============Ans_GetAllActive_0700 setTimeout==================>");
console.debug("===============Ans_GetAllActive_0700 done==================>"); done();
}, time); }, time);
}) })
...@@ -341,9 +341,9 @@ describe('ActsAnsAllActiveTestOne', function () { ...@@ -341,9 +341,9 @@ describe('ActsAnsAllActiveTestOne', function () {
var promiseData = await notify.getAllActiveNotifications(); var promiseData = await notify.getAllActiveNotifications();
console.debug("=========Ans_GetAllActive_0800 promiseData.length=============>"+promiseData.length); console.debug("=========Ans_GetAllActive_0800 promiseData.length=============>"+promiseData.length);
expect(promiseData.length).assertEqual(0); expect(promiseData.length).assertEqual(0);
done(); setTimeout(function(){
setTimeout(async function(){ console.debug("===============Ans_GetAllActive_0800 setTimeout==================>");
console.debug("===============Ans_GetAllActive_0800 done==================>"); done();
}, time); }, time);
}) })
}) })
......
...@@ -17,9 +17,8 @@ group("SubscribeAndPublish") { ...@@ -17,9 +17,8 @@ group("SubscribeAndPublish") {
testonly = true testonly = true
if (is_standard_system) { if (is_standard_system) {
deps = [ deps = [
"actssubscriberorderedtest:ActsSubscriberOrderTest",
"actssubscriberunordertest:ActsSubscriberUnorderTest", "actssubscriberunordertest:ActsSubscriberUnorderTest",
#"actssubscriberorderedtest:ActsSubscriberOrderTest",
#"actssubscriberunordersystemtest:ActsSubscriberTestUnorderSystem" #"actssubscriberunordersystemtest:ActsSubscriberTestUnorderSystem"
] ]
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册