You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2014/11/26 12:54:37 UTC
[07/41] stratos git commit: adding cloudstack dependancy
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeleteIPForwardingRuleResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeleteIPForwardingRuleResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeleteIPForwardingRuleResponseTest.java
new file mode 100644
index 0000000..6080c4a
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeleteIPForwardingRuleResponseTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.cloudstack.parse;
+
+import org.jclouds.json.BaseItemParserTest;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+@Test(groups = "unit", testName = "DeleteIPForwardingRuleResponseTest")
+public class DeleteIPForwardingRuleResponseTest extends BaseItemParserTest<Long> {
+
+ @Override
+ public String resource() {
+ return "/deleteipforwardingruleresponse.json";
+ }
+
+ @Override
+ @SelectJson("jobid")
+ public Long expected() {
+ return 50005l;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeleteNetworkResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeleteNetworkResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeleteNetworkResponseTest.java
new file mode 100644
index 0000000..1e90ee8
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeleteNetworkResponseTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.cloudstack.parse;
+
+import org.jclouds.json.BaseItemParserTest;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+@Test(groups = "unit", testName = "DeleteNetworkResponseTest")
+public class DeleteNetworkResponseTest extends BaseItemParserTest<Long> {
+
+ @Override
+ public String resource() {
+ return "/deletenetworkresponse.json";
+ }
+
+ @Override
+ @SelectJson("jobid")
+ public Long expected() {
+ return 45612l;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeployVirtualMachineResponse3xTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeployVirtualMachineResponse3xTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeployVirtualMachineResponse3xTest.java
new file mode 100644
index 0000000..c366297
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeployVirtualMachineResponse3xTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.cloudstack.parse;
+
+import org.jclouds.cloudstack.domain.AsyncCreateResponse;
+import org.jclouds.json.BaseItemParserTest;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+@Test(groups = "unit", testName = "DeployVirtualMachineResponse3xTest")
+public class DeployVirtualMachineResponse3xTest extends BaseItemParserTest<AsyncCreateResponse> {
+
+ @Override
+ public String resource() {
+ return "/deployvirtualmachineresponse.json";
+ }
+
+ @Override
+ @SelectJson({ "deployvirtualmachine", "deployvirtualmachineresponse" })
+ public AsyncCreateResponse expected() {
+ return AsyncCreateResponse.builder().id("1234").jobId("50006").build();
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeployVirtualMachineResponse4xTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeployVirtualMachineResponse4xTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeployVirtualMachineResponse4xTest.java
new file mode 100644
index 0000000..936656a
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DeployVirtualMachineResponse4xTest.java
@@ -0,0 +1,38 @@
+/*
+ * 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.cloudstack.parse;
+
+import org.jclouds.cloudstack.domain.AsyncCreateResponse;
+import org.jclouds.json.BaseItemParserTest;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+@Test(groups = "unit", testName = "DeployVirtualMachineResponse3xTest")
+public class DeployVirtualMachineResponse4xTest extends BaseItemParserTest<AsyncCreateResponse> {
+
+ @Override
+ public String resource() {
+ return "/deployvirtualmachineresponse4x.json";
+ }
+
+ @Override
+ @SelectJson({ "deployvirtualmachine", "deployvirtualmachineresponse" })
+ public AsyncCreateResponse expected() {
+ return AsyncCreateResponse.builder().id("1cce6cb7-2268-47ff-9696-d9e610f6619a")
+ .jobId("13330fc9-8b3e-4582-aa3e-90883c041ff0").build();
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DisableStaticNATResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DisableStaticNATResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DisableStaticNATResponseTest.java
new file mode 100644
index 0000000..65c8d9f
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/DisableStaticNATResponseTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.cloudstack.parse;
+
+import org.jclouds.json.BaseItemParserTest;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+@Test(groups = "unit", testName = "DisableStaticNATResponseTest")
+public class DisableStaticNATResponseTest extends BaseItemParserTest<Long> {
+
+ @Override
+ public String resource() {
+ return "/disablestaticnatresponse.json";
+ }
+
+ @Override
+ @SelectJson("jobid")
+ public Long expected() {
+ return 50006l;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/EnableStaticNATResponseWhereResponseDoesntHaveJobTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/EnableStaticNATResponseWhereResponseDoesntHaveJobTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/EnableStaticNATResponseWhereResponseDoesntHaveJobTest.java
new file mode 100644
index 0000000..81ad59a
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/EnableStaticNATResponseWhereResponseDoesntHaveJobTest.java
@@ -0,0 +1,42 @@
+/*
+ * 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.cloudstack.parse;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.cloudstack.domain.AsyncCreateResponse;
+import org.jclouds.json.BaseItemParserTest;
+import org.jclouds.rest.annotations.Unwrap;
+import org.testng.annotations.Test;
+
+@Test(groups = "unit", testName = "EnableStaticNATResponseWhereResponseDoesntHaveJobTest")
+public class EnableStaticNATResponseWhereResponseDoesntHaveJobTest extends BaseItemParserTest<AsyncCreateResponse> {
+
+ @Override
+ public String resource() {
+ return "/enablestaticnatresponse-withoutjob.json";
+ }
+
+ @Override
+ @Unwrap
+ @Consumes(MediaType.APPLICATION_JSON)
+ public AsyncCreateResponse expected() {
+ return AsyncCreateResponse.UNINITIALIZED;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/JobResultResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/JobResultResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/JobResultResponseTest.java
new file mode 100644
index 0000000..630e1d5
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/JobResultResponseTest.java
@@ -0,0 +1,38 @@
+/*
+ * 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.cloudstack.parse;
+
+import org.jclouds.cloudstack.domain.JobResult;
+import org.jclouds.json.BaseItemParserTest;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+@Test(groups = "unit", testName = "DeleteNetworkResponseTest")
+public class JobResultResponseTest extends BaseItemParserTest<JobResult> {
+
+ @Override
+ public String resource() {
+ return "/deletetemplateresponse.json";
+ }
+
+ @Override
+ @SelectJson("jobresult")
+ public JobResult expected() {
+ return JobResult.builder().success(true).build();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListAccountsResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListAccountsResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListAccountsResponseTest.java
new file mode 100644
index 0000000..5aa1e8b
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListAccountsResponseTest.java
@@ -0,0 +1,96 @@
+/*
+ * 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.cloudstack.parse;
+
+import java.util.Set;
+
+import org.jclouds.cloudstack.domain.Account;
+import org.jclouds.cloudstack.domain.User;
+import org.jclouds.cloudstack.domain.Account.State;
+import org.jclouds.cloudstack.domain.Account.Type;
+import org.jclouds.date.internal.SimpleDateFormatDateService;
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.json.config.GsonModule;
+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;
+
+@Test(groups = "unit")
+public class ListAccountsResponseTest extends BaseSetParserTest<Account> {
+
+ @Override
+ protected Injector injector() {
+ return Guice.createInjector(new GsonModule() {
+
+ @Override
+ protected void configure() {
+ bind(DateAdapter.class).to(Iso8601DateAdapter.class);
+ super.configure();
+ }
+
+ });
+
+ }
+
+ @Override
+ public String resource() {
+ return "/listaccountsresponse.json";
+ }
+
+ @Override
+ @SelectJson("account")
+ public Set<Account> expected() {
+ return ImmutableSet.<Account> of(Account
+ .builder()
+ .id("505")
+ .name("jclouds")
+ .type(Type.USER)
+ .domainId("457")
+ .domain("AA000062-jclouds-dev")
+ .receivedBytes(318900216)
+ .sentBytes(23189677)
+ .VMLimit(15l)
+ .VMs(1)
+ .IPsAvailable(14l)
+ .IPLimit(15l)
+ .IPs(0)
+ .IPsAvailable(15l)
+ .volumeLimit(90l)
+ .volumes(2)
+ .volumesAvailable(88l)
+ .snapshotLimit(250l)
+ .snapshots(0)
+ .snapshotsAvailable(250l)
+ .templateLimit(15l)
+ .templates(0)
+ .templatesAvailable(15l)
+ .VMsAvailable(14l)
+ .VMsStopped(0)
+ .VMsRunning(1)
+ .state(State.ENABLED)
+ .users(
+ ImmutableSet.of(User.builder().id("505").name("jclouds").firstName("Adrian").lastName("Cole")
+ .email("adrian@jclouds.org")
+ .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-04-19T01:57:24+0000"))
+ .state(User.State.ENABLED).account("jclouds").accountType(Type.USER).domainId("457")
+ .domain("AA000062-jclouds-dev").apiKey("APIKEY").secretKey("SECRETKEY").build())).build());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListAlertsResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListAlertsResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListAlertsResponseTest.java
new file mode 100644
index 0000000..db284ae
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListAlertsResponseTest.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.cloudstack.parse;
+
+import java.util.Calendar;
+import java.util.Set;
+import java.util.TimeZone;
+
+import org.jclouds.cloudstack.domain.Alert;
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.json.config.GsonModule;
+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;
+
+@Test(groups = "unit")
+public class ListAlertsResponseTest extends BaseSetParserTest<Alert> {
+
+ @Override
+ protected Injector injector() {
+ return Guice.createInjector(new GsonModule() {
+
+ @Override
+ protected void configure() {
+ bind(DateAdapter.class).to(Iso8601DateAdapter.class);
+ super.configure();
+ }
+
+ });
+
+ }
+
+ @Override
+ public String resource() {
+ return "/listalertsresponse.json";
+ }
+
+ @Override
+ @SelectJson("alert")
+ public Set<Alert> expected() {
+ Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT+02:00"));
+ c.set(Calendar.YEAR, 2011);
+ c.set(Calendar.MONTH, Calendar.DECEMBER);
+ c.set(Calendar.DAY_OF_MONTH, 4);
+ c.set(Calendar.HOUR_OF_DAY, 10);
+ c.set(Calendar.MINUTE, 5);
+ c.set(Calendar.SECOND, 2);
+ return ImmutableSet.of(Alert.builder()
+ .id("20").description("Failed to deploy Vm with Id: 52").sent(c.getTime()).type("7").build());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListCapabilitiesResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListCapabilitiesResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListCapabilitiesResponseTest.java
new file mode 100644
index 0000000..ec83197
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListCapabilitiesResponseTest.java
@@ -0,0 +1,39 @@
+/*
+ * 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.cloudstack.parse;
+
+import org.jclouds.cloudstack.domain.Capabilities;
+import org.jclouds.json.BaseItemParserTest;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+@Test(groups = "unit")
+public class ListCapabilitiesResponseTest extends BaseItemParserTest<Capabilities> {
+
+ @Override
+ public String resource() {
+ return "/listcapabilitiesresponse.json";
+ }
+
+ @Override
+ @SelectJson("capability")
+ public Capabilities expected() {
+ return Capabilities.builder().securityGroupsEnabled(true).canShareTemplates(true).cloudStackVersion("2.2")
+ .build();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListCapacityResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListCapacityResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListCapacityResponseTest.java
new file mode 100644
index 0000000..9fc4d53
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListCapacityResponseTest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.cloudstack.parse;
+
+import java.util.Set;
+
+import org.jclouds.cloudstack.domain.Capacity;
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+
+@Test(groups = "unit")
+public class ListCapacityResponseTest extends BaseSetParserTest<Capacity> {
+
+ @Override
+ public String resource() {
+ return "/listcapacityresponse.json";
+ }
+
+ @Override
+ @SelectJson("capacity")
+ public Set<Capacity> expected() {
+ Capacity a = Capacity.builder().type(Capacity.Type.PRIMARY_STORAGE_ALLOCATED_BYTES)
+ .zoneId("1").zoneName("Dev Zone 1").podId("null").podName("All")
+ .capacityUsed(34057748480L).capacityTotal(1796712955904L).percentUsed(1.9).build();
+ Capacity b = Capacity.builder().type(Capacity.Type.PRIMARY_STORAGE_ALLOCATED_BYTES)
+ .zoneId("1").zoneName("Dev Zone 1").podId("1").podName("Dev Pod 1")
+ .capacityUsed(34057748480L).capacityTotal(1796712955904L).percentUsed(1.9).build();
+ return ImmutableSet.of(a, b);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListClustersResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListClustersResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListClustersResponseTest.java
new file mode 100644
index 0000000..bb3327a
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListClustersResponseTest.java
@@ -0,0 +1,65 @@
+/*
+ * 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.cloudstack.parse;
+
+import java.util.Set;
+
+import org.jclouds.cloudstack.domain.AllocationState;
+import org.jclouds.cloudstack.domain.Cluster;
+import org.jclouds.cloudstack.domain.Host;
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+
+@Test(groups = "unit")
+public class ListClustersResponseTest extends BaseSetParserTest<Cluster> {
+
+ @Override
+ public String resource() {
+ return "/listclustersresponse.json";
+ }
+
+ @Override
+ @SelectJson("cluster")
+ public Set<Cluster> expected() {
+ Cluster cluster1 = Cluster.builder()
+ .id("1")
+ .name("Xen Clust 1")
+ .podId("1").podName("Dev Pod 1")
+ .zoneId("1").zoneName("Dev Zone 1")
+ .hypervisor("XenServer")
+ .clusterType(Host.ClusterType.CLOUD_MANAGED)
+ .allocationState(AllocationState.ENABLED)
+ .managedState(Cluster.ManagedState.MANAGED)
+ .build();
+ Cluster cluster2 = Cluster.builder()
+ .id("2")
+ .name("Xen Clust 1")
+ .podId("2").podName("Dev Pod 2")
+ .zoneId("2").zoneName("Dev Zone 2")
+ .hypervisor("XenServer")
+ .clusterType(Host.ClusterType.CLOUD_MANAGED)
+ .allocationState(AllocationState.ENABLED)
+ .managedState(Cluster.ManagedState.MANAGED)
+ .build();
+
+ return ImmutableSet.of(cluster1, cluster2);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListConfigurationEntriesResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListConfigurationEntriesResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListConfigurationEntriesResponseTest.java
new file mode 100644
index 0000000..4935c1e
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListConfigurationEntriesResponseTest.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.cloudstack.parse;
+
+import java.util.Set;
+
+import org.jclouds.cloudstack.domain.ConfigurationEntry;
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.json.config.GsonModule;
+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;
+
+@Test(groups = "unit")
+public class ListConfigurationEntriesResponseTest extends BaseSetParserTest<ConfigurationEntry> {
+
+ @Override
+ protected Injector injector() {
+ return Guice.createInjector(new GsonModule() {
+
+ @Override
+ protected void configure() {
+ bind(DateAdapter.class).to(Iso8601DateAdapter.class);
+ super.configure();
+ }
+
+ });
+ }
+
+ @Override
+ public String resource() {
+ return "/listconfigurationsresponse.json";
+ }
+
+ @Override
+ @SelectJson("configuration")
+ public Set<ConfigurationEntry> expected() {
+ return ImmutableSet.of(
+ ConfigurationEntry.builder().category("Advanced").name("account.cleanup.interval").value("86400")
+ .description("The interval (in seconds) between cleanup for removed accounts").build(),
+ ConfigurationEntry.builder().category("Advanced").name("agent.lb.enabled").value("true")
+ .description("If agent load balancing enabled in cluster setup").build()
+ );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListDiskOfferingsResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListDiskOfferingsResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListDiskOfferingsResponseTest.java
new file mode 100644
index 0000000..5c55ea8
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListDiskOfferingsResponseTest.java
@@ -0,0 +1,54 @@
+/*
+ * 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.cloudstack.parse;
+
+import java.util.Set;
+
+import org.jclouds.cloudstack.domain.DiskOffering;
+import org.jclouds.date.internal.SimpleDateFormatDateService;
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+
+@Test(groups = "unit")
+public class ListDiskOfferingsResponseTest extends BaseSetParserTest<DiskOffering> {
+
+ @Override
+ public String resource() {
+ return "/listdiskofferingsresponse.json";
+ }
+
+ @Override
+ @SelectJson("diskoffering")
+ public Set<DiskOffering> expected() {
+ return ImmutableSet.<DiskOffering> of(
+ DiskOffering.builder().id("3").domainId("1").domain("ROOT").name("Small").displayText("Small Disk, 5 GB")
+ .diskSize(5)
+ .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-02-11T15:22:32-0800"))
+ .customized(false).build(),
+ DiskOffering.builder().id("4").domainId("1").domain("ROOT").name("Medium").displayText("Medium Disk, 20 GB")
+ .diskSize(20)
+ .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-02-11T15:22:32-0800"))
+ .customized(false).build(),
+ DiskOffering.builder().id("5").domainId("1").domain("ROOT").name("Large").displayText("Large Disk, 100 GB")
+ .diskSize(100)
+ .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-02-11T15:22:32-0800"))
+ .customized(false).build());
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListDomainsResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListDomainsResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListDomainsResponseTest.java
new file mode 100644
index 0000000..5a3a8fd
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListDomainsResponseTest.java
@@ -0,0 +1,60 @@
+/*
+ * 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.cloudstack.parse;
+
+import java.util.Set;
+
+import org.jclouds.cloudstack.domain.Domain;
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.json.config.GsonModule;
+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;
+
+@Test(groups = "unit")
+public class ListDomainsResponseTest extends BaseSetParserTest<Domain> {
+
+ @Override
+ protected Injector injector() {
+ return Guice.createInjector(new GsonModule() {
+ @Override
+ protected void configure() {
+ bind(DateAdapter.class).to(Iso8601DateAdapter.class);
+ super.configure();
+ }
+ });
+ }
+
+ @Override
+ public String resource() {
+ return "/listdomainsresponse.json";
+ }
+
+ @Override
+ @SelectJson("domain")
+ public Set<Domain> expected() {
+ return ImmutableSet.of(
+ Domain.builder().id("1").name("ROOT").level(0).hasChild(true).build(),
+ Domain.builder().id("2").name("jclouds1").level(1).parentDomainId("1")
+ .parentDomainName("ROOT").hasChild(false).build()
+ );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListFirewallRulesResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListFirewallRulesResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListFirewallRulesResponseTest.java
new file mode 100644
index 0000000..6af9dff
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListFirewallRulesResponseTest.java
@@ -0,0 +1,66 @@
+/*
+ * 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.cloudstack.parse;
+
+import java.util.Set;
+
+import org.jclouds.cloudstack.domain.FirewallRule;
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.json.config.GsonModule;
+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;
+
+@Test(groups = "unit")
+public class ListFirewallRulesResponseTest extends BaseSetParserTest<FirewallRule> {
+
+ @Override
+ protected Injector injector() {
+ return Guice.createInjector(new GsonModule() {
+
+ @Override
+ protected void configure() {
+ bind(DateAdapter.class).to(Iso8601DateAdapter.class);
+ super.configure();
+ }
+
+ });
+ }
+
+ @Override
+ public String resource() {
+ return "/listfirewallrulesresponse.json";
+ }
+
+ @Override
+ @SelectJson("firewallrule")
+ public Set<FirewallRule> expected() {
+ Set<String> CIDRs = ImmutableSet.of("0.0.0.0/0");
+ return ImmutableSet.of(
+ FirewallRule.builder().id("2017").protocol(FirewallRule.Protocol.TCP).startPort(30)
+ .endPort(35).ipAddressId("2").ipAddress("10.27.27.51").state(FirewallRule.State.ACTIVE).CIDRs(CIDRs).build(),
+ FirewallRule.builder().id("2016").protocol(FirewallRule.Protocol.TCP).startPort(22)
+ .endPort(22).ipAddressId("2").ipAddress("10.27.27.51").state(FirewallRule.State.ACTIVE).CIDRs(CIDRs).build(),
+ FirewallRule.builder().id("10").protocol(FirewallRule.Protocol.TCP).startPort(22)
+ .endPort(22).ipAddressId("8").ipAddress("10.27.27.57").state(FirewallRule.State.ACTIVE).CIDRs(CIDRs).build()
+ );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListHostsResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListHostsResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListHostsResponseTest.java
new file mode 100644
index 0000000..b4f5855
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListHostsResponseTest.java
@@ -0,0 +1,153 @@
+/*
+ * 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.cloudstack.parse;
+
+import static org.testng.Assert.assertEquals;
+
+import java.util.Set;
+
+import org.jclouds.cloudstack.config.CloudStackParserModule;
+import org.jclouds.cloudstack.domain.AllocationState;
+import org.jclouds.cloudstack.domain.Host;
+import org.jclouds.date.internal.SimpleDateFormatDateService;
+import org.jclouds.json.BaseParserTest;
+import org.jclouds.json.config.GsonModule;
+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;
+
+@Test(groups = "unit")
+public class ListHostsResponseTest extends BaseParserTest<Set<Host>, Set<Host>> {
+
+ public void compare(Set<Host> expects, Set<Host> response) {
+ assertEquals(response.toString(), expects.toString());
+ }
+
+ @Override
+ protected Injector injector() {
+ return Guice.createInjector(new GsonModule(), new CloudStackParserModule());
+ }
+
+ @Override
+ public String resource() {
+ return "/listhostsresponse.json";
+ }
+
+ @Override
+ @SelectJson("host")
+ public Set<Host> expected() {
+ return ImmutableSet.of(
+
+ Host.builder()
+ .id("1")
+ .name("cs2-xevsrv.alucloud.local")
+ .state(Host.State.UP)
+ .type(Host.Type.ROUTING)
+ .ipAddress("10.26.26.107")
+ .zoneId("1")
+ .zoneName("Dev Zone 1")
+ .podId("1")
+ .podName("Dev Pod 1")
+ .version("2.2.12.20110928142833")
+ .hypervisor("XenServer")
+ .cpuNumber(24)
+ .cpuSpeed(2266)
+ .cpuAllocated("2.76%")
+ .cpuUsed("0.1%")
+ .cpuWithOverProvisioning(54384.0f)
+ .networkKbsRead(4443L)
+ .networkKbsWrite(15048L)
+ .memoryTotal(100549733760L)
+ .memoryAllocated(3623878656L)
+ .memoryUsed(3623878656L)
+ .capabilities("xen-3.0-x86_64 , xen-3.0-x86_32p , hvm-3.0-x86_32 , hvm-3.0-x86_32p , hvm-3.0-x86_64")
+ .lastPinged(new SimpleDateFormatDateService().iso8601SecondsDateParse("1970-01-16T00:54:43+0200"))
+ .managementServerId("223098941760041")
+ .clusterId("1")
+ .clusterName("Xen Clust 1")
+ .clusterType(Host.ClusterType.CLOUD_MANAGED)
+ .localStorageActive(false)
+ .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-11-26T23:28:36+0200"))
+ .events("PrepareUnmanaged; HypervisorVersionChanged; ManagementServerDown; PingTimeout; " +
+ "AgentDisconnected; MaintenanceRequested; HostDown; AgentConnected; StartAgentRebalance; ShutdownRequested; Ping")
+ .hasEnoughCapacity(false)
+ .allocationState(AllocationState.ENABLED).build(),
+
+ Host.builder()
+ .id("2")
+ .name("nfs://10.26.26.165/mnt/nfs/cs_sec")
+ .state(Host.State.ALERT)
+ .disconnected(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-11-26T23:33:38+0200"))
+ .type(Host.Type.SECONDARY_STORAGE)
+ .ipAddress("nfs")
+ .zoneId("1")
+ .zoneName("Dev Zone 1")
+ .version("2.2.12.20110928142833")
+ .hypervisor("None")
+ .lastPinged(new SimpleDateFormatDateService().iso8601SecondsDateParse("1970-01-16T00:42:30+0200"))
+ .localStorageActive(false)
+ .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-11-26T23:33:38+0200"))
+ .events("ManagementServerDown; AgentDisconnected; Remove; MaintenanceRequested; AgentConnected; Ping")
+ .hasEnoughCapacity(false)
+ .allocationState(AllocationState.ENABLED).build(),
+
+ Host.builder()
+ .id("3")
+ .name("s-1-VM")
+ .state(Host.State.UP)
+ .type(Host.Type.SECONDARY_STORAGE_VM)
+ .ipAddress("10.26.26.81")
+ .zoneId("1")
+ .zoneName("Dev Zone 1")
+ .podId("1")
+ .podName("Dev Pod 1")
+ .version("2.2.12.20110928142833")
+ .lastPinged(new SimpleDateFormatDateService().iso8601SecondsDateParse("1970-01-16T00:54:43+0200"))
+ .managementServerId("223098941760041")
+ .localStorageActive(false)
+ .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-11-26T23:35:51+0200"))
+ .events("PrepareUnmanaged; HypervisorVersionChanged; ManagementServerDown; PingTimeout; " +
+ "AgentDisconnected; MaintenanceRequested; HostDown; AgentConnected; StartAgentRebalance; ShutdownRequested; Ping")
+ .hasEnoughCapacity(false)
+ .allocationState(AllocationState.ENABLED).build(),
+
+ Host.builder()
+ .id("4")
+ .name("v-2-VM")
+ .state(Host.State.UP)
+ .type(Host.Type.CONSOLE_PROXY)
+ .ipAddress("10.26.26.96")
+ .zoneId("1")
+ .zoneName("Dev Zone 1")
+ .podId("1")
+ .podName("Dev Pod 1")
+ .version("2.2.12.20110928142833")
+ .lastPinged(new SimpleDateFormatDateService().iso8601SecondsDateParse("1970-01-16T00:54:43+0200"))
+ .managementServerId("223098941760041")
+ .localStorageActive(false)
+ .created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-11-26T23:36:46+0200"))
+ .events("PrepareUnmanaged; HypervisorVersionChanged; ManagementServerDown; PingTimeout; " +
+ "AgentDisconnected; MaintenanceRequested; HostDown; AgentConnected; StartAgentRebalance; ShutdownRequested; Ping")
+ .hasEnoughCapacity(false)
+ .allocationState(AllocationState.ENABLED).build()
+ );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListHypervisorsResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListHypervisorsResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListHypervisorsResponseTest.java
new file mode 100644
index 0000000..3c26223
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListHypervisorsResponseTest.java
@@ -0,0 +1,47 @@
+/*
+ * 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.cloudstack.parse;
+
+import java.util.Set;
+
+import org.jclouds.cloudstack.functions.ParseNamesFromHttpResponse;
+import org.jclouds.http.HttpResponse;
+import org.jclouds.json.BaseSetParserTest;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Function;
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Injector;
+
+@Test(groups = "unit")
+public class ListHypervisorsResponseTest extends BaseSetParserTest<String> {
+
+ @Override
+ public String resource() {
+ return "/listhypervisorsresponse.json";
+ }
+
+ @Override
+ public Set<String> expected() {
+ return ImmutableSet.<String> of("XenServer", "KVM", "VMware");
+ }
+
+ @Override
+ protected Function<HttpResponse, Set<String>> parser(Injector injector) {
+ return injector.getInstance(ParseNamesFromHttpResponse.class);
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListIPForwardingRulesResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListIPForwardingRulesResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListIPForwardingRulesResponseTest.java
new file mode 100644
index 0000000..203c41e
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListIPForwardingRulesResponseTest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.cloudstack.parse;
+
+import java.util.Set;
+
+import org.jclouds.cloudstack.domain.IPForwardingRule;
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+
+@Test(groups = "unit")
+public class ListIPForwardingRulesResponseTest extends BaseSetParserTest<IPForwardingRule> {
+
+ @Override
+ public String resource() {
+ return "/listipforwardingrulesresponse.json";
+ }
+
+ @Override
+ @SelectJson("ipforwardingrule")
+ public Set<IPForwardingRule> expected() {
+ return ImmutableSet.<IPForwardingRule> of(
+ IPForwardingRule.builder().id("66").protocol("tcp").startPort(22).endPort(22).virtualMachineId("58")
+ .virtualMachineDisplayName("i-4-58-VM").virtualMachineName("i-4-58-VM")
+ .IPAddressId("15").IPAddress("10.27.27.64").state("Active").build());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListLoadBalancerRulesResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListLoadBalancerRulesResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListLoadBalancerRulesResponseTest.java
new file mode 100644
index 0000000..2c9e783
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListLoadBalancerRulesResponseTest.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.cloudstack.parse;
+
+import java.util.Set;
+
+import org.jclouds.cloudstack.domain.LoadBalancerRule;
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.json.config.GsonModule;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+import org.testng.collections.Sets;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+@Test(groups = "unit")
+public class ListLoadBalancerRulesResponseTest extends BaseSetParserTest<LoadBalancerRule> {
+
+ @Override
+ protected Injector injector() {
+ return Guice.createInjector(new GsonModule() {
+
+ @Override
+ protected void configure() {
+ bind(DateAdapter.class).to(Iso8601DateAdapter.class);
+ super.configure();
+ }
+
+ });
+ }
+
+ @Override
+ public String resource() {
+ return "/listloadbalancerrulesresponse.json";
+ }
+
+ @Override
+ @SelectJson("loadbalancerrule")
+ public Set<LoadBalancerRule> expected() {
+ return ImmutableSet.<LoadBalancerRule> of(LoadBalancerRule.builder()
+ .id("93").account("admin").algorithm(LoadBalancerRule.Algorithm.ROUNDROBIN)
+ .description("null").domain("ROOT").domainId("1").name("Ranny").privatePort(80)
+ .publicIP("10.27.27.59").publicIPId("10").publicPort(80).state(LoadBalancerRule.State.ADD)
+ .CIDRs(Sets.<String>newHashSet()).zoneId(null)
+ .build());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListNetworkOfferingsResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListNetworkOfferingsResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListNetworkOfferingsResponseTest.java
new file mode 100644
index 0000000..05bd194
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListNetworkOfferingsResponseTest.java
@@ -0,0 +1,50 @@
+/*
+ * 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.cloudstack.parse;
+
+import static org.jclouds.cloudstack.domain.NetworkOfferingAvailabilityType.REQUIRED;
+
+import java.util.Set;
+
+import org.jclouds.cloudstack.domain.NetworkOffering;
+import org.jclouds.cloudstack.domain.TrafficType;
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+
+@Test(groups = "unit")
+public class ListNetworkOfferingsResponseTest extends BaseSetParserTest<NetworkOffering> {
+
+ @Override
+ public String resource() {
+ return "/listnetworkofferingsresponse.json";
+ }
+
+ @Override
+ @SelectJson("networkoffering")
+ public Set<NetworkOffering> expected() {
+ return ImmutableSet.<NetworkOffering>of(
+ NetworkOffering.builder().id("7").name("DefaultDirectNetworkOffering").displayText("Direct")
+ .trafficType(TrafficType.PUBLIC).isDefault(true).supportsVLAN(false).availability(REQUIRED)
+ .networkRate(200).build(), NetworkOffering.builder().id("6").name("DefaultVirtualizedNetworkOffering")
+ .displayText("Virtual Vlan").trafficType(TrafficType.GUEST).isDefault(true).supportsVLAN(false)
+ .availability(REQUIRED).networkRate(200).build());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListNetworksResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListNetworksResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListNetworksResponseTest.java
new file mode 100644
index 0000000..65ed915
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListNetworksResponseTest.java
@@ -0,0 +1,87 @@
+/*
+ * 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.cloudstack.parse;
+
+import java.net.URI;
+import java.util.Set;
+
+import org.jclouds.cloudstack.domain.GuestIPType;
+import org.jclouds.cloudstack.domain.Network;
+import org.jclouds.cloudstack.domain.NetworkService;
+import org.jclouds.cloudstack.domain.TrafficType;
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.ImmutableSortedMap;
+import com.google.common.collect.ImmutableSortedSet;
+
+@Test(groups = "unit")
+public class ListNetworksResponseTest extends BaseSetParserTest<Network> {
+
+ @Override
+ public String resource() {
+ return "/listnetworksresponse.json";
+ }
+
+ @Override
+ @SelectJson("network")
+ public Set<Network> expected() {
+ return ImmutableSet
+ .<Network> of(Network
+ .builder()
+ .id("204")
+ .account("adrian")
+ .name("Virtual Network")
+ .displayText(
+ "A dedicated virtualized network for your account. The broadcast domain is contained within a VLAN and all public network access is routed out by a virtual router.")
+ .broadcastDomainType("Vlan")
+ .trafficType(TrafficType.GUEST)
+ .zoneId("1")
+ .networkOfferingId("6")
+ .networkOfferingName("DefaultVirtualizedNetworkOffering")
+ .networkOfferingDisplayText("Virtual Vlan")
+ .networkOfferingAvailability("Required")
+ .isShared(false)
+ .isSystem(false)
+ .state("Implemented")
+ .related("204")
+ .broadcastURI(URI.create("vlan://240"))
+ .DNS(ImmutableList.of("8.8.8.8"))
+ .guestIPType(GuestIPType.VIRTUAL)
+ .domain("ROOT")
+ .domainId("1")
+ .isDefault(true)
+ .services(
+ ImmutableSortedSet.of(
+ NetworkService.builder().name("Vpn").capabilities(ImmutableMap.of("SupportedVpnTypes", "pptp,l2tp,ipsec")).build(),
+ NetworkService.builder().name("Gateway").build(),
+ NetworkService.builder().name("UserData").build(),
+ NetworkService.builder().name("Dhcp").build(),
+ NetworkService.builder().name("Firewall").capabilities(ImmutableSortedMap.<String, String> naturalOrder()
+ .put("SupportedSourceNatTypes", "per account").put("StaticNat", "true")
+ .put("TrafficStatistics", "per public ip").put("PortForwarding", "true")
+ .put("MultipleIps", "true").put("SupportedProtocols", "tcp,udp").build()).build(),
+ NetworkService.builder().name("Dns").build(),
+ NetworkService.builder().name("Lb").capabilities(ImmutableMap.of("SupportedLbAlgorithms",
+ "roundrobin,leastconn,source", "SupportedProtocols", "tcp, udp")).build()))
+ .networkDomain("cs3cloud.internal").build());
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListOSCategoriesResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListOSCategoriesResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListOSCategoriesResponseTest.java
new file mode 100644
index 0000000..0453777
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListOSCategoriesResponseTest.java
@@ -0,0 +1,49 @@
+/*
+ * 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.cloudstack.parse;
+
+import java.util.Map;
+
+import org.jclouds.cloudstack.functions.ParseIdToNameFromHttpResponse;
+import org.jclouds.http.HttpResponse;
+import org.jclouds.json.BaseItemParserTest;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Function;
+import com.google.common.collect.ImmutableMap;
+import com.google.inject.Injector;
+
+@Test(groups = "unit")
+public class ListOSCategoriesResponseTest extends BaseItemParserTest<Map<String, String>> {
+
+ @Override
+ public String resource() {
+ return "/listoscategoriesresponse.json";
+ }
+
+ @Override
+ public Map<String, String> expected() {
+ return ImmutableMap.<String, String> builder().put("1", "CentOS").put("10", "Ubuntu").put("2", "Debian").put("3", "Oracle")
+ .put("4", "RedHat").put("5", "SUSE").put("6", "Windows").put("7", "Other").put("8", "Novel").put("9", "Unix")
+ .build();
+ }
+
+ @Override
+ protected Function<HttpResponse, Map<String, String>> parser(Injector injector) {
+ return injector.getInstance(ParseIdToNameFromHttpResponse.class);
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a4a03688/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListOSTypesResponseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListOSTypesResponseTest.java b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListOSTypesResponseTest.java
new file mode 100644
index 0000000..91bef18
--- /dev/null
+++ b/dependencies/jclouds/apis/cloudstack/1.8.0-stratos/src/test/java/org/jclouds/cloudstack/parse/ListOSTypesResponseTest.java
@@ -0,0 +1,192 @@
+/*
+ * 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.cloudstack.parse;
+
+import java.util.Set;
+
+import org.jclouds.cloudstack.domain.OSType;
+import org.jclouds.json.BaseSetParserTest;
+import org.jclouds.rest.annotations.SelectJson;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+
+@Test(groups = "unit")
+public class ListOSTypesResponseTest extends BaseSetParserTest<OSType> {
+
+ @Override
+ public String resource() {
+ return "/listostypesresponse.json";
+ }
+
+ @Override
+ @SelectJson("ostype")
+ public Set<OSType> expected() {
+ return ImmutableSet
+ .<OSType> builder()
+ .add(OSType.builder().id("69").OSCategoryId("7").description("Asianux 3(32-bit)").build())
+ .add(OSType.builder().id("70").OSCategoryId("7").description("Asianux 3(64-bit)").build())
+ .add(OSType.builder().id("1").OSCategoryId("1").description("CentOS 4.5 (32-bit)").build())
+ .add(OSType.builder().id("2").OSCategoryId("1").description("CentOS 4.6 (32-bit)").build())
+ .add(OSType.builder().id("3").OSCategoryId("1").description("CentOS 4.7 (32-bit)").build())
+ .add(OSType.builder().id("4").OSCategoryId("1").description("CentOS 4.8 (32-bit)").build())
+ .add(OSType.builder().id("5").OSCategoryId("1").description("CentOS 5.0 (32-bit)").build())
+ .add(OSType.builder().id("6").OSCategoryId("1").description("CentOS 5.0 (64-bit)").build())
+ .add(OSType.builder().id("7").OSCategoryId("1").description("CentOS 5.1 (32-bit)").build())
+ .add(OSType.builder().id("8").OSCategoryId("1").description("CentOS 5.1 (64-bit)").build())
+ .add(OSType.builder().id("9").OSCategoryId("1").description("CentOS 5.2 (32-bit)").build())
+ .add(OSType.builder().id("10").OSCategoryId("1").description("CentOS 5.2 (64-bit)").build())
+ .add(OSType.builder().id("11").OSCategoryId("1").description("CentOS 5.3 (32-bit)").build())
+ .add(OSType.builder().id("12").OSCategoryId("1").description("CentOS 5.3 (64-bit)").build())
+ .add(OSType.builder().id("13").OSCategoryId("1").description("CentOS 5.4 (32-bit)").build())
+ .add(OSType.builder().id("14").OSCategoryId("1").description("CentOS 5.4 (64-bit)").build())
+ .add(OSType.builder().id("111").OSCategoryId("1").description("CentOS 5.5 (32-bit)").build())
+ .add(OSType.builder().id("112").OSCategoryId("1").description("CentOS 5.5 (64-bit)").build())
+ .add(OSType.builder().id("73").OSCategoryId("2").description("Debian GNU/Linux 4(32-bit)").build())
+ .add(OSType.builder().id("74").OSCategoryId("2").description("Debian GNU/Linux 4(64-bit)").build())
+ .add(OSType.builder().id("72").OSCategoryId("2").description("Debian GNU/Linux 5(64-bit)").build())
+ .add(OSType.builder().id("15").OSCategoryId("2").description("Debian GNU/Linux 5.0 (32-bit)").build())
+ .add(OSType.builder().id("132").OSCategoryId("2").description("Debian GNU/Linux 6(32-bit)").build())
+ .add(OSType.builder().id("133").OSCategoryId("2").description("Debian GNU/Linux 6(64-bit)").build())
+ .add(OSType.builder().id("102").OSCategoryId("6").description("DOS").build())
+ .add(OSType.builder().id("118").OSCategoryId("4").description("Fedora 10").build())
+ .add(OSType.builder().id("117").OSCategoryId("4").description("Fedora 11").build())
+ .add(OSType.builder().id("116").OSCategoryId("4").description("Fedora 12").build())
+ .add(OSType.builder().id("115").OSCategoryId("4").description("Fedora 13").build())
+ .add(OSType.builder().id("120").OSCategoryId("4").description("Fedora 8").build())
+ .add(OSType.builder().id("119").OSCategoryId("4").description("Fedora 9").build())
+ .add(OSType.builder().id("83").OSCategoryId("9").description("FreeBSD (32-bit)").build())
+ .add(OSType.builder().id("84").OSCategoryId("9").description("FreeBSD (64-bit)").build())
+ .add(OSType.builder().id("92").OSCategoryId("6").description("Microsoft Small Bussiness Server 2003").build())
+ .add(OSType.builder().id("78").OSCategoryId("8").description("Novell Netware 5.1").build())
+ .add(OSType.builder().id("77").OSCategoryId("8").description("Novell Netware 6.x").build())
+ .add(OSType.builder().id("68").OSCategoryId("7").description("Open Enterprise Server").build())
+ .add(OSType.builder().id("16").OSCategoryId("3").description("Oracle Enterprise Linux 5.0 (32-bit)").build())
+ .add(OSType.builder().id("17").OSCategoryId("3").description("Oracle Enterprise Linux 5.0 (64-bit)").build())
+ .add(OSType.builder().id("18").OSCategoryId("3").description("Oracle Enterprise Linux 5.1 (32-bit)").build())
+ .add(OSType.builder().id("19").OSCategoryId("3").description("Oracle Enterprise Linux 5.1 (64-bit)").build())
+ .add(OSType.builder().id("20").OSCategoryId("3").description("Oracle Enterprise Linux 5.2 (32-bit)").build())
+ .add(OSType.builder().id("21").OSCategoryId("3").description("Oracle Enterprise Linux 5.2 (64-bit)").build())
+ .add(OSType.builder().id("22").OSCategoryId("3").description("Oracle Enterprise Linux 5.3 (32-bit)").build())
+ .add(OSType.builder().id("23").OSCategoryId("3").description("Oracle Enterprise Linux 5.3 (64-bit)").build())
+ .add(OSType.builder().id("24").OSCategoryId("3").description("Oracle Enterprise Linux 5.4 (32-bit)").build())
+ .add(OSType.builder().id("25").OSCategoryId("3").description("Oracle Enterprise Linux 5.4 (64-bit)").build())
+ .add(OSType.builder().id("134").OSCategoryId("3").description("Oracle Enterprise Linux 5.5 (32-bit)").build())
+ .add(OSType.builder().id("135").OSCategoryId("3").description("Oracle Enterprise Linux 5.5 (64-bit)").build())
+ .add(OSType.builder().id("104").OSCategoryId("7").description("OS/2").build())
+ .add(OSType.builder().id("60").OSCategoryId("7").description("Other (32-bit)").build())
+ .add(OSType.builder().id("103").OSCategoryId("7").description("Other (64-bit)").build())
+ .add(OSType.builder().id("75").OSCategoryId("7").description("Other 2.6x Linux (32-bit)").build())
+ .add(OSType.builder().id("76").OSCategoryId("7").description("Other 2.6x Linux (64-bit)").build())
+ .add(OSType.builder().id("98").OSCategoryId("7").description("Other Linux (32-bit)").build())
+ .add(OSType.builder().id("99").OSCategoryId("7").description("Other Linux (64-bit)").build())
+ .add(OSType.builder().id("59").OSCategoryId("10").description("Other Ubuntu (32-bit)").build())
+ .add(OSType.builder().id("100").OSCategoryId("10").description("Other Ubuntu (64-bit)").build())
+ .add(OSType.builder().id("131").OSCategoryId("10").description("Red Hat Enterprise Linux 2").build())
+ .add(OSType.builder().id("66").OSCategoryId("4").description("Red Hat Enterprise Linux 3(32-bit)").build())
+ .add(OSType.builder().id("67").OSCategoryId("4").description("Red Hat Enterprise Linux 3(64-bit)").build())
+ .add(OSType.builder().id("106").OSCategoryId("4").description("Red Hat Enterprise Linux 4(64-bit)").build())
+ .add(OSType.builder().id("26").OSCategoryId("4").description("Red Hat Enterprise Linux 4.5 (32-bit)").build())
+ .add(OSType.builder().id("27").OSCategoryId("4").description("Red Hat Enterprise Linux 4.6 (32-bit)").build())
+ .add(OSType.builder().id("28").OSCategoryId("4").description("Red Hat Enterprise Linux 4.7 (32-bit)").build())
+ .add(OSType.builder().id("29").OSCategoryId("4").description("Red Hat Enterprise Linux 4.8 (32-bit)").build())
+ .add(OSType.builder().id("30").OSCategoryId("4").description("Red Hat Enterprise Linux 5.0 (32-bit)").build())
+ .add(OSType.builder().id("31").OSCategoryId("4").description("Red Hat Enterprise Linux 5.0 (64-bit)").build())
+ .add(OSType.builder().id("32").OSCategoryId("4").description("Red Hat Enterprise Linux 5.1 (32-bit)").build())
+ .add(OSType.builder().id("33").OSCategoryId("4").description("Red Hat Enterprise Linux 5.1 (64-bit)").build())
+ .add(OSType.builder().id("34").OSCategoryId("4").description("Red Hat Enterprise Linux 5.2 (32-bit)").build())
+ .add(OSType.builder().id("35").OSCategoryId("4").description("Red Hat Enterprise Linux 5.2 (64-bit)").build())
+ .add(OSType.builder().id("36").OSCategoryId("4").description("Red Hat Enterprise Linux 5.3 (32-bit)").build())
+ .add(OSType.builder().id("37").OSCategoryId("4").description("Red Hat Enterprise Linux 5.3 (64-bit)").build())
+ .add(OSType.builder().id("38").OSCategoryId("4").description("Red Hat Enterprise Linux 5.4 (32-bit)").build())
+ .add(OSType.builder().id("39").OSCategoryId("4").description("Red Hat Enterprise Linux 5.4 (64-bit)").build())
+ .add(OSType.builder().id("113").OSCategoryId("4").description("Red Hat Enterprise Linux 5.5 (32-bit)").build())
+ .add(OSType.builder().id("114").OSCategoryId("4").description("Red Hat Enterprise Linux 5.5 (64-bit)").build())
+ .add(OSType.builder().id("136").OSCategoryId("4").description("Red Hat Enterprise Linux 6.0 (32-bit)").build())
+ .add(OSType.builder().id("137").OSCategoryId("4").description("Red Hat Enterprise Linux 6.0 (64-bit)").build())
+ .add(OSType.builder().id("85").OSCategoryId("9").description("SCO OpenServer 5").build())
+ .add(OSType.builder().id("86").OSCategoryId("9").description("SCO UnixWare 7").build())
+ .add(OSType.builder().id("79").OSCategoryId("9").description("Sun Solaris 10(32-bit)").build())
+ .add(OSType.builder().id("80").OSCategoryId("9").description("Sun Solaris 10(64-bit)").build())
+ .add(OSType.builder().id("82").OSCategoryId("9").description("Sun Solaris 8(Experimental)").build())
+ .add(OSType.builder().id("81").OSCategoryId("9").description("Sun Solaris 9(Experimental)").build())
+ .add(OSType.builder().id("109").OSCategoryId("5").description("SUSE Linux Enterprise 10(32-bit)").build())
+ .add(OSType.builder().id("110").OSCategoryId("5").description("SUSE Linux Enterprise 10(64-bit)").build())
+ .add(OSType.builder().id("96").OSCategoryId("5").description("SUSE Linux Enterprise 8(32-bit)").build())
+ .add(OSType.builder().id("97").OSCategoryId("5").description("SUSE Linux Enterprise 8(64-bit)").build())
+ .add(OSType.builder().id("107").OSCategoryId("5").description("SUSE Linux Enterprise 9(32-bit)").build())
+ .add(OSType.builder().id("108").OSCategoryId("5").description("SUSE Linux Enterprise 9(64-bit)").build())
+ .add(OSType.builder().id("41").OSCategoryId("5").description("SUSE Linux Enterprise Server 10 SP1 (32-bit)")
+ .build())
+ .add(OSType.builder().id("42").OSCategoryId("5").description("SUSE Linux Enterprise Server 10 SP1 (64-bit)")
+ .build())
+ .add(OSType.builder().id("43").OSCategoryId("5").description("SUSE Linux Enterprise Server 10 SP2 (32-bit)")
+ .build())
+ .add(OSType.builder().id("44").OSCategoryId("5").description("SUSE Linux Enterprise Server 10 SP2 (64-bit)")
+ .build())
+ .add(OSType.builder().id("45").OSCategoryId("5").description("SUSE Linux Enterprise Server 10 SP3 (64-bit)")
+ .build())
+ .add(OSType.builder().id("46").OSCategoryId("5").description("SUSE Linux Enterprise Server 11 (32-bit)")
+ .build())
+ .add(OSType.builder().id("47").OSCategoryId("5").description("SUSE Linux Enterprise Server 11 (64-bit)")
+ .build())
+ .add(OSType.builder().id("40").OSCategoryId("5").description("SUSE Linux Enterprise Server 9 SP4 (32-bit)")
+ .build())
+ .add(OSType.builder().id("121").OSCategoryId("10").description("Ubuntu 10.04 (32-bit)").build())
+ .add(OSType.builder().id("126").OSCategoryId("10").description("Ubuntu 10.04 (64-bit)").build())
+ .add(OSType.builder().id("125").OSCategoryId("10").description("Ubuntu 8.04 (32-bit)").build())
+ .add(OSType.builder().id("130").OSCategoryId("10").description("Ubuntu 8.04 (64-bit)").build())
+ .add(OSType.builder().id("124").OSCategoryId("10").description("Ubuntu 8.10 (32-bit)").build())
+ .add(OSType.builder().id("129").OSCategoryId("10").description("Ubuntu 8.10 (64-bit)").build())
+ .add(OSType.builder().id("123").OSCategoryId("10").description("Ubuntu 9.04 (32-bit)").build())
+ .add(OSType.builder().id("128").OSCategoryId("10").description("Ubuntu 9.04 (64-bit)").build())
+ .add(OSType.builder().id("122").OSCategoryId("10").description("Ubuntu 9.10 (32-bit)").build())
+ .add(OSType.builder().id("127").OSCategoryId("10").description("Ubuntu 9.10 (64-bit)").build())
+ .add(OSType.builder().id("95").OSCategoryId("6").description("Windows 2000 Advanced Server").build())
+ .add(OSType.builder().id("105").OSCategoryId("6").description("Windows 2000 Professional").build())
+ .add(OSType.builder().id("61").OSCategoryId("6").description("Windows 2000 Server").build())
+ .add(OSType.builder().id("55").OSCategoryId("6").description("Windows 2000 Server SP4 (32-bit)").build())
+ .add(OSType.builder().id("65").OSCategoryId("6").description("Windows 3.1").build())
+ .add(OSType.builder().id("48").OSCategoryId("6").description("Windows 7 (32-bit)").build())
+ .add(OSType.builder().id("49").OSCategoryId("6").description("Windows 7 (64-bit)").build())
+ .add(OSType.builder().id("63").OSCategoryId("6").description("Windows 95").build())
+ .add(OSType.builder().id("62").OSCategoryId("6").description("Windows 98").build())
+ .add(OSType.builder().id("64").OSCategoryId("6").description("Windows NT 4").build())
+ .add(OSType.builder().id("87").OSCategoryId("6").description("Windows Server 2003 DataCenter Edition(32-bit)")
+ .build())
+ .add(OSType.builder().id("88").OSCategoryId("6").description("Windows Server 2003 DataCenter Edition(64-bit)")
+ .build())
+ .add(OSType.builder().id("50").OSCategoryId("6").description("Windows Server 2003 Enterprise Edition(32-bit)")
+ .build())
+ .add(OSType.builder().id("51").OSCategoryId("6").description("Windows Server 2003 Enterprise Edition(64-bit)")
+ .build())
+ .add(OSType.builder().id("89").OSCategoryId("6").description("Windows Server 2003 Standard Edition(32-bit)")
+ .build())
+ .add(OSType.builder().id("90").OSCategoryId("6").description("Windows Server 2003 Standard Edition(64-bit)")
+ .build())
+ .add(OSType.builder().id("91").OSCategoryId("6").description("Windows Server 2003 Web Edition").build())
+ .add(OSType.builder().id("52").OSCategoryId("6").description("Windows Server 2008 (32-bit)").build())
+ .add(OSType.builder().id("53").OSCategoryId("6").description("Windows Server 2008 (64-bit)").build())
+ .add(OSType.builder().id("54").OSCategoryId("6").description("Windows Server 2008 R2 (64-bit)").build())
+ .add(OSType.builder().id("56").OSCategoryId("6").description("Windows Vista (32-bit)").build())
+ .add(OSType.builder().id("101").OSCategoryId("6").description("Windows Vista (64-bit)").build())
+ .add(OSType.builder().id("93").OSCategoryId("6").description("Windows XP (32-bit)").build())
+ .add(OSType.builder().id("94").OSCategoryId("6").description("Windows XP (64-bit)").build())
+ .add(OSType.builder().id("57").OSCategoryId("6").description("Windows XP SP2 (32-bit)").build())
+ .add(OSType.builder().id("58").OSCategoryId("6").description("Windows XP SP3 (32-bit)").build()).build();
+ }
+}