Repository: jclouds-labs Updated Branches: refs/heads/master bec869d68 -> 6ab58bd2e
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/java/org/jclouds/azurecompute/parse/ListHostedServicesTest.java ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/java/org/jclouds/azurecompute/parse/ListHostedServicesTest.java b/azurecompute/src/test/java/org/jclouds/azurecompute/parse/ListHostedServicesTest.java new file mode 100644 index 0000000..3eaf136 --- /dev/null +++ b/azurecompute/src/test/java/org/jclouds/azurecompute/parse/ListHostedServicesTest.java @@ -0,0 +1,79 @@ +/* + * 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.azurecompute.parse; + +import com.google.common.collect.ImmutableList; +import java.io.InputStream; +import java.net.URI; +import java.util.List; +import org.jclouds.azurecompute.domain.DetailedHostedServiceProperties; +import org.jclouds.azurecompute.domain.HostedService.Status; +import org.jclouds.azurecompute.domain.HostedServiceWithDetailedProperties; +import org.jclouds.azurecompute.xml.ListHostedServicesHandler; +import org.jclouds.date.DateService; +import org.jclouds.date.internal.SimpleDateFormatDateService; +import org.jclouds.http.functions.BaseHandlerTest; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertEquals; + +@Test(groups = "unit", testName = "ListHostedServicesTest") +public class ListHostedServicesTest extends BaseHandlerTest { + + public void test() { + InputStream is = getClass().getResourceAsStream("/hostedservices.xml"); + + List<HostedServiceWithDetailedProperties> expected = expected(); + + ListHostedServicesHandler handler = injector.getInstance(ListHostedServicesHandler.class); + List<HostedServiceWithDetailedProperties> result = factory.create(handler).parse(is); + + assertEquals(result.toString(), expected.toString()); + + } + + private static final DateService dateService = new SimpleDateFormatDateService(); + + public static List<HostedServiceWithDetailedProperties> expected() { + return ImmutableList.<HostedServiceWithDetailedProperties>builder() + .add(HostedServiceWithDetailedProperties.builder() + .url(URI.create("https://management.core.windows.net/eb0347c3-68d4-4550-9b39-5e7e0f92f7db/services/hostedservices/neotys")) + .name("neotys") + .properties(DetailedHostedServiceProperties.builder() + .description("Implicitly created hosted service2012-08-06 14:55") + .location("West Europe") + .label("neotys") + .rawStatus("Created") + .status(Status.CREATED) + .created(dateService.iso8601SecondsDateParse("2012-08-06T14:55:17Z")) + .lastModified(dateService.iso8601SecondsDateParse("2012-08-06T15:50:34Z")) + .build()) + .build()) + .add(HostedServiceWithDetailedProperties.builder() + .url(URI.create("https://management.core.windows.net/eb0347c3-68d4-4550-9b39-5e7e0f92f7db/services/hostedservices/neotys3")) + .name("neotys3") + .properties(DetailedHostedServiceProperties.builder() + .location("West Europe") + .label("neotys3") + .rawStatus("Created") + .status(Status.CREATED) + .created(dateService.iso8601SecondsDateParse("2012-08-07T09:00:02Z")) + .lastModified(dateService.iso8601SecondsDateParse("2012-08-07T09:00:02Z")) + .build()) + .build()).build(); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/java/org/jclouds/azurecompute/parse/ListImagesTest.java ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/java/org/jclouds/azurecompute/parse/ListImagesTest.java b/azurecompute/src/test/java/org/jclouds/azurecompute/parse/ListImagesTest.java new file mode 100644 index 0000000..d9e19b3 --- /dev/null +++ b/azurecompute/src/test/java/org/jclouds/azurecompute/parse/ListImagesTest.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.azurecompute.parse; + +import com.google.common.collect.ImmutableList; +import java.io.InputStream; +import java.util.List; +import org.jclouds.azurecompute.domain.Image; +import org.jclouds.azurecompute.domain.OSType; +import org.jclouds.azurecompute.xml.ListImagesHandler; +import org.jclouds.http.functions.BaseHandlerTest; +import org.testng.annotations.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +@Test(groups = "unit", testName = "ListOSImagesTest") +public class ListImagesTest extends BaseHandlerTest { + + public void test() { + InputStream is = getClass().getResourceAsStream("/images.xml"); + + ListImagesHandler handler = injector.getInstance(ListImagesHandler.class); + List<Image> result = factory.create(handler).parse(is); + + assertThat(result).usingFieldByFieldElementComparator().containsExactlyElementsOf(expected()); + } + + public static List<Image> expected() { + return ImmutableList.<Image>builder() + .add(Image.builder() + .category("Canonical") + .label("Ubuntu Server 12.04 LTS") + .logicalSizeInGB(30) + .name("CANONICAL__Canonical-Ubuntu-12-04-amd64-server-20120528.1.3-en-us-30GB.vhd") + .os(OSType.LINUX) + .eula("http://www.ubuntu.com/project/about-ubuntu/licensing") + .description("Ubuntu Server 12.04 LTS amd64 20120528 Cloud Image").build()) + .add(Image.builder() + .category("Microsoft") + .label("Windows Server 2008 R2 SP1, June 2012") + .logicalSizeInGB(30) + .name("MSFT__Win2K8R2SP1-120612-1520-121206-01-en-us-30GB.vhd") + .os(OSType.WINDOWS) + .description("Windows Server 2008 R2 is a multi-purpose server.").build()) + .add(Image.builder() + .category("Microsoft") + .label("Microsoft SQL Server 2012 Evaluation Edition") + .logicalSizeInGB(30) + .name("MSFT__Sql-Server-11EVAL-11.0.2215.0-05152012-en-us-30GB.vhd") + .os(OSType.WINDOWS) + .eula("http://go.microsoft.com/fwlink/?LinkID=251820") // NOTE multiple eula. + .eula("http://go.microsoft.com/fwlink/?LinkID=131004") + .description("SQL Server 2012 Evaluation Edition (64-bit).").build()) + .add(Image.builder() + .category("Microsoft") + .label("Windows Server 2012 Release Candidate, July 2012") + .logicalSizeInGB(30) + .name("MSFT__Win2K12RC-Datacenter-201207.02-en.us-30GB.vhd") + .os(OSType.WINDOWS) + .description("Windows Server 2012 incorporates Microsoft's experience building.").build()) + .add(Image.builder() + .category("Microsoft") + .label("Windows Server 2008 R2 SP1, July 2012") + .logicalSizeInGB(30) + .name("MSFT__Win2K8R2SP1-Datacenter-201207.01-en.us-30GB.vhd") + .os(OSType.WINDOWS) + .description("Windows Server 2008 R2 is a multi-purpose server.") + .build()) + .add(Image.builder() + .category("OpenLogic") + .label("OpenLogic CentOS 6.2") + .logicalSizeInGB(30) + .name("OpenLogic__OpenLogic-CentOS-62-20120531-en-us-30GB.vhd") + .os(OSType.LINUX) + .eula("http://www.openlogic.com/azure/service-agreement/") + .description("This distribution of Linux is based on CentOS.").build()) + .add(Image.builder() + .category("SUSE") + .label("openSUSE 12.1") + .logicalSizeInGB(30) + .name("SUSE__openSUSE-12-1-20120603-en-us-30GB.vhd") + .os(OSType.LINUX) + .eula("http://opensuse.org/") + .description("openSUSE is a free and Linux-based operating system!") + .build()) + .add(Image.builder() + .category("SUSE") + .label("SUSE Linux Enterprise Server") + .logicalSizeInGB(30) + .name("SUSE__SUSE-Linux-Enterprise-Server-11SP2-20120601-en-us-30GB.vhd") + .os(OSType.LINUX) + .eula("http://www.novell.com/licensing/eula/") + .description("SUSE Linux Enterprise Server is a highly reliable value.").build()) + .add(Image.builder() + .category("RightScale with Linux") + .label("RightImage-CentOS-6.4-x64-v13.4") + .logicalSizeInGB(10) + .name("0b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.4-x64-v13.4") + .os(OSType.LINUX) // No EULA, as RightScale stuffed ';' into the field. + .build()).build(); + } + +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/java/org/jclouds/azurecompute/parse/ListLocationsTest.java ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/java/org/jclouds/azurecompute/parse/ListLocationsTest.java b/azurecompute/src/test/java/org/jclouds/azurecompute/parse/ListLocationsTest.java new file mode 100644 index 0000000..5ec96b1 --- /dev/null +++ b/azurecompute/src/test/java/org/jclouds/azurecompute/parse/ListLocationsTest.java @@ -0,0 +1,79 @@ +/* + * 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.azurecompute.parse; + +import com.google.common.collect.ImmutableList; +import java.io.InputStream; +import java.util.List; +import org.jclouds.azurecompute.domain.Location; +import org.jclouds.azurecompute.xml.ListLocationsHandler; +import org.jclouds.http.functions.BaseHandlerTest; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertEquals; + +@Test(groups = "unit", testName = "LocationsTest") +public class ListLocationsTest extends BaseHandlerTest { + + public void test() { + InputStream is = getClass().getResourceAsStream("/locations.xml"); + + List<Location> expected = expected(); + + ListLocationsHandler handler = injector.getInstance(ListLocationsHandler.class); + List<Location> result = factory.create(handler).parse(is); + + assertEquals(result.toString(), expected.toString()); + + } + + public static List<Location> expected() { + List<String> availableServices = ImmutableList.of("Compute", "Storage", "PersistentVMRole"); + return ImmutableList.<Location>builder() + .add(Location.builder() + .name("West US") + .displayName("West US") + .availableServices(availableServices) + .build()) + .add(Location.builder() + .name("East US") + .displayName("East US") + .availableServices(availableServices) + .build()) + .add(Location.builder() + .name("East Asia") + .displayName("East Asia") + .availableServices(availableServices) + .build()) + .add(Location.builder() + .name("Southeast Asia") + .displayName("Southeast Asia") + .availableServices(availableServices) + .build()) + .add(Location.builder() + .name("North Europe") + .displayName("North Europe") + .availableServices(availableServices) + .build()) + .add(Location.builder() + .name("West Europe") + .displayName("West Europe") + .availableServices(availableServices) + .build()).build(); + } + +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/azure-test.p12 ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/azure-test.p12 b/azurecompute/src/test/resources/azure-test.p12 new file mode 100644 index 0000000..5250dd6 Binary files /dev/null and b/azurecompute/src/test/resources/azure-test.p12 differ http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/capturerolepayload.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/capturerolepayload.xml b/azurecompute/src/test/resources/capturerolepayload.xml new file mode 100644 index 0000000..9414c52 --- /dev/null +++ b/azurecompute/src/test/resources/capturerolepayload.xml @@ -0,0 +1 @@ +<CaptureRoleOperation xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><OperationType>CaptureRoleOperation</OperationType><PostCaptureAction>Delete</PostCaptureAction><TargetImageLabel>myImageLabel</TargetImageLabel><TargetImageName>myImageName</TargetImageName></CaptureRoleOperation> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/create_hostedservice_location.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/create_hostedservice_location.xml b/azurecompute/src/test/resources/create_hostedservice_location.xml new file mode 100644 index 0000000..076f562 --- /dev/null +++ b/azurecompute/src/test/resources/create_hostedservice_location.xml @@ -0,0 +1 @@ +<CreateHostedService xmlns="http://schemas.microsoft.com/windowsazure"><ServiceName>myservice</ServiceName><Label>c2VydmljZSBtaW5l</Label><Location>West US</Location></CreateHostedService> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/create_hostedservice_location_options.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/create_hostedservice_location_options.xml b/azurecompute/src/test/resources/create_hostedservice_location_options.xml new file mode 100644 index 0000000..9f7f8f0 --- /dev/null +++ b/azurecompute/src/test/resources/create_hostedservice_location_options.xml @@ -0,0 +1 @@ +<CreateHostedService xmlns="http://schemas.microsoft.com/windowsazure"><ServiceName>myservice</ServiceName><Label>c2VydmljZSBtaW5l</Label><Description>my description</Description><Location>West US</Location><ExtendedProperties><ExtendedProperty><Name>Role</Name><Value>Production</Value></ExtendedProperty></ExtendedProperties></CreateHostedService> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/deployment.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/deployment.xml b/azurecompute/src/test/resources/deployment.xml new file mode 100644 index 0000000..c44fc7a --- /dev/null +++ b/azurecompute/src/test/resources/deployment.xml @@ -0,0 +1,70 @@ +<Deployment xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> + <Name>neotysss</Name> + <DeploymentSlot>Production</DeploymentSlot> + <PrivateID>05aa8ec5d8ee4215894431c7db401b31</PrivateID> + <Status>Running</Status> + <Label>bmVvdHlzc3M=</Label> + <Url>http://neotysss.cloudapp.net/</Url> + <Configuration>PFNlcnZpY2VDb25maWd1cmF0aW9uIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zOnhzZD0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zPSJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL1NlcnZpY2VIb3N0aW5nLzIwMDgvMTAvU2VydmljZUNvbmZpZ3VyYXRpb24iPg0KICA8Um9sZSBuYW1lPSJuZW90eXNzcyI+DQogICAgPEluc3RhbmNlcyBjb3VudD0iMSIgLz4NCiAgPC9Sb2xlPg0KPC9TZXJ2aWNlQ29uZmlndXJhdGlvbj4=</Configuration> + <RoleInstanceList> + <RoleInstance> + <RoleName>neotysss</RoleName> + <InstanceName>neotysss</InstanceName> + <InstanceStatus>ReadyRole</InstanceStatus> + <InstanceUpgradeDomain>0</InstanceUpgradeDomain> + <InstanceFaultDomain>0</InstanceFaultDomain> + <InstanceSize>Medium</InstanceSize> + <InstanceStateDetails/> + <IpAddress>10.59.244.162</IpAddress> + <InstanceEndpoints> + <InstanceEndpoint> + <Name>SSH</Name> + <Vip>168.63.27.148</Vip> + <PublicPort>22</PublicPort> + <LocalPort>22</LocalPort> + <Protocol>tcp</Protocol> + </InstanceEndpoint> + </InstanceEndpoints> + <PowerState>Started</PowerState> + <HostName>neotys</HostName> + </RoleInstance> + </RoleInstanceList> + <UpgradeDomainCount>1</UpgradeDomainCount> + <RoleList> + <Role i:type="PersistentVMRole"> + <RoleName>neotysss</RoleName> + <OsVersion/> + <RoleType>PersistentVMRole</RoleType> + <ConfigurationSets> + <ConfigurationSet i:type="NetworkConfigurationSet"> + <ConfigurationSetType>NetworkConfiguration</ConfigurationSetType> + <InputEndpoints> + <InputEndpoint> + <LocalPort>22</LocalPort> + <Name>SSH</Name> + <Port>22</Port> + <Protocol>tcp</Protocol> + <Vip>168.63.27.148</Vip> + </InputEndpoint> + </InputEndpoints> + <SubnetNames/> + </ConfigurationSet> + </ConfigurationSets> + <DataVirtualHardDisks/> + <OSVirtualHardDisk> + <HostCaching>ReadWrite</HostCaching> + <DiskName>neotysss-neotysss-0-20120824091357</DiskName> + <MediaLink>http://portalvhds0g7xhnq2x7t21.blob.core.windows.net/disks/neotysss/MSFT__Win2K8R2SP1-120612-1520-121206-01-en-us-30GB.vhd</MediaLink> + <SourceImageName>MSFT__Win2K8R2SP1-120612-1520-121206-01-en-us-30GB.vhd</SourceImageName> + <OS>Windows</OS> + </OSVirtualHardDisk> + <RoleSize>Medium</RoleSize> + </Role> + </RoleList> + <SdkVersion/> + <Locked>false</Locked> + <RollbackAllowed>false</RollbackAllowed> + <CreatedTime>2012-08-24T09:13:53Z</CreatedTime> + <LastModifiedTime>2012-08-27T08:55:13Z</LastModifiedTime> + <ExtendedProperties/> +</Deployment> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/deploymentparams.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/deploymentparams.xml b/azurecompute/src/test/resources/deploymentparams.xml new file mode 100644 index 0000000..fadaff1 --- /dev/null +++ b/azurecompute/src/test/resources/deploymentparams.xml @@ -0,0 +1 @@ +<Deployment xmlns="http://schemas.microsoft.com/windowsazure"><Name>mydeployment</Name><DeploymentSlot>Production</DeploymentSlot><Label>mydeployment</Label><RoleList><Role><RoleName>mydeployment</RoleName><RoleType>PersistentVMRole</RoleType><ConfigurationSets><ConfigurationSet><ConfigurationSetType>LinuxProvisioningConfiguration</ConfigurationSetType><HostName>mydeployment</HostName><UserName>username</UserName><UserPassword>testpwd</UserPassword><DisableSshPasswordAuthentication>false</DisableSshPasswordAuthentication><SSH/></ConfigurationSet><ConfigurationSet><ConfigurationSetType>NetworkConfiguration</ConfigurationSetType><InputEndpoints/><SubnetNames/></ConfigurationSet></ConfigurationSets><DataVirtualHardDisks/><OSVirtualHardDisk><HostCaching>ReadWrite</HostCaching><MediaLink>http://portalvhds0g7xhnq2x7t21.blob.core.windows.net/disks/mydeployment/OpenLogic__OpenLogic-CentOS-62-20120531-en-us-30GB.vhd</MediaLink><SourceImageName>OpenLogic__OpenLogic-CentOS-62-20120531-en-us-30 GB.vhd</SourceImageName><OS>Linux</OS></OSVirtualHardDisk><RoleSize>Medium</RoleSize></Role></RoleList></Deployment> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/disks.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/disks.xml b/azurecompute/src/test/resources/disks.xml new file mode 100644 index 0000000..afae399 --- /dev/null +++ b/azurecompute/src/test/resources/disks.xml @@ -0,0 +1,23 @@ +<Disks xmlns="http://schemas.microsoft.com/windowsazure"> + <Disk> + <OS>Linux</OS> + <Location>West Europe</Location> + <LogicalDiskSizeInGB>30</LogicalDiskSizeInGB> + <MediaLink>http://neotysbucket1.blob.core.windows.net/vhds/testimage2-testimage2-2012-08-17.vhd</MediaLink> + <Name>testimage2-testimage2-0-20120817095145</Name> + <SourceImageName>OpenLogic__OpenLogic-CentOS-62-20120531-en-us-30GB.vhd</SourceImageName> + </Disk> + <Disk> + <AttachedTo> + <DeploymentName>neotysss</DeploymentName> + <HostedServiceName>neotysss</HostedServiceName> + <RoleName>neotysss</RoleName> + </AttachedTo> + <OS>Windows</OS> + <Location>West Europe</Location> + <LogicalDiskSizeInGB>30</LogicalDiskSizeInGB> + <MediaLink>http://portalvhds0g7xhnq2x7t21.blob.core.windows.net/disks/neotysss/MSFT__Win2K8R2SP1-120612-1520-121206-01-en-us-30GB.vhd</MediaLink> + <Name>neotysss-neotysss-0-20120824091357</Name> + <SourceImageName>MSFT__Win2K8R2SP1-120612-1520-121206-01-en-us-30GB.vhd</SourceImageName> + </Disk> +</Disks> http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/error.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/error.xml b/azurecompute/src/test/resources/error.xml new file mode 100644 index 0000000..a9f9b2f --- /dev/null +++ b/azurecompute/src/test/resources/error.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<Error> + <Code>MissingOrInvalidRequiredQueryParameter</Code> + <Message>A required query parameter was not specified for this request or was specified incorrectly.</Message> +</Error> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/hostedservice.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/hostedservice.xml b/azurecompute/src/test/resources/hostedservice.xml new file mode 100644 index 0000000..625aeb3 --- /dev/null +++ b/azurecompute/src/test/resources/hostedservice.xml @@ -0,0 +1,10 @@ +<HostedService xmlns="http://schemas.microsoft.com/windowsazure"> + <Url>https://management.core.windows.net/eb0347c3-68d4-4550-9b39-5e7e0f92f7db/services/hostedservices/neotys</Url> + <ServiceName>neotys</ServiceName> + <HostedServiceProperties> + <Description>Implicitly created hosted service2012-08-06 14:55 + </Description> + <Location>West Europe</Location> + <Label>bmVvdHlz</Label> + </HostedServiceProperties> +</HostedService> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/hostedservice_details.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/hostedservice_details.xml b/azurecompute/src/test/resources/hostedservice_details.xml new file mode 100644 index 0000000..d730cc7 --- /dev/null +++ b/azurecompute/src/test/resources/hostedservice_details.xml @@ -0,0 +1,13 @@ +<HostedService xmlns="http://schemas.microsoft.com/windowsazure"> + <Url>https://management.core.windows.net/eb0347c3-68d4-4550-9b39-5e7e0f92f7db/services/hostedservices/neotys</Url> + <ServiceName>neotys</ServiceName> + <HostedServiceProperties> + <Description>Implicitly created hosted service2012-08-06 14:55</Description> + <Location>West Europe</Location> + <Label>bmVvdHlz</Label> + <Status>Created</Status> + <DateCreated>2012-08-06T14:55:17Z</DateCreated> + <DateLastModified>2012-08-06T15:50:34Z</DateLastModified> + <ExtendedProperties /> + </HostedServiceProperties> +</HostedService> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/hostedservices.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/hostedservices.xml b/azurecompute/src/test/resources/hostedservices.xml new file mode 100644 index 0000000..66b7589 --- /dev/null +++ b/azurecompute/src/test/resources/hostedservices.xml @@ -0,0 +1,29 @@ +<HostedServices xmlns="http://schemas.microsoft.com/windowsazure" + xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> + <HostedService> + <Url>https://management.core.windows.net/eb0347c3-68d4-4550-9b39-5e7e0f92f7db/services/hostedservices/neotys</Url> + <ServiceName>neotys</ServiceName> + <HostedServiceProperties> + <Description>Implicitly created hosted service2012-08-06 14:55</Description> + <Location>West Europe</Location> + <Label>bmVvdHlz</Label> + <Status>Created</Status> + <DateCreated>2012-08-06T14:55:17Z</DateCreated> + <DateLastModified>2012-08-06T15:50:34Z</DateLastModified> + <ExtendedProperties /> + </HostedServiceProperties> + </HostedService> + <HostedService> + <Url>https://management.core.windows.net/eb0347c3-68d4-4550-9b39-5e7e0f92f7db/services/hostedservices/neotys3</Url> + <ServiceName>neotys3</ServiceName> + <HostedServiceProperties> + <Description i:nil="true" /> + <Location>West Europe</Location> + <Label>bmVvdHlzMw==</Label> + <Status>Created</Status> + <DateCreated>2012-08-07T09:00:02Z</DateCreated> + <DateLastModified>2012-08-07T09:00:02Z</DateLastModified> + <ExtendedProperties /> + </HostedServiceProperties> + </HostedService> +</HostedServices> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/imageparams.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/imageparams.xml b/azurecompute/src/test/resources/imageparams.xml new file mode 100644 index 0000000..d3279ba --- /dev/null +++ b/azurecompute/src/test/resources/imageparams.xml @@ -0,0 +1 @@ +<OSImage xmlns="http://schemas.microsoft.com/windowsazure"><Label>foo</Label><MediaLink>http://example.blob.core.windows.net/disks/mydisk.vhd</MediaLink><Name>myimage</Name><OS>Linux</OS></OSImage> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/images.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/images.xml b/azurecompute/src/test/resources/images.xml new file mode 100644 index 0000000..e7b37d6 --- /dev/null +++ b/azurecompute/src/test/resources/images.xml @@ -0,0 +1,84 @@ +<Images xmlns="http://schemas.microsoft.com/windowsazure" + > + <OSImage> + <Category>Canonical</Category> + <Label>Ubuntu Server 12.04 LTS</Label> + <LogicalSizeInGB>30</LogicalSizeInGB> + <Name>CANONICAL__Canonical-Ubuntu-12-04-amd64-server-20120528.1.3-en-us-30GB.vhd</Name> + <OS>Linux</OS> + <Eula>http://www.ubuntu.com/project/about-ubuntu/licensing</Eula> + <Description>Ubuntu Server 12.04 LTS amd64 20120528 Cloud Image</Description> + </OSImage> + <OSImage> + <Category>Microsoft</Category> + <Label>Windows Server 2008 R2 SP1, June 2012</Label> + <LogicalSizeInGB>30</LogicalSizeInGB> + <Name>MSFT__Win2K8R2SP1-120612-1520-121206-01-en-us-30GB.vhd</Name> + <OS>Windows</OS> + <Eula /> + <Description>Windows Server 2008 R2 is a multi-purpose server.</Description> + </OSImage> + <OSImage> + <Category>Microsoft</Category> + <Label>Microsoft SQL Server 2012 Evaluation Edition</Label> + <LogicalSizeInGB>30</LogicalSizeInGB> + <Name>MSFT__Sql-Server-11EVAL-11.0.2215.0-05152012-en-us-30GB.vhd</Name> + <OS>Windows</OS> + <Eula>http://go.microsoft.com/fwlink/?LinkID=251820;http://go.microsoft.com/fwlink/?LinkID=131004</Eula> + <Description>SQL Server 2012 Evaluation Edition (64-bit).</Description> + </OSImage> + <OSImage> + <Category>Microsoft</Category> + <Label>Windows Server 2012 Release Candidate, July 2012</Label> + <LogicalSizeInGB>30</LogicalSizeInGB> + <Name>MSFT__Win2K12RC-Datacenter-201207.02-en.us-30GB.vhd</Name> + <OS>Windows</OS> + <Eula /> + <Description>Windows Server 2012 incorporates Microsoft's experience building.</Description> + </OSImage> + <OSImage> + <Category>Microsoft</Category> + <Label>Windows Server 2008 R2 SP1, July 2012</Label> + <LogicalSizeInGB>30</LogicalSizeInGB> + <Name>MSFT__Win2K8R2SP1-Datacenter-201207.01-en.us-30GB.vhd</Name> + <OS>Windows</OS> + <Eula /> + <Description>Windows Server 2008 R2 is a multi-purpose server.</Description> + </OSImage> + <OSImage> + <Category>OpenLogic</Category> + <Label>OpenLogic CentOS 6.2</Label> + <LogicalSizeInGB>30</LogicalSizeInGB> + <Name>OpenLogic__OpenLogic-CentOS-62-20120531-en-us-30GB.vhd</Name> + <OS>Linux</OS> + <Eula>http://www.openlogic.com/azure/service-agreement/</Eula> + <Description>This distribution of Linux is based on CentOS.</Description> + </OSImage> + <OSImage> + <Category>SUSE</Category> + <Label>openSUSE 12.1</Label> + <LogicalSizeInGB>30</LogicalSizeInGB> + <Name>SUSE__openSUSE-12-1-20120603-en-us-30GB.vhd</Name> + <OS>Linux</OS> + <Eula>http://opensuse.org/</Eula> + <Description>openSUSE is a free and Linux-based operating system!</Description> + </OSImage> + <OSImage> + <Category>SUSE</Category> + <Label>SUSE Linux Enterprise Server</Label> + <LogicalSizeInGB>30</LogicalSizeInGB> + <Name>SUSE__SUSE-Linux-Enterprise-Server-11SP2-20120601-en-us-30GB.vhd</Name> + <OS>Linux</OS> + <Eula>http://www.novell.com/licensing/eula/</Eula> + <Description>SUSE Linux Enterprise Server is a highly reliable value.</Description> + </OSImage> + <OSImage> + <Category>RightScale with Linux</Category> + <Label>RightImage-CentOS-6.4-x64-v13.4</Label> + <LogicalSizeInGB>10</LogicalSizeInGB> + <Name>0b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.4-x64-v13.4</Name> + <OS>Linux</OS> + <Eula>;</Eula> + <Description/> + </OSImage> +</Images> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/locations.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/locations.xml b/azurecompute/src/test/resources/locations.xml new file mode 100644 index 0000000..5937871 --- /dev/null +++ b/azurecompute/src/test/resources/locations.xml @@ -0,0 +1,57 @@ +<?xml version="1.0"?> +<Locations xmlns="http://schemas.microsoft.com/windowsazure"> + <Location> + <Name>West US</Name> + <DisplayName>West US</DisplayName> + <AvailableServices> + <AvailableService>Compute</AvailableService> + <AvailableService>Storage</AvailableService> + <AvailableService>PersistentVMRole</AvailableService> + </AvailableServices> + </Location> + <Location> + <Name>East US</Name> + <DisplayName>East US</DisplayName> + <AvailableServices> + <AvailableService>Compute</AvailableService> + <AvailableService>Storage</AvailableService> + <AvailableService>PersistentVMRole</AvailableService> + </AvailableServices> + </Location> + <Location> + <Name>East Asia</Name> + <DisplayName>East Asia</DisplayName> + <AvailableServices> + <AvailableService>Compute</AvailableService> + <AvailableService>Storage</AvailableService> + <AvailableService>PersistentVMRole</AvailableService> + </AvailableServices> + </Location> + <Location> + <Name>Southeast Asia</Name> + <DisplayName>Southeast Asia</DisplayName> + <AvailableServices> + <AvailableService>Compute</AvailableService> + <AvailableService>Storage</AvailableService> + <AvailableService>PersistentVMRole</AvailableService> + </AvailableServices> + </Location> + <Location> + <Name>North Europe</Name> + <DisplayName>North Europe</DisplayName> + <AvailableServices> + <AvailableService>Compute</AvailableService> + <AvailableService>Storage</AvailableService> + <AvailableService>PersistentVMRole</AvailableService> + </AvailableServices> + </Location> + <Location> + <Name>West Europe</Name> + <DisplayName>West Europe</DisplayName> + <AvailableServices> + <AvailableService>Compute</AvailableService> + <AvailableService>Storage</AvailableService> + <AvailableService>PersistentVMRole</AvailableService> + </AvailableServices> + </Location> +</Locations> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/operation.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/operation.xml b/azurecompute/src/test/resources/operation.xml new file mode 100644 index 0000000..498d1f0 --- /dev/null +++ b/azurecompute/src/test/resources/operation.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<Operation xmlns="http://schemas.microsoft.com/windowsazure"> + <ID>request-id</ID> + <Status>Failed</Status> + <HttpStatusCode>400</HttpStatusCode> + <Error> + <Code>MissingOrInvalidRequiredQueryParameter</Code> + <Message>A required query parameter was not specified for this request or was specified incorrectly.</Message> + </Error> +</Operation> http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/restartrolepayload.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/restartrolepayload.xml b/azurecompute/src/test/resources/restartrolepayload.xml new file mode 100644 index 0000000..4eca508 --- /dev/null +++ b/azurecompute/src/test/resources/restartrolepayload.xml @@ -0,0 +1 @@ +<RestartRoleOperation xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><OperationType>RestartRoleOperation</OperationType></RestartRoleOperation> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/shutdownrolepayload.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/shutdownrolepayload.xml b/azurecompute/src/test/resources/shutdownrolepayload.xml new file mode 100644 index 0000000..27beee8 --- /dev/null +++ b/azurecompute/src/test/resources/shutdownrolepayload.xml @@ -0,0 +1 @@ +<ShutdownRoleOperation xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><OperationType>ShutdownRoleOperation</OperationType></ShutdownRoleOperation> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/azurecompute/src/test/resources/startrolepayload.xml ---------------------------------------------------------------------- diff --git a/azurecompute/src/test/resources/startrolepayload.xml b/azurecompute/src/test/resources/startrolepayload.xml new file mode 100644 index 0000000..4e82022 --- /dev/null +++ b/azurecompute/src/test/resources/startrolepayload.xml @@ -0,0 +1 @@ +<StartRoleOperation xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><OperationType>StartRoleOperation</OperationType></StartRoleOperation> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/6ab58bd2/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index c88ed47..9140562 100644 --- a/pom.xml +++ b/pom.xml @@ -65,6 +65,7 @@ </repositories> <modules> + <module>azurecompute</module> <module>docker</module> <module>virtualbox</module> <module>vcloud-director</module>
