提交 b3ca6989 编写于 作者: Z zhaoyuan17

Update test code

Signed-off-by: Nzhaoyuan17 <zhaoyuan17@huawei.com>
上级 23974726
......@@ -16,7 +16,6 @@
import notification from '@ohos.notification'
import image from '@ohos.multimedia.image'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
var ERR_ANS_ICON_OVER_SIZE = 67108882
var largeIconA
var smallIconA
var largeBufferA
......@@ -52,7 +51,7 @@ describe('ActsAnsPublishIconTest', function () {
}
function publishCallbackB(err){
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) {
console.debug("===consumeCallbackA data : ===>" + JSON.stringify(data));
......@@ -310,10 +309,10 @@ describe('ActsAnsPublishIconTest', function () {
largeIcon:largeIconD,
}).then().catch((err)=>{
console.debug("===ACTS_PublishIconTest_0400 promise===>"+err.code);
expect(err.code).assertEqual(ERR_ANS_ICON_OVER_SIZE)
expect(err.code != 0).assertEqual(true);
done()
});
})
});
});
})
\ No newline at end of file
})
......@@ -27,7 +27,6 @@ var pubimageA
var pubimageB
var pubimageC
var pubimageD
var ERR_ANS_PICTURE_OVER_SIZE = 67108883
describe('ActsAnsPublishImageTest', function () {
console.info("===ActsAnsPublishImageTest start===>");
......@@ -55,7 +54,7 @@ describe('ActsAnsPublishImageTest', function () {
}
function publishCallbackB(err){
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 () {
sortingKey:"sortingKeyD",
}).then().catch((err)=>{
console.debug("===ActsPublishImage_test_0400 err===>"+err.code);
expect(err.code).assertEqual(ERR_ANS_PICTURE_OVER_SIZE)
expect(err.code != 0).assertEqual(true);
done();
});
})
......
......@@ -16,7 +16,6 @@
import notify from '@ohos.notification'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
var time = 1000
var ERR_ANS_INVALID_BUNDLE = 67108870
describe('ActsAnsBadgeDisplayTest', function () {
console.info("===ActsAnsBadgeDisplayTest start===>");
/*
......@@ -74,7 +73,7 @@ describe('ActsAnsBadgeDisplayTest', function () {
bundle:"wrong BundleName",
}).then().catch((err)=>{
console.log("===>ActsGetDisplay_test_0400 success===>"+err.code)
expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE)
expect(err.code != 0).assertEqual(true);
done();
})
......@@ -211,7 +210,7 @@ describe('ActsAnsBadgeDisplayTest', function () {
bundle:"Wrong BundleName"
},true).then().catch((err)=>{
console.log("===>ActsSetDisplay_test_0400 err===>"+err.code)
expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE)
expect(err.code != 0).assertEqual(true);
done();
})
})
......
......@@ -16,7 +16,6 @@
import notify from '@ohos.notification'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
var time = 1000
var ERR_ANS_INVALID_BUNDLE = 67108870
describe('ActsAnsEnableNotificationTest', function () {
console.info("===========ActsAnsEnableNotificationTest start====================>");
/*
......@@ -82,7 +81,7 @@ describe('ActsAnsEnableNotificationTest', function () {
bundle:"wrong BundleName",
}).then().catch((err)=>{
console.debug("====>ActsGetEnable_test_0400 promsie====>"+err.code);
expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE)
expect(err.code != 0).assertEqual(true);
done();
})
})
......@@ -241,7 +240,7 @@ describe('ActsAnsEnableNotificationTest', function () {
bundle:"Wrong BundleName"
},true).then().catch((err)=>{
console.log("===>ActsSetEnable_test_0400 err===>"+err.code)
expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE)
expect(err.code != 0).assertEqual(true);
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 () {
wants: [
{
deviceId: "",
bundleName: "com.example.WantAgentTest",
abilityName: "com.example.WantAgentTest.MainAbility",
bundleName: "com.example.WantAgentTest1",
abilityName: "com.example.WantAgentTest1.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
......@@ -73,8 +73,8 @@ describe('ActsAnsWantAgentOneTest', function () {
expect(data.finalCode).assertEqual(0);
expect(data.finalData).assertEqual("");
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.WantAgentTest");
expect(data.want.abilityName).assertEqual("com.example.WantAgentTest.MainAbility");
expect(data.want.bundleName).assertEqual("com.example.WantAgentTest1");
expect(data.want.abilityName).assertEqual("com.example.WantAgentTest1.MainAbility");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(JSON.stringify(data.want.entities)).assertEqual(JSON.stringify(["entity1"]));
expect(data.want.action).assertEqual("action1");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册