Skip to content

Commit

Permalink
Merge pull request #628 from watermelo/feature/optCodesForProtocolDir
Browse files Browse the repository at this point in the history
Mod: code linter warnings
  • Loading branch information
zouyx authored Jun 29, 2020
2 parents 2550126 + 51df26a commit 89e3bee
Show file tree
Hide file tree
Showing 20 changed files with 106 additions and 97 deletions.
37 changes: 21 additions & 16 deletions protocol/dubbo/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ import (
"github.com/apache/dubbo-go/protocol"
)

func TestClient_CallOneway(t *testing.T) {
const (
mockMethodNameGetUser = "GetUser"
mockMethodNameGetBigPkg = "GetBigPkg"
mockAddress = "127.0.0.1:20000"
)

func TestClientCallOneway(t *testing.T) {
proto, url := InitTest(t)

c := &Client{
Expand All @@ -50,15 +56,14 @@ func TestClient_CallOneway(t *testing.T) {
}
c.pool = newGettyRPCClientConnPool(c, clientConf.PoolSize, time.Duration(int(time.Second)*clientConf.PoolTTL))

//user := &User{}
err := c.CallOneway(NewRequest("127.0.0.1:20000", url, "GetUser", []interface{}{"1", "username"}, nil))
err := c.CallOneway(NewRequest(mockAddress, url, mockMethodNameGetUser, []interface{}{"1", "username"}, nil))
assert.NoError(t, err)

// destroy
proto.Destroy()
}

func TestClient_Call(t *testing.T) {
func TestClientCall(t *testing.T) {
proto, url := InitTest(t)

c := &Client{
Expand All @@ -77,58 +82,58 @@ func TestClient_Call(t *testing.T) {
)

user = &User{}
err = c.Call(NewRequest("127.0.0.1:20000", url, "GetBigPkg", []interface{}{nil}, nil), NewResponse(user, nil))
err = c.Call(NewRequest(mockAddress, url, mockMethodNameGetBigPkg, []interface{}{nil}, nil), NewResponse(user, nil))
assert.NoError(t, err)
assert.NotEqual(t, "", user.Id)
assert.NotEqual(t, "", user.Name)

user = &User{}
err = c.Call(NewRequest("127.0.0.1:20000", url, "GetUser", []interface{}{"1", "username"}, nil), NewResponse(user, nil))
err = c.Call(NewRequest(mockAddress, url, mockMethodNameGetUser, []interface{}{"1", "username"}, nil), NewResponse(user, nil))
assert.NoError(t, err)
assert.Equal(t, User{Id: "1", Name: "username"}, *user)

user = &User{}
err = c.Call(NewRequest("127.0.0.1:20000", url, "GetUser0", []interface{}{"1", nil, "username"}, nil), NewResponse(user, nil))
err = c.Call(NewRequest(mockAddress, url, "GetUser0", []interface{}{"1", nil, "username"}, nil), NewResponse(user, nil))
assert.NoError(t, err)
assert.Equal(t, User{Id: "1", Name: "username"}, *user)

err = c.Call(NewRequest("127.0.0.1:20000", url, "GetUser1", []interface{}{}, nil), NewResponse(user, nil))
err = c.Call(NewRequest(mockAddress, url, "GetUser1", []interface{}{}, nil), NewResponse(user, nil))
assert.NoError(t, err)

err = c.Call(NewRequest("127.0.0.1:20000", url, "GetUser2", []interface{}{}, nil), NewResponse(user, nil))
err = c.Call(NewRequest(mockAddress, url, "GetUser2", []interface{}{}, nil), NewResponse(user, nil))
assert.EqualError(t, err, "error")

user2 := []interface{}{}
err = c.Call(NewRequest("127.0.0.1:20000", url, "GetUser3", []interface{}{}, nil), NewResponse(&user2, nil))
err = c.Call(NewRequest(mockAddress, url, "GetUser3", []interface{}{}, nil), NewResponse(&user2, nil))
assert.NoError(t, err)
assert.Equal(t, &User{Id: "1", Name: "username"}, user2[0])

user2 = []interface{}{}
err = c.Call(NewRequest("127.0.0.1:20000", url, "GetUser4", []interface{}{[]interface{}{"1", "username"}}, nil), NewResponse(&user2, nil))
err = c.Call(NewRequest(mockAddress, url, "GetUser4", []interface{}{[]interface{}{"1", "username"}}, nil), NewResponse(&user2, nil))
assert.NoError(t, err)
assert.Equal(t, &User{Id: "1", Name: "username"}, user2[0])

user3 := map[interface{}]interface{}{}
err = c.Call(NewRequest("127.0.0.1:20000", url, "GetUser5", []interface{}{map[interface{}]interface{}{"id": "1", "name": "username"}}, nil), NewResponse(&user3, nil))
err = c.Call(NewRequest(mockAddress, url, "GetUser5", []interface{}{map[interface{}]interface{}{"id": "1", "name": "username"}}, nil), NewResponse(&user3, nil))
assert.NoError(t, err)
assert.NotNil(t, user3)
assert.Equal(t, &User{Id: "1", Name: "username"}, user3["key"])

user = &User{}
err = c.Call(NewRequest("127.0.0.1:20000", url, "GetUser6", []interface{}{0}, nil), NewResponse(user, nil))
err = c.Call(NewRequest(mockAddress, url, "GetUser6", []interface{}{0}, nil), NewResponse(user, nil))
assert.NoError(t, err)
assert.Equal(t, User{Id: "", Name: ""}, *user)

user = &User{}
err = c.Call(NewRequest("127.0.0.1:20000", url, "GetUser6", []interface{}{1}, nil), NewResponse(user, nil))
err = c.Call(NewRequest(mockAddress, url, "GetUser6", []interface{}{1}, nil), NewResponse(user, nil))
assert.NoError(t, err)
assert.Equal(t, User{Id: "1", Name: ""}, *user)

// destroy
proto.Destroy()
}

func TestClient_AsyncCall(t *testing.T) {
func TestClientAsyncCall(t *testing.T) {
proto, url := InitTest(t)

c := &Client{
Expand All @@ -144,7 +149,7 @@ func TestClient_AsyncCall(t *testing.T) {
user := &User{}
lock := sync.Mutex{}
lock.Lock()
err := c.AsyncCall(NewRequest("127.0.0.1:20000", url, "GetUser", []interface{}{"1", "username"}, nil), func(response common.CallbackResponse) {
err := c.AsyncCall(NewRequest(mockAddress, url, mockMethodNameGetUser, []interface{}{"1", "username"}, nil), func(response common.CallbackResponse) {
r := response.(AsyncCallbackResponse)
assert.Equal(t, User{Id: "1", Name: "username"}, *r.Reply.(*Response).reply.(*User))
lock.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion protocol/dubbo/codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/stretchr/testify/assert"
)

func TestDubboPackage_MarshalAndUnmarshal(t *testing.T) {
func TestDubboPackageMarshalAndUnmarshal(t *testing.T) {
pkg := &DubboPackage{}
pkg.Body = []interface{}{"a"}
pkg.Header.Type = hessian.PackageHeartbeat
Expand Down
4 changes: 2 additions & 2 deletions protocol/dubbo/dubbo_invoker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"github.com/apache/dubbo-go/protocol/invocation"
)

func TestDubboInvoker_Invoke(t *testing.T) {
func TestDubboInvokerInvoke(t *testing.T) {
proto, url := InitTest(t)

c := &Client{
Expand All @@ -51,7 +51,7 @@ func TestDubboInvoker_Invoke(t *testing.T) {
invoker := NewDubboInvoker(url, c)
user := &User{}

inv := invocation.NewRPCInvocationWithOptions(invocation.WithMethodName("GetUser"), invocation.WithArguments([]interface{}{"1", "username"}),
inv := invocation.NewRPCInvocationWithOptions(invocation.WithMethodName(mockMethodNameGetUser), invocation.WithArguments([]interface{}{"1", "username"}),
invocation.WithReply(user), invocation.WithAttachments(map[string]string{"test_key": "test_value"}))

// Call
Expand Down
30 changes: 13 additions & 17 deletions protocol/dubbo/dubbo_protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,19 @@ import (
"github.com/apache/dubbo-go/protocol"
)

func TestDubboProtocol_Export(t *testing.T) {
// Export
proto := GetProtocol()
srvConf = &ServerConfig{}
url, err := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&" +
const (
mockCommonUrl = "dubbo://127.0.0.1:20000/com.ikurento.user.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&timestamp=1556509797245")
"side=provider&timeout=3000&timestamp=1556509797245"
)

func TestDubboProtocolExport(t *testing.T) {
// Export
proto := GetProtocol()
srvConf = &ServerConfig{}
url, err := common.NewURL(mockCommonUrl)
assert.NoError(t, err)
exporter := proto.Export(protocol.NewBaseInvoker(url))

Expand All @@ -48,11 +52,7 @@ func TestDubboProtocol_Export(t *testing.T) {
assert.True(t, eq)

// second service: the same path and the different version
url2, err := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.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&timestamp=1556509797245", common.WithParamsValue(constant.VERSION_KEY, "v1.1"))
url2, err := common.NewURL(mockCommonUrl, common.WithParamsValue(constant.VERSION_KEY, "v1.1"))
assert.NoError(t, err)
exporter2 := proto.Export(protocol.NewBaseInvoker(url2))
// make sure url
Expand All @@ -74,14 +74,10 @@ func TestDubboProtocol_Export(t *testing.T) {
assert.False(t, ok)
}

func TestDubboProtocol_Refer(t *testing.T) {
func TestDubboProtocolRefer(t *testing.T) {
// Refer
proto := GetProtocol()
url, err := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.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&timestamp=1556509797245")
url, err := common.NewURL(mockCommonUrl)
assert.NoError(t, err)
clientConf = &ClientConfig{}
invoker := proto.Refer(url)
Expand Down
2 changes: 1 addition & 1 deletion protocol/grpc/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func dubboGreeterSayHelloHandler(srv interface{}, ctx context.Context,
Server: srv,
FullMethod: "/helloworld.Greeter/SayHello",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
handler := func(context.Context, interface{}) (interface{}, error) {
result := base.GetProxyImpl().Invoke(context.Background(), invo)
return result.Result(), result.Error()
}
Expand Down
10 changes: 9 additions & 1 deletion protocol/grpc/grpc_invoker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,19 @@ import (
"github.com/apache/dubbo-go/protocol/invocation"
)

const (
mockGrpcCommonUrl = "grpc://127.0.0.1:30000/GrpcGreeterImpl?accesslog=&anyhost=true&app.version=0.0.1&application=BDTService&async=false&bean.name=GrpcGreeterImpl" +
"&category=providers&cluster=failover&dubbo=dubbo-provider-golang-2.6.0&environment=dev&execute.limit=&execute.limit.rejected.handler=&generic=false&group=&interface=io.grpc.examples.helloworld.GreeterGrpc%24IGreeter" +
"&ip=192.168.1.106&loadbalance=random&methods.SayHello.loadbalance=random&methods.SayHello.retries=1&methods.SayHello.tps.limit.interval=&methods.SayHello.tps.limit.rate=&methods.SayHello.tps.limit.strategy=" +
"&methods.SayHello.weight=0&module=dubbogo+say-hello+client&name=BDTService&organization=ikurento.com&owner=ZX&pid=49427&reference.filter=cshutdown&registry.role=3&remote.timestamp=1576923717&retries=" +
"&service.filter=echo%2Ctoken%2Caccesslog%2Ctps%2Cexecute%2Cpshutdown&side=provider&timestamp=1576923740&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&version=&warmup=100!"
)

func TestInvoke(t *testing.T) {
go internal.InitGrpcServer()
defer internal.ShutdownGrpcServer()

url, err := common.NewURL("grpc://127.0.0.1:30000/GrpcGreeterImpl?accesslog=&anyhost=true&app.version=0.0.1&application=BDTService&async=false&bean.name=GrpcGreeterImpl&category=providers&cluster=failover&dubbo=dubbo-provider-golang-2.6.0&environment=dev&execute.limit=&execute.limit.rejected.handler=&generic=false&group=&interface=io.grpc.examples.helloworld.GreeterGrpc%24IGreeter&ip=192.168.1.106&loadbalance=random&methods.SayHello.loadbalance=random&methods.SayHello.retries=1&methods.SayHello.tps.limit.interval=&methods.SayHello.tps.limit.rate=&methods.SayHello.tps.limit.strategy=&methods.SayHello.weight=0&module=dubbogo+say-hello+client&name=BDTService&organization=ikurento.com&owner=ZX&pid=49427&reference.filter=cshutdown&registry.role=3&remote.timestamp=1576923717&retries=&service.filter=echo%2Ctoken%2Caccesslog%2Ctps%2Cexecute%2Cpshutdown&side=provider&timestamp=1576923740&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&version=&warmup=100!")
url, err := common.NewURL(mockGrpcCommonUrl)
assert.Nil(t, err)

cli := NewClient(url)
Expand Down
8 changes: 4 additions & 4 deletions protocol/grpc/grpc_protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ import (
"github.com/apache/dubbo-go/protocol/grpc/internal"
)

func TestGrpcProtocol_Export(t *testing.T) {
func TestGrpcProtocolExport(t *testing.T) {
// Export
addService()

proto := GetProtocol()
url, err := common.NewURL("grpc://127.0.0.1:40000/GrpcGreeterImpl?accesslog=&app.version=0.0.1&application=BDTService&bean.name=GrpcGreeterImpl&cluster=failover&environment=dev&execute.limit=&execute.limit.rejected.handler=&group=&interface=io.grpc.examples.helloworld.GreeterGrpc%24IGreeter&loadbalance=random&methods.SayHello.loadbalance=random&methods.SayHello.retries=1&methods.SayHello.tps.limit.interval=&methods.SayHello.tps.limit.rate=&methods.SayHello.tps.limit.strategy=&methods.SayHello.weight=0&module=dubbogo+say-hello+client&name=BDTService&organization=ikurento.com&owner=ZX&registry.role=3&retries=&service.filter=echo%2Ctoken%2Caccesslog%2Ctps%2Cexecute%2Cpshutdown&timestamp=1576923717&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&version=&warmup=100")
url, err := common.NewURL(mockGrpcCommonUrl)
assert.NoError(t, err)
exporter := proto.Export(protocol.NewBaseInvoker(url))
time.Sleep(time.Second)
Expand All @@ -61,13 +61,13 @@ func TestGrpcProtocol_Export(t *testing.T) {
assert.False(t, ok)
}

func TestGrpcProtocol_Refer(t *testing.T) {
func TestGrpcProtocolRefer(t *testing.T) {
go internal.InitGrpcServer()
defer internal.ShutdownGrpcServer()
time.Sleep(time.Second)

proto := GetProtocol()
url, err := common.NewURL("grpc://127.0.0.1:30000/GrpcGreeterImpl?accesslog=&anyhost=true&app.version=0.0.1&application=BDTService&async=false&bean.name=GrpcGreeterImpl&category=providers&cluster=failover&dubbo=dubbo-provider-golang-2.6.0&environment=dev&execute.limit=&execute.limit.rejected.handler=&generic=false&group=&interface=io.grpc.examples.helloworld.GreeterGrpc%24IGreeter&ip=192.168.1.106&loadbalance=random&methods.SayHello.loadbalance=random&methods.SayHello.retries=1&methods.SayHello.tps.limit.interval=&methods.SayHello.tps.limit.rate=&methods.SayHello.tps.limit.strategy=&methods.SayHello.weight=0&module=dubbogo+say-hello+client&name=BDTService&organization=ikurento.com&owner=ZX&pid=49427&reference.filter=cshutdown&registry.role=3&remote.timestamp=1576923717&retries=&service.filter=echo%2Ctoken%2Caccesslog%2Ctps%2Cexecute%2Cpshutdown&side=provider&timestamp=1576923740&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&version=&warmup=100!")
url, err := common.NewURL(mockGrpcCommonUrl)
assert.NoError(t, err)
invoker := proto.Refer(url)

Expand Down
16 changes: 10 additions & 6 deletions protocol/jsonrpc/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,23 @@ type (
}
)

func TestHTTPClient_Call(t *testing.T) {
const (
mockJsonCommonUrl = "jsonrpc://127.0.0.1:20001/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&timestamp=1556509797245&bean.name=UserProvider"
)

func TestHTTPClientCall(t *testing.T) {

methods, err := common.ServiceMap.Register("com.ikurento.user.UserProvider", "jsonrpc", &UserProvider{})
assert.NoError(t, err)
assert.Equal(t, "GetUser,GetUser0,GetUser1,GetUser2,GetUser3,GetUser4", methods)

// Export
proto := GetProtocol()
url, err := common.NewURL("jsonrpc://127.0.0.1:20001/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&timestamp=1556509797245&bean.name=UserProvider")
url, err := common.NewURL(mockJsonCommonUrl)
assert.NoError(t, err)
proto.Export(&proxy_factory.ProxyInvoker{
BaseInvoker: *protocol.NewBaseInvoker(url),
Expand Down
12 changes: 4 additions & 8 deletions protocol/jsonrpc/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,8 @@ func (c *jsonClientCodec) Write(d *CodecData) ([]byte, error) {
if param != nil {
switch k := reflect.TypeOf(param).Kind(); k {
case reflect.Map:
if reflect.TypeOf(param).Key().Kind() == reflect.String {
if reflect.ValueOf(param).IsNil() {
param = nil
}
if reflect.TypeOf(param).Key().Kind() == reflect.String && reflect.ValueOf(param).IsNil() {
param = nil
}
case reflect.Slice:
if reflect.ValueOf(param).IsNil() {
Expand All @@ -137,10 +135,8 @@ func (c *jsonClientCodec) Write(d *CodecData) ([]byte, error) {
case reflect.Ptr:
switch ptrK := reflect.TypeOf(param).Elem().Kind(); ptrK {
case reflect.Map:
if reflect.TypeOf(param).Elem().Key().Kind() == reflect.String {
if reflect.ValueOf(param).Elem().IsNil() {
param = nil
}
if reflect.TypeOf(param).Elem().Key().Kind() == reflect.String && reflect.ValueOf(param).Elem().IsNil() {
param = nil
}
case reflect.Slice:
if reflect.ValueOf(param).Elem().IsNil() {
Expand Down
8 changes: 4 additions & 4 deletions protocol/jsonrpc/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type TestData struct {
Test string
}

func TestJsonClientCodec_Write(t *testing.T) {
func TestJsonClientCodecWrite(t *testing.T) {
cd := &CodecData{
ID: 1,
Method: "GetUser",
Expand All @@ -46,7 +46,7 @@ func TestJsonClientCodec_Write(t *testing.T) {
assert.EqualError(t, err, "unsupported param type: int")
}

func TestJsonClientCodec_Read(t *testing.T) {
func TestJsonClientCodecRead(t *testing.T) {
codec := newJsonClientCodec()
codec.pending[1] = "GetUser"
rsp := &TestData{}
Expand All @@ -60,7 +60,7 @@ func TestJsonClientCodec_Read(t *testing.T) {
assert.EqualError(t, err, "{\"code\":-32000,\"message\":\"error\"}")
}

func TestServerCodec_Write(t *testing.T) {
func TestServerCodecWrite(t *testing.T) {
codec := newServerCodec()
a := json.RawMessage([]byte("1"))
codec.req = serverRequest{Version: "1.0", Method: "GetUser", ID: &a}
Expand All @@ -73,7 +73,7 @@ func TestServerCodec_Write(t *testing.T) {
assert.Equal(t, "{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":{\"Test\":\"test\"},\"error\":{\"code\":-32000,\"message\":\"error\"}}\n", string(data))
}

func TestServerCodec_Read(t *testing.T) {
func TestServerCodecRead(t *testing.T) {
codec := newServerCodec()
header := map[string]string{}
err := codec.ReadHeader(header, []byte("{\"jsonrpc\":\"2.0\",\"method\":\"GetUser\",\"params\":[\"args\",2],\"id\":1}\n"))
Expand Down
2 changes: 1 addition & 1 deletion protocol/jsonrpc/jsonrpc_invoker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/apache/dubbo-go/protocol/invocation"
)

func TestJsonrpcInvoker_Invoke(t *testing.T) {
func TestJsonrpcInvokerInvoke(t *testing.T) {

methods, err := common.ServiceMap.Register("UserProvider", "jsonrpc", &UserProvider{})
assert.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions protocol/jsonrpc/jsonrpc_protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/apache/dubbo-go/protocol"
)

func TestJsonrpcProtocol_Export(t *testing.T) {
func TestJsonrpcProtocolExport(t *testing.T) {
// Export
proto := GetProtocol()
url, err := common.NewURL("jsonrpc://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&" +
Expand Down Expand Up @@ -65,7 +65,7 @@ func TestJsonrpcProtocol_Export(t *testing.T) {
assert.False(t, ok)
}

func TestJsonrpcProtocol_Refer(t *testing.T) {
func TestJsonrpcProtocolRefer(t *testing.T) {
// Refer
proto := GetProtocol()
url, err := common.NewURL("jsonrpc://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&" +
Expand Down
2 changes: 1 addition & 1 deletion protocol/protocolwrapper/mock_protocol_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ func (pfw *mockProtocolFilter) Refer(url common.URL) protocol.Invoker {

// Destroy will do nothing
func (pfw *mockProtocolFilter) Destroy() {

return
}
4 changes: 2 additions & 2 deletions protocol/protocolwrapper/protocol_filter_wrapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"github.com/apache/dubbo-go/protocol"
)

func TestProtocolFilterWrapper_Export(t *testing.T) {
func TestProtocolFilterWrapperExport(t *testing.T) {
filtProto := extension.GetProtocol(FILTER)
filtProto.(*ProtocolFilterWrapper).protocol = &protocol.BaseProtocol{}

Expand All @@ -48,7 +48,7 @@ func TestProtocolFilterWrapper_Export(t *testing.T) {
assert.True(t, ok)
}

func TestProtocolFilterWrapper_Refer(t *testing.T) {
func TestProtocolFilterWrapperRefer(t *testing.T) {
filtProto := extension.GetProtocol(FILTER)
filtProto.(*ProtocolFilterWrapper).protocol = &protocol.BaseProtocol{}

Expand Down
Loading

0 comments on commit 89e3bee

Please sign in to comment.