InteropTest.java
Go to the documentation of this file.
1 /*
2  * Copyright 2018, gRPC Authors All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package io.grpc.interop.cpp;
18 
19 import static junit.framework.Assert.assertTrue;
20 
21 import android.content.Context;
22 import android.support.test.InstrumentationRegistry;
23 import android.support.test.runner.AndroidJUnit4;
24 import java.io.File;
25 import java.io.FileOutputStream;
26 import java.io.InputStream;
27 import java.io.OutputStream;
28 import org.junit.Before;
29 import org.junit.Test;
30 import org.junit.runner.RunWith;
31 
32 @RunWith(AndroidJUnit4.class)
33 public class InteropTest {
34  private String host;
35  private int port;
36  private boolean useTls;
37 
38  @Before
39  public void setUp() throws Exception {
40  host =
41  InstrumentationRegistry.getArguments()
42  .getString("server_host", "grpc-test.sandbox.googleapis.com");
43  port = Integer.parseInt(InstrumentationRegistry.getArguments().getString("server_port", "443"));
44  useTls =
45  Boolean.parseBoolean(InstrumentationRegistry.getArguments().getString("use_tls", "true"));
46  }
47 
48  @Test
49  public void emptyUnary() {
50  assertTrue(InteropActivity.doEmpty(host, port, useTls));
51  }
52 
53  @Test
54  public void largeUnary() {
55  assertTrue(InteropActivity.doLargeUnary(host, port, useTls));
56  }
57 
58  @Test
59  public void emptyStream() {
60  assertTrue(InteropActivity.doEmptyStream(host, port, useTls));
61  }
62 
63  @Test
64  public void requestStreaming() {
65  assertTrue(InteropActivity.doRequestStreaming(host, port, useTls));
66  }
67 
68  @Test
69  public void responseStreaming() {
70  assertTrue(InteropActivity.doResponseStreaming(host, port, useTls));
71  }
72 
73  @Test
74  public void pingPong() {
75  assertTrue(InteropActivity.doPingPong(host, port, useTls));
76  }
77 }
Test
void Test(StringPiece pattern, const RE2::Options &options, StringPiece text)
Definition: bloaty/third_party/re2/re2/fuzzing/re2_fuzzer.cc:20
io.grpc.interop.cpp.InteropTest.emptyStream
void emptyStream()
Definition: InteropTest.java:59
io.grpc.interop.cpp.InteropActivity.doEmptyStream
static native boolean doEmptyStream(String host, int port, boolean useTls)
io.grpc.interop.cpp.InteropTest.requestStreaming
void requestStreaming()
Definition: InteropTest.java:64
io.grpc.interop.cpp.InteropTest.useTls
boolean useTls
Definition: InteropTest.java:36
io.grpc.interop.cpp.InteropTest.pingPong
void pingPong()
Definition: InteropTest.java:74
io.grpc.interop.cpp.InteropTest
Definition: InteropTest.java:33
io.grpc.interop.cpp.InteropTest.largeUnary
void largeUnary()
Definition: InteropTest.java:54
io.grpc.interop.cpp.InteropTest.host
String host
Definition: InteropTest.java:34
io.grpc.interop.cpp.InteropActivity.doEmpty
static native boolean doEmpty(String host, int port, boolean useTls)
tests.unit._exit_scenarios.port
port
Definition: _exit_scenarios.py:179
java
io.grpc.interop.cpp.InteropActivity
Definition: InteropActivity.java:32
io.grpc.interop.cpp.InteropTest.setUp
void setUp()
Definition: InteropTest.java:39
io.grpc.interop.cpp.InteropActivity.doResponseStreaming
static native boolean doResponseStreaming(String host, int port, boolean useTls)
io.grpc.interop.cpp.InteropTest.port
int port
Definition: InteropTest.java:35
io.grpc.interop.cpp.InteropActivity.doLargeUnary
static native boolean doLargeUnary(String host, int port, boolean useTls)
io.grpc.interop.cpp.InteropActivity.doRequestStreaming
static native boolean doRequestStreaming(String host, int port, boolean useTls)
io.grpc.interop.cpp.InteropTest.responseStreaming
void responseStreaming()
Definition: InteropTest.java:69
io.grpc.interop.cpp.InteropTest.emptyUnary
void emptyUnary()
Definition: InteropTest.java:49
io.grpc.interop.cpp.InteropActivity.doPingPong
void doPingPong(View view)
Definition: InteropActivity.java:64


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:22