Skip to content
Permalink
Browse files
add url call test
  • Loading branch information
EarthChen committed Sep 16, 2021
1 parent b4c7fd7 commit 3e9a32c52c92ec4d0b7e59ee367bfac1e44aeac3
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
@@ -28,11 +28,13 @@ services:
- "org.apache.dubbo.sample.tri/TriPbConsumerTest.class"
- "org.apache.dubbo.sample.tri/TriWrapConsumerTest.class"
- "org.apache.dubbo.sample.tri/TriGenericTest.class"
# use url direct
- "org.apache.dubbo.sample.tri/direct/TriDirectPbConsumerTest.class"
- "org.apache.dubbo.sample.tri/direct/TriDirectWrapConsumerTest.class"
# grpc-->tri
- "org.apache.dubbo.sample.tri/grpc/Grpc*Test.class"
# tri-->grpc
# fixme Failure is always present (https://github.com/apache/dubbo/issues/8738)
#- "org.apache.dubbo.sample.tri.grpc/TriGrpcDirectPbConsumerTest.class"
- "org.apache.dubbo.sample.tri.grpc/TriGrpcDirectPbConsumerTest.class"
systemProps:
- zookeeper.host=dubbo-samples-triple
- zookeeper.port=2181
@@ -18,7 +18,7 @@
#

###set log levels###
log4j.rootLogger=debug, stdout
log4j.rootLogger=info, stdout
###output to the console###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
@@ -6,7 +6,6 @@
import org.apache.dubbo.rpc.RpcException;
import org.apache.dubbo.sample.tri.helper.StdoutStreamObserver;
import org.apache.dubbo.sample.tri.service.PbGreeterManual;

import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Test;
@@ -85,6 +84,7 @@ public void clientSendLargeSizeHeader() {


@Test(expected = RpcException.class)
// @Ignore
public void serverSendLargeSizeHeader() {
final String key = "user-attachment";
GreeterReply reply = delegateManual.greetReturnBigAttachment(GreeterRequest.newBuilder().setName("meta").build());
@@ -21,7 +21,7 @@ public static void init() {
ReferenceConfig<GenericService> ref = new ReferenceConfig<>();
ref.setInterface("org.apache.dubbo.sample.tri.service.WrapGreeter");
ref.setCheck(false);
ref.setTimeout(30000);
ref.setTimeout(3000);
ref.setProtocol(CommonConstants.TRIPLE);
ref.setGeneric("true");
ref.setLazy(true);
@@ -18,14 +18,14 @@ public static void init() {
ref.setCheck(false);
ref.setProtocol(CommonConstants.TRIPLE);
ref.setLazy(true);
ref.setTimeout(10000);
ref.setTimeout(3000);

ReferenceConfig<PbGreeterManual> ref2 = new ReferenceConfig<>();
ref2.setInterface(PbGreeterManual.class);
ref2.setCheck(false);
ref2.setProtocol(CommonConstants.TRIPLE);
ref2.setLazy(true);
ref2.setTimeout(10000);
ref2.setTimeout(3000);

DubboBootstrap bootstrap = DubboBootstrap.getInstance();
ApplicationConfig applicationConfig = new ApplicationConfig(TriPbConsumerTest.class.getName());
@@ -6,10 +6,8 @@
import org.apache.dubbo.config.bootstrap.DubboBootstrap;
import org.apache.dubbo.sample.tri.BasePbConsumerTest;
import org.apache.dubbo.sample.tri.PbGreeter;
import org.apache.dubbo.sample.tri.TriGenericTest;
import org.apache.dubbo.sample.tri.TriSampleConstants;
import org.apache.dubbo.sample.tri.service.PbGreeterManual;

import org.junit.BeforeClass;

public class TriDirectPbConsumerTest extends BasePbConsumerTest {
@@ -22,15 +20,15 @@ public static void init() {
ref.setUrl(TriSampleConstants.DEFAULT_ADDRESS);
ref.setProtocol(CommonConstants.TRIPLE);
ref.setLazy(true);
ref.setTimeout(10000);
ref.setTimeout(3000);

ReferenceConfig<PbGreeterManual> ref2 = new ReferenceConfig<>();
ref2.setInterface(PbGreeterManual.class);
ref2.setCheck(false);
ref2.setUrl(TriSampleConstants.DEFAULT_ADDRESS);
ref2.setUrl(TriSampleConstants.DEFAULT_MULTI_ADDRESS);
ref2.setProtocol(CommonConstants.TRIPLE);
ref2.setLazy(true);
ref2.setTimeout(10000);
ref2.setTimeout(3000);

DubboBootstrap bootstrap = DubboBootstrap.getInstance();
ApplicationConfig applicationConfig = new ApplicationConfig(TriDirectPbConsumerTest.class.getName());
@@ -8,7 +8,6 @@
import org.apache.dubbo.sample.tri.PbGreeter;
import org.apache.dubbo.sample.tri.TriSampleConstants;
import org.apache.dubbo.sample.tri.service.PbGreeterManual;

import org.junit.BeforeClass;

public class TriGrpcDirectPbConsumerTest extends BasePbConsumerTest {
@@ -21,18 +20,20 @@ public static void init() {
ref.setUrl(TriSampleConstants.DEFAULT_ADDRESS);
ref.setProtocol(CommonConstants.TRIPLE);
ref.setLazy(true);
ref.setTimeout(10000);
ref.setTimeout(3000);

ReferenceConfig<PbGreeterManual> ref2 = new ReferenceConfig<>();
ref2.setInterface(PbGreeterManual.class);
ref2.setCheck(false);
ref2.setUrl(TriSampleConstants.DEFAULT_ADDRESS);
ref2.setProtocol(CommonConstants.TRIPLE);
ref2.setLazy(true);
ref2.setTimeout(10000);
ref2.setTimeout(3000);

DubboBootstrap bootstrap = DubboBootstrap.getInstance();
bootstrap.application(new ApplicationConfig("demo-consumer"))
ApplicationConfig applicationConfig = new ApplicationConfig(TriGrpcDirectPbConsumerTest.class.getName());
applicationConfig.setMetadataServicePort(TriSampleConstants.CONSUMER_METADATA_SERVICE_PORT);
bootstrap.application(applicationConfig)
.reference(ref)
.reference(ref2)
.start();

0 comments on commit 3e9a32c

Please sign in to comment.