public static void Run(string[] args) { Console.WriteLine("gRPC C# interop testing client"); ClientOptions options = ParseArguments(args); if (options.serverHost == null || !options.serverPort.HasValue || options.testCase == null) { Console.WriteLine("Missing required argument."); Console.WriteLine(); options.help = true; } if (options.help) { Console.WriteLine("Usage:"); Console.WriteLine(" --server_host=HOSTNAME"); Console.WriteLine(" --server_host_override=HOSTNAME"); Console.WriteLine(" --server_port=PORT"); Console.WriteLine(" --test_case=TESTCASE"); Console.WriteLine(" --use_tls=BOOLEAN"); Console.WriteLine(" --use_test_ca=BOOLEAN"); Console.WriteLine(); Environment.Exit(1); } var interopClient = new InteropClient(options); interopClient.Run().Wait(); }
public static void Run(string[] args) { var parserResult = Parser.Default.ParseArguments <ClientOptions>(args) .WithNotParsed(errors => Environment.Exit(1)) .WithParsed(options => { var interopClient = new InteropClient(options); interopClient.Run().Wait(); }); }
public static void Run(string[] args) { var options = new ClientOptions(); if (!Parser.Default.ParseArguments(args, options)) { Environment.Exit(1); } var interopClient = new InteropClient(options); interopClient.Run().Wait(); }
public async Task StatusCodeAndMessage() { await InteropClient.RunStatusCodeAndMessageAsync(client); }
public async Task TimeoutOnSleepingServer() { await InteropClient.RunTimeoutOnSleepingServerAsync(client); }
public async Task CustomMetadata() { await InteropClient.RunCustomMetadataAsync(client); }
public async Task CancelAfterBegin() { await InteropClient.RunCancelAfterBeginAsync(client); }
public async Task CancelAfterFirstResponse() { await InteropClient.RunCancelAfterFirstResponseAsync(client); }
async Task RunTestCaseAsync(TestService.TestServiceClient client, string testCase) { switch (testCase) { case "empty_unary": InteropClient.RunEmptyUnary(client); break; case "large_unary": InteropClient.RunLargeUnary(client); break; case "client_streaming": await InteropClient.RunClientStreamingAsync(client); break; case "server_streaming": await InteropClient.RunServerStreamingAsync(client); break; case "ping_pong": await InteropClient.RunPingPongAsync(client); break; case "empty_stream": await InteropClient.RunEmptyStreamAsync(client); break; case "cancel_after_begin": await InteropClient.RunCancelAfterBeginAsync(client); break; case "cancel_after_first_response": await InteropClient.RunCancelAfterFirstResponseAsync(client); break; case "timeout_on_sleeping_server": await InteropClient.RunTimeoutOnSleepingServerAsync(client); break; case "custom_metadata": await InteropClient.RunCustomMetadataAsync(client); break; case "status_code_and_message": await InteropClient.RunStatusCodeAndMessageAsync(client); break; default: throw new ArgumentException("Unsupported test case " + testCase); } }
public void UnimplementedMethod() { InteropClient.RunUnimplementedMethod(client); }
public void LargeUnary() { InteropClient.RunLargeUnary(client); }
public static void Run(string[] args) { var parserResult = Parser.Default.ParseArguments<ClientOptions>(args) .WithNotParsed(errors => Environment.Exit(1)) .WithParsed(options => { var interopClient = new InteropClient(options); interopClient.Run().Wait(); }); }
public void CancelAfterBegin() { InteropClient.RunCancelAfterBegin(client); }
public void UnimplementedMethod() { InteropClient.RunUnimplementedMethod(UnimplementedService.NewClient(channel)); }
public void ClientStreaming() { InteropClient.RunClientStreaming(client); }
public void EmptyStream() { InteropClient.RunEmptyStream(client); }
public void PingPong() { InteropClient.RunPingPong(client); }
public void ServerStreaming() { InteropClient.RunServerStreaming(client); }
public void CancelAfterFirstResponse() { InteropClient.RunCancelAfterFirstResponse(client); }
public void EmptyUnary() { InteropClient.RunEmptyUnary(client); }
public async Task ClientStreaming() { await InteropClient.RunClientStreamingAsync(client); }
public async Task ServerStreaming() { await InteropClient.RunServerStreamingAsync(client); }
public async Task PingPong() { await InteropClient.RunPingPongAsync(client); }
public async Task EmptyStream() { await InteropClient.RunEmptyStreamAsync(client); }
public void UnimplementedService() { InteropClient.RunUnimplementedService(new UnimplementedService.UnimplementedServiceClient(channel)); }