mirror of https://github.com/grpc/grpc-java.git
update tests
This commit is contained in:
parent
7ac44928be
commit
b9cacc1553
|
|
@ -43,7 +43,6 @@ import static io.grpc.internal.GrpcUtil.TIMEOUT_KEY;
|
|||
import static io.grpc.internal.GrpcUtil.USER_AGENT_KEY;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.base.Throwables;
|
||||
import com.google.common.util.concurrent.FutureCallback;
|
||||
|
|
|
|||
|
|
@ -104,9 +104,9 @@ public class CompressionTest {
|
|||
private CompressorRegistry clientCompressors = CompressorRegistry.newEmptyInstance();
|
||||
private CompressorRegistry serverCompressors = CompressorRegistry.newEmptyInstance();
|
||||
|
||||
/** The headers received by the server from the client */
|
||||
/** The headers received by the server from the client. */
|
||||
private volatile Metadata serverResponseHeaders;
|
||||
/** The headers received by the client from the server */
|
||||
/** The headers received by the client from the server. */
|
||||
private volatile Metadata clientResponseHeaders;
|
||||
|
||||
// Params
|
||||
|
|
@ -121,6 +121,9 @@ public class CompressionTest {
|
|||
private ManagedChannel channel;
|
||||
private TestServiceBlockingStub stub;
|
||||
|
||||
/**
|
||||
* Auto called by test.
|
||||
*/
|
||||
public CompressionTest(
|
||||
boolean enableClientMessageCompression,
|
||||
boolean clientAcceptEncoding,
|
||||
|
|
@ -164,6 +167,9 @@ public class CompressionTest {
|
|||
executor.shutdownNow();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for test.
|
||||
*/
|
||||
@Parameters
|
||||
public static Collection<Object[]> params() {
|
||||
Boolean[] bools = new Boolean[]{false, true};
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ import io.grpc.testing.integration.Messages.PayloadType;
|
|||
import io.grpc.testing.integration.Messages.SimpleRequest;
|
||||
import io.grpc.testing.integration.Messages.SimpleResponse;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ import static org.mockito.Mockito.when;
|
|||
|
||||
import io.grpc.Metadata;
|
||||
import io.grpc.Status;
|
||||
import io.grpc.internal.GrpcUtil;
|
||||
import io.grpc.internal.ServerStreamListener;
|
||||
|
||||
import io.netty.buffer.EmptyByteBuf;
|
||||
|
|
@ -95,6 +96,7 @@ public class NettyServerStreamTest extends NettyStreamTestBase<NettyServerStream
|
|||
stream.writeHeaders(new Metadata());
|
||||
Http2Headers headers = new DefaultHttp2Headers()
|
||||
.status(Utils.STATUS_OK)
|
||||
.set(GrpcUtil.MESSAGE_ACCEPT_ENCODING, AsciiString.of("gzip"))
|
||||
.set(Utils.CONTENT_TYPE_HEADER, Utils.CONTENT_TYPE_GRPC);
|
||||
verify(writeQueue).enqueue(new SendResponseHeadersCommand(STREAM_ID, headers, false), true);
|
||||
byte[] msg = smallMessage();
|
||||
|
|
|
|||
Loading…
Reference in New Issue