fixed UK provider/region not working + regression tests

This commit is contained in:
danikov 2011-11-21 14:58:39 +00:00
parent a1f02ad0bc
commit 76cecee53a
3 changed files with 18 additions and 2 deletions

View File

@ -32,16 +32,20 @@ import java.util.Properties;
import org.jclouds.cloudloadbalancers.CloudLoadBalancersPropertiesBuilder;
import com.google.common.base.Joiner;
/**
* Builds properties used inRackspace Cloud Load Balancers Clients
*
* @author Dan Lo Bianco
*/
public class CloudLoadBalancersUKPropertiesBuilder extends CloudLoadBalancersPropertiesBuilder {
public static String[] REGIONS = {LON};
@Override
protected Properties defaultProperties() {
Properties properties = super.defaultProperties();
properties.setProperty(PROPERTY_REGIONS, "UK");
properties.setProperty(PROPERTY_REGIONS, Joiner.on(',').join(REGIONS));
properties.setProperty(PROPERTY_ENDPOINT, "https://lon.auth.api.rackspacecloud.com");
properties.setProperty(PROPERTY_ISO3166_CODES, "GB-SLG");

View File

@ -18,7 +18,10 @@
*/
package org.jclouds.rackspace.cloudloadbalancers;
import static org.testng.Assert.assertEquals;
import org.jclouds.cloudloadbalancers.features.LoadBalancerClientLiveTest;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;
/**
@ -30,4 +33,11 @@ public class CloudLoadBalancersUKLoadBalancerClientLiveTest extends LoadBalancer
public CloudLoadBalancersUKLoadBalancerClientLiveTest() {
provider = "cloudloadbalancers-uk";
}
@BeforeGroups(groups = "live")
protected void setup() {
super.setup();
assertEquals(client.getConfiguredRegions().size(),
CloudLoadBalancersUKPropertiesBuilder.REGIONS.length);
}
}

View File

@ -41,11 +41,13 @@ import com.google.common.base.Joiner;
* @author Adrian Cole
*/
public class CloudLoadBalancersUSPropertiesBuilder extends CloudLoadBalancersPropertiesBuilder {
public static String[] REGIONS = {ORD, DFW};
@Override
protected Properties defaultProperties() {
Properties properties = super.defaultProperties();
properties.setProperty(PROPERTY_ENDPOINT, "https://auth.api.rackspacecloud.com");
properties.setProperty(PROPERTY_REGIONS, Joiner.on(',').join(ORD, DFW));
properties.setProperty(PROPERTY_REGIONS, Joiner.on(',').join(REGIONS));
properties.setProperty(PROPERTY_ISO3166_CODES, "US-IL,US-TX");
properties.setProperty(PROPERTY_REGION + "." + ORD + "." + ISO3166_CODES, "US-IL");