Search in sources :

Example 1 with RandomLoadBalancer

use of io.fabric8.gateway.loadbalancer.RandomLoadBalancer in project fabric8 by jboss-fuse.

the class LoadBalancerTest method testRandomLoadBalancer.

@Test
public void testRandomLoadBalancer() throws Exception {
    LoadBalancer loadBalancer = new RandomLoadBalancer();
    assertLoadBalancerWorksOnEmptyOrSingletonServices(loadBalancer);
    List<String> results = performRequests(loadBalancer);
    Set<String> set = asSet(results);
    assertTrue("Should have most of the values but was: " + set, set.size() > 1);
}
Also used : RoundRobinLoadBalancer(io.fabric8.gateway.loadbalancer.RoundRobinLoadBalancer) StickyLoadBalancer(io.fabric8.gateway.loadbalancer.StickyLoadBalancer) RandomLoadBalancer(io.fabric8.gateway.loadbalancer.RandomLoadBalancer) LoadBalancer(io.fabric8.gateway.loadbalancer.LoadBalancer) RandomLoadBalancer(io.fabric8.gateway.loadbalancer.RandomLoadBalancer) Test(org.junit.Test)

Aggregations

LoadBalancer (io.fabric8.gateway.loadbalancer.LoadBalancer)1 RandomLoadBalancer (io.fabric8.gateway.loadbalancer.RandomLoadBalancer)1 RoundRobinLoadBalancer (io.fabric8.gateway.loadbalancer.RoundRobinLoadBalancer)1 StickyLoadBalancer (io.fabric8.gateway.loadbalancer.StickyLoadBalancer)1 Test (org.junit.Test)1