Package org.jclouds.elb.domain

Examples of org.jclouds.elb.domain.LoadBalancer$ConcreteBuilder


public class GetLoadBalancerResponseTest extends BaseHandlerTest {

   public void test() {
      InputStream is = getClass().getResourceAsStream("/describe_loadbalancers.xml");

      LoadBalancer expected = expected();

      LoadBalancerHandler handler = injector.getInstance(LoadBalancerHandler.class);
      LoadBalancer result = factory.create(handler).parse(is);

      assertEquals(result, expected);
      assertEquals(result.getCreatedTime(), expected.getCreatedTime());
      assertEquals(result.getDnsName(), expected.getDnsName());
      assertEquals(result.getHealthCheck(), expected.getHealthCheck());
      assertEquals(result.getScheme(), expected.getScheme());
      assertEquals(result.getVPCId(), expected.getVPCId());
   }
View Full Code Here


   @Override
   public LoadBalancerMetadata getLoadBalancer(String id) {
      String[] parts = parseHandle(id);
      String region = parts[0];
      String name = parts[1];
      LoadBalancer input = api.getLoadBalancerApiForRegion(region).get(name);
      return input != null ? converter.apply(new LoadBalancerInRegion(input, region)) : null;
   }
View Full Code Here

               .payload(payloadFromResourceWithContentType("/describe_loadbalancers.xml", "text/xml")).build();

      ELBApi apiWhenExist = requestsSendResponses(
            list, listResponse1, list2, listResponse2);

      LoadBalancer lb1 = new GetLoadBalancerResponseTest().expected().toBuilder().name("my-load-balancer-1").build();
      LoadBalancer lb2 = new GetLoadBalancerResponseTest().expected();
     
      assertEquals(apiWhenExist.getLoadBalancerApi().list().concat().toSet(), ImmutableSet.of(lb1, lb2));
   }
View Full Code Here

      HttpResponse listResponse2 = HttpResponse.builder().statusCode(200)
               .payload(payloadFromResourceWithContentType("/describe_loadbalancers.xml", "text/xml")).build();

      ELBApi apiWhenExist = requestsSendResponses(list, listResponse1, list2, listResponse2);

      LoadBalancer lb1 = new GetLoadBalancerResponseTest().expected().toBuilder().name("my-load-balancer-1").build();
      LoadBalancer lb2 = new GetLoadBalancerResponseTest().expected();
     
      assertEquals(ImmutableSet.copyOf(Iterables.concat(apiWhenExist.getLoadBalancerApiForRegion("eu-west-1").list())), ImmutableSet.of(lb1, lb2));
   }
View Full Code Here

            checkListener(listener);
         }
      }

      if (Iterables.size(response) > 0) {
         LoadBalancer loadBalancer = response.iterator().next();
         Assert.assertEquals(api().get(loadBalancer.getName()), loadBalancer);
      }
   }
View Full Code Here

            checkListener(listener);
         }
      }

      if (Iterables.size(response) > 0) {
         LoadBalancer loadBalancer = response.iterator().next();
         Assert.assertEquals(api().get(loadBalancer.getName()), loadBalancer);
      }

      // Test with a Marker, even if it's null
      response = api().list(ListLoadBalancersOptions.Builder.afterMarker(response.nextMarker().orNull()));
      for (LoadBalancer loadBalancer : response) {
View Full Code Here

            checkListener(listener);
         }
      }

      if (Iterables.size(response) > 0) {
         LoadBalancer loadBalancer = response.iterator().next();
         Assert.assertEquals(api().get(loadBalancer.getName()), loadBalancer);
      }
   }
View Full Code Here

            checkListener(listener);
         }
      }

      if (Iterables.size(response) > 0) {
         LoadBalancer loadBalancer = response.iterator().next();
         Assert.assertEquals(api().get(loadBalancer.getName()), loadBalancer);
      }

      // Test with a Marker, even if it's null
      response = api().list(ListLoadBalancersOptions.Builder.afterMarker(response.nextMarker().orNull()));
      for (LoadBalancer loadBalancer : response) {
View Full Code Here

   @Override
   public LoadBalancerMetadata getLoadBalancer(String id) {
      String[] parts = parseHandle(id);
      String region = parts[0];
      String name = parts[1];
      LoadBalancer input = api.getLoadBalancerApiForRegion(region).get(name);
      return input != null ? converter.apply(new LoadBalancerInRegion(input, region)) : null;
   }
View Full Code Here

               .payload(payloadFromResourceWithContentType("/describe_loadbalancers.xml", "text/xml")).build();

      ELBApi apiWhenExist = requestsSendResponses(
            list, listResponse1, list2, listResponse2);

      LoadBalancer lb1 = new GetLoadBalancerResponseTest().expected().toBuilder().name("my-load-balancer-1").build();
      LoadBalancer lb2 = new GetLoadBalancerResponseTest().expected();
     
      assertEquals(apiWhenExist.getLoadBalancerApi().list().concat().toSet(), ImmutableSet.of(lb1, lb2));
   }
View Full Code Here

TOP

Related Classes of org.jclouds.elb.domain.LoadBalancer$ConcreteBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.