未验证 提交 7cefd6a6 编写于 作者: O openharmony_ci 提交者: Gitee

!5893 【【IPC/RPC】onRemoteRequestEx方法名称更改用例适配 】

Merge pull request !5893 from 杨启博/master
......@@ -70,8 +70,8 @@ export default function actsRpcClientJsTest() {
const CODE_FILESDIR = 29;
const CODE_WRITE_REMOTEOBJECTARRAY_1 = 30;
const CODE_WRITE_REMOTEOBJECTARRAY_2 = 31;
const CODE_ONREMOTEREQUESTEX_OR_ONREMOTEREQUEST = 32;
const CODE_ONREMOTEREQUESTEX = 33;
const CODE_ONREMOTEMESSAGE_OR_ONREMOTE = 32;
const CODE_ONREMOTEMESSAGEREQUEST = 33;
function connectAbility() {
let want = {
......@@ -4118,7 +4118,7 @@ export default function actsRpcClientJsTest() {
/*
* @tc.number SUB_Softbus_IPC_Compatibility_MessageParcel_11200
* @tc.name Call the writesequenceable interface to write the custom serialized
* @tc.name Call the writeSequenceable interface to write the custom serialized
* object to the messageparcel instance
* @tc.desc Function test
* @tc.level 0
......@@ -4346,8 +4346,8 @@ export default function actsRpcClientJsTest() {
/*
* @tc.number SUB_Softbus_IPC_Compatibility_MessageParcel_11800
* @tc.name Call the writesequenceable interface to write the custom serialized object to the
* messageparcel instance, and call readsequenceable to read the data
* @tc.name Call the writeSequenceable interface to write the custom serialized object to the
* messageparcel instance, and call readSequenceable to read the data
* @tc.desc Function test
* @tc.level 0
*/
......@@ -4387,8 +4387,8 @@ export default function actsRpcClientJsTest() {
/*
* @tc.number SUB_Softbus_IPC_Compatibility_MessageParcel_11900
* @tc.name Call the writesequenceablearray interface to write the custom serialized object to the
* messageparcel instance, and call readsequenceablearray to read the data
* @tc.name Call the writeSequenceablearray interface to write the custom serialized object to the
* messageparcel instance, and call readSequenceablearray to read the data
* @tc.desc Function test
* @tc.level 0
*/
......@@ -4432,8 +4432,8 @@ export default function actsRpcClientJsTest() {
/*
* @tc.number SUB_Softbus_IPC_Compatibility_MessageParcel_12000
* @tc.name Call the writesequenceablearray interface to write the custom serialized object to the
* messageparcel instance, and call readsequenceablearray to read the data
* @tc.name Call the writeSequenceablearray interface to write the custom serialized object to the
* messageparcel instance, and call readSequenceablearray to read the data
* @tc.desc Function test
* @tc.level 0
*/
......@@ -4477,7 +4477,7 @@ export default function actsRpcClientJsTest() {
/*
* @tc.number SUB_Softbus_IPC_Compatibility_MessageParcel_12100
* @tc.name Call the writesequenceablearray interface to write the custom
* @tc.name Call the writeSequenceablearray interface to write the custom
* serialized object to the messageparcel instance
* @tc.desc Function test
* @tc.level 0
......@@ -5887,7 +5887,7 @@ export default function actsRpcClientJsTest() {
/*
* @tc.number SUB_Softbus_IPC_Compatibility_MessageParcel_15500
* @tc.name Invoke the writestring interface to write data to the messageparcel instance SendRequest Asynchronous
* Authentication onRemoteRequestEx Server Processing
* Authentication onRemoteMessageRequest Server Processing
* @tc.desc Function test
* @tc.level 0
*/
......@@ -5898,7 +5898,7 @@ export default function actsRpcClientJsTest() {
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15500: create object successfully.");
var reply = rpc.MessageParcel.create();
var option = new rpc.MessageOption();
var token = 'onRemoteRequestEx invoking';
var token = 'onRemoteMessageRequest invoking';
var result = data.writeString(token);
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15500:run writeStringis is " + result);
expect(result == true).assertTrue();
......@@ -5906,7 +5906,7 @@ export default function actsRpcClientJsTest() {
{
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15500: gIRemoteObject is undefined");
}
await gIRemoteObject.sendRequest(CODE_ONREMOTEREQUESTEX, data, reply, option).then((result) => {
await gIRemoteObject.sendRequest(CODE_ONREMOTEMESSAGEREQUEST, data, reply, option).then((result) => {
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15500: sendRequestis is " + result.errCode);
var replyReadResult = result.reply.readString();
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15500: run readString is " + replyReadResult);
......@@ -5924,7 +5924,7 @@ export default function actsRpcClientJsTest() {
/*
* @tc.number SUB_Softbus_IPC_Compatibility_MessageParcel_15600
* @tc.name Invoke the writestring interface to write data to the messageparcel instance sendMessageRequest Asynchronous
* Authentication onRemoteRequestEx Server Processing
* Authentication onRemoteMessageRequest Server Processing
* @tc.desc Function test
* @tc.level 0
*/
......@@ -5935,14 +5935,14 @@ export default function actsRpcClientJsTest() {
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600: create object successfully.");
var reply = rpc.MessageSequence.create();
var option = new rpc.MessageOption();
var token = 'onRemoteRequestEx invoking';
var token = 'onRemoteMessageRequest invoking';
var result = data.writeString(token);
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600:run writeStringis is " + result);
if (gIRemoteObject == undefined)
{
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600: gIRemoteObject is undefined");
}
await gIRemoteObject.sendMessageRequest(CODE_ONREMOTEREQUESTEX, data, reply, option).then((result) => {
await gIRemoteObject.sendMessageRequest(CODE_ONREMOTEMESSAGEREQUEST, data, reply, option).then((result) => {
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600: sendRequestis is " + result.errCode);
var replyReadResult = result.reply.readString();
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600: run readString is " + replyReadResult);
......@@ -5960,7 +5960,7 @@ export default function actsRpcClientJsTest() {
/*
* @tc.number SUB_Softbus_IPC_Compatibility_MessageParcel_15700
* @tc.name Invoke the writestring interface to write data to the messageparcel instance. SendRequest asynchronously
* verifies the priority processing levels of onRemoteRequestEx and onRemoteRequest
* verifies the priority processing levels of onRemoteMessageRequest and onRemoteRequest
* @tc.desc Function test
* @tc.level 0
*/
......@@ -5971,7 +5971,7 @@ export default function actsRpcClientJsTest() {
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15700: create object successfully.");
var reply = rpc.MessageParcel.create();
var option = new rpc.MessageOption();
var token = "onRemoteRequest or onRemoteRequestEx invoking";
var token = "onRemoteRequest or onRemoteMessageRequest invoking";
var result = data.writeString(token);
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15700:run writeStringis is " + result);
expect(result == true).assertTrue();
......@@ -5979,11 +5979,11 @@ export default function actsRpcClientJsTest() {
{
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15700: gIRemoteObject is undefined");
}
await gIRemoteObject.sendRequest(CODE_ONREMOTEREQUESTEX_OR_ONREMOTEREQUEST, data, reply, option).then((result) => {
await gIRemoteObject.sendRequest(CODE_ONREMOTEMESSAGE_OR_ONREMOTE, data, reply, option).then((result) => {
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15700: sendRequestis is " + result.errCode);
var replyReadResult = result.reply.readString();
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15700: run readString is " + replyReadResult);
expect(replyReadResult).assertEqual("onRemoteRequestEx invoking");
expect(replyReadResult).assertEqual("onRemoteMessageRequest invoking");
});
data.reclaim();
reply.reclaim();
......@@ -5997,7 +5997,7 @@ export default function actsRpcClientJsTest() {
/*
* @tc.number SUB_Softbus_IPC_Compatibility_MessageParcel_15800
* @tc.name Invoke the writestring interface to write data to the messageparcel instance. sendMessageRequest asynchronously verifies
* the priority processing levels of onRemoteRequestEx and onRemoteRequest
* the priority processing levels of onRemoteMessageRequest and onRemoteRequest
* @tc.desc Function test
* @tc.level 0
*/
......@@ -6008,17 +6008,17 @@ export default function actsRpcClientJsTest() {
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15800: create object successfully.");
var reply = rpc.MessageSequence.create();
var option = new rpc.MessageOption();
var token = 'onRemoteRequest or onRemoteRequestEx invoking';
var token = 'onRemoteRequest or onRemoteMessageRequest invoking';
data.writeString(token);
if (gIRemoteObject == undefined)
{
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15800: gIRemoteObject is undefined");
}
await gIRemoteObject.sendMessageRequest(CODE_ONREMOTEREQUESTEX_OR_ONREMOTEREQUEST, data, reply, option).then((result) => {
await gIRemoteObject.sendMessageRequest(CODE_ONREMOTEMESSAGE_OR_ONREMOTE, data, reply, option).then((result) => {
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15800: sendRequestis is " + result.errCode);
var replyReadResult = result.reply.readString();
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15800: run readString is " + replyReadResult);
expect(replyReadResult).assertEqual("onRemoteRequestEx invoking");
expect(replyReadResult).assertEqual("onRemoteMessageRequest invoking");
});
data.reclaim();
reply.reclaim();
......
......@@ -86,9 +86,9 @@ class Stub extends rpc.RemoteObject {
}
return false
}
onRemoteRequestEx(code, data, reply, option) {
onRemoteMessageRequest(code, data, reply, option) {
try{
console.info("onRemoteRequestEx: " + code)
console.info("onRemoteMessageRequest: " + code)
switch(code) {
case 1:
{
......@@ -196,10 +196,10 @@ class Stub extends rpc.RemoteObject {
data2.writeString(str)
listener.sendRequest(1, data2, reply2, option2)
.then(function(result) {
console.info("send request done, error code: " + result.errCode )
console.info("14 send request done, error code: " + result.errCode )
})
.catch(function(e) {
console.error("send request got exception: " + e)
console.error("14 send request got exception: " + e)
})
.finally(() => {
data2.reclaim()
......@@ -213,8 +213,8 @@ class Stub extends rpc.RemoteObject {
{
console.info("case 15 start")
let s = new MySequenceable(null, null)
var tmp1 = data.readSequenceable(s)
let result = reply.writeSequenceable(s)
var tmp1 = data.readParcelable(s)
let result = reply.writeParcelable(s)
return true
}
case 16:
......@@ -231,8 +231,8 @@ class Stub extends rpc.RemoteObject {
console.info("case 17 start")
var s = [new MySequenceable(null, null), new MySequenceable(null, null),
new MySequenceable(null, null)];
data.readSequenceableArray(s);
let result = reply.writeSequenceableArray(s);
data.readParcelableArray(s);
let result = reply.writeParcelableArray(s);
return true
}
case 18:
......@@ -245,10 +245,10 @@ class Stub extends rpc.RemoteObject {
let reply2 = rpc.MessageParcel.create()
listeners[i].sendRequest(1, data2, reply2, option2)
.then(function(result) {
console.info("send request done, error code: " + result.errCode + ", index: " + i)
console.info("18 send request done, error code: " + result.errCode + ", index: " + i)
})
.catch(function(e) {
console.error("send request got exception: " + e)
console.error("18 send request got exception: " + e)
})
.finally(() => {
data2.reclaim()
......@@ -256,7 +256,7 @@ class Stub extends rpc.RemoteObject {
console.info("case 18 test done")
})
}
console.info("The server's writeRemoteObjectArray result is " + result);
console.info("18 The server's writeRemoteObjectArray result is " + result);
return true
}
case 19:
......@@ -280,7 +280,7 @@ class Stub extends rpc.RemoteObject {
let tmp8 = data.readChar()
let tmp9 = data.readString()
let s = new MySequenceable(null, null)
let tmp10 = data.readSequenceable(s)
let tmp10 = data.readParcelable(s)
let result1 = reply.writeByte(tmp1)
let result2 = reply.writeShort(tmp2)
let result3 = reply.writeInt(tmp3)
......@@ -290,7 +290,7 @@ class Stub extends rpc.RemoteObject {
let result7 = reply.writeBoolean(tmp7)
let result8 = reply.writeChar(tmp8)
let result9 = reply.writeString(tmp9)
let result10 = reply.writeSequenceable(s)
let result10 = reply.writeParcelable(s)
return true
}
case 21:
......@@ -307,7 +307,7 @@ class Stub extends rpc.RemoteObject {
let tmp9 = data.readStringArray()
let s = [new MySequenceable(null, null), new MySequenceable(null, null),
new MySequenceable(null, null)]
let tmp10 = data.readSequenceableArray(s)
let tmp10 = data.readParcelableArray(s)
let result1 = reply.writeByteArray(tmp1)
let result2 = reply.writeShortArray(tmp2)
let result3 = reply.writeIntArray(tmp3)
......@@ -317,7 +317,7 @@ class Stub extends rpc.RemoteObject {
let result7 = reply.writeBooleanArray(tmp7)
let result8 = reply.writeCharArray(tmp8)
let result9 = reply.writeStringArray(tmp9)
let result10 = reply.writeSequenceableArray(s)
let result10 = reply.writeParcelableArray(s)
return true
}
case 22:
......@@ -341,8 +341,8 @@ class Stub extends rpc.RemoteObject {
{
console.info("case 23 start")
let s = new MySequenceable(null, null);
var tmp1 = data.readSequenceable(s);
var result = reply.writeSequenceable(s);
var tmp1 = data.readParcelable(s);
var result = reply.writeParcelable(s);
return true
}
case 24:
......@@ -436,10 +436,10 @@ class Stub extends rpc.RemoteObject {
data2.writeString(str)
listeners[i].sendRequest(1, data2, reply2, option2)
.then(function(result) {
console.info("send request done, error code: " + result.errCode + ", index: " + i)
console.info("30 send request done, error code: " + result.errCode + ", index: " + i)
})
.catch(function(e) {
console.error("send request got exception: " + e)
console.error("30 send request got exception: " + e)
})
.finally(() => {
data2.reclaim()
......@@ -466,10 +466,10 @@ class Stub extends rpc.RemoteObject {
data2.writeString(str)
listeners[i].sendRequest(1, data2, reply2, option2)
.then(function(result) {
console.info("send request done, error code: " + result.errCode + ", index: " + i)
console.info("31 send request done, error code: " + result.errCode + ", index: " + i)
})
.catch(function(e) {
console.error("send request got exception: " + e)
console.error("31 send request got exception: " + e)
})
.finally(() => {
data2.reclaim()
......@@ -484,14 +484,14 @@ class Stub extends rpc.RemoteObject {
{
console.info("case 32 start")
let tmp1 = data.readString()
let result = reply.writeString("onRemoteRequestEx invoking")
let result = reply.writeString("onRemoteMessageRequest invoking")
return true
}
default:
this.onRemoteRequest(code, data, reply, option)
}
} catch (error) {
console.info("onRemoteRequestEx: " + error);
console.info("onRemoteMessageRequest: " + error);
}
return false
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册