io.grpc.internal.testing.TestUtils#installConscryptIfAvailable ( )源码实例Demo

下面列出了io.grpc.internal.testing.TestUtils#installConscryptIfAvailable ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: grpc-nebula-java   文件: TestServiceServer.java
/** The main application allowing this server to be launched from the command line. */
public static void main(String[] args) throws Exception {
  // Let Netty use Conscrypt if it is available.
  TestUtils.installConscryptIfAvailable();
  final TestServiceServer server = new TestServiceServer();
  server.parseArgs(args);
  if (server.useTls) {
    System.out.println(
        "\nUsing fake CA for TLS certificate. Test clients should expect host\n"
            + "*.test.google.fr and our test CA. For the Java test client binary, use:\n"
            + "--server_host_override=foo.test.google.fr --use_test_ca=true\n");
  }

  Runtime.getRuntime()
      .addShutdownHook(
          new Thread() {
            @Override
            @SuppressWarnings("CatchAndPrintStackTrace")
            public void run() {
              try {
                System.out.println("Shutting down");
                server.stop();
              } catch (Exception e) {
                e.printStackTrace();
              }
            }
          });
  server.start();
  System.out.println("Server started on port " + server.port);
  server.blockUntilShutdown();
}
 
源代码2 项目: grpc-nebula-java   文件: TestServiceClient.java
/**
 * The main application allowing this client to be launched from the command line.
 */
public static void main(String[] args) throws Exception {
  // Let Netty or OkHttp use Conscrypt if it is available.
  TestUtils.installConscryptIfAvailable();
  final TestServiceClient client = new TestServiceClient();
  client.parseArgs(args);
  client.setUp();

  Runtime.getRuntime().addShutdownHook(new Thread() {
    @Override
    @SuppressWarnings("CatchAndPrintStackTrace")
    public void run() {
      System.out.println("Shutting down");
      try {
        client.tearDown();
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  });

  try {
    client.run();
  } finally {
    client.tearDown();
  }
  System.exit(0);
}
 
源代码3 项目: grpc-java   文件: TestServiceServer.java
/** The main application allowing this server to be launched from the command line. */
public static void main(String[] args) throws Exception {
  // Let Netty use Conscrypt if it is available.
  TestUtils.installConscryptIfAvailable();
  final TestServiceServer server = new TestServiceServer();
  server.parseArgs(args);
  if (server.useTls) {
    System.out.println(
        "\nUsing fake CA for TLS certificate. Test clients should expect host\n"
            + "*.test.google.fr and our test CA. For the Java test client binary, use:\n"
            + "--server_host_override=foo.test.google.fr --use_test_ca=true\n");
  }

  Runtime.getRuntime()
      .addShutdownHook(
          new Thread() {
            @Override
            @SuppressWarnings("CatchAndPrintStackTrace")
            public void run() {
              try {
                System.out.println("Shutting down");
                server.stop();
              } catch (Exception e) {
                e.printStackTrace();
              }
            }
          });
  server.start();
  System.out.println("Server started on port " + server.port);
  server.blockUntilShutdown();
}
 
源代码4 项目: grpc-java   文件: TestServiceClient.java
/**
 * The main application allowing this client to be launched from the command line.
 */
public static void main(String[] args) throws Exception {
  // Let Netty or OkHttp use Conscrypt if it is available.
  TestUtils.installConscryptIfAvailable();
  final TestServiceClient client = new TestServiceClient();
  client.parseArgs(args);
  client.setUp();

  Runtime.getRuntime().addShutdownHook(new Thread() {
    @Override
    @SuppressWarnings("CatchAndPrintStackTrace")
    public void run() {
      System.out.println("Shutting down");
      try {
        client.tearDown();
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  });

  try {
    client.run();
  } finally {
    client.tearDown();
  }
  System.exit(0);
}
 
源代码5 项目: grpc-nebula-java   文件: Http2OkHttpTest.java
@BeforeClass
public static void loadConscrypt() throws Exception {
  // Load conscrypt if it is available. Either Conscrypt or Jetty ALPN needs to be available for
  // OkHttp to negotiate.
  TestUtils.installConscryptIfAvailable();
}
 
源代码6 项目: grpc-nebula-java   文件: TlsTest.java
@BeforeClass
public static void loadConscrypt() {
  TestUtils.installConscryptIfAvailable();
}
 
源代码7 项目: grpc-java   文件: Http2OkHttpTest.java
@BeforeClass
public static void loadConscrypt() throws Exception {
  // Load conscrypt if it is available. Either Conscrypt or Jetty ALPN needs to be available for
  // OkHttp to negotiate.
  TestUtils.installConscryptIfAvailable();
}
 
源代码8 项目: grpc-java   文件: TlsTest.java
@BeforeClass
public static void loadConscrypt() {
  TestUtils.installConscryptIfAvailable();
}