bugfix: allow inconsistent null weights from listNodes

This commit is contained in:
danikov 2011-11-21 10:28:19 +00:00
parent 4a5af1e7a5
commit a1f02ad0bc
1 changed files with 4 additions and 2 deletions
apis/cloudloadbalancers/src/test/java/org/jclouds/cloudloadbalancers/features

View File

@ -89,7 +89,8 @@ public class NodeClientLiveTest extends BaseCloudLoadBalancersClientLiveTest {
assert n.getAddress() != null : n;
assert n.getPort() != -1 : n;
assert n.getStatus() != null : n;
assert n.getWeight() != null : n; //FIXME may fail as can be null (json response doesn't have the attribute)
// until fixed by rackspace... listNodes gives null weight when loadbalancer algorithm isn't weighted
// assert n.getWeight() != null : n;
Node getDetails = client.getNodeClient(lb.getRegion()).getNodeInLoadBalancer(n.getId(), lb.getId());
System.out.println(n.toString());
@ -99,7 +100,8 @@ public class NodeClientLiveTest extends BaseCloudLoadBalancersClientLiveTest {
assertEquals(getDetails.getAddress(), n.getAddress());
assertEquals(getDetails.getPort(), n.getPort());
assertEquals(getDetails.getStatus(), n.getStatus());
assertEquals(getDetails.getWeight(), n.getWeight()); //FIXME disparity between list/get can lead these to mismatch
// see above; getNodes gives valid/default weight which doesn't match
// assertEquals(getDetails.getWeight(), n.getWeight());
} catch (AssertionError e) {
throw new AssertionError(String.format("%s\n%s - %s", e.getMessage(),getDetails, n));
}