mirror of https://github.com/grpc/grpc-java.git
gae-interop-testing: concrete channel builders (#3678)
Do not rely on ManagedChannelBuilder to select the correct concrete type; directly instantiate the required type.
This commit is contained in:
parent
2999d24bc7
commit
6827f53785
|
|
@ -45,10 +45,7 @@ dependencies {
|
||||||
compile project(":grpc-okhttp")
|
compile project(":grpc-okhttp")
|
||||||
compile project(":grpc-protobuf")
|
compile project(":grpc-protobuf")
|
||||||
compile project(":grpc-stub")
|
compile project(":grpc-stub")
|
||||||
compile (project(":grpc-interop-testing")) {
|
compile project(":grpc-interop-testing")
|
||||||
// We want the gRPC and service definitions but NOT grpc-netty for jdk7
|
|
||||||
exclude module: ":grpc-netty"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// [START model]
|
// [START model]
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,7 @@
|
||||||
|
|
||||||
package io.grpc.testing.integration;
|
package io.grpc.testing.integration;
|
||||||
|
|
||||||
import static junit.framework.TestCase.assertTrue;
|
|
||||||
|
|
||||||
import io.grpc.ManagedChannel;
|
import io.grpc.ManagedChannel;
|
||||||
import io.grpc.ManagedChannelBuilder;
|
|
||||||
import io.grpc.okhttp.OkHttpChannelBuilder;
|
import io.grpc.okhttp.OkHttpChannelBuilder;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
|
@ -134,10 +131,9 @@ public final class OkHttpClientInteropServlet extends HttpServlet {
|
||||||
public static final class Tester extends AbstractInteropTest {
|
public static final class Tester extends AbstractInteropTest {
|
||||||
@Override
|
@Override
|
||||||
protected ManagedChannel createChannel() {
|
protected ManagedChannel createChannel() {
|
||||||
ManagedChannelBuilder<?> builder =
|
OkHttpChannelBuilder builder =
|
||||||
ManagedChannelBuilder.forTarget(INTEROP_TEST_ADDRESS)
|
OkHttpChannelBuilder.forTarget(INTEROP_TEST_ADDRESS)
|
||||||
.maxInboundMessageSize(AbstractInteropTest.MAX_MESSAGE_SIZE);
|
.maxInboundMessageSize(AbstractInteropTest.MAX_MESSAGE_SIZE);
|
||||||
assertTrue(builder instanceof OkHttpChannelBuilder);
|
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,7 @@
|
||||||
|
|
||||||
package io.grpc.testing.integration;
|
package io.grpc.testing.integration;
|
||||||
|
|
||||||
import static junit.framework.TestCase.assertTrue;
|
|
||||||
|
|
||||||
import io.grpc.ManagedChannel;
|
import io.grpc.ManagedChannel;
|
||||||
import io.grpc.ManagedChannelBuilder;
|
|
||||||
import io.grpc.netty.NettyChannelBuilder;
|
import io.grpc.netty.NettyChannelBuilder;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
|
@ -82,12 +79,11 @@ public final class NettyClientInteropServlet extends HttpServlet {
|
||||||
public static final class Tester extends AbstractInteropTest {
|
public static final class Tester extends AbstractInteropTest {
|
||||||
@Override
|
@Override
|
||||||
protected ManagedChannel createChannel() {
|
protected ManagedChannel createChannel() {
|
||||||
ManagedChannelBuilder<?> builder =
|
NettyChannelBuilder builder =
|
||||||
ManagedChannelBuilder.forTarget(INTEROP_TEST_ADDRESS)
|
NettyChannelBuilder.forTarget(INTEROP_TEST_ADDRESS)
|
||||||
.maxInboundMessageSize(AbstractInteropTest.MAX_MESSAGE_SIZE);
|
.maxInboundMessageSize(AbstractInteropTest.MAX_MESSAGE_SIZE);
|
||||||
|
|
||||||
assertTrue(builder instanceof NettyChannelBuilder);
|
builder.flowControlWindow(65 * 1024);
|
||||||
((NettyChannelBuilder) builder).flowControlWindow(65 * 1024);
|
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue