This is an automated email from the ASF dual-hosted git repository. zhaoyunxing pushed a commit to branch config-enhance in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git
commit 55184c30f26c505c1952429924ad8732da4b1320 Author: 氕氘氚 <[email protected]> AuthorDate: Sat Aug 28 09:04:15 2021 +0800 add triple msgpack sample (#212) --- .run/triple-msgpack-client.run.xml | 15 ------ .run/triple-msgpack-server.run.xml | 15 ------ .run/triple/triple-msgpack-client.run.xml | 7 ++- .run/triple/triple-msgpack-server.run.xml | 7 ++- rpc/dubbo3/msgpack/go-client/cmd/client.go | 27 +++++----- rpc/dubbo3/msgpack/go-client/conf/client.yml | 33 ------------ rpc/dubbo3/msgpack/go-client/conf/dubbogo.yml | 14 +++++ rpc/dubbo3/msgpack/go-client/conf/log.yml | 27 ---------- rpc/dubbo3/msgpack/go-client/pkg/hello.go | 36 ------------- rpc/dubbo3/msgpack/go-server/cmd/server.go | 35 +++++++----- rpc/dubbo3/msgpack/go-server/conf/client.yml | 32 ----------- rpc/dubbo3/msgpack/go-server/conf/dubbogo.yml | 18 +++++++ rpc/dubbo3/msgpack/go-server/conf/log.yml | 27 ---------- rpc/dubbo3/msgpack/go-server/conf/server.yml | 30 ----------- .../msgpack/go-server/docker/docker-compose.yml | 9 ---- .../go-server/docker/docker-compose.yml~merged | 9 ---- .../go-server/docker/docker-health-check.sh | 10 ---- rpc/dubbo3/msgpack/go-server/pkg/greeter.go | 46 ---------------- .../go-server/tests/integration/main_test.go | 62 ---------------------- .../tests/integration/userprovider_test.go | 38 ------------- 20 files changed, 74 insertions(+), 423 deletions(-) diff --git a/.run/triple-msgpack-client.run.xml b/.run/triple-msgpack-client.run.xml deleted file mode 100644 index 76d0bf0..0000000 --- a/.run/triple-msgpack-client.run.xml +++ /dev/null @@ -1,15 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration default="false" name="triple-msgpack-client" type="GoApplicationRunConfiguration" factoryName="Go Application" folderName="triple"> - <module name="dubbo-go-samples" /> - <working_directory value="$PROJECT_DIR$" /> - <envs> - <env name="APP_LOG_CONF_FILE" value="$PROJECT_DIR$/general/dubbo3/msgpack/go-client/conf/log.yml" /> - <env name="CONF_CONSUMER_FILE_PATH" value="$PROJECT_DIR$/general/dubbo3/msgpack/go-client/conf/client.yml" /> - </envs> - <kind value="PACKAGE" /> - <package value="github.com/apache/dubbo-go-samples/rpc/dubbo3/msgpack/go-client/cmd" /> - <directory value="github.com/apache/dubbo-go-samples/general/dubbo3/api/dubbogo-grpc/server/dubbogo-server/cmd" /> - <filePath value="$PROJECT_DIR$" /> - <method v="2" /> - </configuration> -</component> \ No newline at end of file diff --git a/.run/triple-msgpack-server.run.xml b/.run/triple-msgpack-server.run.xml deleted file mode 100644 index 5ff8ee6..0000000 --- a/.run/triple-msgpack-server.run.xml +++ /dev/null @@ -1,15 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration default="false" name="triple-msgpack-server" type="GoApplicationRunConfiguration" factoryName="Go Application" folderName="triple"> - <module name="dubbo-go-samples" /> - <working_directory value="$PROJECT_DIR$" /> - <envs> - <env name="APP_LOG_CONF_FILE" value="$PROJECT_DIR$/general/dubbo3/msgpack/go-server/conf/log.yml" /> - <env name="CONF_PROVIDER_FILE_PATH" value="$PROJECT_DIR$/general/dubbo3/msgpack/go-server/conf/server.yml" /> - </envs> - <kind value="PACKAGE" /> - <package value="github.com/apache/dubbo-go-samples/rpc/dubbo3/msgpack/go-server/cmd" /> - <directory value="github.com/apache/dubbo-go-samples/general/dubbo3/api/dubbogo-grpc/server/dubbogo-server/cmd" /> - <filePath value="$PROJECT_DIR$" /> - <method v="2" /> - </configuration> -</component> \ No newline at end of file diff --git a/.run/triple/triple-msgpack-client.run.xml b/.run/triple/triple-msgpack-client.run.xml index d76c342..c120b23 100644 --- a/.run/triple/triple-msgpack-client.run.xml +++ b/.run/triple/triple-msgpack-client.run.xml @@ -3,12 +3,11 @@ <module name="dubbo-go-samples" /> <working_directory value="$PROJECT_DIR$" /> <envs> - <env name="APP_LOG_CONF_FILE" value="$PROJECT_DIR$/general/dubbo3/msgpack/go-client/conf/log.yml" /> - <env name="CONF_CONSUMER_FILE_PATH" value="$PROJECT_DIR$/general/dubbo3/msgpack/go-client/conf/client.yml" /> + <env name="CONF_CONSUMER_FILE_PATH" value="$PROJECT_DIR$/rpc/dubbo3/msgpack/go-client/conf/dubbogo.yml" /> </envs> <kind value="PACKAGE" /> - <filePath value="$PROJECT_DIR$/general/dubbo3/msgpack/go-client/cmd/client.go" /> - <package value="github.com/apache/dubbo-go-samples/general/dubbo3/msgpack/go-client/cmd" /> + <filePath value="$PROJECT_DIR$/rpc/dubbo3/msgpack/go-client/cmd/client.go" /> + <package value="github.com/apache/dubbo-go-samples/rpc/dubbo3/msgpack/go-client/cmd" /> <directory value="$PROJECT_DIR$" /> <method v="2" /> </configuration> diff --git a/.run/triple/triple-msgpack-server.run.xml b/.run/triple/triple-msgpack-server.run.xml index 6e12c1c..ffdc266 100644 --- a/.run/triple/triple-msgpack-server.run.xml +++ b/.run/triple/triple-msgpack-server.run.xml @@ -3,12 +3,11 @@ <module name="dubbo-go-samples" /> <working_directory value="$PROJECT_DIR$" /> <envs> - <env name="APP_LOG_CONF_FILE" value="$PROJECT_DIR$/general/dubbo3/msgpack/go-server/conf/log.yml" /> - <env name="CONF_PROVIDER_FILE_PATH" value="$PROJECT_DIR$/general/dubbo3/msgpack/go-server/conf/server.yml" /> + <env name="CONF_PROVIDER_FILE_PATH" value="$PROJECT_DIR$/rpc/dubbo3/msgpack/go-server/conf/dubbogo.yml" /> </envs> <kind value="PACKAGE" /> - <filePath value="$PROJECT_DIR$/general/dubbo3/msgpack/go-server/cmd/server.go" /> - <package value="github.com/apache/dubbo-go-samples/general/dubbo3/msgpack/go-server/cmd" /> + <filePath value="$PROJECT_DIR$/rpc/dubbo3/msgpack/go-server/cmd/server.go" /> + <package value="github.com/apache/dubbo-go-samples/rpc/dubbo3/msgpack/go-server/cmd" /> <directory value="$PROJECT_DIR$" /> <method v="2" /> </configuration> diff --git a/rpc/dubbo3/msgpack/go-client/cmd/client.go b/rpc/dubbo3/msgpack/go-client/cmd/client.go index 3a52862..d0bc974 100644 --- a/rpc/dubbo3/msgpack/go-client/cmd/client.go +++ b/rpc/dubbo3/msgpack/go-client/cmd/client.go @@ -24,24 +24,24 @@ import ( ) import ( - _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl" - _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance" - _ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory" "dubbo.apache.org/dubbo-go/v3/config" - _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl" - _ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3" - _ "dubbo.apache.org/dubbo-go/v3/protocol/grpc" - _ "dubbo.apache.org/dubbo-go/v3/registry/protocol" - _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper" - - "github.com/dubbogo/gost/log" + _ "dubbo.apache.org/dubbo-go/v3/imports" + gxlog "github.com/dubbogo/gost/log" ) import ( - "github.com/apache/dubbo-go-samples/general/dubbo3/msgpack/go-client/pkg" + "github.com/apache/dubbo-go-samples/api" ) -var userProvider = new(pkg.UserProvider) +type UserProvider struct { + GetUser func(ctx context.Context, req *api.User) (rsp *api.User, err error) +} + +func (u *UserProvider) Reference() string { + return "greeterImpl" +} + +var userProvider = new(UserProvider) func init() { config.SetConsumerService(userProvider) @@ -53,8 +53,7 @@ func main() { time.Sleep(3 * time.Second) gxlog.CInfo("\n\n\nstart to test dubbo") - user := &pkg.User{} - err := userProvider.GetUser(context.TODO(), &pkg.User{Name: "laurence"}, user) + user, err := userProvider.GetUser(context.TODO(), &api.User{Name: "laurence"}) if err != nil { gxlog.CError("error: %v\n", err) os.Exit(1) diff --git a/rpc/dubbo3/msgpack/go-client/conf/client.yml b/rpc/dubbo3/msgpack/go-client/conf/client.yml deleted file mode 100644 index 2a1082a..0000000 --- a/rpc/dubbo3/msgpack/go-client/conf/client.yml +++ /dev/null @@ -1,33 +0,0 @@ -# dubbo client yaml configure file - -check: true -# client -request_timeout: "3s" -# connect timeout -connect_timeout: "3s" - -# application config -application: - organization: "dubbo.io" - name: "UserProvider" - module: "dubbo-go3.0 client" - version: "0.0.1" - environment: "dev" - -# registry config -registries: - "demoZk": - protocol: "zookeeper" - timeout: "3s" - address: "127.0.0.1:2181" - username: "" - password: "" - -# reference config -references: - "UserProvider": - registry: "demoZk" - protocol: "tri" - serialization: "msgpack" -# url: "dubbo://127.0.0.1:20000" # target server ip:port - interface: "com.apache.dubbo.sample.basic.IGreeter" \ No newline at end of file diff --git a/rpc/dubbo3/msgpack/go-client/conf/dubbogo.yml b/rpc/dubbo3/msgpack/go-client/conf/dubbogo.yml new file mode 100644 index 0000000..b33f18c --- /dev/null +++ b/rpc/dubbo3/msgpack/go-client/conf/dubbogo.yml @@ -0,0 +1,14 @@ +dubbo: + registries: + "demoZK": + protocol: "zookeeper" + timeout: "3s" + address: "127.0.0.1:2181" + consumer: + registry: + - demoZK + references: + "greeterImpl": + protocol: "tri" + serialization: "msgpack" + interface: "com.apache.dubbo.sample.basic.IGreeter" # must be compatible with grpc or dubbo-java \ No newline at end of file diff --git a/rpc/dubbo3/msgpack/go-client/conf/log.yml b/rpc/dubbo3/msgpack/go-client/conf/log.yml deleted file mode 100644 index 8c3f700..0000000 --- a/rpc/dubbo3/msgpack/go-client/conf/log.yml +++ /dev/null @@ -1,27 +0,0 @@ -level: "info" -development: true -disableCaller: false -disableStacktrace: false -sampling: -encoding: "console" - -# encoder -encoderConfig: - messageKey: "message" - levelKey: "level" - timeKey: "time" - nameKey: "logger" - callerKey: "caller" - stacktraceKey: "stacktrace" - lineEnding: "" - levelEncoder: "capital" - timeEncoder: "iso8601" - durationEncoder: "seconds" - callerEncoder: "short" - nameEncoder: "" - -outputPaths: - - "stderr" -errorOutputPaths: - - "stderr" -initialFields: diff --git a/rpc/dubbo3/msgpack/go-client/pkg/hello.go b/rpc/dubbo3/msgpack/go-client/pkg/hello.go deleted file mode 100644 index da5c377..0000000 --- a/rpc/dubbo3/msgpack/go-client/pkg/hello.go +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package pkg - -import ( - "context" -) - -type User struct { - ID string - Name string - Age int32 -} - -type UserProvider struct { - GetUser func(ctx context.Context, req *User, rsp *User) error -} - -func (u *UserProvider) Reference() string { - return "UserProvider" -} diff --git a/rpc/dubbo3/msgpack/go-server/cmd/server.go b/rpc/dubbo3/msgpack/go-server/cmd/server.go index 0664d29..9c956c0 100644 --- a/rpc/dubbo3/msgpack/go-server/cmd/server.go +++ b/rpc/dubbo3/msgpack/go-server/cmd/server.go @@ -18,6 +18,7 @@ package main import ( + "context" "fmt" "os" "os/signal" @@ -26,30 +27,40 @@ import ( ) import ( - _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl" - _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance" "dubbo.apache.org/dubbo-go/v3/common/logger" - _ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory" "dubbo.apache.org/dubbo-go/v3/config" - _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl" - _ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3" - _ "dubbo.apache.org/dubbo-go/v3/registry/nacos" - _ "dubbo.apache.org/dubbo-go/v3/registry/protocol" - _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper" - - _ "github.com/dubbogo/triple/pkg/triple" + _ "dubbo.apache.org/dubbo-go/v3/imports" + gxlog "github.com/dubbogo/gost/log" ) import ( - "github.com/apache/dubbo-go-samples/general/dubbo3/msgpack/go-server/pkg" + "github.com/apache/dubbo-go-samples/api" ) +type UserProvider struct { +} + +func (u UserProvider) GetUser(ctx context.Context, user *api.User) (*api.User, error) { + gxlog.CInfo("req:%#v", user) + rsp := api.User{ + Name: "12345", + Id: "Hello " + user.Name, + Age: 18, + } + gxlog.CInfo("rsp:%#v", rsp) + return &rsp, nil +} + +func (u UserProvider) Reference() string { + return "greeterImpl" +} + var ( survivalTimeout = int(3 * time.Second) ) func init() { - config.SetProviderService(new(pkg.UserProvider)) + config.SetProviderService(new(UserProvider)) } // need to setup environment variable "CONF_PROVIDER_FILE_PATH" to "conf/server.yml" before run diff --git a/rpc/dubbo3/msgpack/go-server/conf/client.yml b/rpc/dubbo3/msgpack/go-server/conf/client.yml deleted file mode 100644 index 144bc66..0000000 --- a/rpc/dubbo3/msgpack/go-server/conf/client.yml +++ /dev/null @@ -1,32 +0,0 @@ -# dubbo client yaml configure file - -check: true -# client -request_timeout: "3s" -# connect timeout -connect_timeout: "3s" - -# application config -application: - organization: "dubbo.io" - name: "UserProvider" - module: "dubbo-go3.0 client" - version: "0.0.1" - environment: "dev" - -# registry config -registries: - "demoZk": - protocol: "zookeeper" - timeout: "3s" - address: "127.0.0.1:2181" - username: "" - password: "" - -# reference config -references: - "UserProvider": - registry: "demoZk" - protocol: "tri" - serialization: "msgpack" - interface: "com.apache.dubbo.sample.basic.IGreeter" diff --git a/rpc/dubbo3/msgpack/go-server/conf/dubbogo.yml b/rpc/dubbo3/msgpack/go-server/conf/dubbogo.yml new file mode 100644 index 0000000..0b208b4 --- /dev/null +++ b/rpc/dubbo3/msgpack/go-server/conf/dubbogo.yml @@ -0,0 +1,18 @@ +dubbo: + registries: + "demoZK": + protocol: "zookeeper" + timeout: "3s" + address: "127.0.0.1:2181" + protocols: + "triple": + name: "tri" + port: 20000 + provider: + registry: + - demoZK + services: + "greeterImpl": + protocol: "triple" + serialization: "msgpack" + interface: "com.apache.dubbo.sample.basic.IGreeter" # must be compatible with grpc or dubbo-java \ No newline at end of file diff --git a/rpc/dubbo3/msgpack/go-server/conf/log.yml b/rpc/dubbo3/msgpack/go-server/conf/log.yml deleted file mode 100644 index 8c3f700..0000000 --- a/rpc/dubbo3/msgpack/go-server/conf/log.yml +++ /dev/null @@ -1,27 +0,0 @@ -level: "info" -development: true -disableCaller: false -disableStacktrace: false -sampling: -encoding: "console" - -# encoder -encoderConfig: - messageKey: "message" - levelKey: "level" - timeKey: "time" - nameKey: "logger" - callerKey: "caller" - stacktraceKey: "stacktrace" - lineEnding: "" - levelEncoder: "capital" - timeEncoder: "iso8601" - durationEncoder: "seconds" - callerEncoder: "short" - nameEncoder: "" - -outputPaths: - - "stderr" -errorOutputPaths: - - "stderr" -initialFields: diff --git a/rpc/dubbo3/msgpack/go-server/conf/server.yml b/rpc/dubbo3/msgpack/go-server/conf/server.yml deleted file mode 100644 index 8ae95f6..0000000 --- a/rpc/dubbo3/msgpack/go-server/conf/server.yml +++ /dev/null @@ -1,30 +0,0 @@ -# dubbo server yaml configure file - -# application config -application: - organization: "dubbo.io" - name: "UserProvider" - module: "dubbo-go3.0 greeter server" - version: "0.0.1" - environment: "dev" - -# registry config -registries: - "demoZK": - protocol: "zookeeper" - timeout: "3s" - address: "127.0.0.1:2181" - -# service config -services: - "UserProvider": - registry: "demoZK" - protocol: "tri" # tri is dubbo-go3.0 protocol - serialization: "msgpack" # msgpack is serialization type - interface: "com.apache.dubbo.sample.basic.IGreeter" - -# protocol config -protocols: - "tri": - name: "tri" - port: 20001 \ No newline at end of file diff --git a/rpc/dubbo3/msgpack/go-server/docker/docker-compose.yml b/rpc/dubbo3/msgpack/go-server/docker/docker-compose.yml deleted file mode 100644 index 8724179..0000000 --- a/rpc/dubbo3/msgpack/go-server/docker/docker-compose.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: '3' - -services: - zookeeper: - image: zookeeper - ports: - - 2181:2181 - restart: on-failure - diff --git a/rpc/dubbo3/msgpack/go-server/docker/docker-compose.yml~merged b/rpc/dubbo3/msgpack/go-server/docker/docker-compose.yml~merged deleted file mode 100644 index 8724179..0000000 --- a/rpc/dubbo3/msgpack/go-server/docker/docker-compose.yml~merged +++ /dev/null @@ -1,9 +0,0 @@ -version: '3' - -services: - zookeeper: - image: zookeeper - ports: - - 2181:2181 - restart: on-failure - diff --git a/rpc/dubbo3/msgpack/go-server/docker/docker-health-check.sh b/rpc/dubbo3/msgpack/go-server/docker/docker-health-check.sh deleted file mode 100644 index 2cc32c2..0000000 --- a/rpc/dubbo3/msgpack/go-server/docker/docker-health-check.sh +++ /dev/null @@ -1,10 +0,0 @@ -curl 127.0.0.1:2181 -res=$? -passCode=52 -while [ "$res" != "$passCode" ];do - sleep 5 - curl 127.0.0.1:2181 - res=$? -done - -sleep 5 diff --git a/rpc/dubbo3/msgpack/go-server/pkg/greeter.go b/rpc/dubbo3/msgpack/go-server/pkg/greeter.go deleted file mode 100644 index 3283212..0000000 --- a/rpc/dubbo3/msgpack/go-server/pkg/greeter.go +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package pkg - -import ( - "context" -) - -import ( - "github.com/dubbogo/gost/log" -) - -type User struct { - ID string - Name string - Age int32 -} - -type UserProvider struct { -} - -func (u UserProvider) GetUser(ctx context.Context, user *User) (*User, error) { - gxlog.CInfo("req:%#v", user) - rsp := User{"12345", "Hello " + user.Name, 18} - gxlog.CInfo("rsp:%#v", rsp) - return &rsp, nil -} - -func (u UserProvider) Reference() string { - return "UserProvider" -} diff --git a/rpc/dubbo3/msgpack/go-server/tests/integration/main_test.go b/rpc/dubbo3/msgpack/go-server/tests/integration/main_test.go deleted file mode 100644 index d7edc46..0000000 --- a/rpc/dubbo3/msgpack/go-server/tests/integration/main_test.go +++ /dev/null @@ -1,62 +0,0 @@ -// +build integration - -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package integration - -import ( - "context" - "os" - "testing" - "time" -) - -import ( - _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl" - _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance" - _ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory" - "dubbo.apache.org/dubbo-go/v3/config" - _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl" - _ "dubbo.apache.org/dubbo-go/v3/metadata/service/local" - _ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3" - _ "dubbo.apache.org/dubbo-go/v3/registry/protocol" - _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper" -) - -var userProvider = new(UserProvider) - -func TestMain(m *testing.M) { - config.SetConsumerService(userProvider) - config.Load() - time.Sleep(3 * time.Second) - os.Exit(m.Run()) -} - -type User struct { - ID string - Name string - Age int32 -} - -type UserProvider struct { - GetUser func(ctx context.Context, req *User, rsp *User) error -} - -func (u *UserProvider) Reference() string { - return "UserProvider" -} diff --git a/rpc/dubbo3/msgpack/go-server/tests/integration/userprovider_test.go b/rpc/dubbo3/msgpack/go-server/tests/integration/userprovider_test.go deleted file mode 100644 index 7a08d19..0000000 --- a/rpc/dubbo3/msgpack/go-server/tests/integration/userprovider_test.go +++ /dev/null @@ -1,38 +0,0 @@ -// +build integration - -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package integration - -import ( - "context" - "testing" -) - -import ( - "github.com/stretchr/testify/assert" -) - -func TestGetUser(t *testing.T) { - user := &User{} - err := userProvider.GetUser(context.TODO(), &User{Name: "laurence"}, user) - assert.Nil(t, err) - assert.Equal(t, "12345", user.ID) - assert.Equal(t, "Hello laurence", user.Name) - assert.Equal(t, int32(18), user.Age) -}
