Beispiel #1
0
        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();
        }
Beispiel #2
0
 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();
     });
 }
Beispiel #3
0
        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();
        }
Beispiel #4
0
 public async Task StatusCodeAndMessage()
 {
     await InteropClient.RunStatusCodeAndMessageAsync(client);
 }
Beispiel #5
0
 public async Task TimeoutOnSleepingServer()
 {
     await InteropClient.RunTimeoutOnSleepingServerAsync(client);
 }
Beispiel #6
0
 public async Task CustomMetadata()
 {
     await InteropClient.RunCustomMetadataAsync(client);
 }
Beispiel #7
0
 public async Task CancelAfterBegin()
 {
     await InteropClient.RunCancelAfterBeginAsync(client);
 }
Beispiel #8
0
 public async Task CancelAfterFirstResponse()
 {
     await InteropClient.RunCancelAfterFirstResponseAsync(client);
 }
Beispiel #9
0
        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);
 }
Beispiel #11
0
 public void LargeUnary()
 {
     InteropClient.RunLargeUnary(client);
 }
Beispiel #12
0
 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();
         });
 }
Beispiel #13
0
 public void CancelAfterBegin()
 {
     InteropClient.RunCancelAfterBegin(client);
 }
Beispiel #14
0
 public void UnimplementedMethod()
 {
     InteropClient.RunUnimplementedMethod(UnimplementedService.NewClient(channel));
 }
Beispiel #15
0
 public void ClientStreaming()
 {
     InteropClient.RunClientStreaming(client);
 }
Beispiel #16
0
 public void EmptyStream()
 {
     InteropClient.RunEmptyStream(client);
 }
Beispiel #17
0
 public void PingPong()
 {
     InteropClient.RunPingPong(client);
 }
Beispiel #18
0
 public void ServerStreaming()
 {
     InteropClient.RunServerStreaming(client);
 }
Beispiel #19
0
 public void CancelAfterFirstResponse()
 {
     InteropClient.RunCancelAfterFirstResponse(client);
 }
Beispiel #20
0
 public void EmptyUnary()
 {
     InteropClient.RunEmptyUnary(client);
 }
        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();
        }
Beispiel #22
0
 public async Task ClientStreaming()
 {
     await InteropClient.RunClientStreamingAsync(client);
 }
Beispiel #23
0
 public async Task ServerStreaming()
 {
     await InteropClient.RunServerStreamingAsync(client);
 }
Beispiel #24
0
 public async Task PingPong()
 {
     await InteropClient.RunPingPongAsync(client);
 }
Beispiel #25
0
 public async Task EmptyStream()
 {
     await InteropClient.RunEmptyStreamAsync(client);
 }
Beispiel #26
0
        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 void UnimplementedService()
 {
     InteropClient.RunUnimplementedService(new UnimplementedService.UnimplementedServiceClient(channel));
 }