com.netflix.loadbalancer.ConfigurationBasedServerList Java Examples

The following examples show how to use com.netflix.loadbalancer.ConfigurationBasedServerList. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClientFactoryTest.java    From ribbon with Apache License 2.0 6 votes vote down vote up
@Test
public void testChooseServers() {
	assertNotNull(client);
	DynamicServerListLoadBalancer lb = (DynamicServerListLoadBalancer) client.getLoadBalancer();
	assertTrue(lb.getServerListImpl() instanceof ConfigurationBasedServerList);
	Set<Server> expected = new HashSet<Server>();
	expected.add(new Server("www.example1.come:80"));
	expected.add(new Server("www.example2.come:80"));
	expected.add(new Server("www.example3.come:80"));
	Set<Server> result = new HashSet<Server>();
	for (int i = 0; i <= 10; i++) {
		Server s = lb.chooseServer();
		result.add(s);			
	}
	assertEquals(expected, result);
}
 
Example #2
Source File: NacosRibbonClientPropertyOverrideTests.java    From spring-cloud-alibaba with Apache License 2.0 4 votes vote down vote up
@Test
public void serverListOverridesToTest() {
	ConfigurationBasedServerList.class
			.cast(getLoadBalancer("localApp").getServerListImpl());
}