Search in sources :

Example 71 with Server

use of com.netflix.loadbalancer.Server in project java-chassis by ServiceComb.

the class TestLoadBalancer method testAddServerException.

@Test
public void testAddServerException() {
    boolean status = true;
    List<Server> newServers = new ArrayList<Server>();
    Server server = Mockito.mock(Server.class);
    newServers.add(server);
    try {
        loadBalancer.addServers(newServers);
    } catch (Exception e) {
        status = false;
        Assert.assertEquals("Not implemented.", e.getMessage());
    }
    Assert.assertFalse(status);
}
Also used : Server(com.netflix.loadbalancer.Server) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 72 with Server

use of com.netflix.loadbalancer.Server in project java-chassis by ServiceComb.

the class TestLoadBalancer method testServerListException.

@Test
public void testServerListException() {
    boolean status = true;
    List<Server> newServers = new ArrayList<Server>();
    Server server = Mockito.mock(Server.class);
    newServers.add(server);
    try {
        loadBalancer.getServerList(ServerGroup.ALL);
    } catch (Exception e) {
        status = false;
        Assert.assertEquals("Not implemented.", e.getMessage());
    }
    Assert.assertFalse(status);
}
Also used : Server(com.netflix.loadbalancer.Server) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

Server (com.netflix.loadbalancer.Server)72 Test (org.junit.Test)56 ByteBuf (io.netty.buffer.ByteBuf)26 MockWebServer (com.google.mockwebserver.MockWebServer)25 BaseLoadBalancer (com.netflix.loadbalancer.BaseLoadBalancer)24 IClientConfig (com.netflix.client.config.IClientConfig)20 AvailabilityFilteringRule (com.netflix.loadbalancer.AvailabilityFilteringRule)19 DummyPing (com.netflix.loadbalancer.DummyPing)18 HttpServer (com.sun.net.httpserver.HttpServer)18 ArrayList (java.util.ArrayList)13 Person (com.netflix.ribbon.test.resources.EmbeddedResources.Person)12 URI (java.net.URI)11 ServerStats (com.netflix.loadbalancer.ServerStats)10 ClientException (com.netflix.client.ClientException)9 HttpClientResponse (io.reactivex.netty.protocol.http.client.HttpClientResponse)9 ExecutionListener (com.netflix.loadbalancer.reactive.ExecutionListener)8 MockResponse (com.google.mockwebserver.MockResponse)7 AbortExecutionException (com.netflix.loadbalancer.reactive.ExecutionListener.AbortExecutionException)6 CountDownLatch (java.util.concurrent.CountDownLatch)6 DynamicServerListLoadBalancer (com.netflix.loadbalancer.DynamicServerListLoadBalancer)5