You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2014/03/31 09:13:51 UTC

[38/52] [partial] Moving jclouds dependencies to accurate parent directories

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApiExpectTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApiExpectTest.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApiExpectTest.java
new file mode 100644
index 0000000..4f0ac08
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApiExpectTest.java
@@ -0,0 +1,179 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URI;
+
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.date.DateService;
+import org.jclouds.date.internal.SimpleDateFormatDateService;
+import org.jclouds.http.HttpResponse;
+import org.jclouds.openstack.nova.v2_0.domain.HostAggregate;
+import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+
+/**
+ * Tests HostAggregateApi guice wiring and parsing
+ *
+ * @author Adam Lowe
+ */
+@Test(groups = "unit", testName = "HostAggregateApiExpectTest")
+public class HostAggregateApiExpectTest extends BaseNovaApiExpectTest {
+   private DateService dateService = new SimpleDateFormatDateService();
+
+   public void testList() {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-aggregates");
+      HostAggregateApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).build(),
+            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/host_aggregate_list.json")).build())
+            .getHostAggregateExtensionForZone("az-1.region-a.geo-1").get();
+
+      HostAggregate result = Iterables.getOnlyElement(api.list());
+      assertEquals(result, exampleHostAggregate());
+   }
+
+   public void testGet() {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-aggregates/1");
+      HostAggregateApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).build(),
+            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/host_aggregate_with_host_details.json")).build())
+            .getHostAggregateExtensionForZone("az-1.region-a.geo-1").get();
+
+      assertEquals(api.get("1"), exampleHostAggregateWithHost());
+   }
+
+   public void testGetFailNotFound() {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-aggregates/1");
+      HostAggregateApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).build(),
+            HttpResponse.builder().statusCode(404).build()).getHostAggregateExtensionForZone("az-1.region-a.geo-1").get();
+
+      assertNull(api.get("1"));
+   }
+
+   public void testCreateAggregate() {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-aggregates");
+      HostAggregateApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).method("POST")
+                  .payload(payloadFromStringWithContentType("{\"aggregate\":{\"name\":\"ubuntu1\",\"availability_zone\":\"nova\"}}", MediaType.APPLICATION_JSON))
+                  .endpoint(endpoint).build(),
+            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/host_aggregate_details.json")).build())
+            .getHostAggregateExtensionForZone("az-1.region-a.geo-1").get();
+
+      assertEquals(api.createInAvailabilityZone("ubuntu1", "nova"), exampleHostAggregate());
+   }
+
+   public void testDeleteAggregate() {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-aggregates/1");
+      HostAggregateApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).method("DELETE").build(),
+            HttpResponse.builder().statusCode(200).build()).getHostAggregateExtensionForZone("az-1.region-a.geo-1").get();
+
+      assertTrue(api.delete("1"));
+   }
+
+   public void testDeleteAggregateFailNotFound() {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-aggregates/1");
+      HostAggregateApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).method("DELETE").build(),
+            HttpResponse.builder().statusCode(404).build()).getHostAggregateExtensionForZone("az-1.region-a.geo-1").get();
+
+      assertFalse(api.delete("1"));
+   }
+
+   public void testUpdateName() {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-aggregates/1");
+      HostAggregateApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).method("POST")
+                  .payload(payloadFromStringWithContentType("{\"aggregate\":{\"name\":\"newaggregatename\"}}", MediaType.APPLICATION_JSON)).build(),
+            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/host_aggregate_details.json")).build()).getHostAggregateExtensionForZone("az-1.region-a.geo-1").get();
+
+      assertEquals(api.updateName("1", "newaggregatename"), exampleHostAggregate());
+   }
+
+   public void testUpdateAvailabilityZone() {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-aggregates/1");
+      HostAggregateApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).method("POST")
+                  .payload(payloadFromStringWithContentType("{\"aggregate\":{\"availability_zone\":\"zone1\"}}", MediaType.APPLICATION_JSON)).build(),
+            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/host_aggregate_details.json")).build()).getHostAggregateExtensionForZone("az-1.region-a.geo-1").get();
+
+      assertEquals(api.updateAvailabilityZone("1", "zone1"), exampleHostAggregate());
+   }
+
+   public void testAddHost() {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-aggregates/1/action");
+      HostAggregateApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).method("POST")
+                  .payload(payloadFromStringWithContentType("{\"add_host\":{\"host\":\"ubuntu\"}}", MediaType.APPLICATION_JSON)).build(),
+            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/host_aggregate_details.json")).build()).getHostAggregateExtensionForZone("az-1.region-a.geo-1").get();
+
+      assertEquals(api.addHost("1", "ubuntu"), exampleHostAggregate());
+   }
+
+   public void testRemoveHost() {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-aggregates/1/action");
+      HostAggregateApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).method("POST")
+                  .payload(payloadFromStringWithContentType("{\"remove_host\":{\"host\":\"ubuntu\"}}", MediaType.APPLICATION_JSON)).build(),
+            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/host_aggregate_details.json")).build()).getHostAggregateExtensionForZone("az-1.region-a.geo-1").get();
+
+      assertEquals(api.removeHost("1", "ubuntu"), exampleHostAggregate());
+   }
+
+
+   public void testSetMetadata() {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-aggregates/1/action");
+      HostAggregateApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).method("POST")
+                  .payload(payloadFromStringWithContentType("{\"set_metadata\":{\"metadata\":{\"mykey\":\"some value or other\"}}}", MediaType.APPLICATION_JSON)).build(),
+            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/host_aggregate_details.json")).build()).getHostAggregateExtensionForZone("az-1.region-a.geo-1").get();
+
+      assertEquals(api.setMetadata("1", ImmutableMap.of("mykey", "some value or other")), exampleHostAggregate());
+   }
+
+   public HostAggregate exampleHostAggregate() {
+      return HostAggregate.builder().name("jclouds-test-a").availabilityZone("nova")
+            .created(dateService.iso8601SecondsDateParse("2012-05-11 11:40:17"))
+            .updated(dateService.iso8601SecondsDateParse("2012-05-11 11:46:44"))
+            .state("created").id("1").metadata(ImmutableMap.of("somekey", "somevalue", "anotherkey", "another val")).build();
+   }
+
+   public HostAggregate exampleHostAggregateWithHost() {
+      return exampleHostAggregate().toBuilder().hosts("ubuntu").build();
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApiLiveTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApiLiveTest.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApiLiveTest.java
new file mode 100644
index 0000000..5a237db
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApiLiveTest.java
@@ -0,0 +1,148 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.jclouds.openstack.nova.v2_0.domain.Host;
+import org.jclouds.openstack.nova.v2_0.domain.HostAggregate;
+import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiLiveTest;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+
+/**
+ * Tests behavior of AggregateApi
+ *
+ * @author Adam Lowe
+ */
+@Test(groups = "live", testName = "AggregateApiLiveTest", singleThreaded = true)
+public class HostAggregateApiLiveTest extends BaseNovaApiLiveTest {
+   private Optional<? extends HostAggregateApi> apiOption;
+   private Optional<? extends HostAdministrationApi> hostAdminOption;
+
+   private HostAggregate testAggregate;
+
+   @BeforeClass(groups = {"integration", "live"})
+   @Override
+   public void setup() {
+      super.setup();
+      String zone = Iterables.getLast(api.getConfiguredZones(), "nova");
+      apiOption = api.getHostAggregateExtensionForZone(zone);
+      hostAdminOption = api.getHostAdministrationExtensionForZone(zone);
+   }
+
+   @AfterClass(groups = { "integration", "live" })
+   @Override
+   protected void tearDown() {
+      if (testAggregate != null) {
+         assertTrue(apiOption.get().delete(testAggregate.getId()));
+      }
+      super.tearDown();
+   }
+
+   public void testCreateAggregate() {
+      if (apiOption.isPresent()) {
+         // TODO assuming "nova" availability zone is present
+         testAggregate = apiOption.get().createInAvailabilityZone("jclouds-test-a", "nova");
+      }
+   }
+
+   @Test(dependsOnMethods = "testCreateAggregate")
+   public void testListAndGetAggregate() {
+      if (apiOption.isPresent()) {
+         HostAggregateApi api = apiOption.get();
+         Set<? extends HostAggregate> aggregates = api.list().toSet();
+         for (HostAggregate aggregate : aggregates) {
+            assertNotNull(aggregate.getId());
+            assertNotNull(aggregate.getName());
+            assertNotNull(aggregate.getAvailabilityZone());
+
+            HostAggregate details = api.get(aggregate.getId());
+            assertEquals(details.getId(), aggregate.getId());
+            assertEquals(details.getName(), aggregate.getName());
+            assertEquals(details.getAvailabilityZone(), aggregate.getAvailabilityZone());
+            assertEquals(details.getHosts(), aggregate.getHosts());
+         }
+      }
+   }
+
+   @Test(dependsOnMethods = "testCreateAggregate")
+   public void testModifyMetadata() {
+      if (apiOption.isPresent()) {
+         HostAggregateApi api = apiOption.get();
+         for (Map<String, String> theMetaData : ImmutableSet.of(
+               ImmutableMap.of("somekey", "somevalue"),
+               ImmutableMap.of("somekey", "some other value", "anotherkey", "another val")
+         )) {
+            // Apply changes
+            HostAggregate details = api.setMetadata(testAggregate.getId(), theMetaData);
+            
+            //  bug in openstack - metadata values are never removed, so we just checking what we've set
+            for (Map.Entry<String, String> entry : theMetaData.entrySet()) {
+               assertEquals(details.getMetadata().get(entry.getKey()), entry.getValue());
+            }
+
+            // Re-fetch to double-check
+            details = api.get(testAggregate.getId());
+            for (Map.Entry<String, String> entry : theMetaData.entrySet()) {
+               assertEquals(details.getMetadata().get(entry.getKey()), entry.getValue());
+            }
+         }
+      }
+   }
+
+   // Note the host will be added, but cannot remove it til
+   @Test(enabled = false, dependsOnMethods = "testCreateAggregate")
+   public void testModifyHosts() {
+      if (apiOption.isPresent() && hostAdminOption.isPresent()) {
+         HostAggregateApi api = apiOption.get();
+         Host host = Iterables.getFirst(hostAdminOption.get().list(), null);
+         assertNotNull(host);
+
+         String host_id = host.getName();
+         assertNotNull(host_id);
+         HostAggregate details;
+
+         try {
+            details = api.addHost(testAggregate.getId(), host_id);
+
+            assertEquals(details.getHosts(), ImmutableSet.of(host_id));
+
+            // re-fetch to double-check
+            details = api.get(testAggregate.getId());
+            assertEquals(details.getHosts(), ImmutableSet.of(host_id));
+
+            // TODO wait until status of aggregate isn't CHANGING (hostAdministration.shutdown?)
+         } finally {
+            details = api.removeHost(testAggregate.getId(), host_id);
+         }
+
+         assertEquals(details.getHosts(), ImmutableSet.of());
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiExpectTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiExpectTest.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiExpectTest.java
new file mode 100644
index 0000000..55f0d58
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiExpectTest.java
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
+import org.jclouds.http.HttpRequest;
+import org.jclouds.http.HttpResponse;
+import org.jclouds.openstack.nova.v2_0.NovaApi;
+import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest;
+import org.jclouds.openstack.nova.v2_0.parse.ParseKeyPairListTest;
+import org.jclouds.openstack.nova.v2_0.parse.ParseKeyPairTest;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Tests annotation parsing of {@code KeyPairAsyncApi}
+ * 
+ * @author Michael Arnold
+ */
+@Test(groups = "unit", testName = "KeyPairApiExpectTest")
+public class KeyPairApiExpectTest extends BaseNovaApiExpectTest {
+
+   public void testListKeyPairsWhenResponseIs2xx() throws Exception {
+      HttpRequest list = HttpRequest
+            .builder()
+            .method("GET")
+            .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-keypairs")
+            .addHeader("Accept", "application/json")
+            .addHeader("X-Auth-Token", authToken).build();
+
+      HttpResponse listResponse = HttpResponse.builder().statusCode(200)
+            .payload(payloadFromResource("/keypair_list.json")).build();
+
+      NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, list, listResponse);
+
+      assertEquals(apiWhenServersExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1", "az-2.region-a.geo-1", "az-3.region-a.geo-1"));
+
+      // NOTE this required a change to the KeyPair domain object toString method
+      assertEquals(apiWhenServersExist.getKeyPairExtensionForZone("az-1.region-a.geo-1").get().list().toString(),
+            new ParseKeyPairListTest().expected().toString());
+   }
+
+   public void testListKeyPairsWhenResponseIs404() throws Exception {
+      HttpRequest list = HttpRequest
+            .builder()
+            .method("GET")
+            .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-keypairs")
+            .addHeader("Accept", "application/json")
+            .addHeader("X-Auth-Token", authToken).build();
+
+      HttpResponse listResponse = HttpResponse.builder().statusCode(404).build();
+
+      NovaApi apiWhenNoServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, list, listResponse);
+
+      assertTrue(apiWhenNoServersExist.getKeyPairExtensionForZone("az-1.region-a.geo-1").get().list().isEmpty());
+
+   }
+
+   public void testCreateKeyPair() throws Exception {
+      HttpRequest create = HttpRequest
+            .builder()
+            .method("POST")
+            .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-keypairs")
+            .addHeader("Accept", "application/json")
+            .addHeader("X-Auth-Token", authToken)
+            .payload(payloadFromStringWithContentType("{\"keypair\":{\"name\":\"testkeypair\"}}", "application/json"))
+            .build();
+
+      HttpResponse createResponse = HttpResponse.builder().statusCode(200)
+            .payload(payloadFromResource("/keypair_created.json")).build();
+
+      NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, create, createResponse);
+
+      assertEquals(apiWhenServersExist.getKeyPairExtensionForZone("az-1.region-a.geo-1").get().create("testkeypair")
+            .toString(), new ParseKeyPairTest().expected().toString());
+
+   }
+
+   public void testCreateKeyPairWithPublicKey() throws Exception {
+      HttpRequest create = HttpRequest
+            .builder()
+            .method("POST")
+            .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-keypairs")
+            .addHeader("Accept", "application/json")
+            .addHeader("X-Auth-Token", authToken)
+            .payload(
+                  payloadFromStringWithContentType(
+                        "{\"keypair\":{\"name\":\"testkeypair\",\"public_key\":\"ssh-rsa AAAXB3NzaC1yc2EAAAADAQABAAAAgQDFNyGjgs6c9akgmZ2ou/fJf7Pdrc23hC95/gM/33OrG4GZABACE4DTioa/PGN+7rHv9YUavUCtXrWayhGniKq/wCuI5fo5TO4AmDNv7/sCGHIHFumADSIoLx0vFhGJIetXEWxL9r0lfFC7//6yZM2W3KcGjbMtlPXqBT9K9PzdyQ== nova@nv-aw2az1-api0001\n\"}}",
+                        "application/json")).build();
+
+      HttpResponse createResponse = HttpResponse.builder().statusCode(200)
+            .payload(payloadFromResource("/keypair_created.json")).build();
+
+      NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, create, createResponse);
+
+      assertEquals(
+            apiWhenServersExist
+                  .getKeyPairExtensionForZone("az-1.region-a.geo-1")
+                  .get()
+                  .createWithPublicKey(
+                        "testkeypair",
+                        "ssh-rsa AAAXB3NzaC1yc2EAAAADAQABAAAAgQDFNyGjgs6c9akgmZ2ou/fJf7Pdrc23hC95/gM/33OrG4GZABACE4DTioa/PGN+7rHv9YUavUCtXrWayhGniKq/wCuI5fo5TO4AmDNv7/sCGHIHFumADSIoLx0vFhGJIetXEWxL9r0lfFC7//6yZM2W3KcGjbMtlPXqBT9K9PzdyQ== nova@nv-aw2az1-api0001\n")
+                  .toString(), new ParseKeyPairTest().expected().toString());
+   }
+
+   public void testDeleteKeyPair() throws Exception {
+      HttpRequest delete = HttpRequest
+            .builder()
+            .method("DELETE")
+            .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-keypairs/testkeypair")
+            .addHeader("Accept", "*/*")
+            .addHeader("X-Auth-Token", authToken).build();
+
+      HttpResponse deleteResponse = HttpResponse.builder().statusCode(202).build();
+
+      NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, delete, deleteResponse);
+
+      assertTrue(apiWhenServersExist.getKeyPairExtensionForZone("az-1.region-a.geo-1").get().delete("testkeypair"));
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiLiveTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiLiveTest.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiLiveTest.java
new file mode 100644
index 0000000..da2e1e4
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiLiveTest.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+import static org.testng.Assert.assertNotNull;
+
+import org.jclouds.openstack.nova.v2_0.domain.KeyPair;
+import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiLiveTest;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.FluentIterable;
+
+/**
+ * Tests behavior of {@code KeyPairApi}
+ * 
+ * @author Michael Arnold
+ */
+@Test(groups = "live", testName = "KeyPairApiLiveTest")
+public class KeyPairApiLiveTest extends BaseNovaApiLiveTest {
+
+   public void testListKeyPairs() throws Exception {
+      for (String zoneId : api.getConfiguredZones()) {
+         KeyPairApi keyPairApi = api.getKeyPairExtensionForZone(zoneId).get();
+         FluentIterable<? extends KeyPair> keyPairsList = keyPairApi.list();
+         assertNotNull(keyPairsList);
+      }
+   }
+
+   public void testCreateAndDeleteKeyPair() throws Exception {
+      final String KEYPAIR_NAME = "testkp";
+      for (String zoneId : api.getConfiguredZones()) {
+         KeyPairApi keyPairApi = api.getKeyPairExtensionForZone(zoneId).get();
+         KeyPair keyPair = null;
+         try {
+            keyPair = keyPairApi.create(KEYPAIR_NAME);
+            assertNotNull(keyPair);
+         } finally {
+            if (keyPair != null) {
+               keyPairApi.delete(KEYPAIR_NAME);
+            }
+         }
+      }
+   }
+
+   public void testCreateAndDeleteKeyPairWithPublicKey() throws Exception {
+      final String KEYPAIR_NAME = "testkp";
+      final String PUBLIC_KEY = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCrrBREFxz3002l1HuXz0+UOdJQ/mOYD5DiJwwB/TOybwIKQJPOxJWA9gBoo4k9dthTKBTaEYbzrll7iZcp59E80S6mNiAr3mUgi+x5Y8uyXeJ2Ws+h6peVyFVUu9epkwpcTd1GVfdcVWsTajwDz9+lxCDhl0RZKDFoT0scTxbj/w== nova@nv-aw2az2-api0002";
+
+      for (String zoneId : api.getConfiguredZones()) {
+         KeyPairApi keyPairApi = api.getKeyPairExtensionForZone(zoneId).get();
+         KeyPair keyPair = null;
+         try {
+            keyPair = keyPairApi.createWithPublicKey(KEYPAIR_NAME, PUBLIC_KEY);
+            assertNotNull(keyPair);
+         } finally {
+            if (keyPair != null) {
+               keyPairApi.delete(KEYPAIR_NAME);
+            }
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApiExpectTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApiExpectTest.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApiExpectTest.java
new file mode 100644
index 0000000..79e6747
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApiExpectTest.java
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URI;
+
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.http.HttpRequest;
+import org.jclouds.http.HttpResponse;
+import org.jclouds.openstack.nova.v2_0.domain.Quota;
+import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest;
+import org.jclouds.rest.ResourceNotFoundException;
+import org.testng.annotations.Test;
+
+/**
+ * Tests HostAdministrationApi guice wiring and parsing
+ *
+ * @author Adam Lowe
+ */
+@Test(groups = "unit", testName = "QuotaApiExpectTest")
+public class QuotaApiExpectTest extends BaseNovaApiExpectTest {
+
+   public void testGetQuotas() throws Exception {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-quota-sets/demo");
+      QuotaApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).build(),
+            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/quotas.json")).build()).getQuotaExtensionForZone("az-1.region-a.geo-1").get();
+
+      assertEquals(api.getByTenant("demo"), getTestQuotas());
+   }
+
+   public void testGetQuotasFailsTenantNotFound() throws Exception {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-quota-sets/demo");
+      QuotaApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).build(),
+            HttpResponse.builder().statusCode(404).build()).getQuotaExtensionForZone("az-1.region-a.geo-1").get();
+      assertNull(api.getByTenant("demo"));
+   }
+
+   public void testGetDefaultQuotas() throws Exception {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-quota-sets/demo/defaults");
+      QuotaApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).build(),
+            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/quotas.json")).build()).getQuotaExtensionForZone("az-1.region-a.geo-1").get();
+
+      assertEquals(api.getDefaultsForTenant("demo"), getTestQuotas());
+   }
+
+   public void testGetDefaultQuotasFailsTenantNotFound() throws Exception {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-quota-sets/demo/defaults");
+      QuotaApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).build(),
+            HttpResponse.builder().statusCode(404).build()).getQuotaExtensionForZone("az-1.region-a.geo-1").get();
+      assertNull(api.getDefaultsForTenant("demo"));
+   }
+
+
+   public void testUpdateQuotas() throws Exception {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-quota-sets/demo");
+      QuotaApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            HttpRequest.builder().endpoint(endpoint).method("PUT")
+                  .addHeader("X-Auth-Token", authToken)
+                  .payload(payloadFromResourceWithContentType("/quotas.json", MediaType.APPLICATION_JSON))
+                  .build(),
+            HttpResponse.builder().statusCode(200).build()).getQuotaExtensionForZone("az-1.region-a.geo-1").get();
+
+      assertTrue(api.updateQuotaOfTenant(getTestQuotas(), "demo"));
+   }
+
+   @Test(expectedExceptions = ResourceNotFoundException.class)
+   public void testUpdateQuotasFailsNotFound() throws Exception {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-quota-sets/demo");
+      QuotaApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            HttpRequest.builder().endpoint(endpoint).method("PUT")
+                  .addHeader("X-Auth-Token", authToken)
+                  .payload(payloadFromResourceWithContentType("/quotas.json", MediaType.APPLICATION_JSON))
+                  .build(),
+            HttpResponse.builder().statusCode(404).build()).getQuotaExtensionForZone("az-1.region-a.geo-1").get();
+
+      api.updateQuotaOfTenant(getTestQuotas(), "demo");
+   }
+
+   public static Quota getTestQuotas() {
+      return Quota.builder()
+            .metadataItems(128)
+            .injectedFileContentBytes(10240)
+            .injectedFiles(5)
+            .gigabytes(1000)
+            .ram(51200)
+            .floatingIps(10)
+            .securityGroups(10)
+            .securityGroupRules(20)
+            .instances(10)
+            .keyPairs(100)
+            .volumes(10)
+            .cores(20)
+            .id("demo").build();
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApiLiveTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApiLiveTest.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApiLiveTest.java
new file mode 100644
index 0000000..1408223
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApiLiveTest.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
+import org.jclouds.openstack.nova.v2_0.domain.Quota;
+import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiLiveTest;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Optional;
+import com.google.common.collect.Iterables;
+
+/**
+ * Tests behavior of QuotaApi
+ *
+ * @author Adam Lowe
+ */
+@Test(groups = "live", testName = "QuotaApiLiveTest", singleThreaded = true)
+public class QuotaApiLiveTest extends BaseNovaApiLiveTest {
+   private Optional<? extends QuotaApi> apiOption;
+   private String tenant;
+
+   @BeforeClass(groups = {"integration", "live"})
+   @Override
+   public void setup() {
+      super.setup();
+      tenant = identity.split(":")[0];
+      String zone = Iterables.getLast(api.getConfiguredZones(), "nova");
+      apiOption = api.getQuotaExtensionForZone(zone);
+   }
+
+   public void testGetQuotasForCurrentTenant() {
+      if (apiOption.isPresent()) {
+         Quota quota = apiOption.get().getByTenant(tenant);
+         assertQuotasIsValid(quota);
+      }
+   }
+
+   public void testGetDefaultQuotasForCurrentTenant() {
+      if (apiOption.isPresent()) {
+         Quota quota = apiOption.get().getDefaultsForTenant(tenant);
+         assertQuotasIsValid(quota);
+      }
+   }
+
+   public void testUpdateQuotasOfCurrentTenantThenReset() {
+      if (apiOption.isPresent()) {
+         QuotaApi api = apiOption.get();
+         Quota before = api.getByTenant(tenant);
+         assertQuotasIsValid(before);
+
+         Quota modified = before.toBuilder()
+               .cores(before.getCores() - 1)
+               .instances(before.getInstances() - 1)
+               .metadataItems(before.getMetadatas() - 1)
+               .ram(before.getRam() - 1)
+               .volumes(before.getVolumes() - 1)
+               .build();
+
+         assertTrue(api.updateQuotaOfTenant(modified, tenant));
+
+         assertEquals(api.getByTenant(tenant), modified);
+
+         assertTrue(api.updateQuotaOfTenant(before, tenant));
+
+         assertEquals(api.getByTenant(tenant), before);
+      }
+   }
+
+   protected void assertQuotasIsValid(Quota quota) {
+      assertTrue(quota.getCores() > 0);
+      assertTrue(quota.getFloatingIps() >= 0);
+      assertTrue(quota.getGigabytes() > 0);
+      assertTrue(quota.getInjectedFileContentBytes() >= 0);
+      assertTrue(quota.getInjectedFiles() >= 0);
+      assertTrue(quota.getInstances() > 0);
+      assertTrue(quota.getKeyPairs() > 0);
+      assertTrue(quota.getRam() > 0);
+      assertTrue(quota.getSecurityGroups() > 0);
+      assertTrue(quota.getSecurityGroupRules() > 0);
+      assertTrue(quota.getVolumes() > 0);
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiExpectTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiExpectTest.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiExpectTest.java
new file mode 100644
index 0000000..4611ea9
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiExpectTest.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URI;
+
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.http.HttpRequest;
+import org.jclouds.http.HttpResponse;
+import org.jclouds.openstack.nova.v2_0.domain.QuotaClass;
+import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest;
+import org.jclouds.rest.ResourceNotFoundException;
+import org.testng.annotations.Test;
+
+/**
+ * Tests HostAdministrationApi guice wiring and parsing
+ *
+ * @author Adam Lowe
+ */
+@Test(groups = "unit", testName = "QuotaClassApiExpectTest")
+public class QuotaClassApiExpectTest extends BaseNovaApiExpectTest {
+
+   public void testGetQuotas() throws Exception {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-quota-class-sets/jcloudstestquotas");
+      QuotaClassApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).build(),
+            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/quota_class.json")).build()).getQuotaClassExtensionForZone("az-1.region-a.geo-1").get();
+
+      assertEquals(api.get("jcloudstestquotas"), getTestQuotas());
+   }
+
+   public void testGetQuotasFailsTenantNotFound() throws Exception {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-quota-class-sets/jcloudstestquotas");
+      QuotaClassApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).build(),
+            HttpResponse.builder().statusCode(404).build()).getQuotaClassExtensionForZone("az-1.region-a.geo-1").get();
+      assertNull(api.get("jcloudstestquotas"));
+   }
+
+   public void testUpdateQuotas() throws Exception {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-quota-class-sets/myclass");
+      QuotaClassApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            HttpRequest.builder().endpoint(endpoint).method("PUT")
+                  .addHeader("X-Auth-Token", authToken)
+                  .payload(payloadFromResourceWithContentType("/quota_class.json", MediaType.APPLICATION_JSON))
+                  .build(),
+            HttpResponse.builder().statusCode(200).build()).getQuotaClassExtensionForZone("az-1.region-a.geo-1").get();
+
+      assertTrue(api.update("myclass", getTestQuotas()));
+   }
+
+   @Test(expectedExceptions = ResourceNotFoundException.class)
+   public void testUpdateQuotasFailsNotFound() throws Exception {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-quota-class-sets/jcloudstestquotas");
+      QuotaClassApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            HttpRequest.builder().endpoint(endpoint).method("PUT")
+                  .addHeader("X-Auth-Token", authToken)
+                  .payload(payloadFromResourceWithContentType("/quota_class.json", MediaType.APPLICATION_JSON))
+                  .build(),
+            HttpResponse.builder().statusCode(404).build()).getQuotaClassExtensionForZone("az-1.region-a.geo-1").get();
+
+      api.update("jcloudstestquotas", getTestQuotas());
+   }
+
+   public static QuotaClass getTestQuotas() {
+      return QuotaClass.builder()
+            .metadataItems(128)
+            .injectedFileContentBytes(10240)
+            .injectedFiles(5)
+            .gigabytes(1000)
+            .ram(4096)
+            .floatingIps(10)
+            .securityGroups(10)
+            .securityGroupRules(20)
+            .instances(5)
+            .keyPairs(100)
+            .volumes(5)
+            .cores(10)
+            .id("jcloudstestquotas").build();
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiLiveTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiLiveTest.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiLiveTest.java
new file mode 100644
index 0000000..43fd342
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiLiveTest.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
+import org.jclouds.openstack.nova.v2_0.domain.QuotaClass;
+import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiLiveTest;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Optional;
+import com.google.common.collect.Iterables;
+
+/**
+ * Tests behavior of QuotaApi
+ *
+ * @author Adam Lowe
+ */
+@Test(groups = "live", testName = "QuotaClassApiLiveTest", singleThreaded = true)
+public class QuotaClassApiLiveTest extends BaseNovaApiLiveTest {
+   private Optional<? extends QuotaClassApi> apiOption;
+   private String zone;
+
+   @BeforeClass(groups = {"integration", "live"})
+   @Override
+   public void setup() {
+      super.setup();
+      zone = Iterables.getLast(api.getConfiguredZones(), "nova");
+      apiOption = api.getQuotaClassExtensionForZone(zone);
+   }
+
+   public void testUpdateAndGetQuotaClass() {
+      if (apiOption.isPresent()) {
+         QuotaClassApi api = apiOption.get();
+
+         QuotaClass firstVersion =
+               QuotaClassApiExpectTest.getTestQuotas().toBuilder()
+                     .id("jcloudstestquotas")
+                     .cores(10)
+                     .instances(5)
+                     .ram(4096)
+                     .volumes(5)
+                     .build();
+
+         assertTrue(api.update(firstVersion.getId(), firstVersion));
+
+         assertEquals(api.get(firstVersion.getId()), firstVersion);
+
+         // Change it again (since we may have run this test before and we can't delete the QuotaClass)
+         QuotaClass secondVersion = firstVersion.toBuilder().ram(8192).build();
+
+         assertTrue(api.update(secondVersion.getId(), secondVersion));
+
+         assertEquals(api.get(secondVersion.getId()), secondVersion);
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApiExpectTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApiExpectTest.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApiExpectTest.java
new file mode 100644
index 0000000..1fa8416
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApiExpectTest.java
@@ -0,0 +1,235 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URI;
+
+import org.jclouds.http.HttpRequest;
+import org.jclouds.http.HttpResponse;
+import org.jclouds.net.domain.IpProtocol;
+import org.jclouds.openstack.nova.v2_0.NovaApi;
+import org.jclouds.openstack.nova.v2_0.domain.Ingress;
+import org.jclouds.openstack.nova.v2_0.domain.SecurityGroup;
+import org.jclouds.openstack.nova.v2_0.domain.SecurityGroupRule;
+import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest;
+import org.jclouds.openstack.nova.v2_0.parse.ParseSecurityGroupListTest;
+import org.jclouds.openstack.nova.v2_0.parse.ParseSecurityGroupTest;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableMultimap;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Tests annotation parsing of {@code SecurityGroupAsyncApi}
+ * 
+ * @author Michael Arnold
+ */
+@Test(groups = "unit", testName = "SecurityGroupApiExpectTest")
+public class SecurityGroupApiExpectTest extends BaseNovaApiExpectTest {
+   public void testListSecurityGroupsWhenResponseIs2xx() throws Exception {
+      HttpRequest list = HttpRequest.builder().method("GET").endpoint(
+               URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-security-groups")).headers(
+               ImmutableMultimap.<String, String> builder().put("Accept", "application/json").put("X-Auth-Token",
+                        authToken).build()).build();
+
+      HttpResponse listResponse = HttpResponse.builder().statusCode(200).payload(
+               payloadFromResource("/securitygroup_list.json")).build();
+
+      NovaApi apiWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+               responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, list,
+               listResponse);
+
+      assertEquals(apiWhenSecurityGroupsExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1", "az-2.region-a.geo-1", "az-3.region-a.geo-1"));
+
+      assertEquals(apiWhenSecurityGroupsExist.getSecurityGroupExtensionForZone("az-1.region-a.geo-1").get()
+               .list().toString(), new ParseSecurityGroupListTest().expected().toString());
+   }
+
+   public void testListSecurityGroupsWhenReponseIs404IsEmpty() throws Exception {
+      HttpRequest listListSecurityGroups = HttpRequest.builder().method("GET").endpoint(
+               URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-security-groups")).headers(
+               ImmutableMultimap.<String, String> builder().put("Accept", "application/json").put("X-Auth-Token",
+                        authToken).build()).build();
+
+      HttpResponse listListSecurityGroupsResponse = HttpResponse.builder().statusCode(404).build();
+
+      NovaApi apiWhenNoSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+               responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, listListSecurityGroups,
+               listListSecurityGroupsResponse);
+
+      assertTrue(apiWhenNoSecurityGroupsExist.getSecurityGroupExtensionForZone("az-1.region-a.geo-1").get()
+               .list().isEmpty());
+   }
+
+   public void testGetSecurityGroupWhenResponseIs2xx() throws Exception {
+
+      HttpRequest getSecurityGroup = HttpRequest.builder().method("GET").endpoint(
+               URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-security-groups/0")).headers(
+               ImmutableMultimap.<String, String> builder().put("Accept", "application/json").put("X-Auth-Token",
+                        authToken).build()).build();
+
+      HttpResponse getSecurityGroupResponse = HttpResponse.builder().statusCode(200).payload(
+               payloadFromResource("/securitygroup_details.json")).build();
+
+      NovaApi apiWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+               responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, getSecurityGroup,
+               getSecurityGroupResponse);
+
+      assertEquals(apiWhenSecurityGroupsExist.getSecurityGroupExtensionForZone("az-1.region-a.geo-1").get()
+               .get("0").toString(), new ParseSecurityGroupTest().expected().toString());
+   }
+
+   public void testGetSecurityGroupWhenResponseIs404() throws Exception {
+      HttpRequest getSecurityGroup = HttpRequest.builder().method("GET").endpoint(
+               URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-security-groups/0")).headers(
+               ImmutableMultimap.<String, String> builder().put("Accept", "application/json").put("X-Auth-Token",
+                        authToken).build()).build();
+
+      HttpResponse getSecurityGroupResponse = HttpResponse.builder().statusCode(404).build();
+
+      NovaApi apiWhenNoSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+               responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, getSecurityGroup,
+               getSecurityGroupResponse);
+
+      assertNull(apiWhenNoSecurityGroupsExist.getSecurityGroupExtensionForZone("az-1.region-a.geo-1").get()
+               .get("0"));
+
+   }
+
+   public void testCreateSecurityGroupWhenResponseIs2xx() throws Exception {
+      HttpRequest create = HttpRequest.builder().method("POST").endpoint(
+               URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-security-groups")).headers(
+               ImmutableMultimap.<String, String> builder().put("Accept", "application/json").put("X-Auth-Token",
+                        authToken).build())
+               .payload(
+                        payloadFromStringWithContentType(
+                                 "{\"security_group\":{\"name\":\"jclouds-test\",\"description\":\"jclouds-test\"}}",
+                                 "application/json")).build();
+
+      HttpResponse createResponse = HttpResponse.builder().statusCode(200).payload(
+               payloadFromResource("/securitygroup_created.json")).build();
+
+      NovaApi apiWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+               responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, create,
+               createResponse);
+
+      assertEquals(apiWhenSecurityGroupsExist.getSecurityGroupExtensionForZone("az-1.region-a.geo-1").get()
+               .createWithDescription("jclouds-test", "jclouds-test").toString(),
+               createExpected().toString());
+   }
+
+   public void testDeleteSecurityGroupWhenResponseIs2xx() throws Exception {
+      HttpRequest delete = HttpRequest.builder().method("DELETE").endpoint(
+               URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-security-groups/160"))
+               .headers(
+                        ImmutableMultimap.<String, String> builder().put("Accept", "application/json")
+                                 .put("X-Auth-Token", authToken).build()).build();
+
+      HttpResponse deleteResponse = HttpResponse.builder().statusCode(202).build();
+
+      NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+               responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, delete,
+               deleteResponse);
+
+      assertTrue(apiWhenServersExist.getSecurityGroupExtensionForZone("az-1.region-a.geo-1").get()
+               .delete("160"));
+
+   }
+
+   public void testCreateSecurityGroupRuleForCidrBlockWhenResponseIs2xx() throws Exception {
+      HttpRequest createRule = HttpRequest
+               .builder()
+               .method("POST")
+               .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-security-group-rules")
+            .addHeader("Accept", "application/json")
+            .addHeader("X-Auth-Token", authToken)
+               .payload(
+                        payloadFromStringWithContentType(
+                                 "{\"security_group_rule\":{\"parent_group_id\":\"161\",\"cidr\":\"0.0.0.0/0\",\"ip_protocol\":\"tcp\",\"from_port\":\"80\",\"to_port\":\"8080\"}}",
+                                 "application/json")).build();
+
+      HttpResponse createRuleResponse = HttpResponse.builder().statusCode(200).payload(
+               payloadFromResource("/securitygrouprule_created.json")).build();
+
+      NovaApi apiWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+               responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, createRule,
+               createRuleResponse);
+
+      assertEquals(apiWhenSecurityGroupsExist.getSecurityGroupExtensionForZone("az-1.region-a.geo-1").get()
+               .createRuleAllowingCidrBlock("161",
+                        Ingress.builder().ipProtocol(IpProtocol.TCP).fromPort(80).toPort(8080).build(), "0.0.0.0/0")
+               .toString(), createRuleExpected().toString());
+   }
+   
+   public void testCreateSecurityGroupRuleForSecurityGroupIdWhenResponseIs2xx() throws Exception {
+      HttpRequest createRule = HttpRequest
+               .builder()
+               .method("POST")
+               .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-security-group-rules")
+               .addHeader("Accept", "application/json")
+               .addHeader("X-Auth-Token", authToken)
+               .payload(
+                        payloadFromStringWithContentType(
+                                 "{\"security_group_rule\":{\"group_id\":\"999\",\"parent_group_id\":\"161\",\"ip_protocol\":\"tcp\",\"from_port\":\"80\",\"to_port\":\"8080\"}}",
+                                 "application/json")).build();
+
+      HttpResponse createRuleResponse = HttpResponse.builder().statusCode(200).payload(
+               payloadFromResource("/securitygrouprule_created.json")).build();
+
+      NovaApi apiWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+               responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, createRule,
+               createRuleResponse);
+
+      assertEquals(apiWhenSecurityGroupsExist.getSecurityGroupExtensionForZone("az-1.region-a.geo-1").get()
+               .createRuleAllowingSecurityGroupId("161",
+                        Ingress.builder().ipProtocol(IpProtocol.TCP).fromPort(80).toPort(8080).build(), "999")
+               .toString(), createRuleExpected().toString());
+   }
+
+   public void testDeleteSecurityGroupRuleWhenResponseIs2xx() throws Exception {
+      HttpRequest deleteRule = HttpRequest.builder().method("DELETE").endpoint(
+               URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-security-group-rules/161"))
+               .headers(
+                        ImmutableMultimap.<String, String> builder().put("Accept", "*/*")
+                                 .put("X-Auth-Token", authToken).build()).build();
+
+      HttpResponse deleteRuleResponse = HttpResponse.builder().statusCode(202).build();
+
+      NovaApi apiWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+               responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, deleteRule,
+               deleteRuleResponse);
+
+      assertTrue(apiWhenSecurityGroupsExist.getSecurityGroupExtensionForZone("az-1.region-a.geo-1").get()
+               .deleteRule("161"));
+
+   }
+
+   private SecurityGroup createExpected() {
+      return SecurityGroup.builder().description("jclouds-test").id("160").name("jclouds-test").rules(
+               ImmutableSet.<SecurityGroupRule> of()).tenantId("dev_16767499955063").build();
+   }
+
+   private SecurityGroupRule createRuleExpected() {
+      return SecurityGroupRule.builder().fromPort(80).id("218").ipProtocol(
+               IpProtocol.TCP).ipRange("0.0.0.0/0").parentGroupId("161").toPort(8080).build();
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApiLiveTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApiLiveTest.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApiLiveTest.java
new file mode 100644
index 0000000..c0fb2df
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApiLiveTest.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+import static org.testng.Assert.assertNotNull;
+
+import java.util.Set;
+
+import org.jclouds.net.domain.IpProtocol;
+import org.jclouds.openstack.nova.v2_0.domain.Ingress;
+import org.jclouds.openstack.nova.v2_0.domain.SecurityGroup;
+import org.jclouds.openstack.nova.v2_0.domain.SecurityGroupRule;
+import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiLiveTest;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Tests behavior of {@code SecurityGroupApi}
+ * 
+ * @author Michael Arnold
+ */
+@Test(groups = "live", testName = "SecurityGroupApiLiveTest", singleThreaded = true)
+public class SecurityGroupApiLiveTest extends BaseNovaApiLiveTest {
+
+   public static final String SECURITY_GROUP_NAME = "testsg";
+
+   public void list() throws Exception {
+      for (String zoneId : api.getConfiguredZones()) {
+         SecurityGroupApi securityGroupApi = api.getSecurityGroupExtensionForZone(zoneId).get();
+         Set<? extends SecurityGroup> securityGroupsList = securityGroupApi.list().toSet();
+         assertNotNull(securityGroupsList);
+      }
+   }
+
+   public void createGetAndDeleteSecurityGroup() throws Exception {
+      for (String zoneId : api.getConfiguredZones()) {
+         SecurityGroupApi securityGroupApi = api.getSecurityGroupExtensionForZone(zoneId).get();
+         SecurityGroup securityGroup = null;
+         String id;
+         try {
+            securityGroup = securityGroupApi
+                     .createWithDescription(SECURITY_GROUP_NAME, "test security group");
+            assertNotNull(securityGroup);
+            id = securityGroup.getId();
+            SecurityGroup theGroup = securityGroupApi.get(id);
+            assertNotNull(theGroup);
+         } finally {
+            if (securityGroup != null) {
+               securityGroupApi.delete(securityGroup.getId());
+            }
+         }
+      }
+   }
+
+   public void createAndDeleteSecurityGroupRule() throws Exception {
+      for (String zoneId : api.getConfiguredZones()) {
+         SecurityGroupApi securityGroupApi = api.getSecurityGroupExtensionForZone(zoneId).get();
+         SecurityGroup securityGroup = null;
+
+         try {
+            securityGroup = securityGroupApi.createWithDescription(SECURITY_GROUP_NAME, "test security group");
+            assertNotNull(securityGroup);
+
+            for (int port : ImmutableSet.of(22, 8080)) {
+               SecurityGroupRule rule = securityGroupApi.createRuleAllowingCidrBlock(securityGroup.getId(), Ingress
+                        .builder().ipProtocol(IpProtocol.TCP).fromPort(port).toPort(port).build(), "0.0.0.0/0");
+               assertNotNull(rule);
+
+               SecurityGroupRule rule2 = securityGroupApi.createRuleAllowingSecurityGroupId(securityGroup.getId(),
+                        Ingress.builder().ipProtocol(IpProtocol.TCP).fromPort(port).toPort(port).build(), securityGroup
+                                 .getId());
+
+               assertNotNull(rule2);
+            }
+            securityGroup = securityGroupApi.get(securityGroup.getId());
+
+         } finally {
+            if (securityGroup != null) {
+               securityGroupApi.delete(securityGroup.getId());
+            }
+         }
+      }
+
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/ServerWithSecurityGroupsApiExpectTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/ServerWithSecurityGroupsApiExpectTest.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/ServerWithSecurityGroupsApiExpectTest.java
new file mode 100644
index 0000000..3eb9524
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/ServerWithSecurityGroupsApiExpectTest.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+
+import java.net.URI;
+
+import org.jclouds.http.HttpResponse;
+import org.jclouds.openstack.nova.v2_0.domain.ServerWithSecurityGroups;
+import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Tests parsing and guice wiring of ServerWithSecurityGroupsApi
+ *
+ * @author Adam Lowe
+ */
+@Test(groups = "unit", testName = "ServerWithSecurityGroupsApiExpectTest")
+public class ServerWithSecurityGroupsApiExpectTest extends BaseNovaApiExpectTest {
+
+   public void testGetServerWithSecurityGroups() {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-create-server-ext/8d0a6ca5-8849-4b3d-b86e-f24c92490ebb");
+      ServerWithSecurityGroupsApi api = requestsSendResponses(
+            keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).build(),
+            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/server_with_security_groups.json")).build()
+      ).getServerWithSecurityGroupsExtensionForZone("az-1.region-a.geo-1").get();
+
+      ServerWithSecurityGroups server = api.get("8d0a6ca5-8849-4b3d-b86e-f24c92490ebb");
+      assertEquals(server.getId(), "8d0a6ca5-8849-4b3d-b86e-f24c92490ebb");
+      assertEquals(server.getSecurityGroupNames(), ImmutableSet.of("default", "group1"));
+   }
+
+   public void testGetServerWithSecurityGroupsFailNotFound() {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-create-server-ext/8d0a6ca5-8849-4b3d-b86e-f24c92490ebb");
+      ServerWithSecurityGroupsApi api = requestsSendResponses(
+            keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            authenticatedGET().endpoint(endpoint).build(),
+            HttpResponse.builder().statusCode(404).build()
+      ).getServerWithSecurityGroupsExtensionForZone("az-1.region-a.geo-1").get();
+      assertNull(api.get("8d0a6ca5-8849-4b3d-b86e-f24c92490ebb"));
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/ServerWithSecurityGroupsApiLiveTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/ServerWithSecurityGroupsApiLiveTest.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/ServerWithSecurityGroupsApiLiveTest.java
new file mode 100644
index 0000000..a448253
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/ServerWithSecurityGroupsApiLiveTest.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+
+import org.jclouds.openstack.nova.v2_0.domain.Server;
+import org.jclouds.openstack.nova.v2_0.domain.ServerWithSecurityGroups;
+import org.jclouds.openstack.nova.v2_0.features.ServerApi;
+import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiLiveTest;
+import org.jclouds.openstack.v2_0.domain.Resource;
+import org.testng.annotations.BeforeGroups;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+
+/**
+ * Tests behavior of ServerWithSecurityGroupsApi
+ *
+ * @author Adam Lowe
+ */
+@Test(groups = "live", testName = "ServerWithSecurityGroupsApiLiveTest", singleThreaded = true)
+public class ServerWithSecurityGroupsApiLiveTest extends BaseNovaApiLiveTest {
+   private ServerApi serverApi;
+   private Optional<? extends ServerWithSecurityGroupsApi> apiOption;
+   private String zone;
+
+   @BeforeGroups(groups = {"integration", "live"})
+   @Override
+   public void setup() {
+      super.setup();
+      zone = Iterables.getLast(api.getConfiguredZones(), "nova");
+      serverApi = api.getServerApiForZone(zone);
+      apiOption = api.getServerWithSecurityGroupsExtensionForZone(zone);
+   }
+
+   public void testGetServer() {
+      if (apiOption.isPresent()) {
+
+         for (Resource server : serverApi.list().concat()) {
+            ServerWithSecurityGroups serverWithGroups = apiOption.get().get(server.getId());
+            assertEquals(serverWithGroups.getId(), server.getId());
+            assertEquals(serverWithGroups.getName(), server.getName());
+            assertNotNull(serverWithGroups.getSecurityGroupNames());
+         }
+
+         // Create a new server to verify the groups work as expected
+         Server testServer = null;
+         try {
+            testServer = createServerInZone(zone);
+            
+            ServerWithSecurityGroups results = apiOption.get().get(testServer.getId());
+            assertEquals(results.getId(), testServer.getId());
+            assertEquals(results.getSecurityGroupNames(), ImmutableSet.of("default"));
+         } finally {
+            if (testServer != null) {
+               serverApi.delete(testServer.getId());
+            }
+         }
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApiExpectTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApiExpectTest.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApiExpectTest.java
new file mode 100644
index 0000000..cfb2393
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApiExpectTest.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URI;
+import java.util.Set;
+
+import org.jclouds.date.DateService;
+import org.jclouds.date.internal.SimpleDateFormatDateService;
+import org.jclouds.http.HttpRequest;
+import org.jclouds.http.HttpResponse;
+import org.jclouds.openstack.nova.v2_0.domain.SimpleServerUsage;
+import org.jclouds.openstack.nova.v2_0.domain.SimpleTenantUsage;
+import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+
+/**
+ * Tests SimpleTenantUsageApi guice wiring and parsing
+ * 
+ * @author Adam Lowe
+ */
+@Test(groups = "unit", testName = "SimpleTenantUsageApiExpectTest")
+public class SimpleTenantUsageApiExpectTest extends BaseNovaApiExpectTest {
+   private DateService dateService = new SimpleDateFormatDateService();
+
+   public void testList() throws Exception {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-simple-tenant-usage");
+      SimpleTenantUsageApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            HttpRequest.builder().method("GET")
+                       .addHeader("Accept", "application/json")
+                       .addHeader("X-Auth-Token", authToken)
+            .endpoint(endpoint).build(),
+            HttpResponse.builder().statusCode(200)
+                  .payload(payloadFromResource("/simple_tenant_usages.json")).build())
+            .getSimpleTenantUsageExtensionForZone("az-1.region-a.geo-1").get();
+      
+      Set<? extends SimpleTenantUsage> results = api.list().toSet();
+      
+      SimpleTenantUsage usage = Iterables.getOnlyElement(results);
+      assertEquals(usage.getTenantId(), "f8535069c3fb404cb61c873b1a0b4921");
+      assertEquals(usage.getTotalHours(), 4.888888888888889e-07);
+      assertEquals(usage.getTotalLocalGbUsage(), 1.9555555555555557e-05);
+      assertEquals(usage.getTotalMemoryMbUsage(), 0.0015018666666666667);
+      assertEquals(usage.getTotalVcpusUsage(), 7.333333333333333e-07);
+      assertEquals(usage.getStart(), dateService.iso8601DateParse("2012-04-18 12:18:39.702411"));
+      assertEquals(usage.getStop(), dateService.iso8601DateParse("2012-04-18 12:18:39.702499"));
+      assertNotNull(usage.getServerUsages());
+      assertTrue(usage.getServerUsages().isEmpty());
+   }
+
+   public void testGet() throws Exception {
+      URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-simple-tenant-usage/test-1234");
+      SimpleTenantUsageApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
+            HttpRequest.builder().method("GET")
+                       .addHeader("Accept", "application/json")
+                       .addHeader("X-Auth-Token", authToken)
+                  .endpoint(endpoint).build(),
+            HttpResponse.builder().statusCode(200)
+                  .payload(payloadFromResource("/simple_tenant_usage.json")).build())
+            .getSimpleTenantUsageExtensionForZone("az-1.region-a.geo-1").get();
+
+      SimpleTenantUsage usage = api.get("test-1234");
+      assertEquals(usage.getTenantId(), "f8535069c3fb404cb61c873b1a0b4921");
+      
+      SimpleTenantUsage expected = SimpleTenantUsage.builder().tenantId("f8535069c3fb404cb61c873b1a0b4921").totalHours(4.833333333333333E-7).totalLocalGbUsage(1.933333333333333E-05)
+            .start(dateService.iso8601DateParse("2012-04-18 13:32:07.255743")).stop(dateService.iso8601DateParse("2012-04-18 13:32:07.255743"))
+            .totalMemoryMbUsage(0.0014847999999999999).totalVcpusUsage(7.249999999999999E-07).serverUsages(
+            ImmutableSet.of(
+                  SimpleServerUsage.builder().hours(2.4166666666666665e-07).uptime(91149).flavorLocalGb(50).instanceName("test1").tenantId("f8535069c3fb404cb61c873b1a0b4921").flavorVcpus(2).flavorMemoryMb(4096).instanceStatus(SimpleServerUsage.Status.ACTIVE).flavorName("m1.medium").instanceCreated(this.dateService.iso8601SecondsDateParse("2012-04-17T12:12:58")).build(),
+                  SimpleServerUsage.builder().hours(2.4166666666666665e-07).uptime(84710).flavorLocalGb(30).instanceName("mish_test").tenantId("f8535069c3fb404cb61c873b1a0b4921").flavorVcpus(1).flavorMemoryMb(2048).instanceStatus(SimpleServerUsage.Status.ACTIVE).flavorName("m1.small").instanceCreated(this.dateService.iso8601SecondsDateParse("2012-04-17T14:00:17")).build()
+            )).build();
+      
+      assertEquals(usage, expected);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApiLiveTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApiLiveTest.java b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApiLiveTest.java
new file mode 100644
index 0000000..f658d26
--- /dev/null
+++ b/dependencies/jclouds/apis/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApiLiveTest.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+import static org.testng.Assert.assertNotNull;
+
+import java.util.Set;
+
+import org.jclouds.openstack.nova.v2_0.domain.SimpleTenantUsage;
+import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiLiveTest;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Optional;
+
+/**
+ * Tests behavior of SimpleTenantUsageApi
+ *
+ * @author Adam Lowe
+ */
+@Test(groups = "live", testName = "SimpleTenantUsageApiLiveTest")
+public class SimpleTenantUsageApiLiveTest extends BaseNovaApiLiveTest {
+
+   public void testList() throws Exception {
+      for (String zoneId : api.getConfiguredZones()) {
+         Optional<? extends SimpleTenantUsageApi> optApi = api.getSimpleTenantUsageExtensionForZone(zoneId);
+         if (optApi.isPresent() && identity.endsWith(":admin")) {
+            SimpleTenantUsageApi api = optApi.get();
+            Set<? extends SimpleTenantUsage> usages = api.list().toSet();
+            assertNotNull(usages);
+            for (SimpleTenantUsage usage : usages) {
+               SimpleTenantUsage details = api.get(usage.getTenantId());
+               assertNotNull(details);
+            }
+         }
+      }
+   }
+}