提交 7f9ca8b7 编写于 作者: O openharmony_ci 提交者: Gitee

!1305 Update test code

Merge pull request !1305 from blackleon/update_master_1207
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
import notification from '@ohos.notification' import notification from '@ohos.notification'
import image from '@ohos.multimedia.image' import image from '@ohos.multimedia.image'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
var ERR_ANS_ICON_OVER_SIZE = 67108882
var largeIconA var largeIconA
var smallIconA var smallIconA
var largeBufferA var largeBufferA
...@@ -52,7 +51,7 @@ describe('ActsAnsPublishIconTest', function () { ...@@ -52,7 +51,7 @@ describe('ActsAnsPublishIconTest', function () {
} }
function publishCallbackB(err){ function publishCallbackB(err){
console.log('ActsAnsPublishIconTest publishCallbackB asyncCallback'+err.code) console.log('ActsAnsPublishIconTest publishCallbackB asyncCallback'+err.code)
expect(err.code).assertEqual(ERR_ANS_ICON_OVER_SIZE) expect(err.code != 0).assertEqual(true);
} }
function consumeCallbackA(data) { function consumeCallbackA(data) {
console.debug("===consumeCallbackA data : ===>" + JSON.stringify(data)); console.debug("===consumeCallbackA data : ===>" + JSON.stringify(data));
...@@ -310,10 +309,10 @@ describe('ActsAnsPublishIconTest', function () { ...@@ -310,10 +309,10 @@ describe('ActsAnsPublishIconTest', function () {
largeIcon:largeIconD, largeIcon:largeIconD,
}).then().catch((err)=>{ }).then().catch((err)=>{
console.debug("===ACTS_PublishIconTest_0400 promise===>"+err.code); console.debug("===ACTS_PublishIconTest_0400 promise===>"+err.code);
expect(err.code).assertEqual(ERR_ANS_ICON_OVER_SIZE) expect(err.code != 0).assertEqual(true);
done() done()
}); });
}) })
}); });
}); });
}) })
\ No newline at end of file
...@@ -27,7 +27,6 @@ var pubimageA ...@@ -27,7 +27,6 @@ var pubimageA
var pubimageB var pubimageB
var pubimageC var pubimageC
var pubimageD var pubimageD
var ERR_ANS_PICTURE_OVER_SIZE = 67108883
describe('ActsAnsPublishImageTest', function () { describe('ActsAnsPublishImageTest', function () {
console.info("===ActsAnsPublishImageTest start===>"); console.info("===ActsAnsPublishImageTest start===>");
...@@ -55,7 +54,7 @@ describe('ActsAnsPublishImageTest', function () { ...@@ -55,7 +54,7 @@ describe('ActsAnsPublishImageTest', function () {
} }
function publishCallbackB(err){ function publishCallbackB(err){
console.log('ActsAnsPublishImageTest publishCallbackB asyncCallback'+err.code) console.log('ActsAnsPublishImageTest publishCallbackB asyncCallback'+err.code)
expect(err.code).assertEqual(ERR_ANS_PICTURE_OVER_SIZE) expect(err.code != 0).assertEqual(true);
} }
/* /*
...@@ -221,7 +220,7 @@ describe('ActsAnsPublishImageTest', function () { ...@@ -221,7 +220,7 @@ describe('ActsAnsPublishImageTest', function () {
sortingKey:"sortingKeyD", sortingKey:"sortingKeyD",
}).then().catch((err)=>{ }).then().catch((err)=>{
console.debug("===ActsPublishImage_test_0400 err===>"+err.code); console.debug("===ActsPublishImage_test_0400 err===>"+err.code);
expect(err.code).assertEqual(ERR_ANS_PICTURE_OVER_SIZE) expect(err.code != 0).assertEqual(true);
done(); done();
}); });
}) })
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
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 = 1000
var ERR_ANS_INVALID_BUNDLE = 67108870
describe('ActsAnsBadgeDisplayTest', function () { describe('ActsAnsBadgeDisplayTest', function () {
console.info("===ActsAnsBadgeDisplayTest start===>"); console.info("===ActsAnsBadgeDisplayTest start===>");
/* /*
...@@ -74,7 +73,7 @@ describe('ActsAnsBadgeDisplayTest', function () { ...@@ -74,7 +73,7 @@ describe('ActsAnsBadgeDisplayTest', function () {
bundle:"wrong BundleName", bundle:"wrong BundleName",
}).then().catch((err)=>{ }).then().catch((err)=>{
console.log("===>ActsGetDisplay_test_0400 success===>"+err.code) console.log("===>ActsGetDisplay_test_0400 success===>"+err.code)
expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE) expect(err.code != 0).assertEqual(true);
done(); done();
}) })
...@@ -211,7 +210,7 @@ describe('ActsAnsBadgeDisplayTest', function () { ...@@ -211,7 +210,7 @@ describe('ActsAnsBadgeDisplayTest', function () {
bundle:"Wrong BundleName" bundle:"Wrong BundleName"
},true).then().catch((err)=>{ },true).then().catch((err)=>{
console.log("===>ActsSetDisplay_test_0400 err===>"+err.code) console.log("===>ActsSetDisplay_test_0400 err===>"+err.code)
expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE) expect(err.code != 0).assertEqual(true);
done(); done();
}) })
}) })
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
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 = 1000
var ERR_ANS_INVALID_BUNDLE = 67108870
describe('ActsAnsEnableNotificationTest', function () { describe('ActsAnsEnableNotificationTest', function () {
console.info("===========ActsAnsEnableNotificationTest start====================>"); console.info("===========ActsAnsEnableNotificationTest start====================>");
/* /*
...@@ -82,7 +81,7 @@ describe('ActsAnsEnableNotificationTest', function () { ...@@ -82,7 +81,7 @@ describe('ActsAnsEnableNotificationTest', function () {
bundle:"wrong BundleName", bundle:"wrong BundleName",
}).then().catch((err)=>{ }).then().catch((err)=>{
console.debug("====>ActsGetEnable_test_0400 promsie====>"+err.code); console.debug("====>ActsGetEnable_test_0400 promsie====>"+err.code);
expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE) expect(err.code != 0).assertEqual(true);
done(); done();
}) })
}) })
...@@ -241,7 +240,7 @@ describe('ActsAnsEnableNotificationTest', function () { ...@@ -241,7 +240,7 @@ describe('ActsAnsEnableNotificationTest', function () {
bundle:"Wrong BundleName" bundle:"Wrong BundleName"
},true).then().catch((err)=>{ },true).then().catch((err)=>{
console.log("===>ActsSetEnable_test_0400 err===>"+err.code) console.log("===>ActsSetEnable_test_0400 err===>"+err.code)
expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE) expect(err.code != 0).assertEqual(true);
done(); done();
}) })
}) })
......
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
/entry/.preview
.cxx
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="PLATFORM" />
<option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="D:\HUAWEI\DevEco Studio 2.1.0.301\tools\gradle" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/entry" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven2" />
<option name="name" value="maven2" />
<option name="url" value="https://developer.huawei.com/repo/" />
</remote-repository>
<remote-repository>
<option name="id" value="BintrayJCenter" />
<option name="name" value="BintrayJCenter" />
<option name="url" value="https://jcenter.bintray.com/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="https://repo.huaweicloud.com/repository/maven/" />
</remote-repository>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>
\ No newline at end of file
...@@ -32,8 +32,8 @@ describe('ActsAnsWantAgentOneTest', function () { ...@@ -32,8 +32,8 @@ describe('ActsAnsWantAgentOneTest', function () {
wants: [ wants: [
{ {
deviceId: "", deviceId: "",
bundleName: "com.example.WantAgentTest", bundleName: "com.example.WantAgentTest1",
abilityName: "com.example.WantAgentTest.MainAbility", abilityName: "com.example.WantAgentTest1.MainAbility",
action: "action1", action: "action1",
entities: ["entity1"], entities: ["entity1"],
type: "MIMETYPE", type: "MIMETYPE",
...@@ -73,8 +73,8 @@ describe('ActsAnsWantAgentOneTest', function () { ...@@ -73,8 +73,8 @@ describe('ActsAnsWantAgentOneTest', function () {
expect(data.finalCode).assertEqual(0); expect(data.finalCode).assertEqual(0);
expect(data.finalData).assertEqual(""); expect(data.finalData).assertEqual("");
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.WantAgentTest"); expect(data.want.bundleName).assertEqual("com.example.WantAgentTest1");
expect(data.want.abilityName).assertEqual("com.example.WantAgentTest.MainAbility"); expect(data.want.abilityName).assertEqual("com.example.WantAgentTest1.MainAbility");
expect(data.want.uri).assertEqual("key={true,true,false}"); expect(data.want.uri).assertEqual("key={true,true,false}");
expect(JSON.stringify(data.want.entities)).assertEqual(JSON.stringify(["entity1"])); expect(JSON.stringify(data.want.entities)).assertEqual(JSON.stringify(["entity1"]));
expect(data.want.action).assertEqual("action1"); expect(data.want.action).assertEqual("action1");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册