Skip to content
Permalink
Browse files
Merge pull request #386 from EarthChen/feature/overload-method
[Triple] Add overload method test case
  • Loading branch information
guohao committed Oct 29, 2021
2 parents b1c5dc9 + e60ab13 commit d467e02498bab2a2a70fcbc04eb6b141fa0b994e
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 d467e02

Please sign in to comment.