You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2014/03/18 03:59:55 UTC
[03/21] fixing https://issues.apache.org/jira/browse/STRATOS-520 -
adding Openstack-nova module to dependencies
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseMetadataListTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseMetadataListTest.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseMetadataListTest.java
new file mode 100644
index 0000000..5559b20
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseMetadataListTest.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.parse;
+
+import java.util.Map;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.json.BaseItemParserTest;
+import org.jclouds.json.config.GsonModule;
+import org.jclouds.openstack.nova.v2_0.config.NovaParserModule;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ *
+ * @author Jeremy Daggett
+ */
+@Test(groups = "unit", testName = "ParseMetadataListTest")
+public class ParseMetadataListTest extends BaseItemParserTest<Map<String, String>> {
+
+ @Override
+ public String resource() {
+ return "/metadata_list.json";
+ }
+
+ @Override
+ @SelectJson("metadata")
+ @Consumes(MediaType.APPLICATION_JSON)
+ public Map<String, String> expected() {
+ ImmutableMap<String, String> metadata =
+ new ImmutableMap.Builder<String, String>()
+ .put("Server Label", "Web Head 1")
+ .put("Image Version", "2.1")
+ .build();
+
+ return metadata;
+ }
+
+ protected Injector injector() {
+ return Guice.createInjector(new NovaParserModule(), new GsonModule());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseMetadataUpdateTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseMetadataUpdateTest.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseMetadataUpdateTest.java
new file mode 100644
index 0000000..eb7a1e8
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseMetadataUpdateTest.java
@@ -0,0 +1,64 @@
+/*
+ * 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.parse;
+
+import java.util.Map;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.json.BaseItemParserTest;
+import org.jclouds.json.config.GsonModule;
+import org.jclouds.openstack.nova.v2_0.config.NovaParserModule;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ *
+ * @author Jeremy Daggett
+ */
+@Test(groups = "unit", testName = "ParseMetadataUpdateTest")
+public class ParseMetadataUpdateTest extends BaseItemParserTest<Map<String, String>> {
+
+ @Override
+ public String resource() {
+ return "/metadata_updated.json";
+ }
+
+ @Override
+ @SelectJson("metadata")
+ @Consumes(MediaType.APPLICATION_JSON)
+ public Map<String, String> expected() {
+ ImmutableMap<String, String> metadata =
+ new ImmutableMap.Builder<String, String>()
+ .put("Server Label", "Web Head 2")
+ .put("Image Version", "2.1")
+ .put("Server Description", "Simple Server")
+ .build();
+
+ return metadata;
+ }
+
+ protected Injector injector() {
+ return Guice.createInjector(new NovaParserModule(), new GsonModule());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseSecurityGroupListTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseSecurityGroupListTest.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseSecurityGroupListTest.java
new file mode 100644
index 0000000..4e46ede
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseSecurityGroupListTest.java
@@ -0,0 +1,72 @@
+/*
+ * 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.parse;
+
+import java.util.Set;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.json.config.GsonModule;
+import org.jclouds.net.domain.IpProtocol;
+import org.jclouds.openstack.nova.v2_0.config.NovaParserModule;
+import org.jclouds.openstack.nova.v2_0.domain.SecurityGroup;
+import org.jclouds.openstack.nova.v2_0.domain.SecurityGroupRule;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ *
+ * @author Michael Arnold
+ */
+@Test(groups = "unit", testName = "ParseSecurityGroupListTest")
+public class ParseSecurityGroupListTest extends BaseSetParserTest<SecurityGroup> {
+
+ @Override
+ public String resource() {
+ return "/securitygroup_list.json";
+ }
+
+ @Override
+ @SelectJson("security_groups")
+ @Consumes(MediaType.APPLICATION_JSON)
+ public Set<SecurityGroup> expected() {
+
+ Set<SecurityGroupRule> securityGroupRules = ImmutableSet.<SecurityGroupRule> of(
+ SecurityGroupRule.builder().fromPort(22)
+ .ipProtocol(IpProtocol.TCP).toPort(22).parentGroupId("3").ipRange("0.0.0.0/0")
+ .id("107").build(),
+ SecurityGroupRule.builder().fromPort(7600)
+ .ipProtocol(IpProtocol.TCP).toPort(7600).parentGroupId("3").ipRange("0.0.0.0/0")
+ .id("118").build(),
+ SecurityGroupRule.builder().fromPort(8084)
+ .ipProtocol(IpProtocol.TCP).toPort(8084).parentGroupId("3").ipRange("0.0.0.0/0")
+ .id("119").build());
+
+ return ImmutableSet.of(SecurityGroup.builder().description("description1").id("1").tenantId("tenant1")
+ .rules(securityGroupRules).name("name1").build());
+ }
+
+ protected Injector injector() {
+ return Guice.createInjector(new NovaParserModule(), new GsonModule());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseSecurityGroupTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseSecurityGroupTest.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseSecurityGroupTest.java
new file mode 100644
index 0000000..784a0bd
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseSecurityGroupTest.java
@@ -0,0 +1,69 @@
+/*
+ * 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.parse;
+
+import java.util.Set;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.json.BaseItemParserTest;
+import org.jclouds.json.config.GsonModule;
+import org.jclouds.net.domain.IpProtocol;
+import org.jclouds.openstack.nova.v2_0.config.NovaParserModule;
+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.domain.TenantIdAndName;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ *
+ * @author Michael Arnold
+ */
+@Test(groups = "unit", testName = "ParseSecurityGroupTest")
+public class ParseSecurityGroupTest extends BaseItemParserTest<SecurityGroup> {
+ @Override
+ public String resource() {
+ return "/securitygroup_details.json";
+ }
+
+ @Override
+ @SelectJson("security_group")
+ @Consumes(MediaType.APPLICATION_JSON)
+ public SecurityGroup expected() {
+
+ Set<SecurityGroupRule> securityGroupRules = ImmutableSet.<SecurityGroupRule> of(
+ SecurityGroupRule.builder().fromPort(22)
+ .ipProtocol(IpProtocol.TCP).toPort(22).parentGroupId("28")
+ .ipRange("10.2.6.0/24").id("108").build(),
+ SecurityGroupRule.builder().fromPort(22).group(TenantIdAndName.builder().name("11111").tenantId("admin").build())
+ .ipProtocol(IpProtocol.TCP).toPort(22).parentGroupId("28")
+ .id("109").build());
+
+ return SecurityGroup.builder().description("description0").id("0").tenantId("tenant0").rules(securityGroupRules)
+ .name("name0").build();
+ }
+
+ protected Injector injector() {
+ return Guice.createInjector(new NovaParserModule(), new GsonModule());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerDetailsEssexTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerDetailsEssexTest.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerDetailsEssexTest.java
new file mode 100644
index 0000000..afa6874
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerDetailsEssexTest.java
@@ -0,0 +1,170 @@
+/*
+ * 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.parse;
+
+import java.net.URI;
+import java.util.Set;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.date.internal.SimpleDateFormatDateService;
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.json.config.GsonModule;
+import org.jclouds.openstack.nova.v2_0.config.NovaParserModule;
+import org.jclouds.openstack.nova.v2_0.domain.Address;
+import org.jclouds.openstack.nova.v2_0.domain.Server;
+import org.jclouds.openstack.nova.v2_0.domain.Server.Status;
+import org.jclouds.openstack.nova.v2_0.domain.ServerExtendedStatus;
+import org.jclouds.openstack.v2_0.domain.Link;
+import org.jclouds.openstack.v2_0.domain.Link.Relation;
+import org.jclouds.openstack.v2_0.domain.Resource;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableMultimap;
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * @author Adrian Cole
+ */
+@Test(groups = "unit", testName = "ParseServerDetailsEssexTest")
+public class ParseServerDetailsEssexTest extends BaseSetParserTest<Server> {
+
+ @Override
+ public String resource() {
+ return "/server_list_details_essex.json";
+ }
+
+ @Override
+ @SelectJson("servers")
+ @Consumes(MediaType.APPLICATION_JSON)
+ public Set<Server> expected() {
+ return ImmutableSet.<Server>of(
+ Server.builder()
+ .addresses(ImmutableMultimap.<String, Address>builder()
+ .putAll("Net TenantA Front-Middle", Address.createV4("172.16.11.5"))
+ .putAll("Public network", Address.createV4("172.16.1.13"), Address.createV4("10.193.112.119")).build())
+ .links(
+ Link.create(
+ Relation.SELF,
+ URI.create("http://nova:8774/v1.1/8d10e6646d5d4585937395b04839a353/servers/0c80b392-db30-4736-ae02-4480090f1207")),
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://nova:8774/8d10e6646d5d4585937395b04839a353/servers/0c80b392-db30-4736-ae02-4480090f1207")))
+ .image(
+ Resource.builder()
+ .id("416af940-2d3c-4a7c-977c-a9030685ad5e")
+ .links(
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://nova:8774/8d10e6646d5d4585937395b04839a353/images/416af940-2d3c-4a7c-977c-a9030685ad5e"))).build())
+ .flavor(
+ Resource.builder()
+ .id("1")
+ .links(
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://nova:8774/8d10e6646d5d4585937395b04839a353/flavors/1"))).build())
+ .id("0c80b392-db30-4736-ae02-4480090f1207")
+ .userId("df13814f6c354d00a8acf66502836323")
+ .status(Status.ACTIVE)
+ .updated(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-04-12T11:21:33Z"))
+ .hostId("03d796ebb52b1b555e5f6d9262f7dbd52b3f7c181e3aa89b34ca5408")
+ .name("VM proxy")
+ .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-04-12T11:21:23Z"))
+ .tenantId("8d10e6646d5d4585937395b04839a353")
+ .extendedStatus(ServerExtendedStatus.builder().vmState("active").powerState(1).build())
+ .diskConfig("MANUAL").build(),
+ Server.builder()
+ .addresses(ImmutableMultimap.<String, Address>builder()
+ .putAll("Net TenantA Front-Middle", Address.createV4("172.16.11.4"))
+ .putAll("Net TenantA Middle-Back", Address.createV4("172.16.12.5")).build())
+ .links(
+ Link.create(
+ Relation.SELF,
+ URI.create("http://nova:8774/v1.1/8d10e6646d5d4585937395b04839a353/servers/b332b5cd-535e-4677-b68e-fc8badc13236")),
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://nova:8774/8d10e6646d5d4585937395b04839a353/servers/b332b5cd-535e-4677-b68e-fc8badc13236")))
+ .image(
+ Resource.builder()
+ .id("416af940-2d3c-4a7c-977c-a9030685ad5e")
+ .links(
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://nova:8774/8d10e6646d5d4585937395b04839a353/images/416af940-2d3c-4a7c-977c-a9030685ad5e"))).build())
+ .flavor(
+ Resource.builder()
+ .id("1")
+ .links(
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://nova:8774/8d10e6646d5d4585937395b04839a353/flavors/1"))).build())
+ .id("b332b5cd-535e-4677-b68e-fc8badc13236")
+ .userId("df13814f6c354d00a8acf66502836323")
+ .status(Status.ACTIVE)
+ .updated(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-04-12T11:18:58Z"))
+ .hostId("e5bbff80bebacfe1db63951e787b5341427060a602d33abfefb6a1bc")
+ .name("VM blog")
+ .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-04-12T11:18:48Z"))
+ .tenantId("8d10e6646d5d4585937395b04839a353")
+ .extendedStatus(ServerExtendedStatus.builder().vmState("active").powerState(1).build())
+ .diskConfig("MANUAL").build(),
+ Server.builder()
+ .addresses(ImmutableMultimap.<String, Address>builder()
+ .putAll("Net TenantA Middle-Back", Address.createV4("172.16.12.4")).build())
+ .links(
+ Link.create(
+ Relation.SELF,
+ URI.create("http://nova:8774/v1.1/8d10e6646d5d4585937395b04839a353/servers/f9d43436-4572-4c9b-9b74-5fa6890a2f21")),
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://nova:8774/8d10e6646d5d4585937395b04839a353/servers/f9d43436-4572-4c9b-9b74-5fa6890a2f21")))
+ .image(
+ Resource.builder()
+ .id("416af940-2d3c-4a7c-977c-a9030685ad5e")
+ .links(
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://nova:8774/8d10e6646d5d4585937395b04839a353/images/416af940-2d3c-4a7c-977c-a9030685ad5e"))).build())
+ .flavor(
+ Resource.builder()
+ .id("1")
+ .links(
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://nova:8774/8d10e6646d5d4585937395b04839a353/flavors/1"))).build())
+ .id("f9d43436-4572-4c9b-9b74-5fa6890a2f21")
+ .userId("df13814f6c354d00a8acf66502836323")
+ .status(Status.ACTIVE)
+ .updated(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-04-12T11:15:09Z"))
+ .hostId("03d796ebb52b1b555e5f6d9262f7dbd52b3f7c181e3aa89b34ca5408")
+ .name("VM MySQL")
+ .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-04-12T11:14:56Z"))
+ .tenantId("8d10e6646d5d4585937395b04839a353")
+ .extendedStatus(ServerExtendedStatus.builder().vmState("active").powerState(1).build())
+ .diskConfig("MANUAL").build());
+ }
+
+
+ protected Injector injector() {
+ return Guice.createInjector(new NovaParserModule(), new GsonModule());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerDiagnostics.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerDiagnostics.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerDiagnostics.java
new file mode 100644
index 0000000..8d4eb8b
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerDiagnostics.java
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jclouds.openstack.nova.v2_0.parse;
+
+import java.util.Map;
+
+import org.jclouds.json.BaseItemParserTest;
+
+import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableMap;
+
+/**
+ *
+ * @author Leander Beernaert
+ */
+public class ParseServerDiagnostics extends BaseItemParserTest<Optional<Map<String,String>>> {
+
+
+ @Override
+ public Optional<Map<String,String>> expected() {
+ return Optional.<Map<String,String>>of(
+ new ImmutableMap.Builder<String,String>()
+ .put("vnet0_tx_errors", "0")
+ .put("vda_read","77364736")
+ .put("vda_write","415446016")
+ .put("vnet0_tx_packets","9701")
+ .put("vda_write_req","47278")
+ .put("cpu0_time","143150000000")
+ .put("vnet0_tx","1691221")
+ .put("vnet0_rx_drop","0")
+ .put("vda_errors","-1")
+ .put("vnet0_rx_errors","0")
+ .put("memory","524288")
+ .put("vnet0_rx_packets","11271")
+ .put("vda_read_req","9551")
+ .put("vnet0_rx","1805288")
+ .put("vnet0_tx_drop","0").build());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerListTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerListTest.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerListTest.java
new file mode 100644
index 0000000..4ebbcf2
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerListTest.java
@@ -0,0 +1,85 @@
+/*
+ * 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.parse;
+
+import java.net.URI;
+import java.util.Set;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.json.config.GsonModule;
+import org.jclouds.openstack.nova.v2_0.config.NovaParserModule;
+import org.jclouds.openstack.v2_0.domain.Link;
+import org.jclouds.openstack.v2_0.domain.Link.Relation;
+import org.jclouds.openstack.v2_0.domain.Resource;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ *
+ * @author Adrian Cole
+ */
+@Test(groups = "unit", testName = "ParseServerListTest")
+public class ParseServerListTest extends BaseSetParserTest<Resource> {
+
+ @Override
+ public String resource() {
+ return "/server_list.json";
+ }
+
+ @Override
+ @SelectJson("servers")
+ @Consumes(MediaType.APPLICATION_JSON)
+ public Set<Resource> expected() {
+ return ImmutableSet
+ .of(Resource
+ .builder()
+ .id("52415800-8b69-11e0-9b19-734f6af67565")
+ .name("sample-server")
+ .links(
+ Link.create(
+ Relation.SELF,
+ URI.create("http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f6af67565")),
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f6af67565")))
+ .build(),
+ Resource
+ .builder()
+ .id("52415800-8b69-11e0-9b19-734f1f1350e5")
+ .name("sample-server2")
+ .links(
+ Link.create(
+ Relation.SELF,
+ URI.create("http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f1f1350e5")),
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f1f1350e5")))
+ .build());
+ }
+
+ protected Injector injector() {
+ return Guice.createInjector(new NovaParserModule(), new GsonModule());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerTest.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerTest.java
new file mode 100644
index 0000000..1b53135
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerTest.java
@@ -0,0 +1,117 @@
+/*
+ * 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.parse;
+
+import java.net.URI;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.date.internal.SimpleDateFormatDateService;
+import org.jclouds.json.BaseItemParserTest;
+import org.jclouds.json.config.GsonModule;
+import org.jclouds.openstack.nova.v2_0.config.NovaParserModule;
+import org.jclouds.openstack.nova.v2_0.domain.Address;
+import org.jclouds.openstack.nova.v2_0.domain.Server;
+import org.jclouds.openstack.nova.v2_0.domain.Server.Status;
+import org.jclouds.openstack.v2_0.domain.Link;
+import org.jclouds.openstack.v2_0.domain.Link.Relation;
+import org.jclouds.openstack.v2_0.domain.Resource;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMultimap;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+import static org.jclouds.openstack.nova.v2_0.domain.Address.createV4;
+import static org.jclouds.openstack.nova.v2_0.domain.Address.createV6;
+
+/**
+ * @author Adrian Cole
+ */
+@Test(groups = "unit", testName = "ParseServerTest")
+public class ParseServerTest extends BaseItemParserTest<Server> {
+
+ @Override
+ public String resource() {
+ return "/server_details.json";
+ }
+
+ @Override
+ @SelectJson("server")
+ @Consumes(MediaType.APPLICATION_JSON)
+ public Server expected() {
+ return Server
+ .builder()
+ .id("52415800-8b69-11e0-9b19-734f000004d2")
+ .tenantId("1234")
+ .userId("5678")
+ .name("sample-f352")
+ .updated(new SimpleDateFormatDateService().iso8601SecondsDateParse("2010-10-10T12:00:00Z"))
+ .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2010-08-10T12:00:00Z"))
+ .hostId("e4d909c290d0fb1ca068ffaddf22cbd0")
+ .accessIPv4("67.23.10.132")
+ .accessIPv6("::babe:67.23.10.132")
+ .status(Status.BUILD)
+ .diskConfig(Server.DISK_CONFIG_AUTO)
+ .image(
+ Resource
+ .builder()
+ .id("52415800-8b69-11e0-9b19-734f6f006e54")
+ .name("null")
+ .links(
+ Link.create(
+ Relation.SELF,
+ URI.create("http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6f006e54")),
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54")))
+ .build())
+ .flavor(
+ Resource
+ .builder()
+ .id("52415800-8b69-11e0-9b19-734f216543fd")
+ .name("null")
+ .links(
+ Link.create(
+ Relation.SELF,
+ URI.create("http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd")),
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd")))
+ .build())
+ .metadata(
+ new ImmutableMap.Builder<String, String>().put("Server Label", "Web Head 1")
+ .put("Image Version", "2.1").build())
+ .addresses(ImmutableMultimap.<String, Address>builder()
+ .putAll("public", createV4("67.23.10.132"), createV6("::babe:67.23.10.132"), createV4("67.23.10.131"), createV6("::babe:4317:0A83"))
+ .putAll("private", createV4("10.176.42.16"), createV6("::babe:10.176.42.16"))
+ .build())
+ .links(Link.create(
+ Relation.SELF, URI.create("http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f6f006e54")),
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f6f006e54")))
+ .build();
+ }
+
+ protected Injector injector() {
+ return Guice.createInjector(new NovaParserModule(), new GsonModule());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerWithAllExtensionsTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerWithAllExtensionsTest.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerWithAllExtensionsTest.java
new file mode 100644
index 0000000..e5d37d0
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerWithAllExtensionsTest.java
@@ -0,0 +1,104 @@
+/*
+ * 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.parse;
+
+import java.net.URI;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.date.internal.SimpleDateFormatDateService;
+import org.jclouds.json.BaseItemParserTest;
+import org.jclouds.json.config.GsonModule;
+import org.jclouds.openstack.nova.v2_0.config.NovaParserModule;
+import org.jclouds.openstack.nova.v2_0.domain.Address;
+import org.jclouds.openstack.nova.v2_0.domain.Server;
+import org.jclouds.openstack.nova.v2_0.domain.Server.Status;
+import org.jclouds.openstack.nova.v2_0.domain.ServerExtendedAttributes;
+import org.jclouds.openstack.nova.v2_0.domain.ServerExtendedStatus;
+import org.jclouds.openstack.v2_0.domain.Link;
+import org.jclouds.openstack.v2_0.domain.Link.Relation;
+import org.jclouds.openstack.v2_0.domain.Resource;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableMultimap;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * @author Adam Lowe
+ */
+@Test(groups = "unit", testName = "ParseServerWithAllExtensionsTest")
+public class ParseServerWithAllExtensionsTest extends BaseItemParserTest<Server> {
+
+ @Override
+ public String resource() {
+ return "/server_details_devstack.json";
+ }
+
+ @Override
+ @SelectJson("server")
+ @Consumes(MediaType.APPLICATION_JSON)
+ public Server expected() {
+ return Server
+ .builder()
+ .id("141b775f-7ac1-45f0-9a95-146260f33a53")
+ .tenantId("7f312675f9b84c97bff8f5054e181419")
+ .userId("89c01b67395d4bea945f7f5bfd7f344a")
+ .name("test")
+ .updated(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-04T15:07:48Z"))
+ .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-04T15:07:36Z"))
+ .hostId("eab9a77d1c44b8833e4a3dc6d2d9d50de556e780a319f184d8c82d9b")
+ .status(Status.PAUSED)
+ .image(
+ Resource
+ .builder()
+ .id("8e6f5bc4-a210-45b2-841f-c510eae14300")
+ .links(
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://172.16.89.149:8774/7f312675f9b84c97bff8f5054e181419/images/8e6f5bc4-a210-45b2-841f-c510eae14300")))
+ .build())
+ .flavor(
+ Resource
+ .builder()
+ .id("1")
+ .links(
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://172.16.89.149:8774/7f312675f9b84c97bff8f5054e181419/flavors/1")))
+ .build())
+ .links(
+ Link.create(
+ Relation.SELF,
+ URI.create("http://172.16.89.149:8774/v2/7f312675f9b84c97bff8f5054e181419/servers/141b775f-7ac1-45f0-9a95-146260f33a53")),
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("http://172.16.89.149:8774/7f312675f9b84c97bff8f5054e181419/servers/141b775f-7ac1-45f0-9a95-146260f33a53")))
+ .addresses(ImmutableMultimap.of("private", Address.createV4("10.0.0.8")))
+ .diskConfig("MANUAL")
+ .extendedStatus(ServerExtendedStatus.builder().vmState("paused").powerState(3).build())
+ .extendedAttributes(ServerExtendedAttributes.builder().instanceName("instance-00000014").hostName("ubuntu").build())
+ .build();
+ }
+
+
+ protected Injector injector() {
+ return Guice.createInjector(new NovaParserModule(), new GsonModule());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerWithInternetAddressesTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerWithInternetAddressesTest.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerWithInternetAddressesTest.java
new file mode 100644
index 0000000..2065f20
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/ParseServerWithInternetAddressesTest.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.parse;
+
+import java.net.URI;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.date.internal.SimpleDateFormatDateService;
+import org.jclouds.json.BaseItemParserTest;
+import org.jclouds.json.config.GsonModule;
+import org.jclouds.openstack.nova.v2_0.config.NovaParserModule;
+import org.jclouds.openstack.nova.v2_0.domain.Address;
+import org.jclouds.openstack.nova.v2_0.domain.Server;
+import org.jclouds.openstack.nova.v2_0.domain.Server.Status;
+import org.jclouds.openstack.v2_0.domain.Link;
+import org.jclouds.openstack.v2_0.domain.Link.Relation;
+import org.jclouds.openstack.v2_0.domain.Resource;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableMultimap;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * @author Adrian Cole
+ */
+@Test(groups = "unit", testName = "ParseServerTest")
+public class ParseServerWithInternetAddressesTest extends BaseItemParserTest<Server> {
+
+ @Override
+ public String resource() {
+ return "/server_details_openstack.json";
+ }
+
+ @Override
+ @SelectJson("server")
+ @Consumes(MediaType.APPLICATION_JSON)
+ public Server expected() {
+ return Server
+ .builder()
+ .id("1459")
+ .uuid("2443c9c7-9791-412e-ac09-a6d55ec25335")
+ .tenantId("37")
+ .userId("508151008")
+ .name("mygroup-72c")
+ .updated(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-03-23T01:30:26Z"))
+ .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-03-23T01:30:26Z"))
+ .hostId("881706597197955ac7cc4b353bc7ec884e13fa280de9cc82057796cb")
+ .status(Status.ACTIVE)
+ .image(
+ Resource
+ .builder()
+ .id("14")
+ .links(
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("https://nova-api.openstack.org:9774/37/images/14")))
+ .build())
+ .flavor(
+ Resource
+ .builder()
+ .id("1")
+ .links(
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("https://nova-api.openstack.org:9774/37/flavors/1")))
+ .build())
+ .links(
+ Link.create(
+ Relation.SELF,
+ URI.create("https://nova-api.openstack.org:9774/v1.1/37/servers/1459")),
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("https://nova-api.openstack.org:9774/37/servers/1459")))
+ .addresses(ImmutableMultimap.of("internet", Address.createV4("8.21.28.47"))).build();
+ }
+
+
+ protected Injector injector() {
+ return Guice.createInjector(new NovaParserModule(), new GsonModule());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/PublicIpsInPrivateAddressBlockExpectTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/PublicIpsInPrivateAddressBlockExpectTest.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/PublicIpsInPrivateAddressBlockExpectTest.java
new file mode 100644
index 0000000..3b56766
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/parse/PublicIpsInPrivateAddressBlockExpectTest.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.parse;
+
+import java.net.URI;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.date.internal.SimpleDateFormatDateService;
+import org.jclouds.json.BaseItemParserTest;
+import org.jclouds.json.config.GsonModule;
+import org.jclouds.openstack.nova.v2_0.config.NovaParserModule;
+import org.jclouds.openstack.nova.v2_0.domain.Address;
+import org.jclouds.openstack.nova.v2_0.domain.Server;
+import org.jclouds.openstack.nova.v2_0.domain.Server.Status;
+import org.jclouds.openstack.v2_0.domain.Link;
+import org.jclouds.openstack.v2_0.domain.Link.Relation;
+import org.jclouds.openstack.v2_0.domain.Resource;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMultimap;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * @author Adrian Cole
+ */
+@Test(groups = "unit", testName = "ParseCreatedServerTest")
+public class PublicIpsInPrivateAddressBlockExpectTest extends BaseItemParserTest<Server> {
+
+ @Override
+ public String resource() {
+ return "/server_public_ip_in_private.json";
+ }
+
+ @Override
+ @SelectJson("server")
+ @Consumes(MediaType.APPLICATION_JSON)
+ public Server expected() {
+ return Server
+ .builder()
+ .id("59662")
+ .hostId("cb0d9e5004bef8c21270a0b09f7624f4c387f3a523f3aaa4c5694a61")
+ .uuid("7aed8e05-1daf-476a-87b2-640e8f7dcafd")
+ .tenantId("37936628937291")
+ .userId("54297837463082")
+ .name("hpcloud-computes-38d")
+ .updated(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-03-22T22:11:55Z"))
+ .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-03-22T22:11:19Z"))
+ .status(Status.ACTIVE)
+ .keyName("jclouds_hpcloud-computes_77")
+ .image(
+ Resource
+ .builder()
+ .id("229")
+ .links(
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("https://az-2.region-a.geo-1.compute.hpcloudsvc.com/37936628937291/images/229")))
+ .build())
+ .flavor(
+ Resource
+ .builder()
+ .id("100")
+ .links(
+ Link.create(
+ Relation.BOOKMARK,
+ URI.create("https://az-2.region-a.geo-1.compute.hpcloudsvc.com/37936628937291/flavors/100")))
+ .build())
+ .metadata(ImmutableMap.of("Name", "hpcloud-computes"))
+ .addresses(ImmutableMultimap.<String, Address>builder()
+ .putAll("private", Address.createV4("10.6.39.189"), Address.createV4("15.185.181.94")).build())
+ .links(
+ Link.create(Relation.SELF, URI.create("https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v1.1/37936628937291/servers/59662")),
+ Link.create(Relation.BOOKMARK, URI.create("https://az-2.region-a.geo-1.compute.hpcloudsvc.com/37936628937291/servers/59662"))).build();
+
+ }
+
+ protected Injector injector() {
+ return Guice.createInjector(new NovaParserModule(), new GsonModule());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/predicates/ImagePredicatesTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/predicates/ImagePredicatesTest.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/predicates/ImagePredicatesTest.java
new file mode 100644
index 0000000..b4cad2b
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/predicates/ImagePredicatesTest.java
@@ -0,0 +1,44 @@
+/*
+ * 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.predicates;
+
+import static org.jclouds.openstack.nova.v2_0.predicates.ImagePredicates.statusEquals;
+
+import org.jclouds.openstack.nova.v2_0.domain.Image;
+import org.jclouds.openstack.nova.v2_0.domain.Image.Status;
+import org.jclouds.openstack.nova.v2_0.parse.ParseImageTest;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Adrian Cole
+ */
+@Test(groups = "unit", testName = "ImagePredicatesTest")
+public class ImagePredicatesTest {
+ Image ref = new ParseImageTest().expected();
+
+ @Test
+ public void teststatusEqualsWhenEqual() {
+ assert statusEquals(Status.SAVING).apply(ref);
+ }
+
+ @Test
+ public void teststatusEqualsWhenNotEqual() {
+ assert !statusEquals(Status.DELETED).apply(ref);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/predicates/SecurityGroupPredicatesTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/predicates/SecurityGroupPredicatesTest.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/predicates/SecurityGroupPredicatesTest.java
new file mode 100644
index 0000000..26e5ce2
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/java/org/jclouds/openstack/nova/v2_0/predicates/SecurityGroupPredicatesTest.java
@@ -0,0 +1,129 @@
+/*
+ * 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.predicates;
+
+import static org.jclouds.openstack.nova.v2_0.predicates.SecurityGroupPredicates.nameEquals;
+import static org.jclouds.openstack.nova.v2_0.predicates.SecurityGroupPredicates.nameIn;
+import static org.jclouds.openstack.nova.v2_0.predicates.SecurityGroupPredicates.ruleCidr;
+import static org.jclouds.openstack.nova.v2_0.predicates.SecurityGroupPredicates.ruleEndPort;
+import static org.jclouds.openstack.nova.v2_0.predicates.SecurityGroupPredicates.ruleGroup;
+import static org.jclouds.openstack.nova.v2_0.predicates.SecurityGroupPredicates.ruleProtocol;
+import static org.jclouds.openstack.nova.v2_0.predicates.SecurityGroupPredicates.ruleStartPort;
+import static org.testng.Assert.assertTrue;
+
+import org.jclouds.net.domain.IpProtocol;
+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.domain.TenantIdAndName;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+
+/**
+ *
+ * @author Adrian Cole
+ */
+@Test(groups = "unit", testName = "SecurityGroupPredicatesTest")
+public class SecurityGroupPredicatesTest {
+ SecurityGroup ref = SecurityGroup.builder().id("12345").name("jclouds").description("description").build();
+ SecurityGroupRule ruleRef = SecurityGroupRule.builder().id("6789").parentGroupId("12345").ipRange("0.0.0.0/0")
+ .fromPort(10).toPort(20).ipProtocol(IpProtocol.TCP)
+ .group(TenantIdAndName.builder().tenantId("11111111").name("abcd").build())
+ .build();
+
+ public void testnameEqualsWhenEqual() {
+ assertTrue(nameEquals("jclouds").apply(ref), "expected 'jclouds' as the name of " + ref);
+ }
+
+ @Test
+ public void testnameEqualsWhenNotEqual() {
+ assertTrue(!nameEquals("foo").apply(ref), "expected 'foo' not to be the name of " + ref);
+ }
+
+ @Test
+ public void testNameInWhenIn() {
+ assertTrue(nameIn(ImmutableSet.of("jclouds", "pants")).apply(ref),
+ "expected the name of " + ref + " to be one of 'jclouds' or 'pants'");
+ }
+
+ @Test
+ public void testNameInWhenNotIn() {
+ assertTrue(!nameIn(ImmutableSet.of("foo", "pants")).apply(ref),
+ "expected the name of " + ref + " to not be either of 'foo' or 'pants'");
+
+ }
+
+ @Test
+ public void testRuleCidrWhenEqual() {
+ assertTrue(ruleCidr("0.0.0.0/0").apply(ruleRef),
+ "expected the CIDR to be '0.0.0.0/0' for " + ruleRef);
+ }
+
+ @Test
+ public void testRuleCidrWhenNotEqual() {
+ assertTrue(!ruleCidr("1.1.1.1/0").apply(ruleRef),
+ "expected the CIDR to not be '1.1.1.1/0' for " + ruleRef);
+ }
+
+ @Test
+ public void testRuleGroupWhenEqual() {
+ assertTrue(ruleGroup("abcd").apply(ruleRef),
+ "expected the group to be equal to 'abcd' for " + ruleRef);
+ }
+
+ @Test
+ public void testRuleGroupWhenNotEqual() {
+ assertTrue(!ruleGroup("pants").apply(ruleRef),
+ "expected the group to not be equal to 'pants' for " + ruleRef);
+ }
+
+ @Test
+ public void testRuleProtocolWhenEqual() {
+ assertTrue(ruleProtocol(IpProtocol.TCP).apply(ruleRef),
+ "expected TCP for " + ruleRef);
+ }
+
+ @Test
+ public void testRuleProtocolWhenNotEqual() {
+ assertTrue(!ruleProtocol(IpProtocol.UDP).apply(ruleRef),
+ "expected not UDP for " + ruleRef);
+ }
+
+ @Test
+ public void testRuleStartPortWhenEqual() {
+ assertTrue(ruleStartPort(10).apply(ruleRef),
+ "expected start port 10 for " + ruleRef);
+ }
+
+ @Test
+ public void testRuleStartPortWhenNotEqual() {
+ assertTrue(!ruleStartPort(50).apply(ruleRef),
+ "expected start port not to be 50 for " + ruleRef);
+ }
+
+ @Test
+ public void testRuleEndPortWhenEqual() {
+ assertTrue(ruleEndPort(20).apply(ruleRef),
+ "expected end port 20 for " + ruleRef);
+ }
+
+ @Test
+ public void testRuleEndPortWhenNotEqual() {
+ assertTrue(!ruleEndPort(50).apply(ruleRef),
+ "expected end port not to be 50 for " + ruleRef);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/attachment_details.json
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/attachment_details.json b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/attachment_details.json
new file mode 100644
index 0000000..c436406
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/attachment_details.json
@@ -0,0 +1 @@
+{"volumeAttachment": {"device": "/dev/vdc", "serverId": "b4785058-cb80-491b-baa3-e4ee6546450e", "id": 1, "volumeId": 1}}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/attachment_list.json
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/attachment_list.json b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/attachment_list.json
new file mode 100644
index 0000000..b40de0b
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/attachment_list.json
@@ -0,0 +1 @@
+{"volumeAttachments": [{"device": "/dev/vdc", "serverId": "b4785058-cb80-491b-baa3-e4ee6546450e", "id": 1, "volumeId": 1}]}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_details.json
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_details.json b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_details.json
new file mode 100644
index 0000000..6336a42
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_details.json
@@ -0,0 +1,21 @@
+{
+ "extension" : {
+ "name" : "Public Image Extension",
+ "namespace" : "http://docs.rackspacecloud.com/servers/api/ext/pie/v1.0",
+ "alias" : "RS-PIE",
+ "updated" : "2011-01-22T13:25:27-06:00",
+ "description" : "Adds the capability to share an image with other users.",
+ "links" : [
+ {
+ "rel" : "describedby",
+ "type" : "application/pdf",
+ "href" : "http://docs.rackspacecloud.com/servers/api/ext/cs-pie-20111111.pdf"
+ },
+ {
+ "rel" : "describedby",
+ "type" : "application/vnd.sun.wadl+xml",
+ "href" : "http://docs.rackspacecloud.com/servers/api/ext/cs-pie.wadl"
+ }
+ ]
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list.json
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list.json b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list.json
new file mode 100644
index 0000000..4f3faa5
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list.json
@@ -0,0 +1,42 @@
+{
+ "extensions": [
+ {
+ "name": "Public Image Extension",
+ "namespace": "http://docs.rackspacecloud.com/servers/api/ext/pie/v1.0",
+ "alias": "RAX-PIE",
+ "updated": "2011-01-22T13:25:27-06:00",
+ "description": "Adds the capability to share an image with other users.",
+ "links": [
+ {
+ "rel": "describedby",
+ "type": "application/pdf",
+ "href": "http://docs.rackspacecloud.com/servers/api/ext/cs-pie-20111111.pdf"
+ },
+ {
+ "rel": "describedby",
+ "type": "application/vnd.sun.wadl+xml",
+ "href": "http://docs.rackspacecloud.com/servers/api/ext/cs-pie.wadl"
+ }
+ ]
+ },
+ {
+ "name": "Cloud Block Storage",
+ "namespace": "http://docs.rackspacecloud.com/servers/api/ext/cbs/v1.0",
+ "alias": "RAX-CBS",
+ "updated": "2011-01-12T11:22:33-06:00",
+ "description": "Allows mounting cloud block storage volumes.",
+ "links": [
+ {
+ "rel": "describedby",
+ "type": "application/pdf",
+ "href": "http://docs.rackspacecloud.com/servers/api/ext/cs-cbs-20111201.pdf"
+ },
+ {
+ "rel": "describedby",
+ "type": "application/vnd.sun.wadl+xml",
+ "href": "http://docs.rackspacecloud.com/servers/api/ext/cs-cbs.wadl"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list_full.json
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list_full.json b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list_full.json
new file mode 100644
index 0000000..490bebc
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list_full.json
@@ -0,0 +1,281 @@
+{"extensions": [
+{
+ "updated": "2011-09-27T00:00:00+00:00",
+ "name": "DiskConfig",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/disk_config/api/v1.1",
+ "alias": "OS-DCF",
+ "description": "Disk Management Extension"
+},
+{
+ "updated": "2011-06-29T00:00:00+00:00",
+ "name": "Hosts",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/hosts/api/v1.1",
+ "alias": "os-hosts",
+ "description": "Admin-only host administration"
+},
+{
+ "updated": "2011-07-19T00:00:00+00:00",
+ "name": "SchedulerHints",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/scheduler-hints/api/v2",
+ "alias": "os-scheduler-hints",
+ "description": "Pass arbitrary key/value pairs to the scheduler"
+},
+{
+ "updated": "2011-08-08T00:00:00+00:00",
+ "name": "Quotas",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/quotas-sets/api/v1.1",
+ "alias": "os-quota-sets",
+ "description": "Quotas management support"
+},
+{
+ "updated": "2011-12-23T00:00:00+00:00",
+ "name": "Floating_ip_dns",
+ "links": [],
+ "namespace": "http://docs.openstack.org/ext/floating_ip_dns/api/v1.1",
+ "alias": "os-floating-ip-dns",
+ "description": "Floating IP DNS support"
+},
+{
+ "updated": "2011-09-14T00:00:00+00:00",
+ "name": "FlavorExtraData",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/flavor_extra_data/api/v1.1",
+ "alias": "OS-FLV-EXT-DATA",
+ "description": "Provide additional data for flavors"
+},
+{
+ "updated": "2011-06-23T00:00:00+00:00",
+ "name": "FlavorExtraSpecs",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/flavor_extra_specs/api/v1.1",
+ "alias": "os-flavor-extra-specs",
+ "description": "Instance type (flavor) extra specs"
+},
+{
+ "updated": "2011-08-17T00:00:00+00:00",
+ "name": "VirtualInterfaces",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/virtual_interfaces/api/v1.1",
+ "alias": "virtual_interfaces",
+ "description": "Virtual interface support"
+},
+{
+ "updated": "2011-12-23T00:00:00+00:00",
+ "name": "Accounts",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/accounts/api/v1.1",
+ "alias": "os-accounts",
+ "description": "Admin-only access to accounts"
+},
+{
+ "updated": "2011-03-25T00:00:00+00:00",
+ "name": "Volumes",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/volumes/api/v1.1",
+ "alias": "os-volumes",
+ "description": "Volumes support"
+},
+{
+ "updated": "2011-11-03T00:00:00+00:00",
+ "name": "ExtendedStatus",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/extended_status/api/v1.1",
+ "alias": "OS-EXT-STS",
+ "description": "Extended Status support"
+},
+{
+ "updated": "2011-12-23T00:00:00+00:00",
+ "name": "Consoles",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/os-consoles/api/v2",
+ "alias": "os-consoles",
+ "description": "Interactive Console support."
+},
+{
+ "updated": "2011-07-21T00:00:00+00:00",
+ "name": "SecurityGroups",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/securitygroups/api/v1.1",
+ "alias": "security_groups",
+ "description": "Security group support"
+},
+{
+ "updated": "2012-01-12T00:00:00+00:00",
+ "name": "Aggregates",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/aggregates/api/v1.1",
+ "alias": "os-aggregates",
+ "description": "Admin-only aggregate administration"
+},
+{
+ "updated": "2011-07-19T00:00:00+00:00",
+ "name": "Createserverext",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/createserverext/api/v1.1",
+ "alias": "os-create-server-ext",
+ "description": "Extended support to the Create Server v1.1 API"
+},
+{
+ "updated": "2011-09-01T00:00:00+00:00",
+ "name": "DeferredDelete",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/deferred-delete/api/v1.1",
+ "alias": "os-deferred-delete",
+ "description": "Instance deferred delete"
+},
+{
+ "updated": "2011-12-21T00:00:00+00:00",
+ "name": "ServerDiagnostics",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/server-diagnostics/api/v1.1",
+ "alias": "os-server-diagnostics",
+ "description": "Allow Admins to view server diagnostics through server action"
+},
+{
+ "updated": "2011-12-23T00:00:00+00:00",
+ "name": "Networks",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/networks/api/v1.1",
+ "alias": "os-networks",
+ "description": "Admin-only Network Management Extension"
+},
+{
+ "updated": "2011-11-03T00:00:00+00:00",
+ "name": "ExtendedServerAttributes",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/extended_status/api/v1.1",
+ "alias": "OS-EXT-SRV-ATTR",
+ "description": "Extended Server Attributes support."
+},
+{
+ "updated": "2011-08-08T00:00:00+00:00",
+ "name": "Keypairs",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/keypairs/api/v1.1",
+ "alias": "os-keypairs",
+ "description": "Keypair Support"
+},
+{
+ "updated": "2011-08-24T00:00:00+00:00",
+ "name": "VolumeTypes",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/volume_types/api/v1.1",
+ "alias": "os-volume-types",
+ "description": "Volume types support"
+},
+{
+ "updated": "2011-08-19T00:00:00+00:00",
+ "name": "SimpleTenantUsage",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/os-simple-tenant-usage/api/v1.1",
+ "alias": "os-simple-tenant-usage",
+ "description": "Simple tenant usage extension"
+},
+{
+ "updated": "2012-01-04T00:00:00+00:00",
+ "name": "Floating_ip_pools",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/floating_ip_pools/api/v1.1",
+ "alias": "os-floating-ip-pools",
+ "description": "Floating IPs support"
+},
+{
+ "updated": "2012-01-23T00:00:00+00:00",
+ "name": "ServerStartStop",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/servers/api/v1.1",
+ "alias": "os-server-start-stop",
+ "description": "Start/Stop instance compute API support"
+},
+{
+ "updated": "2012-03-12T00:00:00+00:00",
+ "name": "QuotaClasses",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/quota-classes-sets/api/v1.1",
+ "alias": "os-quota-class-sets",
+ "description": "Quota classes management support"
+},
+{
+ "updated": "2012-01-19T00:00:00+00:00",
+ "name": "Certificates",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/certificates/api/v1.1",
+ "alias": "os-certificates",
+ "description": "Certificates support"
+},
+{
+ "updated": "2011-08-18T00:00:00+00:00",
+ "name": "Rescue",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/rescue/api/v1.1",
+ "alias": "os-rescue",
+ "description": "Instance rescue mode"
+},
+{
+ "updated": "2012-01-19T00:00:00+00:00",
+ "name": "FlavorManage",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/flavor_manage/api/v1.1",
+ "alias": "os-flavor-manage",
+ "description": "\n Flavor create/delete API support\n "
+},
+{
+ "updated": "2011-12-16T00:00:00+00:00",
+ "name": "Cloudpipe",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/cloudpipe/api/v1.1",
+ "alias": "os-cloudpipe",
+ "description": "Adds actions to create cloudpipe instances.\n\n When running with the Vlan network mode, you need a mechanism to route\n from the public Internet to your vlans. This mechanism is known as a\n cloudpipe.\n\n At the time of creating this class, only OpenVPN is supported. Support for\n a SSH Bastion host is forthcoming.\n "
+},
+{
+ "updated": "2011-06-09T00:00:00+00:00",
+ "name": "Multinic",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/multinic/api/v1.1",
+ "alias": "NMN",
+ "description": "Multiple network support"
+},
+{
+ "updated": "2011-08-08T00:00:00+00:00",
+ "name": "Users",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/users/api/v1.1",
+ "alias": "os-users",
+ "description": "Allow admins to acces user information"
+},
+{
+ "updated": "2011-09-20T00:00:00+00:00",
+ "name": "AdminActions",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/admin-actions/api/v1.1",
+ "alias": "os-admin-actions",
+ "description": "Enable admin-only server actions\n\n Actions include: pause,unpause, suspend, resume, migrate,\n resetNetwork, injectNetworkInfo, lock, unlock, createBackup\n "
+},
+{
+ "updated": "2011-12-21T00:00:00+00:00",
+ "name": "ServerActionList",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/server-actions-list/api/v1.1",
+ "alias": "os-server-action-list",
+ "description": "Allow Admins to view pending server actions"
+},
+{
+ "updated": "2011-12-08T00:00:00+00:00",
+ "name": "Console_output",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/os-console-output/api/v2",
+ "alias": "os-console-output",
+ "description": "Console log output support, with tailing ability."
+},
+{
+ "updated": "2011-06-16T00:00:00+00:00",
+ "name": "Floating_ips",
+ "links": [],
+ "namespace": "http://docs.openstack.org/compute/ext/floating_ips/api/v1.1",
+ "alias": "os-floating-ips",
+ "description": "Floating IPs support"}
+]}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list_normal.json
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list_normal.json b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list_normal.json
new file mode 100644
index 0000000..37fd53f
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list_normal.json
@@ -0,0 +1,31 @@
+{
+ "extensions": [{
+ "updated": "2011-08-08T00:00:00+00:00",
+ "name": "Keypairs",
+ "links": [],
+ "namespace": "http://docs.openstack.org/ext/keypairs/api/v1.1",
+ "alias": "os-keypairs",
+ "description": "Keypair Support"
+ }, {
+ "updated": "2011-03-25T00:00:00+00:00",
+ "name": "Volumes",
+ "links": [],
+ "namespace": "http://docs.openstack.org/ext/volumes/api/v1.1",
+ "alias": "os-volumes",
+ "description": "Volumes support"
+ }, {
+ "updated": "2011-07-21T00:00:00+00:00",
+ "name": "SecurityGroups",
+ "links": [],
+ "namespace": "http://docs.openstack.org/ext/securitygroups/api/v1.1",
+ "alias": "security_groups",
+ "description": "Security group support"
+ }, {
+ "updated": "2011-06-16T00:00:00+00:00",
+ "name": "Floating_ips",
+ "links": [],
+ "namespace": "http://docs.openstack.org/ext/floating_ips/api/v1.1",
+ "alias": "os-floating-ips",
+ "description": "Floating IPs support"
+ }]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list_openstack.json
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list_openstack.json b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list_openstack.json
new file mode 100644
index 0000000..0144af6
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/extension_list_openstack.json
@@ -0,0 +1,115 @@
+{
+ "extensions": [{
+ "updated": "2011-06-09T00:00:00+00:00",
+ "name": "Multinic",
+ "links": [],
+ "namespace": "https://docs.openstack.org/ext/multinic/api/v1.1",
+ "alias": "NMN",
+ "description": "Multiple network support"
+ }, {
+ "updated": "2011-06-29T00:00:00+00:00",
+ "name": "Hosts",
+ "links": [],
+ "namespace": "https://docs.openstack.org/ext/hosts/api/v1.1",
+ "alias": "os-hosts",
+ "description": "Host administration"
+ }, {
+ "updated": "2011-03-25T00:00:00+00:00",
+ "name": "Volumes",
+ "links": [],
+ "namespace": "https://docs.openstack.org/ext/volumes/api/v1.1",
+ "alias": "os-volumes",
+ "description": "Volumes support"
+ }, {
+ "updated": "2011-05-25 16:12:21.656723",
+ "name": "Admin Controller",
+ "links": [],
+ "namespace": "https:TODO/",
+ "alias": "ADMIN",
+ "description": "The Admin API Extension"
+ }, {
+ "updated": "2011-08-08T00:00:00+00:00",
+ "name": "Quotas",
+ "links": [],
+ "namespace": "https://docs.openstack.org/ext/quotas-sets/api/v1.1",
+ "alias": "os-quota-sets",
+ "description": "Quotas management support"
+ }, {
+ "updated": "2011-08-24T00:00:00+00:00",
+ "name": "VolumeTypes",
+ "links": [],
+ "namespace": "https://docs.openstack.org/ext/volume_types/api/v1.1",
+ "alias": "os-volume-types",
+ "description": "Volume types support"
+ }, {
+ "updated": "2011-06-23T00:00:00+00:00",
+ "name": "FlavorExtraSpecs",
+ "links": [],
+ "namespace": "https://docs.openstack.org/ext/flavor_extra_specs/api/v1.1",
+ "alias": "os-flavor-extra-specs",
+ "description": "Instance type (flavor) extra specs"
+ }, {
+ "updated": "2011-09-14T00:00:00+00:00",
+ "name": "FlavorExtraData",
+ "links": [],
+ "namespace": "https://docs.openstack.org/ext/flavor_extra_data/api/v1.1",
+ "alias": "os-flavor-extra-data",
+ "description": "Provide additional data for flavors"
+ }, {
+ "updated": "2011-08-17T00:00:00+00:00",
+ "name": "VirtualInterfaces",
+ "links": [],
+ "namespace": "https://docs.openstack.org/ext/virtual_interfaces/api/v1.1",
+ "alias": "virtual_interfaces",
+ "description": "Virtual interface support"
+ }, {
+ "updated": "2011-07-19T00:00:00+00:00",
+ "name": "Createserverext",
+ "links": [],
+ "namespace": "https://docs.openstack.org/ext/createserverext/api/v1.1",
+ "alias": "os-create-server-ext",
+ "description": "Extended support to the Create Server v1.1 API"
+ }, {
+ "updated": "2011-08-08T00:00:00+00:00",
+ "name": "Keypairs",
+ "links": [],
+ "namespace": "https://docs.openstack.org/ext/keypairs/api/v1.1",
+ "alias": "os-keypairs",
+ "description": "Keypair Support"
+ }, {
+ "updated": "2011-08-25T00:00:00+00:00",
+ "name": "VSAs",
+ "links": [],
+ "namespace": "https://docs.openstack.org/ext/vsa/api/v1.1",
+ "alias": "zadr-vsa",
+ "description": "Virtual Storage Arrays support"
+ }, {
+ "updated": "2011-08-19T00:00:00+00:00",
+ "name": "SimpleTenantUsage",
+ "links": [],
+ "namespace": "https://docs.openstack.org/ext/os-simple-tenant-usage/api/v1.1",
+ "alias": "os-simple-tenant-usage",
+ "description": "Simple tenant usage extension"
+ }, {
+ "updated": "2011-08-18T00:00:00+00:00",
+ "name": "Rescue",
+ "links": [],
+ "namespace": "https://docs.openstack.org/ext/rescue/api/v1.1",
+ "alias": "os-rescue",
+ "description": "Instance rescue mode"
+ }, {
+ "updated": "2011-07-21T00:00:00+00:00",
+ "name": "SecurityGroups",
+ "links": [],
+ "namespace": "https://docs.openstack.org/ext/securitygroups/api/v1.1",
+ "alias": "security_groups",
+ "description": "Security group support"
+ }, {
+ "updated": "2011-06-16T00:00:00+00:00",
+ "name": "Floating_ips",
+ "links": [],
+ "namespace": "https://docs.openstack.org/ext/floating_ips/api/v1.1",
+ "alias": "os-floating-ips",
+ "description": "Floating IPs support"
+ }]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/flavor_details.json
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/flavor_details.json b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/flavor_details.json
new file mode 100644
index 0000000..b2a3556
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/flavor_details.json
@@ -0,0 +1,19 @@
+{
+ "flavor" : {
+ "id" : "52415800-8b69-11e0-9b19-734f1195ff37",
+ "name" : "256 MB Server",
+ "ram" : 256,
+ "disk" : 10,
+ "vcpus" : 1,
+ "links": [
+ {
+ "rel" : "self",
+ "href" : "http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"
+ },
+ {
+ "rel" : "bookmark",
+ "href" : "http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"
+ }
+ ]
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/flavor_list.json
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/flavor_list.json b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/flavor_list.json
new file mode 100644
index 0000000..1e4cdeb
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/flavor_list.json
@@ -0,0 +1,32 @@
+{
+ "flavors": [
+ {
+ "id": "52415800-8b69-11e0-9b19-734f1195ff37",
+ "name": "256 MB Server",
+ "links": [
+ {
+ "rel": "self",
+ "href": "http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"
+ },
+ {
+ "rel": "bookmark",
+ "href": "http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"
+ }
+ ]
+ },
+ {
+ "id": "52415800-8b69-11e0-9b19-734f216543fd",
+ "name": "512 MB Server",
+ "links": [
+ {
+ "rel": "self",
+ "href": "http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"
+ },
+ {
+ "rel": "bookmark",
+ "href": "http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/flavor_list_detail.json
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/flavor_list_detail.json b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/flavor_list_detail.json
new file mode 100644
index 0000000..e810b48
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/test/resources/flavor_list_detail.json
@@ -0,0 +1 @@
+{"flavors": [{"rxtx_quota": 0, "name": "standard.xsmall", "links": [{"href": "https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v1.1/37936628937291/flavors/100", "rel": "self"}, {"href": "https://az-2.region-a.geo-1.compute.hpcloudsvc.com/37936628937291/flavors/100", "rel": "bookmark"}], "ram": 1024, "vcpus": 1, "rxtx_cap": 0, "swap": 0, "disk": 30, "id": 100}, {"rxtx_quota": 0, "name": "standard.small", "links": [{"href": "https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v1.1/37936628937291/flavors/101", "rel": "self"}, {"href": "https://az-2.region-a.geo-1.compute.hpcloudsvc.com/37936628937291/flavors/101", "rel": "bookmark"}], "ram": 2048, "vcpus": 2, "rxtx_cap": 0, "swap": 0, "disk": 60, "id": 101}, {"rxtx_quota": 0, "name": "standard.2xlarge", "links": [{"href": "https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v1.1/37936628937291/flavors/105", "rel": "self"}, {"href": "https://az-2.region-a.geo-1.compute.hpcloudsvc.com/37936628937291/flavors/105", "rel": "bookmark"}], "ra
m": 32768, "vcpus": 8, "rxtx_cap": 0, "swap": 0, "disk": 960, "id": 105}, {"rxtx_quota": 0, "name": "standard.large", "links": [{"href": "https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v1.1/37936628937291/flavors/103", "rel": "self"}, {"href": "https://az-2.region-a.geo-1.compute.hpcloudsvc.com/37936628937291/flavors/103", "rel": "bookmark"}], "ram": 8192, "vcpus": 4, "rxtx_cap": 0, "swap": 0, "disk": 240, "id": 103}, {"rxtx_quota": 0, "name": "standard.medium", "links": [{"href": "https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v1.1/37936628937291/flavors/102", "rel": "self"}, {"href": "https://az-2.region-a.geo-1.compute.hpcloudsvc.com/37936628937291/flavors/102", "rel": "bookmark"}], "ram": 4096, "vcpus": 2, "rxtx_cap": 0, "swap": 0, "disk": 120, "id": 102}, {"rxtx_quota": 0, "name": "standard.xlarge", "links": [{"href": "https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v1.1/37936628937291/flavors/104", "rel": "self"}, {"href": "https://az-2.region-a.geo-1.compute.hpclou
dsvc.com/37936628937291/flavors/104", "rel": "bookmark"}], "ram": 16384, "vcpus": 4, "rxtx_cap": 0, "swap": 0, "disk": 480, "id": 104}]}
\ No newline at end of file