Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
7cefd6a6
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
7cefd6a6
编写于
10月 13, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 13, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5893 【【IPC/RPC】onRemoteRequestEx方法名称更改用例适配 】
Merge pull request !5893 from 杨启博/master
上级
18497aef
20e1a907
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
47 addition
and
47 deletion
+47
-47
communication/dsoftbus/rpc/src/main/js/test/RpcClientJsunit.test.js
...ion/dsoftbus/rpc/src/main/js/test/RpcClientJsunit.test.js
+24
-24
communication/dsoftbus/rpc_server/src/main/js/ServiceAbility/service.js
...dsoftbus/rpc_server/src/main/js/ServiceAbility/service.js
+23
-23
未找到文件。
communication/dsoftbus/rpc/src/main/js/test/RpcClientJsunit.test.js
浏览文件 @
7cefd6a6
...
...
@@ -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_ONREMOTE
REQUESTEX_OR_ONREMOTEREQUEST
=
32
;
const
CODE_ONREMOTE
REQUESTEX
=
33
;
const
CODE_ONREMOTE
MESSAGE_OR_ONREMOTE
=
32
;
const
CODE_ONREMOTE
MESSAGEREQUEST
=
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 write
s
equenceable interface to write the custom serialized
* @tc.name Call the write
S
equenceable 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 write
s
equenceable interface to write the custom serialized object to the
* messageparcel instance, and call read
s
equenceable to read the data
* @tc.name Call the write
S
equenceable interface to write the custom serialized object to the
* messageparcel instance, and call read
S
equenceable 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 write
s
equenceablearray interface to write the custom serialized object to the
* messageparcel instance, and call read
s
equenceablearray to read the data
* @tc.name Call the write
S
equenceablearray interface to write the custom serialized object to the
* messageparcel instance, and call read
S
equenceablearray 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 write
s
equenceablearray interface to write the custom serialized object to the
* messageparcel instance, and call read
s
equenceablearray to read the data
* @tc.name Call the write
S
equenceablearray interface to write the custom serialized object to the
* messageparcel instance, and call read
S
equenceablearray 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 write
s
equenceablearray interface to write the custom
* @tc.name Call the write
S
equenceablearray 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 onRemote
RequestEx
Server Processing
* Authentication onRemote
MessageRequest
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
=
'
onRemote
RequestEx
invoking
'
;
var
token
=
'
onRemote
MessageRequest
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_ONREMOTE
REQUESTEX
,
data
,
reply
,
option
).
then
((
result
)
=>
{
await
gIRemoteObject
.
sendRequest
(
CODE_ONREMOTE
MESSAGEREQUEST
,
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 onRemote
RequestEx
Server Processing
* Authentication onRemote
MessageRequest
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
=
'
onRemote
RequestEx
invoking
'
;
var
token
=
'
onRemote
MessageRequest
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_ONREMOTE
REQUESTEX
,
data
,
reply
,
option
).
then
((
result
)
=>
{
await
gIRemoteObject
.
sendMessageRequest
(
CODE_ONREMOTE
MESSAGEREQUEST
,
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 onRemote
RequestEx
and onRemoteRequest
* verifies the priority processing levels of onRemote
MessageRequest
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 onRemote
RequestEx
invoking
"
;
var
token
=
"
onRemoteRequest or onRemote
MessageRequest
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_ONREMOTE
REQUESTEX_OR_ONREMOTEREQUEST
,
data
,
reply
,
option
).
then
((
result
)
=>
{
await
gIRemoteObject
.
sendRequest
(
CODE_ONREMOTE
MESSAGE_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
(
"
onRemote
RequestEx
invoking
"
);
expect
(
replyReadResult
).
assertEqual
(
"
onRemote
MessageRequest
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 onRemote
RequestEx
and onRemoteRequest
* the priority processing levels of onRemote
MessageRequest
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 onRemote
RequestEx
invoking
'
;
var
token
=
'
onRemoteRequest or onRemote
MessageRequest
invoking
'
;
data
.
writeString
(
token
);
if
(
gIRemoteObject
==
undefined
)
{
console
.
info
(
"
SUB_Softbus_IPC_Compatibility_MessageParcel_15800: gIRemoteObject is undefined
"
);
}
await
gIRemoteObject
.
sendMessageRequest
(
CODE_ONREMOTE
REQUESTEX_OR_ONREMOTEREQUEST
,
data
,
reply
,
option
).
then
((
result
)
=>
{
await
gIRemoteObject
.
sendMessageRequest
(
CODE_ONREMOTE
MESSAGE_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
(
"
onRemote
RequestEx
invoking
"
);
expect
(
replyReadResult
).
assertEqual
(
"
onRemote
MessageRequest
invoking
"
);
});
data
.
reclaim
();
reply
.
reclaim
();
...
...
communication/dsoftbus/rpc_server/src/main/js/ServiceAbility/service.js
浏览文件 @
7cefd6a6
...
...
@@ -86,9 +86,9 @@ class Stub extends rpc.RemoteObject {
}
return
false
}
onRemote
RequestEx
(
code
,
data
,
reply
,
option
)
{
onRemote
MessageRequest
(
code
,
data
,
reply
,
option
)
{
try
{
console
.
info
(
"
onRemote
RequestEx
:
"
+
code
)
console
.
info
(
"
onRemote
MessageRequest
:
"
+
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
.
read
Sequence
able
(
s
)
let
result
=
reply
.
write
Sequence
able
(
s
)
var
tmp1
=
data
.
read
Parcel
able
(
s
)
let
result
=
reply
.
write
Parcel
able
(
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
.
read
Sequence
ableArray
(
s
);
let
result
=
reply
.
write
Sequence
ableArray
(
s
);
data
.
read
Parcel
ableArray
(
s
);
let
result
=
reply
.
write
Parcel
ableArray
(
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
.
read
Sequence
able
(
s
)
let
tmp10
=
data
.
read
Parcel
able
(
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
.
write
Sequence
able
(
s
)
let
result10
=
reply
.
write
Parcel
able
(
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
.
read
Sequence
ableArray
(
s
)
let
tmp10
=
data
.
read
Parcel
ableArray
(
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
.
write
Sequence
ableArray
(
s
)
let
result10
=
reply
.
write
Parcel
ableArray
(
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
.
read
Sequence
able
(
s
);
var
result
=
reply
.
write
Sequence
able
(
s
);
var
tmp1
=
data
.
read
Parcel
able
(
s
);
var
result
=
reply
.
write
Parcel
able
(
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
(
"
onRemote
RequestEx
invoking
"
)
let
result
=
reply
.
writeString
(
"
onRemote
MessageRequest
invoking
"
)
return
true
}
default
:
this
.
onRemoteRequest
(
code
,
data
,
reply
,
option
)
}
}
catch
(
error
)
{
console
.
info
(
"
onRemote
RequestEx
:
"
+
error
);
console
.
info
(
"
onRemote
MessageRequest
:
"
+
error
);
}
return
false
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录