diff --git a/common/rpc_service_test.go b/common/rpc_service_test.go index 072c54344279d33dffcbecfc5530839150d6b208..b50d8d962c4277f702388b74e5137bdf1c8bdf7e 100644 --- a/common/rpc_service_test.go +++ b/common/rpc_service_test.go @@ -96,12 +96,12 @@ func TestServiceMapRegister(t *testing.T) { // repeat _, err = ServiceMap.Register(testInterfaceName, "testporotocol", "", "v1", s) - assert.EqualError(t, err, "service already defined: com.test.Path") + assert.EqualError(t, err, "service already defined: testService:v1") // no method s1 := &TestService1{} _, err = ServiceMap.Register(testInterfaceName, "testporotocol", "", "v2", s1) - assert.EqualError(t, err, "type com.test.Path1 has no exported methods of suitable type") + assert.EqualError(t, err, "type testService:v2 has no exported methods of suitable type") ServiceMap = &serviceMap{ serviceMap: make(map[string]map[string]*Service), diff --git a/filter/filter_impl/generic_service_filter_test.go b/filter/filter_impl/generic_service_filter_test.go index 58221d710522f443e9fb905a54169d48c70a7f1b..8b2fb549c299bb6c1cf65c4254ba6784caec5655 100644 --- a/filter/filter_impl/generic_service_filter_test.go +++ b/filter/filter_impl/generic_service_filter_test.go @@ -96,7 +96,7 @@ func TestGenericServiceFilterInvoke(t *testing.T) { hessian.Object("222")}, } s := &TestService{} - _, _ = common.ServiceMap.Register("TestService", "testprotocol", "", "", s) + _, _ = common.ServiceMap.Register("com.test.Path", "testprotocol", "", "", s) rpcInvocation := invocation.NewRPCInvocation(methodName, aurguments, nil) filter := GetGenericServiceFilter() url, _ := common.NewURL("testprotocol://127.0.0.1:20000/com.test.Path") diff --git a/metadata/service/exporter/configurable/exporter_test.go b/metadata/service/exporter/configurable/exporter_test.go index 2a5e646acdf86d2d9d339ae7ae377c7098b2e1b6..7c2baa2728b4c4888d9dbb117816648d72874c0b 100644 --- a/metadata/service/exporter/configurable/exporter_test.go +++ b/metadata/service/exporter/configurable/exporter_test.go @@ -69,7 +69,7 @@ func TestConfigurableExporter(t *testing.T) { assert.Equal(t, false, exported.IsExported()) assert.NoError(t, exported.Export(registryURL)) assert.Equal(t, true, exported.IsExported()) - assert.Regexp(t, "dubbo://:20003/MetadataService*", exported.GetExportedURLs()[0].String()) + assert.Regexp(t, "dubbo://:20003/org.apache.dubbo.metadata.MetadataService*", exported.GetExportedURLs()[0].String()) exported.Unexport() assert.Equal(t, false, exported.IsExported()) }) diff --git a/protocol/dubbo/dubbo_invoker_test.go b/protocol/dubbo/dubbo_invoker_test.go index cad01581d71f9465e366fb4f8b1578843c492b7d..c7a9a2697529d096e57585347b0a8b0a535451b0 100644 --- a/protocol/dubbo/dubbo_invoker_test.go +++ b/protocol/dubbo/dubbo_invoker_test.go @@ -97,7 +97,7 @@ func InitTest(t *testing.T) (protocol.Protocol, *common.URL) { hessian.RegisterPOJO(&User{}) - methods, err := common.ServiceMap.Register("com.ikurento.user.UserProvider", "dubbo", "", "0.0.1", &UserProvider{}) + methods, err := common.ServiceMap.Register("com.ikurento.user.UserProvider", "dubbo", "", "", &UserProvider{}) assert.NoError(t, err) assert.Equal(t, "GetBigPkg,GetUser,GetUser0,GetUser1,GetUser2,GetUser3,GetUser4,GetUser5,GetUser6", methods) diff --git a/protocol/jsonrpc/http_test.go b/protocol/jsonrpc/http_test.go index e3f951041fddb6fefe173ddaaf927d942ec1abf4..c4801c8db883353c82762162a7b658f964fc6ffa 100644 --- a/protocol/jsonrpc/http_test.go +++ b/protocol/jsonrpc/http_test.go @@ -49,7 +49,7 @@ type ( ) const ( - mockJsonCommonUrl = "jsonrpc://127.0.0.1:20001/UserProvider?anyhost=true&" + + mockJsonCommonUrl = "jsonrpc://127.0.0.1:20001/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&" + @@ -58,7 +58,7 @@ const ( func TestHTTPClientCall(t *testing.T) { - methods, err := common.ServiceMap.Register("com.ikurento.user.UserProvider", "jsonrpc", "", "0.0.1", &UserProvider{}) + 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) diff --git a/protocol/jsonrpc/jsonrpc_invoker_test.go b/protocol/jsonrpc/jsonrpc_invoker_test.go index 686b880122108f65ea9b512a3f5cb88be9f649be..12a57052eba6e3a2af1b7cfb15e6ab368a7da286 100644 --- a/protocol/jsonrpc/jsonrpc_invoker_test.go +++ b/protocol/jsonrpc/jsonrpc_invoker_test.go @@ -36,13 +36,13 @@ import ( func TestJsonrpcInvokerInvoke(t *testing.T) { - methods, err := common.ServiceMap.Register("UserProvider", "jsonrpc", "", "0.0.1", &UserProvider{}) + 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&" + + url, err := common.NewURL("jsonrpc://127.0.0.1:20001/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&" + diff --git a/protocol/rest/rest_protocol_test.go b/protocol/rest/rest_protocol_test.go index e41c29b9f4fb984d8628e462f4d7bd81ef3aee66..580fc61fd6cfda731184eed6f785b80abc9fccfe 100644 --- a/protocol/rest/rest_protocol_test.go +++ b/protocol/rest/rest_protocol_test.go @@ -120,8 +120,6 @@ func TestRestProtocolExport(t *testing.T) { proto.Destroy() _, ok = proto.(*RestProtocol).serverMap[url.Location] assert.False(t, ok) - err = common.ServiceMap.UnRegister(url.Service(), url.Protocol, url.ServiceKey()) - assert.NoError(t, err) } type UserProvider struct { diff --git a/remoting/getty/getty_client_test.go b/remoting/getty/getty_client_test.go index 65c19f4a70315cc61892344b1a21a236b9e903ed..0b18e973cd2ea7a3f6aae59e822aaf68ee983331 100644 --- a/remoting/getty/getty_client_test.go +++ b/remoting/getty/getty_client_test.go @@ -211,7 +211,9 @@ func testGetUser3(t *testing.T, c *Client) { request := remoting.NewRequest("2.0.2") invocation := createInvocation("GetUser3", nil, nil, []interface{}{}, []reflect.Value{}) - attachment := map[string]string{INTERFACE_KEY: "com.ikurento.user.UserProvider"} + attachment := map[string]string{ + INTERFACE_KEY: "com.ikurento.user.UserProvider", + } setAttachment(invocation, attachment) request.Data = invocation request.Event = false @@ -341,7 +343,7 @@ func InitTest(t *testing.T) (*Server, *common.URL) { hessian.RegisterPOJO(&User{}) remoting.RegistryCodec("dubbo", &DubboTestCodec{}) - methods, err := common.ServiceMap.Register("", "dubbo", "", "0.0.1", &UserProvider{}) + methods, err := common.ServiceMap.Register("com.ikurento.user.UserProvider", "dubbo", "", "", &UserProvider{}) assert.NoError(t, err) assert.Equal(t, "GetBigPkg,GetUser,GetUser0,GetUser1,GetUser2,GetUser3,GetUser4,GetUser5,GetUser6", methods) @@ -387,7 +389,7 @@ func InitTest(t *testing.T) (*Server, *common.URL) { }}) assert.NoError(t, srvConf.CheckValidity()) - url, err := common.NewURL("dubbo://127.0.0.1:20060/UserProvider?anyhost=true&" + + url, err := common.NewURL("dubbo://127.0.0.1:20060/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=127.0.0.1&methods=GetUser%2C&" + "module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&" +