diff --git a/.gitignore b/.gitignore index f7622f8ac9cc1ae42ea5203df70c5327f09bf300..fabff68b874df4c2a7de15ce91798e9bb963b358 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,7 @@ registry/zookeeper/zookeeper-4unittest/ metadata/report/zookeeper/zookeeper-4unittest/ registry/consul/agent* config_center/apollo/mockDubbog.properties.json + +# vim stuff +*~ +.*.sw? diff --git a/README.md b/README.md index 3f8394536f944518f8d969289147272c32f169da..2f40eaa3a65e9e64c751ba77b981bdade081c321 100644 --- a/README.md +++ b/README.md @@ -169,12 +169,40 @@ If you are willing to do some code contributions and document contributions to [ Benchmark project [dubbo-go-benchmark](https://github.com/dubbogo/dubbo-go-benchmark). -About dubbo-go benchmarking report, please refer to [dubbo benchmarking report](https://github.com/apache/dubbo-go/wiki/pressure-test-report-for-dubbo) & [jsonrpc benchmarking report](https://github.com/apache/dubbo-go/wiki/pressure-test-report-for-jsonrpc). +About dubbo-go benchmarking report, please refer to [dubbo benchmarking report](https://github.com/apache/dubbo-go/wiki/Benchmark-test-of-dubbo) & [jsonrpc benchmarking report](https://github.com/apache/dubbo-go/wiki/Benchmark-test-of-jsonrpc). ## [User List](https://github.com/apache/dubbo-go/issues/2) If you are using [apache/dubbo-go](github.com/apache/dubbo-go) and think that it helps you or want do some contributions to it, please add your company to to [the user list](https://github.com/apache/dubbo-go/issues/2) to let us know your needs. - - - + +<div> +<table> + <tbody> + <tr></tr> + <tr> + <td align="center" valign="middle"> + <a href="" target="_blank"> + <img width="222px" src="https://pic.c-ctrip.com/common/c_logo2013.png"> + </a> + </td> + <td align="center" valign="middle"> + <a href="" target="_blank"> + <img width="222px" src="https://user-images.githubusercontent.com/52339367/84628582-80512200-af1b-11ea-945a-c6b4b9ad31f2.png"> + </a> + </td> + <td align="center" valign="middle"> + <a href="" target="_blank"> + <img width="222px" src="https://mosn.io/images/community/tuya.png"> + </a> + </td> + <td align="center" valign="middle"> + <a href="https://github.com/mosn" target="_blank"> + <img width="222px" src="https://raw.githubusercontent.com/mosn/community/master/icons/png/mosn-labeled-horizontal.png"> + </a> + </td> + </tr> + <tr></tr> + </tbody> +</table> +</div> diff --git a/README_CN.md b/README_CN.md index 582c5cf04cba08d4167c87b40fd0e86a3aa2ceb0..94630da6c3b2f5e4c0c7e0fe39da4a3b4e780ba4 100644 --- a/README_CN.md +++ b/README_CN.md @@ -168,12 +168,39 @@ go test ./... -coverprofile=coverage.txt -covermode=atomic 鎬ц兘娴嬭瘯椤圭洰鏄� [dubbo-go-benchmark](https://github.com/dubbogo/dubbo-go-benchmark)銆� -鍏充簬 dubbo-go 鎬ц兘娴嬭瘯鎶ュ憡锛岃闃呰 [dubbo benchmarking report](https://github.com/apache/dubbo-go/wiki/pressure-test-report-for-dubbo) & [jsonrpc benchmarking report](https://github.com/apache/dubbo-go/wiki/pressure-test-report-for-jsonrpc)銆� +鍏充簬 dubbo-go 鎬ц兘娴嬭瘯鎶ュ憡锛岃闃呰 [dubbo benchmarking report](https://github.com/apache/dubbo-go/wiki/Benchmark-test-of-dubbo) & [jsonrpc benchmarking report](https://github.com/apache/dubbo-go/wiki/Benchmark-test-of-jsonrpc)銆� ## [User List](https://github.com/apache/dubbo-go/issues/2) 鑻ヤ綘姝e湪浣跨敤 [apache/dubbo-go](github.com/apache/dubbo-go) 涓旇涓哄叾鏈夌敤鎴栬€呭悜瀵瑰叾鍋氭敼杩涳紝璇峰繚鍒楄吹鍙镐俊鎭簬 [鐢ㄦ埛鍒楄〃](https://github.com/apache/dubbo-go/issues/2)锛屼互渚挎垜浠煡鏅撲箣銆� - - - +<div> +<table> + <tbody> + <tr></tr> + <tr> + <td align="center" valign="middle"> + <a href="" target="_blank"> + <img width="222px" src="https://pic.c-ctrip.com/common/c_logo2013.png"> + </a> + </td> + <td align="center" valign="middle"> + <a href="" target="_blank"> + <img width="222px" src="https://user-images.githubusercontent.com/52339367/84628582-80512200-af1b-11ea-945a-c6b4b9ad31f2.png"> + </a> + </td> + <td align="center" valign="middle"> + <a href="" target="_blank"> + <img width="222px" src="https://mosn.io/images/community/tuya.png"> + </a> + </td> + <td align="center" valign="middle"> + <a href="https://github.com/mosn" target="_blank"> + <img width="222px" src="https://raw.githubusercontent.com/mosn/community/master/icons/png/mosn-labeled-horizontal.png"> + </a> + </td> + </tr> + <tr></tr> + </tbody> +</table> +</div> diff --git a/filter/filter_impl/access_log_filter_test.go b/filter/filter_impl/access_log_filter_test.go index f0de24d2a89f35876a32763eeb75495e8919ecd9..55c328cc30ae892c603fcc65034e48d2a52403d2 100644 --- a/filter/filter_impl/access_log_filter_test.go +++ b/filter/filter_impl/access_log_filter_test.go @@ -53,7 +53,7 @@ func TestAccessLogFilter_Invoke_Not_Config(t *testing.T) { assert.Nil(t, result.Error()) } -func TestAccessLogFilter_Invoke_Default_Config(t *testing.T) { +func TestAccessLogFilterInvokeDefaultConfig(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() url, _ := common.NewURL( @@ -74,7 +74,7 @@ func TestAccessLogFilter_Invoke_Default_Config(t *testing.T) { assert.Nil(t, result.Error()) } -func TestAccessLogFilter_OnResponse(t *testing.T) { +func TestAccessLogFilterOnResponse(t *testing.T) { result := &protocol.RPCResult{} accessLogFilter := GetAccessLogFilter() response := accessLogFilter.OnResponse(nil, result, nil, nil) diff --git a/filter/filter_impl/active_filter_test.go b/filter/filter_impl/active_filter_test.go index d5a51d50d93bd9769001964fbb0ae7905eb24980..6b72830e6a1a523b775b9294863ab18f8fe518a2 100644 --- a/filter/filter_impl/active_filter_test.go +++ b/filter/filter_impl/active_filter_test.go @@ -36,7 +36,7 @@ import ( "github.com/apache/dubbo-go/protocol/mock" ) -func TestActiveFilter_Invoke(t *testing.T) { +func TestActiveFilterInvoke(t *testing.T) { invoc := invocation.NewRPCInvocation("test", []interface{}{"OK"}, make(map[string]string, 0)) url, _ := common.NewURL("dubbo://192.168.10.10:20000/com.ikurento.user.UserProvider") filter := ActiveFilter{} @@ -50,7 +50,7 @@ func TestActiveFilter_Invoke(t *testing.T) { } -func TestActiveFilter_OnResponse(t *testing.T) { +func TestActiveFilterOnResponse(t *testing.T) { c := protocol.CurrentTimeMillis() elapsed := 100 invoc := invocation.NewRPCInvocation("test", []interface{}{"OK"}, map[string]string{ diff --git a/filter/filter_impl/echo_filter_test.go b/filter/filter_impl/echo_filter_test.go index fc09bdce696c6be3c9e11d0ac864b187d1d85cde..b821a1a30cb8af7e957fac45beecd46067627f91 100644 --- a/filter/filter_impl/echo_filter_test.go +++ b/filter/filter_impl/echo_filter_test.go @@ -32,7 +32,7 @@ import ( "github.com/apache/dubbo-go/protocol/invocation" ) -func TestEchoFilter_Invoke(t *testing.T) { +func TestEchoFilterInvoke(t *testing.T) { filter := GetFilter() result := filter.Invoke(context.Background(), protocol.NewBaseInvoker(common.URL{}), invocation.NewRPCInvocation("$echo", []interface{}{"OK"}, nil)) assert.Equal(t, "OK", result.Result()) diff --git a/filter/filter_impl/execute_limit_filter_test.go b/filter/filter_impl/execute_limit_filter_test.go index ae8641f2db0b98b59f9939cfc85f3ad096b1bc7f..d36d6edef1ec52c24a9ccd64233b4620b4f10bc7 100644 --- a/filter/filter_impl/execute_limit_filter_test.go +++ b/filter/filter_impl/execute_limit_filter_test.go @@ -34,7 +34,7 @@ import ( "github.com/apache/dubbo-go/protocol/invocation" ) -func TestExecuteLimitFilter_Invoke_Ignored(t *testing.T) { +func TestExecuteLimitFilterInvokeIgnored(t *testing.T) { methodName := "hello" invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0)) @@ -49,7 +49,7 @@ func TestExecuteLimitFilter_Invoke_Ignored(t *testing.T) { assert.Nil(t, result.Error()) } -func TestExecuteLimitFilter_Invoke_Configure_Error(t *testing.T) { +func TestExecuteLimitFilterInvokeConfigureError(t *testing.T) { methodName := "hello1" invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0)) @@ -66,7 +66,7 @@ func TestExecuteLimitFilter_Invoke_Configure_Error(t *testing.T) { assert.Nil(t, result.Error()) } -func TestExecuteLimitFilter_Invoke(t *testing.T) { +func TestExecuteLimitFilterInvoke(t *testing.T) { methodName := "hello1" invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0)) diff --git a/filter/filter_impl/generic_filter_test.go b/filter/filter_impl/generic_filter_test.go index b08229199898a30657682d47c32689dc084f5bf4..e40733209b2e1db972ab576dea54f206a1e888c0 100644 --- a/filter/filter_impl/generic_filter_test.go +++ b/filter/filter_impl/generic_filter_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/assert" ) -func Test_struct2MapAll(t *testing.T) { +func TestStruct2MapAll(t *testing.T) { var testData struct { AaAa string `m:"aaAa"` BaBa string @@ -64,7 +64,7 @@ type testStruct struct { } `m:"xxYy"` } -func Test_struct2MapAll_Slice(t *testing.T) { +func TestStruct2MapAllSlice(t *testing.T) { var testData struct { AaAa string `m:"aaAa"` BaBa string @@ -89,7 +89,7 @@ func Test_struct2MapAll_Slice(t *testing.T) { assert.Equal(t, reflect.Map, reflect.TypeOf(m["caCa"].([]interface{})[0].(map[string]interface{})["xxYy"]).Kind()) } -func Test_struct2MapAll_Map(t *testing.T) { +func TestStruct2MapAllMap(t *testing.T) { var testData struct { AaAa string Baba map[string]interface{} diff --git a/filter/filter_impl/generic_service_filter_test.go b/filter/filter_impl/generic_service_filter_test.go index 2a911659f068b53836b87af5caf5773d8ac5f119..f0bdb7fb334f31de27d32d79124e4cb8c03f45a0 100644 --- a/filter/filter_impl/generic_service_filter_test.go +++ b/filter/filter_impl/generic_service_filter_test.go @@ -77,7 +77,7 @@ func (*TestService) Reference() string { return "com.test.Path" } -func TestGenericServiceFilter_Invoke(t *testing.T) { +func TestGenericServiceFilterInvoke(t *testing.T) { hessian.RegisterPOJO(&TestStruct{}) methodName := "$invoke" m := make(map[string]interface{}) @@ -105,7 +105,7 @@ func TestGenericServiceFilter_Invoke(t *testing.T) { assert.Nil(t, result.Error()) } -func TestGenericServiceFilter_ResponseTestStruct(t *testing.T) { +func TestGenericServiceFilterResponseTestStruct(t *testing.T) { ts := &TestStruct{ AaAa: "aaa", BaBa: "bbb", @@ -130,7 +130,7 @@ func TestGenericServiceFilter_ResponseTestStruct(t *testing.T) { assert.Equal(t, reflect.ValueOf(r.Result()).Kind(), reflect.Map) } -func TestGenericServiceFilter_ResponseString(t *testing.T) { +func TestGenericServiceFilterResponseString(t *testing.T) { str := "111" result := &protocol.RPCResult{ Rest: str, diff --git a/filter/filter_impl/graceful_shutdown_filter_test.go b/filter/filter_impl/graceful_shutdown_filter_test.go index 4c670933e3dcec29ad9ae7bfef250b4236ae7c54..87ac2eac616a20617b7a5e68254a1f47ecb8ac17 100644 --- a/filter/filter_impl/graceful_shutdown_filter_test.go +++ b/filter/filter_impl/graceful_shutdown_filter_test.go @@ -38,7 +38,7 @@ import ( "github.com/apache/dubbo-go/protocol/invocation" ) -func TestGenericFilter_Invoke(t *testing.T) { +func TestGenericFilterInvoke(t *testing.T) { invoc := invocation.NewRPCInvocation("GetUser", []interface{}{"OK"}, make(map[string]string, 0)) invokeUrl := common.NewURLWithOptions( diff --git a/filter/filter_impl/hystrix_filter_test.go b/filter/filter_impl/hystrix_filter_test.go index 71fc097c8bf4752e0cb2b451b0da7e16480b0701..eebbae55565aa7072846d368403605002df0c61b 100644 --- a/filter/filter_impl/hystrix_filter_test.go +++ b/filter/filter_impl/hystrix_filter_test.go @@ -90,7 +90,7 @@ func TestGetHystrixFilter(t *testing.T) { assert.NotNil(t, filterGot) } -func TestGetConfig_1(t *testing.T) { +func TestGetConfig1(t *testing.T) { mockInitHystrixConfig() configGot := getConfig("com.ikurento.user.UserProvider", "GetUser", true) assert.NotNil(t, configGot) @@ -101,7 +101,7 @@ func TestGetConfig_1(t *testing.T) { assert.Equal(t, 5, configGot.RequestVolumeThreshold) } -func TestGetConfig_2(t *testing.T) { +func TestGetConfig2(t *testing.T) { mockInitHystrixConfig() configGot := getConfig("com.ikurento.user.UserProvider", "GetUser0", true) assert.NotNil(t, configGot) @@ -112,7 +112,7 @@ func TestGetConfig_2(t *testing.T) { assert.Equal(t, 15, configGot.RequestVolumeThreshold) } -func TestGetConfig_3(t *testing.T) { +func TestGetConfig3(t *testing.T) { mockInitHystrixConfig() //This should use default configGot := getConfig("Mock.Service", "GetMock", true) @@ -145,7 +145,7 @@ func (iv *testMockFailInvoker) Invoke(_ context.Context, _ protocol.Invocation) } } -func TestHystrixFilter_Invoke_Success(t *testing.T) { +func TestHystrixFilterInvokeSuccess(t *testing.T) { hf := &HystrixFilter{} result := hf.Invoke(context.Background(), &testMockSuccessInvoker{}, &invocation.RPCInvocation{}) assert.NotNil(t, result) @@ -153,14 +153,14 @@ func TestHystrixFilter_Invoke_Success(t *testing.T) { assert.NotNil(t, result.Result()) } -func TestHystrixFilter_Invoke_Fail(t *testing.T) { +func TestHystrixFilterInvokeFail(t *testing.T) { hf := &HystrixFilter{} result := hf.Invoke(context.Background(), &testMockFailInvoker{}, &invocation.RPCInvocation{}) assert.NotNil(t, result) assert.Error(t, result.Error()) } -func TestHystricFilter_Invoke_CircuitBreak(t *testing.T) { +func TestHystricFilterInvokeCircuitBreak(t *testing.T) { mockInitHystrixConfig() hystrix.Flush() hf := &HystrixFilter{COrP: true} @@ -183,7 +183,7 @@ func TestHystricFilter_Invoke_CircuitBreak(t *testing.T) { } -func TestHystricFilter_Invoke_CircuitBreak_Omit_Exception(t *testing.T) { +func TestHystricFilterInvokeCircuitBreakOmitException(t *testing.T) { mockInitHystrixConfig() hystrix.Flush() reg, _ := regexp.Compile(".*exception.*") diff --git a/filter/filter_impl/metrics_filter_test.go b/filter/filter_impl/metrics_filter_test.go index 709404a2af4f4df0dbf625dbbbd673e34975c0db..881106f4bc5a7890569be347122da5144e440c8b 100644 --- a/filter/filter_impl/metrics_filter_test.go +++ b/filter/filter_impl/metrics_filter_test.go @@ -38,7 +38,7 @@ import ( "github.com/apache/dubbo-go/protocol/invocation" ) -func TestMetricsFilter_Invoke(t *testing.T) { +func TestMetricsFilterInvoke(t *testing.T) { // prepare the mock reporter config.GetMetricConfig().Reporters = []string{"mock"} diff --git a/filter/filter_impl/token_filter_test.go b/filter/filter_impl/token_filter_test.go index b8b297e67267640a1c294541afdd4e062bfebb25..c2f69bd03941b1404585dc5842c56eb2bf3c918f 100644 --- a/filter/filter_impl/token_filter_test.go +++ b/filter/filter_impl/token_filter_test.go @@ -34,7 +34,7 @@ import ( "github.com/apache/dubbo-go/protocol/invocation" ) -func TestTokenFilter_Invoke(t *testing.T) { +func TestTokenFilterInvoke(t *testing.T) { filter := GetTokenFilter() url := common.NewURLWithOptions( @@ -50,7 +50,7 @@ func TestTokenFilter_Invoke(t *testing.T) { assert.Nil(t, result.Result()) } -func TestTokenFilter_InvokeEmptyToken(t *testing.T) { +func TestTokenFilterInvokeEmptyToken(t *testing.T) { filter := GetTokenFilter() testUrl := common.URL{} @@ -61,7 +61,7 @@ func TestTokenFilter_InvokeEmptyToken(t *testing.T) { assert.Nil(t, result.Result()) } -func TestTokenFilter_InvokeEmptyAttach(t *testing.T) { +func TestTokenFilterInvokeEmptyAttach(t *testing.T) { filter := GetTokenFilter() testUrl := common.NewURLWithOptions( @@ -72,7 +72,7 @@ func TestTokenFilter_InvokeEmptyAttach(t *testing.T) { assert.NotNil(t, result.Error()) } -func TestTokenFilter_InvokeNotEqual(t *testing.T) { +func TestTokenFilterInvokeNotEqual(t *testing.T) { filter := GetTokenFilter() testUrl := common.NewURLWithOptions( diff --git a/filter/filter_impl/tps/tps_limit_fix_window_strategy_test.go b/filter/filter_impl/tps/tps_limit_fix_window_strategy_test.go index 5eaf2f707dcc9dd6cf325988242623dd5161c1a8..83a2f9b54d2a7b3d603538201a822fa0428523f5 100644 --- a/filter/filter_impl/tps/tps_limit_fix_window_strategy_test.go +++ b/filter/filter_impl/tps/tps_limit_fix_window_strategy_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestFixedWindowTpsLimitStrategyImpl_IsAllowable(t *testing.T) { +func TestFixedWindowTpsLimitStrategyImplIsAllowable(t *testing.T) { creator := &fixedWindowStrategyCreator{} strategy := creator.Create(2, 60000) assert.True(t, strategy.IsAllowable()) diff --git a/filter/filter_impl/tps/tps_limit_sliding_window_strategy_test.go b/filter/filter_impl/tps/tps_limit_sliding_window_strategy_test.go index 57342d1c443993c49c6124f0ef28dae5ebb203e8..ca5d70ae143eb0d08ba1f3407a7ea10d9c113643 100644 --- a/filter/filter_impl/tps/tps_limit_sliding_window_strategy_test.go +++ b/filter/filter_impl/tps/tps_limit_sliding_window_strategy_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestSlidingWindowTpsLimitStrategyImpl_IsAllowable(t *testing.T) { +func TestSlidingWindowTpsLimitStrategyImplIsAllowable(t *testing.T) { creator := &slidingWindowStrategyCreator{} strategy := creator.Create(2, 60000) assert.True(t, strategy.IsAllowable()) diff --git a/filter/filter_impl/tps/tps_limit_thread_safe_fix_window_strategy_test.go b/filter/filter_impl/tps/tps_limit_thread_safe_fix_window_strategy_test.go index 90cd15201cd71aafcc50a1dfb801ece7a5dee26a..80d31f8ff053d4d86b5f565e7018294b049f2801 100644 --- a/filter/filter_impl/tps/tps_limit_thread_safe_fix_window_strategy_test.go +++ b/filter/filter_impl/tps/tps_limit_thread_safe_fix_window_strategy_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestThreadSafeFixedWindowTpsLimitStrategyImpl_IsAllowable(t *testing.T) { +func TestThreadSafeFixedWindowTpsLimitStrategyImplIsAllowable(t *testing.T) { creator := &threadSafeFixedWindowStrategyCreator{} strategy := creator.Create(2, 60000) assert.True(t, strategy.IsAllowable()) diff --git a/filter/filter_impl/tps/tps_limiter_method_service_test.go b/filter/filter_impl/tps/tps_limiter_method_service_test.go index 441224a3e35147b85c3553871dcaa1fefd09db04..edae99ec2d3157ad7f0d81c95a2fb181410475fa 100644 --- a/filter/filter_impl/tps/tps_limiter_method_service_test.go +++ b/filter/filter_impl/tps/tps_limiter_method_service_test.go @@ -34,7 +34,7 @@ import ( "github.com/apache/dubbo-go/protocol/invocation" ) -func TestMethodServiceTpsLimiterImpl_IsAllowable_Only_Service_Level(t *testing.T) { +func TestMethodServiceTpsLimiterImplIsAllowableOnlyServiceLevel(t *testing.T) { methodName := "hello" invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0)) @@ -61,7 +61,7 @@ func TestMethodServiceTpsLimiterImpl_IsAllowable_Only_Service_Level(t *testing.T assert.True(t, result) } -func TestMethodServiceTpsLimiterImpl_IsAllowable_No_Config(t *testing.T) { +func TestMethodServiceTpsLimiterImplIsAllowableNoConfig(t *testing.T) { methodName := "hello1" invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0)) // ctrl := gomock.NewController(t) @@ -77,7 +77,7 @@ func TestMethodServiceTpsLimiterImpl_IsAllowable_No_Config(t *testing.T) { assert.True(t, result) } -func TestMethodServiceTpsLimiterImpl_IsAllowable_Method_Level_Override(t *testing.T) { +func TestMethodServiceTpsLimiterImplIsAllowableMethodLevelOverride(t *testing.T) { methodName := "hello2" methodConfigPrefix := "methods." + methodName + "." invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0)) @@ -110,7 +110,7 @@ func TestMethodServiceTpsLimiterImpl_IsAllowable_Method_Level_Override(t *testin assert.True(t, result) } -func TestMethodServiceTpsLimiterImpl_IsAllowable_Both_Method_And_Service(t *testing.T) { +func TestMethodServiceTpsLimiterImplIsAllowableBothMethodAndService(t *testing.T) { methodName := "hello3" methodConfigPrefix := "methods." + methodName + "." invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0)) diff --git a/filter/filter_impl/tps_limit_filter_test.go b/filter/filter_impl/tps_limit_filter_test.go index cc423ae1e5f3589dd60b0c8655f1123c290f0ffc..274e4e6de61b94079e9ad3b2f7a5bcd79a276cc6 100644 --- a/filter/filter_impl/tps_limit_filter_test.go +++ b/filter/filter_impl/tps_limit_filter_test.go @@ -39,7 +39,7 @@ import ( "github.com/apache/dubbo-go/protocol/invocation" ) -func TestTpsLimitFilter_Invoke_With_No_TpsLimiter(t *testing.T) { +func TestTpsLimitFilterInvokeWithNoTpsLimiter(t *testing.T) { tpsFilter := GetTpsLimitFilter() invokeUrl := common.NewURLWithOptions( common.WithParams(url.Values{}), @@ -55,7 +55,7 @@ func TestTpsLimitFilter_Invoke_With_No_TpsLimiter(t *testing.T) { } -func TestGenericFilter_Invoke_With_Default_TpsLimiter(t *testing.T) { +func TestGenericFilterInvokeWithDefaultTpsLimiter(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() mockLimiter := tps.NewMockTpsLimiter(ctrl) @@ -78,7 +78,7 @@ func TestGenericFilter_Invoke_With_Default_TpsLimiter(t *testing.T) { assert.Nil(t, result.Result()) } -func TestGenericFilter_Invoke_With_Default_TpsLimiter_Not_Allow(t *testing.T) { +func TestGenericFilterInvokeWithDefaultTpsLimiterNotAllow(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() mockLimiter := tps.NewMockTpsLimiter(ctrl) diff --git a/filter/filter_impl/tracing_filter_test.go b/filter/filter_impl/tracing_filter_test.go index a51692dddcc3400032650f4953eb1e28fb047709..15dc32e7ec1d30936b37ab2350c899e5c30d2ab7 100644 --- a/filter/filter_impl/tracing_filter_test.go +++ b/filter/filter_impl/tracing_filter_test.go @@ -36,7 +36,7 @@ import ( "github.com/apache/dubbo-go/protocol/invocation" ) -func TestTracingFilter_Invoke(t *testing.T) { +func TestTracingFilterInvoke(t *testing.T) { url, _ := common.NewURL( "dubbo://:20000/UserProvider?app.version=0.0.1&application=BDTService&bean.name=UserProvider" + "&cluster=failover&environment=dev&group=&interface=com.ikurento.user.UserProvider&loadbalance=random&methods.GetUser." + diff --git a/registry/base_configuration_listener.go b/registry/base_configuration_listener.go index 7b28d7ee1b30a03b8211c4c1efa5824c3b61453a..3b36510306680486ba9d269472450df8867b61b1 100644 --- a/registry/base_configuration_listener.go +++ b/registry/base_configuration_listener.go @@ -100,7 +100,12 @@ func ToConfigurators(urls []*common.URL, f func(url *common.URL) config_center.C configurators = []config_center.Configurator{} break } - //TODO:anyhost_key judage + + override := url.GetParams() + delete(override, constant.ANYHOST_KEY) + if len(override) == 0 { + continue + } configurators = append(configurators, f(url)) } return configurators