Skip to content
Snippets Groups Projects
Commit 2d8d2f02 authored by haohongfan's avatar haohongfan
Browse files

feat: rest GetBigPkg

parent f9f1d7a6
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
package getty package getty
import ( import (
"bytes"
"context" "context"
"reflect" "reflect"
"sync" "sync"
...@@ -41,11 +42,6 @@ import ( ...@@ -41,11 +42,6 @@ import (
"github.com/apache/dubbo-go/remoting" "github.com/apache/dubbo-go/remoting"
) )
const (
DubboCodecForTestUserID = "DubboCodecForTestUserID"
DubboCodecForTestUserName = "DubboCodecForTestUserName"
)
func TestRunSuite(t *testing.T) { func TestRunSuite(t *testing.T) {
svr, url := InitTest(t) svr, url := InitTest(t)
client := getClient(url) client := getClient(url)
...@@ -126,8 +122,8 @@ func testGetBigPkg(t *testing.T, c *Client) { ...@@ -126,8 +122,8 @@ func testGetBigPkg(t *testing.T, c *Client) {
remoting.AddPendingResponse(pendingResponse) remoting.AddPendingResponse(pendingResponse)
err := c.Request(request, 8*time.Second, pendingResponse) err := c.Request(request, 8*time.Second, pendingResponse)
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, DubboCodecForTestUserID, user.Id) assert.NotEqual(t, "", user.Id)
assert.Equal(t, DubboCodecForTestUserName, user.Name) assert.NotEqual(t, "", user.Name)
} }
func testGetUser(t *testing.T, c *Client) { func testGetUser(t *testing.T, c *Client) {
...@@ -438,8 +434,13 @@ type ( ...@@ -438,8 +434,13 @@ type (
// size:4801228 // size:4801228
func (u *UserProvider) GetBigPkg(ctx context.Context, req []interface{}, rsp *User) error { func (u *UserProvider) GetBigPkg(ctx context.Context, req []interface{}, rsp *User) error {
rsp.Id = DubboCodecForTestUserID argBuf := new(bytes.Buffer)
rsp.Name = DubboCodecForTestUserName for i := 0; i < 400; i++ {
argBuf.WriteString("击鼓其镗,踊跃用兵。土国城漕,我独南行。从孙子仲,平陈与宋。不我以归,忧心有忡。爰居爰处?爰丧其马?于以求之?于林之下。死生契阔,与子成说。执子之手,与子偕老。于嗟阔兮,不我活兮。于嗟洵兮,不我信兮。")
argBuf.WriteString("击鼓其镗,踊跃用兵。土国城漕,我独南行。从孙子仲,平陈与宋。不我以归,忧心有忡。爰居爰处?爰丧其马?于以求之?于林之下。死生契阔,与子成说。执子之手,与子偕老。于嗟阔兮,不我活兮。于嗟洵兮,不我信兮。")
}
rsp.Id = argBuf.String()
rsp.Name = argBuf.String()
return nil return nil
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment