mirror of https://github.com/grpc/grpc-java.git
Fixes GRPC third_party TAP breakage due to naming changes on generated interfaces.
------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=71347520
This commit is contained in:
parent
bf8870ba86
commit
1e26ae1924
|
|
@ -14,7 +14,7 @@ import com.google.net.stubby.testing.integration.Test.Payload;
|
||||||
import com.google.net.stubby.testing.integration.Test.PayloadType;
|
import com.google.net.stubby.testing.integration.Test.PayloadType;
|
||||||
import com.google.net.stubby.testing.integration.Test.SimpleRequest;
|
import com.google.net.stubby.testing.integration.Test.SimpleRequest;
|
||||||
import com.google.net.stubby.testing.integration.Test.SimpleResponse;
|
import com.google.net.stubby.testing.integration.Test.SimpleResponse;
|
||||||
import com.google.net.stubby.testing.integration.grpcapi.TestService;
|
import com.google.net.stubby.testing.integration.TestServiceGrpc;
|
||||||
import com.google.protobuf.ByteString;
|
import com.google.protobuf.ByteString;
|
||||||
|
|
||||||
import org.hamcrest.BaseMatcher;
|
import org.hamcrest.BaseMatcher;
|
||||||
|
|
@ -70,8 +70,8 @@ public class ContextExchangeChannelTest {
|
||||||
exchange.receive("auth", Marshallers.forProto(SimpleResponse.PARSER));
|
exchange.receive("auth", Marshallers.forProto(SimpleResponse.PARSER));
|
||||||
// Should be null, nothing has happened
|
// Should be null, nothing has happened
|
||||||
assertNull(auth.get());
|
assertNull(auth.get());
|
||||||
TestService.TestServiceBlockingStub stub =
|
TestServiceGrpc.TestServiceBlockingStub stub =
|
||||||
TestService.blockingClient(exchange);
|
TestServiceGrpc.newBlockingStub(exchange);
|
||||||
callStub(stub);
|
callStub(stub);
|
||||||
assertEquals(RESP, auth.get());
|
assertEquals(RESP, auth.get());
|
||||||
exchange.clearLastReceived();
|
exchange.clearLastReceived();
|
||||||
|
|
@ -82,8 +82,8 @@ public class ContextExchangeChannelTest {
|
||||||
public void testSend() throws Exception {
|
public void testSend() throws Exception {
|
||||||
ContextExchangeChannel exchange = new ContextExchangeChannel(channel);
|
ContextExchangeChannel exchange = new ContextExchangeChannel(channel);
|
||||||
exchange.send("auth", RESP, Marshallers.forProto(SimpleResponse.PARSER));
|
exchange.send("auth", RESP, Marshallers.forProto(SimpleResponse.PARSER));
|
||||||
TestService.TestServiceBlockingStub stub =
|
TestServiceGrpc.TestServiceBlockingStub stub =
|
||||||
TestService.blockingClient(exchange);
|
TestServiceGrpc.newBlockingStub(exchange);
|
||||||
callStub(stub);
|
callStub(stub);
|
||||||
verify(call).sendContext(eq("auth"),
|
verify(call).sendContext(eq("auth"),
|
||||||
argThat(new BaseMatcher<InputStream>() {
|
argThat(new BaseMatcher<InputStream>() {
|
||||||
|
|
@ -105,7 +105,7 @@ public class ContextExchangeChannelTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private void callStub(final TestService.TestServiceBlockingStub stub) throws Exception {
|
private void callStub(final TestServiceGrpc.TestServiceBlockingStub stub) throws Exception {
|
||||||
when(channel.newCall(Mockito.<MethodDescriptor>any())).thenReturn(call);
|
when(channel.newCall(Mockito.<MethodDescriptor>any())).thenReturn(call);
|
||||||
|
|
||||||
// execute the call in another thread so we don't deadlock waiting for the
|
// execute the call in another thread so we don't deadlock waiting for the
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue