Skip to content
Permalink
Browse files
add overload method test case
  • Loading branch information
EarthChen committed Oct 28, 2021
1 parent ab1c41e commit e60ab13fb9aa3ae73dad7bfb46b706ebd059afe4
Showing 3 changed files with 26 additions and 2 deletions.
@@ -3,6 +3,12 @@
import org.apache.dubbo.common.stream.StreamObserver;

public interface WrapGreeter {


String overload();


String overload(String param);
/**
* <pre>
* Sends a greeting
@@ -6,6 +6,16 @@
import org.apache.dubbo.sample.tri.service.WrapGreeter;

public class WrapGreeterImpl implements WrapGreeter {
@Override
public String overload() {
return "overload";
}

@Override
public String overload(String param) {
return param;
}

@Override
public String sayHelloLong(int len) {
StringBuilder respBuilder = new StringBuilder();
@@ -53,7 +63,7 @@ public StreamObserver<String> sayHelloStream(StreamObserver<String> response) {
@Override
public void onNext(String data) {
System.out.println(data);
response.onNext("hello,"+data);
response.onNext("hello," + data);
}

@Override
@@ -21,6 +21,13 @@ public abstract class BaseTriWrapConsumerTest {

protected static DubboBootstrap appDubboBootstrap;

@Test
public void overload() {
String ret = delegate.overload();
Assert.assertEquals(ret, "overload");
String ret2 = delegate.overload("overload");
Assert.assertEquals(ret2, "overload");
}

@Test
public void sayHelloUnaryRequestVoid() {
@@ -60,7 +67,8 @@ public void onNext(String data) {
public void sayHelloStream() throws InterruptedException {
int n = 10;
CountDownLatch latch = new CountDownLatch(n);
final StreamObserver<String> request = delegate.sayHelloStream(new StdoutStreamObserver<String>("sayHelloStream") {
final StreamObserver<String> request = delegate.sayHelloStream(new StdoutStreamObserver<String>(
"sayHelloStream") {
@Override
public void onNext(String data) {
super.onNext(data);

0 comments on commit e60ab13

Please sign in to comment.