From 59aa2710cfd45c4f10e2a3267cc2b82cd733c3cf Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Fri, 16 Mar 2012 13:30:43 +0100 Subject: [PATCH] Update ELB API version and fix exception to support ELB in VPC --- .../src/main/java/org/jclouds/elb/ELBAsyncClient.java | 2 +- .../elb/xml/DescribeLoadBalancersResponseHandler.java | 3 +-- .../test/java/org/jclouds/elb/ELBAsyncClientTest.java | 10 +++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/labs/elb/src/main/java/org/jclouds/elb/ELBAsyncClient.java b/labs/elb/src/main/java/org/jclouds/elb/ELBAsyncClient.java index 444fa132c0..1d920e02fa 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/ELBAsyncClient.java +++ b/labs/elb/src/main/java/org/jclouds/elb/ELBAsyncClient.java @@ -62,7 +62,7 @@ import com.google.common.util.concurrent.ListenableFuture; @FormParams(keys = VERSION, values = ELBAsyncClient.VERSION) @VirtualHost public interface ELBAsyncClient { - public static final String VERSION = "2010-07-01"; + public static final String VERSION = "2011-11-15"; // TODO: there are a lot of missing methods diff --git a/labs/elb/src/main/java/org/jclouds/elb/xml/DescribeLoadBalancersResponseHandler.java b/labs/elb/src/main/java/org/jclouds/elb/xml/DescribeLoadBalancersResponseHandler.java index fa75788cb5..e22b9c6965 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/xml/DescribeLoadBalancersResponseHandler.java +++ b/labs/elb/src/main/java/org/jclouds/elb/xml/DescribeLoadBalancersResponseHandler.java @@ -130,10 +130,9 @@ public class DescribeLoadBalancersResponseHandler extends contents.add(elb); } catch (NullPointerException e) { logger.warn(e, "malformed load balancer: %s", localName); + this.elb = null; } - this.elb = null; - } } diff --git a/labs/elb/src/test/java/org/jclouds/elb/ELBAsyncClientTest.java b/labs/elb/src/test/java/org/jclouds/elb/ELBAsyncClientTest.java index 08dc42a790..5964de9948 100644 --- a/labs/elb/src/test/java/org/jclouds/elb/ELBAsyncClientTest.java +++ b/labs/elb/src/test/java/org/jclouds/elb/ELBAsyncClientTest.java @@ -67,7 +67,7 @@ public class ELBAsyncClientTest extends RestClientTest { assertNonPayloadHeadersEqual(request, "Host: elasticloadbalancing.us-east-1.amazonaws.com\n"); assertPayloadEquals( request, - "Version=2010-07-01&Action=CreateLoadBalancer&Listeners.member.1.Protocol=http&LoadBalancerName=name&Listeners.member.1.LoadBalancerPort=80&Listeners.member.1.InstancePort=80", + String.format("Version=%s&Action=CreateLoadBalancer&Listeners.member.1.Protocol=http&LoadBalancerName=name&Listeners.member.1.LoadBalancerPort=80&Listeners.member.1.InstancePort=80", ELBAsyncClient.VERSION), "application/x-www-form-urlencoded", false); assertResponseParserClassEquals(method, request, ParseSax.class); @@ -83,7 +83,7 @@ public class ELBAsyncClientTest extends RestClientTest { assertRequestLineEquals(request, "POST https://elasticloadbalancing.us-east-1.amazonaws.com/ HTTP/1.1"); assertNonPayloadHeadersEqual(request, "Host: elasticloadbalancing.us-east-1.amazonaws.com\n"); - assertPayloadEquals(request, "Version=2010-07-01&Action=DescribeLoadBalancers", + assertPayloadEquals(request, String.format("Version=%s&Action=DescribeLoadBalancers", ELBAsyncClient.VERSION), "application/x-www-form-urlencoded", false); assertResponseParserClassEquals(method, request, ParseSax.class); @@ -101,7 +101,7 @@ public class ELBAsyncClientTest extends RestClientTest { assertNonPayloadHeadersEqual(request, "Host: elasticloadbalancing.us-east-1.amazonaws.com\n"); assertPayloadEquals( request, - "Version=2010-07-01&Action=DescribeLoadBalancers&LoadBalancerNames.member.1=1&LoadBalancerNames.member.2=2", + String.format("Version=%s&Action=DescribeLoadBalancers&LoadBalancerNames.member.1=1&LoadBalancerNames.member.2=2", ELBAsyncClient.VERSION), "application/x-www-form-urlencoded", false); assertResponseParserClassEquals(method, request, ParseSax.class); @@ -121,7 +121,7 @@ public class ELBAsyncClientTest extends RestClientTest { assertNonPayloadHeadersEqual(request, "Host: elasticloadbalancing.us-east-1.amazonaws.com\n"); assertPayloadEquals( request, - "Version=2010-07-01&Action=RegisterInstancesWithLoadBalancer&LoadBalancerName=ReferenceAP1&Instances.member.1.InstanceId=i-6055fa09", + String.format("Version=%s&Action=RegisterInstancesWithLoadBalancer&LoadBalancerName=ReferenceAP1&Instances.member.1.InstanceId=i-6055fa09", ELBAsyncClient.VERSION), "application/x-www-form-urlencoded", false); assertResponseParserClassEquals(method, request, ParseSax.class); @@ -141,7 +141,7 @@ public class ELBAsyncClientTest extends RestClientTest { assertNonPayloadHeadersEqual(request, "Host: elasticloadbalancing.us-east-1.amazonaws.com\n"); assertPayloadEquals( request, - "Version=2010-07-01&Action=DeregisterInstancesFromLoadBalancer&LoadBalancerName=ReferenceAP1&Instances.member.1.InstanceId=i-6055fa09", + String.format("Version=%s&Action=DeregisterInstancesFromLoadBalancer&LoadBalancerName=ReferenceAP1&Instances.member.1.InstanceId=i-6055fa09", ELBAsyncClient.VERSION), "application/x-www-form-urlencoded", false); assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);