public abstract class AbstractInteropTest extends Object
| Modifier and Type | Field and Description |
|---|---|
protected io.grpc.testing.integration.TestServiceGrpc.TestServiceStub |
asyncStub |
protected io.grpc.testing.integration.TestServiceGrpc.TestServiceBlockingStub |
blockingStub |
protected io.grpc.ManagedChannel |
channel |
protected static com.google.protobuf.EmptyProtos.Empty |
EMPTY |
static int |
MAX_MESSAGE_SIZE
Must be at least
unaryPayloadLength(), plus some to account for encoding overhead. |
static io.grpc.Metadata.Key<io.grpc.testing.integration.Messages.SimpleContext> |
METADATA_KEY |
| Constructor and Description |
|---|
AbstractInteropTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertRemoteAddr(String expectedRemoteAddress)
Helper for asserting remote address
ServerCall.getAttributes() |
protected static void |
assertSuccess(io.grpc.testing.StreamRecorder<?> recorder) |
protected void |
assertX500SubjectDn(String tlsInfo)
Helper for asserting TLS info in SSLSession
ServerCall.getAttributes() |
void |
cancelAfterBegin() |
void |
cancelAfterFirstResponse() |
void |
clientStreaming() |
void |
computeEngineCreds(String serviceAccount,
String oauthScope)
Sends a large unary rpc with compute engine credentials.
|
protected abstract io.grpc.ManagedChannel |
createChannel() |
void |
customMetadata() |
void |
deadlineExceeded() |
void |
deadlineExceededServerStreaming() |
void |
deadlineInPast() |
void |
deadlineNotExceeded() |
void |
emptyStream() |
void |
emptyUnary() |
void |
exchangeMetadataStreamingCall() |
void |
exchangeMetadataUnaryCall() |
void |
fullDuplexCallShouldSucceed() |
protected com.google.instrumentation.stats.StatsContextFactory |
getClientStatsFactory() |
void |
gracefulShutdown() |
void |
halfDuplexCallShouldSucceed() |
void |
jwtTokenCreds(InputStream serviceAccountJson)
Test JWT-based auth.
|
void |
largeUnary() |
void |
maxInboundSize_exact() |
void |
maxInboundSize_tooBig() |
void |
maxOutboundSize_exact() |
void |
maxOutboundSize_tooBig() |
protected boolean |
metricsExpected() |
void |
oauth2AuthToken(String jsonKey,
InputStream credentialsStream,
String authScope)
Sends a unary rpc with raw oauth2 access token credentials.
|
protected int |
operationTimeoutMillis() |
void |
perRpcCreds(String jsonKey,
InputStream credentialsStream,
String oauthScope)
Sends a unary rpc with "per rpc" raw oauth2 access token credentials.
|
void |
pingPong() |
void |
sendsTimeoutHeader() |
void |
serverStreaming() |
void |
serverStreamingShouldBeFlowControlled() |
void |
serviceAccountCreds(String jsonKey,
InputStream credentialsStream,
String authScope)
Sends a large unary rpc with service account credentials.
|
void |
setUp()
Must be called by the subclass setup method if overridden.
|
protected static void |
startStaticServer(io.grpc.internal.AbstractServerImplBuilder<?> builder,
io.grpc.ServerInterceptor... interceptors) |
void |
statusCodeAndMessage() |
protected static void |
stopStaticServer() |
void |
tearDown()
Clean up.
|
void |
timeoutOnSleepingServer()
Start a fullDuplexCall which the server will not respond, and verify the deadline expires.
|
protected int |
unaryPayloadLength() |
void |
unimplementedMethod()
Sends an rpc to an unimplemented method within TestService.
|
void |
unimplementedService()
Sends an rpc to an unimplemented service on the server.
|
void |
veryLargeRequest() |
void |
veryLargeResponse() |
public static final int MAX_MESSAGE_SIZE
unaryPayloadLength(), plus some to account for encoding overhead.public static final io.grpc.Metadata.Key<io.grpc.testing.integration.Messages.SimpleContext> METADATA_KEY
protected static final com.google.protobuf.EmptyProtos.Empty EMPTY
protected io.grpc.ManagedChannel channel
protected io.grpc.testing.integration.TestServiceGrpc.TestServiceBlockingStub blockingStub
protected io.grpc.testing.integration.TestServiceGrpc.TestServiceStub asyncStub
protected static void startStaticServer(io.grpc.internal.AbstractServerImplBuilder<?> builder,
io.grpc.ServerInterceptor... interceptors)
protected static void stopStaticServer()
public void setUp()
protected abstract io.grpc.ManagedChannel createChannel()
protected final com.google.instrumentation.stats.StatsContextFactory getClientStatsFactory()
protected boolean metricsExpected()
public void fullDuplexCallShouldSucceed()
throws Exception
Exceptionpublic void halfDuplexCallShouldSucceed()
throws Exception
Exceptionpublic void serverStreamingShouldBeFlowControlled()
throws Exception
Exceptionpublic void exchangeMetadataUnaryCall()
throws Exception
Exceptionpublic void exchangeMetadataStreamingCall()
throws Exception
Exceptionpublic void sendsTimeoutHeader()
public void deadlineNotExceeded()
public void deadlineExceeded()
public void deadlineExceededServerStreaming()
throws Exception
Exceptionpublic void maxInboundSize_exact()
public void maxInboundSize_tooBig()
public void maxOutboundSize_exact()
public void maxOutboundSize_tooBig()
protected int unaryPayloadLength()
public void unimplementedMethod()
public void unimplementedService()
public void timeoutOnSleepingServer()
public void serviceAccountCreds(String jsonKey, InputStream credentialsStream, String authScope) throws Exception
Exceptionpublic void computeEngineCreds(String serviceAccount, String oauthScope) throws Exception
Exceptionpublic void jwtTokenCreds(InputStream serviceAccountJson) throws Exception
Exceptionpublic void oauth2AuthToken(String jsonKey, InputStream credentialsStream, String authScope) throws Exception
Exceptionpublic void perRpcCreds(String jsonKey, InputStream credentialsStream, String oauthScope) throws Exception
Exceptionprotected static void assertSuccess(io.grpc.testing.StreamRecorder<?> recorder)
protected void assertRemoteAddr(String expectedRemoteAddress)
ServerCall.getAttributes()protected void assertX500SubjectDn(String tlsInfo)
ServerCall.getAttributes()protected int operationTimeoutMillis()