Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22a7f0099
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22a7f0099
Commits
c5f002bb
Commit
c5f002bb
authored
4 years ago
by
邹毅贤
Browse files
Options
Downloads
Patches
Plain Diff
fix bug
parent
b20b53fb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
protocol/dubbo/dubbo_invoker_test.go
+0
-140
0 additions, 140 deletions
protocol/dubbo/dubbo_invoker_test.go
with
0 additions
and
140 deletions
protocol/dubbo/dubbo_invoker_test.go
+
0
−
140
View file @
c5f002bb
...
...
@@ -231,143 +231,3 @@ func (u *UserProvider) Reference() string {
func
(
u
User
)
JavaClassName
()
string
{
return
"com.ikurento.user.User"
}
func
InitTest
(
t
*
testing
.
T
)
(
protocol
.
Protocol
,
common
.
URL
)
{
hessian
.
RegisterPOJO
(
&
User
{})
methods
,
err
:=
common
.
ServiceMap
.
Register
(
""
,
"dubbo"
,
&
UserProvider
{})
assert
.
NoError
(
t
,
err
)
assert
.
Equal
(
t
,
"GetBigPkg,GetUser,GetUser0,GetUser1,GetUser2,GetUser3,GetUser4,GetUser5,GetUser6"
,
methods
)
// config
getty
.
SetClientConf
(
getty
.
ClientConfig
{
ConnectionNum
:
2
,
HeartbeatPeriod
:
"5s"
,
SessionTimeout
:
"20s"
,
PoolTTL
:
600
,
PoolSize
:
64
,
GettySessionParam
:
getty
.
GettySessionParam
{
CompressEncoding
:
false
,
TcpNoDelay
:
true
,
TcpKeepAlive
:
true
,
KeepAlivePeriod
:
"120s"
,
TcpRBufSize
:
262144
,
TcpWBufSize
:
65536
,
PkgWQSize
:
512
,
TcpReadTimeout
:
"4s"
,
TcpWriteTimeout
:
"5s"
,
WaitTimeout
:
"1s"
,
MaxMsgLen
:
10240000000
,
SessionName
:
"client"
,
},
})
getty
.
SetServerConfig
(
getty
.
ServerConfig
{
SessionNumber
:
700
,
SessionTimeout
:
"20s"
,
GettySessionParam
:
getty
.
GettySessionParam
{
CompressEncoding
:
false
,
TcpNoDelay
:
true
,
TcpKeepAlive
:
true
,
KeepAlivePeriod
:
"120s"
,
TcpRBufSize
:
262144
,
TcpWBufSize
:
65536
,
PkgWQSize
:
512
,
TcpReadTimeout
:
"1s"
,
TcpWriteTimeout
:
"5s"
,
WaitTimeout
:
"1s"
,
MaxMsgLen
:
10240000000
,
SessionName
:
"server"
,
}})
// Export
proto
:=
GetProtocol
()
url
,
err
:=
common
.
NewURL
(
"dubbo://127.0.0.1:20702/UserProvider?anyhost=true&"
+
"application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-provider-golang-1.0.0&"
+
"environment=dev&interface=com.ikurento.user.UserProvider&ip=192.168.56.1&methods=GetUser%2C&"
+
"module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&"
+
"side=provider&timeout=3000×tamp=1556509797245&bean.name=UserProvider"
)
assert
.
NoError
(
t
,
err
)
proto
.
Export
(
&
proxy_factory
.
ProxyInvoker
{
BaseInvoker
:
*
protocol
.
NewBaseInvoker
(
url
),
})
time
.
Sleep
(
time
.
Second
*
2
)
return
proto
,
url
}
//////////////////////////////////
// provider
//////////////////////////////////
type
(
User
struct
{
Id
string
`json:"id"`
Name
string
`json:"name"`
}
UserProvider
struct
{
user
map
[
string
]
User
}
)
// size:4801228
func
(
u
*
UserProvider
)
GetBigPkg
(
ctx
context
.
Context
,
req
[]
interface
{},
rsp
*
User
)
error
{
argBuf
:=
new
(
bytes
.
Buffer
)
for
i
:=
0
;
i
<
400
;
i
++
{
// use chinese for test
argBuf
.
WriteString
(
"击鼓其镗,踊跃用兵。土国城漕,我独南行。从孙子仲,平陈与宋。不我以归,忧心有忡。爰居爰处?爰丧其马?于以求之?于林之下。死生契阔,与子成说。执子之手,与子偕老。于嗟阔兮,不我活兮。于嗟洵兮,不我信兮。"
)
argBuf
.
WriteString
(
"击鼓其镗,踊跃用兵。土国城漕,我独南行。从孙子仲,平陈与宋。不我以归,忧心有忡。爰居爰处?爰丧其马?于以求之?于林之下。死生契阔,与子成说。执子之手,与子偕老。于嗟阔兮,不我活兮。于嗟洵兮,不我信兮。"
)
}
rsp
.
Id
=
argBuf
.
String
()
rsp
.
Name
=
argBuf
.
String
()
return
nil
}
func
(
u
*
UserProvider
)
GetUser
(
ctx
context
.
Context
,
req
[]
interface
{},
rsp
*
User
)
error
{
rsp
.
Id
=
req
[
0
]
.
(
string
)
rsp
.
Name
=
req
[
1
]
.
(
string
)
return
nil
}
func
(
u
*
UserProvider
)
GetUser0
(
id
string
,
k
*
User
,
name
string
)
(
User
,
error
)
{
return
User
{
Id
:
id
,
Name
:
name
},
nil
}
func
(
u
*
UserProvider
)
GetUser1
()
error
{
return
nil
}
func
(
u
*
UserProvider
)
GetUser2
()
error
{
return
perrors
.
New
(
"error"
)
}
func
(
u
*
UserProvider
)
GetUser3
(
rsp
*
[]
interface
{})
error
{
*
rsp
=
append
(
*
rsp
,
User
{
Id
:
"1"
,
Name
:
"username"
})
return
nil
}
func
(
u
*
UserProvider
)
GetUser4
(
ctx
context
.
Context
,
req
[]
interface
{})
([]
interface
{},
error
)
{
return
[]
interface
{}{
User
{
Id
:
req
[
0
]
.
([]
interface
{})[
0
]
.
(
string
),
Name
:
req
[
0
]
.
([]
interface
{})[
1
]
.
(
string
)}},
nil
}
func
(
u
*
UserProvider
)
GetUser5
(
ctx
context
.
Context
,
req
[]
interface
{})
(
map
[
interface
{}]
interface
{},
error
)
{
return
map
[
interface
{}]
interface
{}{
"key"
:
User
{
Id
:
req
[
0
]
.
(
map
[
interface
{}]
interface
{})[
"id"
]
.
(
string
),
Name
:
req
[
0
]
.
(
map
[
interface
{}]
interface
{})[
"name"
]
.
(
string
)}},
nil
}
func
(
u
*
UserProvider
)
GetUser6
(
id
int64
)
(
*
User
,
error
)
{
if
id
==
0
{
return
nil
,
nil
}
return
&
User
{
Id
:
"1"
},
nil
}
func
(
u
*
UserProvider
)
Reference
()
string
{
return
"UserProvider"
}
func
(
u
User
)
JavaClassName
()
string
{
return
"com.ikurento.user.User"
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment