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

!7504 修复用例

Merge pull request !7504 from 张攀/master
...@@ -3807,23 +3807,12 @@ export default function actsRpcClientJsTest() { ...@@ -3807,23 +3807,12 @@ export default function actsRpcClientJsTest() {
it("SUB_Softbus_IPC_Compatibility_MessageSequence_10800", 0,async function(done){ it("SUB_Softbus_IPC_Compatibility_MessageSequence_10800", 0,async function(done){
console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_10800---------------------------"); console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_10800---------------------------");
try{ try{
let count = 0;
function checkResult(num, str) {
expect(num).assertEqual(123);
expect(str).assertEqual("rpcListenerTest");
count++;
console.info("check result done, count: " + count);
if (count == 3) {
done();
};
};
let data = rpc.MessageSequence.create(); let data = rpc.MessageSequence.create();
let reply = rpc.MessageSequence.create(); let reply = rpc.MessageSequence.create();
let option = new rpc.MessageOption(); let option = new rpc.MessageOption();
data.writeInterfaceToken("rpcTestAbility"); let listeners = [new TestRemoteObject("rpcListener"),
let listeners = [new TestListener("rpcListener", checkResult), new TestRemoteObject("rpcListener2"),
new TestListener("rpcListener2", checkResult), new TestRemoteObject("rpcListener3")];
new TestListener("rpcListener3", checkResult)];
data.writeRemoteObjectArray(listeners); data.writeRemoteObjectArray(listeners);
expect(gIRemoteObject != undefined).assertTrue(); expect(gIRemoteObject != undefined).assertTrue();
await gIRemoteObject.sendMessageRequest(CODE_WRITE_REMOTEOBJECTARRAY, data, reply, option).then((result) => { await gIRemoteObject.sendMessageRequest(CODE_WRITE_REMOTEOBJECTARRAY, data, reply, option).then((result) => {
...@@ -3842,48 +3831,6 @@ export default function actsRpcClientJsTest() { ...@@ -3842,48 +3831,6 @@ export default function actsRpcClientJsTest() {
console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_10800---------------------------"); console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_10800---------------------------");
}); });
/*
* @tc.number SUB_Softbus_IPC_Compatibility_MessageSequence_10900
* @tc.name Call the writeremoteobjectarray interface to write the object array to the MessageSequence instance,
* and call readremoteobjectarray (objects: iremoteobject []) to read the data
* @tc.desc Function test
* @tc.level 3
*/
it("SUB_Softbus_IPC_Compatibility_MessageSequence_10900", 0,async function(done){
console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_10900---------------------------");
try{
let count = 0;
function checkResult(num, str) {
expect(num).assertEqual(123);
expect(str).assertEqual("rpcListenerTest");
count++;
console.info("check result done, count: " + count);
if (count == 3) {
done();
}
}
let data = rpc.MessageSequence.create();
let reply = rpc.MessageSequence.create();
let option = new rpc.MessageOption();
data.writeInterfaceToken("rpcTestAbility");
let listeners = [new TestListener("rpcListener", checkResult),
new TestListener("rpcListener2", checkResult),
new TestListener("rpcListener3", checkResult)];
data.writeRemoteObjectArray(listeners);
expect(gIRemoteObject != undefined).assertTrue();
await gIRemoteObject.sendMessageRequest(CODE_WRITE_REMOTEOBJECTARRAY, data, reply, option).then((result) => {
console.info("SUB_Softbus_IPC_Compatibility_MessageSequence_10900: sendMessageRequest is " + result.errCode);
expect(result.errCode == 0).assertTrue();
});
data.reclaim();
reply.reclaim();
} catch (error) {
expect(error == null).assertTrue();
}
done();
console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_10900---------------------------");
});
/* /*
* @tc.number SUB_Softbus_IPC_Compatibility_MessageSequence_11000 * @tc.number SUB_Softbus_IPC_Compatibility_MessageSequence_11000
* @tc.name Test MessageSequence to deliver the reply message received in promise across processes * @tc.name Test MessageSequence to deliver the reply message received in promise across processes
...@@ -9360,25 +9307,13 @@ export default function actsRpcClientJsTest() { ...@@ -9360,25 +9307,13 @@ export default function actsRpcClientJsTest() {
it("SUB_Softbus_IPC_Compatibility_MessageParcel_12200", 0,async function(done){ it("SUB_Softbus_IPC_Compatibility_MessageParcel_12200", 0,async function(done){
console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_12200---------------------------"); console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_12200---------------------------");
try{ try{
let count = 0
function checkResult(num, str) {
expect(num).assertEqual(123);
expect(str).assertEqual("rpcListenerTest");
count++;
console.info("check result done, count: " + count);
if (count == 3) {
done();
}
}
var data = rpc.MessageParcel.create(); var data = rpc.MessageParcel.create();
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12200: create object successfully."); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12200: create object successfully.");
var reply = rpc.MessageParcel.create(); var reply = rpc.MessageParcel.create();
var option = new rpc.MessageOption(); var option = new rpc.MessageOption();
var listeners = [new TestRemoteObject("rpcListener"),
expect(data.writeInterfaceToken("rpcTestAbility")).assertTrue(); new TestRemoteObject("rpcListener2"),
var listeners = [new TestListener("rpcListener", checkResult), new TestRemoteObject("rpcListener3")];
new TestListener("rpcListener2", checkResult),
new TestListener("rpcListener3", checkResult)];
var result = data.writeRemoteObjectArray(listeners); var result = data.writeRemoteObjectArray(listeners);
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12200: writeRemoteObjectArray is " + result); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12200: writeRemoteObjectArray is " + result);
expect(result == true).assertTrue(); expect(result == true).assertTrue();
...@@ -9404,55 +9339,6 @@ export default function actsRpcClientJsTest() { ...@@ -9404,55 +9339,6 @@ export default function actsRpcClientJsTest() {
console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_12200---------------------------"); console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_12200---------------------------");
}); });
/*
* @tc.number SUB_Softbus_IPC_Compatibility_MessageParcel_12300
* @tc.name Call the writeremoteobjectarray interface to write the object array to the messageparcel instance,
* and call readremoteobjectarray (objects: iremoteobject []) to read the data
* @tc.desc Function test
* @tc.level 3
*/
it("SUB_Softbus_IPC_Compatibility_MessageParcel_12300", 0,async function(done){
console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_12300---------------------------");
try{
let count = 0;
function checkResult(num, str) {
expect(num).assertEqual(123);
expect(str).assertEqual("rpcListenerTest");
count++;
console.info("check result done, count: " + count);
if (count == 3) {
done();
}
}
var data = rpc.MessageParcel.create();
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12300: create object successfully.");
var reply = rpc.MessageParcel.create();
var option = new rpc.MessageOption();
expect(data.writeInterfaceToken("rpcTestAbility")).assertTrue()
var listeners = [new TestListener("rpcListener", checkResult),
new TestListener("rpcListener2", checkResult),
new TestListener("rpcListener3", checkResult)];
var result = data.writeRemoteObjectArray(listeners);
console.info("RpcClient: writeRemoteObjectArray is " + result);
expect(result == true).assertTrue();
if (gIRemoteObject == undefined)
{
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12300: gIRemoteObject is undefined");
}
await gIRemoteObject.sendRequest(CODE_WRITE_REMOTEOBJECTARRAY, data, reply, option).then((result) => {
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12300: sendRequestis is " + result.errCode);
expect(result.errCode == 0).assertTrue();
});
data.reclaim();
reply.reclaim();
done();
} catch (error) {
console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12300:error = " + error);
}
console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_12300---------------------------");
});
/* /*
* @tc.number SUB_Softbus_IPC_Compatibility_MessageParcel_12400 * @tc.number SUB_Softbus_IPC_Compatibility_MessageParcel_12400
* @tc.name Test messageparcel delivery file descriptor object * @tc.name Test messageparcel delivery file descriptor object
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册