Java 类io.grpc.NameResolverProvider 实例源码

项目:grpc-java    文件:DnsNameResolverProviderTest.java   
@Test
public void provided() {
  for (NameResolverProvider current
      : InternalServiceProviders.getCandidatesViaServiceLoader(
          NameResolverProvider.class, getClass().getClassLoader())) {
    if (current instanceof DnsNameResolverProvider) {
      return;
    }
  }
  fail("DnsNameResolverProvider not registered");
}
项目:grpc-java    文件:DnsNameResolverProviderTest.java   
@Test
public void providedHardCoded() {
  for (NameResolverProvider current : InternalServiceProviders.getCandidatesViaHardCoded(
      NameResolverProvider.class, InternalNameResolverProvider.HARDCODED_CLASSES)) {
    if (current instanceof DnsNameResolverProvider) {
      return;
    }
  }
  fail("DnsNameResolverProvider not registered");
}