aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Gribkoff <ericgribkoff@google.com>2020-04-02 15:39:25 -0700
committerGitHub <noreply@github.com>2020-04-02 15:39:25 -0700
commit4ae7a37d7cc22ab9f79f4ec17247c0c23999714b (patch)
treefa276b15ea8fe35459077c810a8e2fd9d306402f
parent7555a400db886b5ae040e579f246eeec31048803 (diff)
downloadgrpc-grpc-java-4ae7a37d7cc22ab9f79f4ec17247c0c23999714b.tar.gz
interop-testing: add health service to XdsTestServer (#6891)
-rw-r--r--interop-testing/build.gradle1
-rw-r--r--interop-testing/src/main/java/io/grpc/testing/integration/XdsTestServer.java12
2 files changed, 12 insertions, 1 deletions
diff --git a/interop-testing/build.gradle b/interop-testing/build.gradle
index ad833f73f..7d7c9b272 100644
--- a/interop-testing/build.gradle
+++ b/interop-testing/build.gradle
@@ -24,6 +24,7 @@ dependencies {
project(':grpc-netty'),
project(':grpc-okhttp'),
project(':grpc-protobuf'),
+ project(':grpc-services'),
project(':grpc-stub'),
project(':grpc-testing'),
libraries.google_auth_oauth2_http,
diff --git a/interop-testing/src/main/java/io/grpc/testing/integration/XdsTestServer.java b/interop-testing/src/main/java/io/grpc/testing/integration/XdsTestServer.java
index 915be98a4..fc8a4f60b 100644
--- a/interop-testing/src/main/java/io/grpc/testing/integration/XdsTestServer.java
+++ b/interop-testing/src/main/java/io/grpc/testing/integration/XdsTestServer.java
@@ -17,7 +17,9 @@
package io.grpc.testing.integration;
import io.grpc.Server;
+import io.grpc.health.v1.HealthCheckResponse.ServingStatus;
import io.grpc.netty.NettyServerBuilder;
+import io.grpc.services.HealthStatusManager;
import io.grpc.stub.StreamObserver;
import io.grpc.testing.integration.Messages.SimpleRequest;
import io.grpc.testing.integration.Messages.SimpleResponse;
@@ -33,6 +35,7 @@ public final class XdsTestServer {
private int port = 8080;
private String serverId = "java_server";
+ private HealthStatusManager health;
private Server server;
/**
@@ -107,7 +110,14 @@ public final class XdsTestServer {
}
private void start() throws Exception {
- server = NettyServerBuilder.forPort(port).addService(new TestServiceImpl()).build().start();
+ health = new HealthStatusManager();
+ server =
+ NettyServerBuilder.forPort(port)
+ .addService(new TestServiceImpl())
+ .addService(health.getHealthService())
+ .build()
+ .start();
+ health.setStatus("", ServingStatus.SERVING);
}
private void stop() throws Exception {