@Test public void getClassesViaHardcoded_classesPresent() throws Exception { List<Class<?>> classes = LoadBalancerRegistry.getHardCodedClasses(); assertThat(classes).hasSize(2); assertThat(classes.get(0)).isEqualTo(PickFirstLoadBalancerProvider.class); assertThat(classes.get(1).getName()).isEqualTo( "io.grpc.util.SecretRoundRobinLoadBalancerProvider$Provider"); }
@VisibleForTesting static List<Class<?>> getHardCodedClasses() { ArrayList<Class<?>> list = new ArrayList<Class<?>>(); try { list.add(Class.forName("io.grpc.internal.PickFirstLoadBalancerProvider")); } catch (ClassNotFoundException e) { logger.log(Level.WARNING, "Unable to find pick-first LoadBalancer", e); } try { list.add(Class.forName("io.grpc.util.SecretRoundRobinLoadBalancerProvider$Provider")); } catch (ClassNotFoundException e) { logger.log(Level.FINE, "Unable to find round-robin LoadBalancer", e); } return Collections.unmodifiableList(list); }
LoadBalancerRegistry { @VisibleForTesting static List<Class<?>> getHardCodedClasses() { ArrayList<Class<?>> list = new ArrayList<Class<?>>(); try { list.add(Class.forName("io.grpc.internal.PickFirstLoadBalancerProvider")); } catch (ClassNotFoundException e) { logger.log(Level.WARNING, "Unable to find pick-first LoadBalancer", e); } try { list.add(Class.forName("io.grpc.util.SecretRoundRobinLoadBalancerProvider$Provider")); } catch (ClassNotFoundException e) { logger.log(Level.FINE, "Unable to find round-robin LoadBalancer", e); } return Collections.unmodifiableList(list); } }
LoadBalancerRegistry { @VisibleForTesting static List<Class<?>> getHardCodedClasses() { ArrayList<Class<?>> list = new ArrayList<Class<?>>(); try { list.add(Class.forName("io.grpc.internal.PickFirstLoadBalancerProvider")); } catch (ClassNotFoundException e) { logger.log(Level.WARNING, "Unable to find pick-first LoadBalancer", e); } try { list.add(Class.forName("io.grpc.util.SecretRoundRobinLoadBalancerProvider$Provider")); } catch (ClassNotFoundException e) { logger.log(Level.FINE, "Unable to find round-robin LoadBalancer", e); } return Collections.unmodifiableList(list); } @VisibleForTesting  LoadBalancerRegistry(List<LoadBalancerProvider> providerList); }
LoadBalancerRegistry { @VisibleForTesting static List<Class<?>> getHardCodedClasses() { ArrayList<Class<?>> list = new ArrayList<Class<?>>(); try { list.add(Class.forName("io.grpc.internal.PickFirstLoadBalancerProvider")); } catch (ClassNotFoundException e) { logger.log(Level.WARNING, "Unable to find pick-first LoadBalancer", e); } try { list.add(Class.forName("io.grpc.util.SecretRoundRobinLoadBalancerProvider$Provider")); } catch (ClassNotFoundException e) { logger.log(Level.FINE, "Unable to find round-robin LoadBalancer", e); } return Collections.unmodifiableList(list); } @VisibleForTesting  LoadBalancerRegistry(List<LoadBalancerProvider> providerList); static synchronized LoadBalancerRegistry getDefaultRegistry(); @Nullable LoadBalancerProvider getProvider(String policy); }
LoadBalancerRegistry { @VisibleForTesting static List<Class<?>> getHardCodedClasses() { ArrayList<Class<?>> list = new ArrayList<Class<?>>(); try { list.add(Class.forName("io.grpc.internal.PickFirstLoadBalancerProvider")); } catch (ClassNotFoundException e) { logger.log(Level.WARNING, "Unable to find pick-first LoadBalancer", e); } try { list.add(Class.forName("io.grpc.util.SecretRoundRobinLoadBalancerProvider$Provider")); } catch (ClassNotFoundException e) { logger.log(Level.FINE, "Unable to find round-robin LoadBalancer", e); } return Collections.unmodifiableList(list); } @VisibleForTesting  LoadBalancerRegistry(List<LoadBalancerProvider> providerList); static synchronized LoadBalancerRegistry getDefaultRegistry(); @Nullable LoadBalancerProvider getProvider(String policy);  }