From b36d68417c6d9369507b4fd3bb6dddc5692c6e12 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 11 Mar 2010 08:25:09 -0800 Subject: [PATCH] update to reflect get network errors --- .../BlueLockVCloudComputeServiceLiveTest.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/vcloud/bluelock/src/test/java/org/jclouds/vcloud/bluelock/compute/BlueLockVCloudComputeServiceLiveTest.java b/vcloud/bluelock/src/test/java/org/jclouds/vcloud/bluelock/compute/BlueLockVCloudComputeServiceLiveTest.java index d042142d05..83bcf9a97a 100644 --- a/vcloud/bluelock/src/test/java/org/jclouds/vcloud/bluelock/compute/BlueLockVCloudComputeServiceLiveTest.java +++ b/vcloud/bluelock/src/test/java/org/jclouds/vcloud/bluelock/compute/BlueLockVCloudComputeServiceLiveTest.java @@ -24,6 +24,7 @@ import static org.testng.Assert.assertEquals; import java.util.Map; import org.jclouds.compute.domain.Image; +import org.jclouds.http.HttpResponseException; import org.jclouds.vcloud.VCloudClient; import org.jclouds.vcloud.VCloudMediaType; import org.jclouds.vcloud.compute.VCloudComputeServiceLiveTest; @@ -46,7 +47,7 @@ public class BlueLockVCloudComputeServiceLiveTest extends VCloudComputeServiceLi public void setServiceDefaults() { service = "bluelock"; } - + @Override public void testListImages() throws Exception { super.testListImages(); @@ -95,6 +96,19 @@ public class BlueLockVCloudComputeServiceLiveTest extends VCloudComputeServiceLi // get details on a specific template I know by name bluelockClient.getVAppTemplate(vAppTemplatesByName .get("Ubuntu904Serverx64 1CPUx1GBx20GB a01").getId()); + } + + @Test + public void testErrorWhereAllNetworksReturn403() throws Exception { + VCloudClient bluelockClient = VCloudClient.class.cast(context.getProviderSpecificContext() + .getApi()); + for (String i : new String[] { "1", "2", "3", "4" }) { + try { + bluelockClient.getNetwork(i); + } catch (HttpResponseException e) { + assertEquals(e.getResponse().getStatusCode(), 403); + } + } } }