Ver Fonte

Zend_Cloud_Infrastructure_Adapter tests

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24494 44c647ce-9c0f-0410-b52a-842ac1e357ba
ezimuel há 14 anos atrás
pai
commit
af8847bdc7
42 ficheiros alterados com 1068 adições e 0 exclusões
  1. 243 0
      tests/Zend/Cloud/Infrastructure/Adapter/Ec2Test.php
  2. 238 0
      tests/Zend/Cloud/Infrastructure/Adapter/RackspaceTest.php
  3. 9 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testCreateInstance.request
  4. 45 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testCreateInstance.response
  5. 9 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testDeployInstance.request
  6. 15 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testDeployInstance.response
  7. 9 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testDestroyInstance.request
  8. 23 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testDestroyInstance.response
  9. 9 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testImagesInstance.request
  10. 62 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testImagesInstance.response
  11. 9 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testListInstance.request
  12. 45 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testListInstance.response
  13. 9 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testMonitorInstance.request
  14. 15 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testMonitorInstance.response
  15. 9 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testRebootInstance.request
  16. 11 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testRebootInstance.response
  17. 9 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testStartInstance.request
  18. 15 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testStartInstance.response
  19. 9 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testStopInstance.request
  20. 15 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testStopInstance.response
  21. 9 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testZonesInstance.request
  22. 32 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testZonesInstance.response
  23. 10 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testCreateInstance.request
  24. 14 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testCreateInstance.response
  25. 7 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testDeployInstance.request
  26. 15 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testDeployInstance.response
  27. 7 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testDestroyInstance.request
  28. 12 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testDestroyInstance.response
  29. 7 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testImagesInstance.request
  30. 15 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testImagesInstance.response
  31. 7 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testListInstance.request
  32. 15 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testListInstance.response
  33. 7 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testMonitorInstance.request
  34. 15 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testMonitorInstance.response
  35. 10 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testRebootInstance.request
  36. 12 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testRebootInstance.response
  37. 7 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testStartInstance.request
  38. 15 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testStartInstance.response
  39. 7 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testStopInstance.request
  40. 15 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testStopInstance.response
  41. 7 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testZonesInstance.request
  42. 15 0
      tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testZonesInstance.response

+ 243 - 0
tests/Zend/Cloud/Infrastructure/Adapter/Ec2Test.php

@@ -0,0 +1,243 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Cloud_Infrastructure_Adapter
+ * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ */
+
+require_once 'Zend/Http/Client.php';
+require_once 'Zend/Http/Client/Adapter/Test.php';
+require_once 'Zend/Cloud/Infrastructure/Adapter/Ec2.php';
+require_once 'Zend/Cloud/Infrastructure/Factory.php';
+
+class Zend_Cloud_Infrastructure_Adapter_Ec2Test extends PHPUnit_Framework_TestCase
+{
+    /**
+     * Timeout in seconds for status change
+     */
+    const STATUS_TIMEOUT= 120;
+
+    /**
+     * Reference to Infrastructure object
+     *
+     * @var Zend_Cloud_Infrastructure_Adapter
+     */
+    protected $infrastructure;
+
+    /**
+     * Socket based HTTP client adapter
+     *
+     * @var Zend_Http_Client_Adapter_Test
+     */
+    protected $httpClientAdapterTest;
+    
+    /**
+     * Image ID of the instance
+     * 
+     * @var string
+     */
+    protected static $instanceId;
+
+    /**
+     * Setup for each test
+     */
+    public function setUp()
+    {
+        $this->infrastructure = Zend_Cloud_Infrastructure_Factory::getAdapter(array( 
+            Zend_Cloud_Infrastructure_Factory::INFRASTRUCTURE_ADAPTER_KEY => 'Zend_Cloud_Infrastructure_Adapter_Ec2', 
+            Zend_Cloud_Infrastructure_Adapter_Ec2::AWS_ACCESS_KEY         => 'foo', 
+            Zend_Cloud_Infrastructure_Adapter_Ec2::AWS_SECRET_KEY         => 'bar', 
+            Zend_Cloud_Infrastructure_Adapter_Ec2::AWS_REGION             => 'us-east-1'     
+        )); 
+
+        $this->httpClientAdapterTest = new Zend_Http_Client_Adapter_Test();     
+
+        // load the HTTP response (from a file)
+        $shortClassName = substr(__CLASS__,strlen('Zend_Cloud_Infrastructure_Adapter_'));
+        $filename= dirname(__FILE__) . '/_files/' . $shortClassName . '_'. $this->getName().'.response';
+
+        if (file_exists($filename)) {
+            $this->httpClientAdapterTest->setResponse($this->loadResponse($filename)); 
+        }
+        
+        $adapter= $this->infrastructure->getAdapter();
+        
+        $client = new Zend_Http_Client(null, array(
+            'adapter' => $this->httpClientAdapterTest
+        ));
+        
+        call_user_func(array($adapter,'setHttpClient'),$client);
+    
+    }
+    /**
+     * Utility method for returning a string HTTP response, which is loaded from a file
+     *
+     * @param  string $name
+     * @return string
+     */
+    protected function loadResponse($name)
+    {
+        return file_get_contents($name);
+    }
+    /**
+     * Get Config Array
+     * 
+     * @return array
+     */ 
+    static function getConfigArray()
+    {
+         return array(
+            Zend_Cloud_Infrastructure_Factory::INFRASTRUCTURE_ADAPTER_KEY => 'Zend_Cloud_Infrastructure_Adapter_Ec2',
+            Zend_Cloud_Infrastructure_Adapter_Ec2::AWS_ACCESS_KEY         => 'foo',
+            Zend_Cloud_Infrastructure_Adapter_Ec2::AWS_SECRET_KEY         => 'bar',
+            Zend_Cloud_Infrastructure_Adapter_Ec2::AWS_REGION             => 'us-east-1',
+            Zend_Cloud_Infrastructure_Adapter_Ec2::AWS_SECURITY_GROUP     => 'default'
+        );
+    }
+    
+    /**
+     * Test all the constants of the class
+     */
+    public function testConstants()
+    {
+        $this->assertEquals('aws_accesskey', Zend_Cloud_Infrastructure_Adapter_Ec2::AWS_ACCESS_KEY);
+        $this->assertEquals('aws_secretkey', Zend_Cloud_Infrastructure_Adapter_Ec2::AWS_SECRET_KEY);
+        $this->assertEquals('aws_region', Zend_Cloud_Infrastructure_Adapter_Ec2::AWS_REGION);
+    }
+
+    /**
+     * Test construct with missing params
+     */
+    public function testConstructExceptionMissingParams() 
+    {
+        $this->setExpectedException(
+            'Zend_Cloud_Infrastructure_Exception',
+            'Invalid options provided'
+        );
+        $image = new Zend_Cloud_Infrastructure_Adapter_Ec2('foo');
+    }
+
+    /**
+     * Test getAdapter
+     */
+    public function testGetAdapter()
+    {
+        $this->assertInstanceOf('Zend_Service_Amazon_Ec2_Instance',$this->infrastructure->getAdapter());
+    }
+
+    /**
+     * Test create an instance
+     */
+    public function testCreateInstance()
+    {
+        $options = array (
+            Zend_Cloud_Infrastructure_Instance::INSTANCE_IMAGEID      => 'ami-7f418316',
+            Zend_Cloud_Infrastructure_Adapter_Ec2::AWS_SECURITY_GROUP => array('default')
+        );       
+        $instance = $this->infrastructure->createInstance('test', $options);
+        self::$instanceId= $instance->getId();
+        $this->assertEquals('ami-7f418316', $instance->getImageId());
+    }
+
+    /**
+     * Test list of an instance
+     */
+    public function testListInstance()
+    {
+        $instances = $this->infrastructure->listInstances(self::$instanceId);
+        $found = false;
+        foreach ($instances as $instance) {
+            if ($instance->getId()==self::$instanceId) {
+                $found = true;
+                break;
+            }
+        }
+        $this->assertTrue($found);
+    }
+
+    /**
+     * Test images instance
+     */
+    public function testImagesInstance()
+    {
+        $images = $this->infrastructure->imagesInstance();
+        $this->assertTrue(!empty($images));
+    }
+
+    /**
+     * Test zones instance
+     */
+    public function testZonesInstance()
+    {
+        $zones = $this->infrastructure->zonesInstance();
+        $this->assertTrue(!empty($zones));
+    }
+
+    /**
+     * Test monitor instance
+     */
+    public function testMonitorInstance()
+    {
+        $monitor       = $this->infrastructure->monitorInstance(self::$instanceId,Zend_Cloud_Infrastructure_Instance::MONITOR_CPU);
+        $adapterResult = $this->infrastructure->getAdapterResult();
+        $this->assertTrue(!empty($adapterResult['label']));
+    }
+
+    /**
+     * Test deploy instance
+     */
+    public function testDeployInstance()
+    {
+        $this->markTestSkipped('Test deploy instance skipped');
+    }
+
+    /**
+     * Test stop an instance
+     */
+    public function testStopInstance()
+    {
+        $this->markTestSkipped('Test stop instance skipped');
+    }
+
+    /**
+     * Test start an instance
+     */
+    public function testStartInstance()
+    {
+        $this->markTestSkipped('Test start instance skipped');   
+    }
+
+    /**
+     * Test reboot and instance
+     */
+    public function testRebootInstance()
+    {
+        $this->assertTrue($this->infrastructure->rebootInstance(self::$instanceId));    
+    }
+
+    /**
+     * Test destroy instance
+     */
+    public function testDestroyInstance()
+    {
+        $this->assertTrue($this->infrastructure->destroyInstance(self::$instanceId));
+    }
+}
+
+if (PHPUnit_MAIN_METHOD == 'Zend_Cloud_Infrastructure_Adapter_Ec2Test::main') {
+    Zend_Cloud_Infrastructure_Adapter_Ec2Test::main();
+}

+ 238 - 0
tests/Zend/Cloud/Infrastructure/Adapter/RackspaceTest.php

@@ -0,0 +1,238 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend\Cloud\Infrastructure\Adapter
+ * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ */
+
+require_once 'Zend/Http/Client/Adapter/Test.php';
+require_once 'Zend/Cloud/Infrastructure/Adapter/Rackspace.php';
+require_once 'Zend/Cloud/Infrastructure/Factory.php';
+
+class Zend_Cloud_Infrastructure_Adapter_RackspaceTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * Timeout in seconds for status change
+     */
+    const STATUS_TIMEOUT= 120;
+    /**
+     * Reference to Infrastructure object
+     *
+     * @var Zend_Cloud_Infrastructure_Adapter
+     */
+    protected $infrastructure;
+
+    /**
+     * Socket based HTTP client adapter
+     *
+     * @var Zend_Http_Client_Adapter_Test
+     */
+    protected $httpClientAdapterTest;
+    
+    /**
+     * Image ID of the instance
+     * 
+     * @var string
+     */
+    protected static $instanceId;
+    
+    /**
+     * Setup for each test
+     */
+    public function setUp()
+    {
+        $this->infrastructure = Zend_Cloud_Infrastructure_Factory::getAdapter(array( 
+            Zend_Cloud_Infrastructure_Factory::INFRASTRUCTURE_ADAPTER_KEY => 'Zend_Cloud_Infrastructure_Adapter_Rackspace', 
+            Zend_Cloud_Infrastructure_Adapter_Rackspace::RACKSPACE_USER   => constant('TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_USER'), 
+            Zend_Cloud_Infrastructure_Adapter_Rackspace::RACKSPACE_KEY    => constant('TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_KEY'), 
+            Zend_Cloud_Infrastructure_Adapter_Rackspace::RACKSPACE_REGION => constant('TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_REGION')   
+        )); 
+
+        $this->httpClientAdapterTest = new Zend_Http_Client_Adapter_Test();
+
+        $this->infrastructure->getAdapter()
+                             ->getHttpClient()
+                             ->setAdapter($this->httpClientAdapterTest);
+        
+        // load the HTTP response (from a file)
+        $shortClassName = substr(__CLASS__,strlen('Zend_Cloud_Infrastructure_Adapter_'));
+        $filename= dirname(__FILE__) . '/_files/' . $shortClassName . '_'. $this->getName().'.response';
+        
+        if (file_exists($filename)) {
+            $this->httpClientAdapterTest->setResponse($this->loadResponse($filename)); 
+        }
+        
+    }
+    
+    /**
+     * Utility method for returning a string HTTP response, which is loaded from a file
+     *
+     * @param  string $name
+     * @return string
+     */
+    protected function loadResponse($name)
+    {
+        return file_get_contents($name);
+    }    
+    /**
+     * Get Config Array
+     * 
+     * @return array
+     */ 
+    static function getConfigArray()
+    {
+         return array(
+            Zend_Cloud_Infrastructure_Factory::INFRASTRUCTURE_ADAPTER_KEY => 'Zend_Cloud_Infrastructure_Adapter_Rackspace',
+            Zend_Cloud_Infrastructure_Adapter_Rackspace::RACKSPACE_USER   => constant('TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_USER'),
+            Zend_Cloud_Infrastructure_Adapter_Rackspace::RACKSPACE_KEY    => constant('TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_KEY'),
+            Zend_Cloud_Infrastructure_Adapter_Rackspace::RACKSPACE_REGION => constant('TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_REGION')
+        );
+    }
+    
+    /**
+     * Test all the constants of the class
+     */
+    public function testConstants()
+    {
+        $this->assertEquals('rackspace_user', Zend_Cloud_Infrastructure_Adapter_Rackspace::RACKSPACE_USER);
+        $this->assertEquals('rackspace_key', Zend_Cloud_Infrastructure_Adapter_Rackspace::RACKSPACE_KEY);
+        $this->assertEquals('rackspace_region', Zend_Cloud_Infrastructure_Adapter_Rackspace::RACKSPACE_REGION);
+        $this->assertEquals('USA', Zend_Cloud_Infrastructure_Adapter_Rackspace::RACKSPACE_ZONE_USA);
+        $this->assertEquals('UK', Zend_Cloud_Infrastructure_Adapter_Rackspace::RACKSPACE_ZONE_UK);
+        $this->assertTrue(Zend_Cloud_Infrastructure_Adapter_Rackspace::MONITOR_CPU_SAMPLES>0);
+    }
+    /**
+     * Test construct with missing params
+     */
+    public function testConstructExceptionMissingParams() 
+    {
+        $this->setExpectedException(
+            'Zend_Cloud_Infrastructure_Exception',
+            'Invalid options provided'
+        );
+        $instance = new Zend_Cloud_Infrastructure_Adapter_Rackspace('foo');
+    }
+    /**
+     * Test getAdapter
+     */
+    public function testGetAdapter()
+    {
+        $this->assertInstanceOf('Zend_Service_Rackspace_Servers',$this->infrastructure->getAdapter());
+    }
+    /**
+     * Test create an instance
+     */
+    public function testCreateInstance()
+    {
+        $options = array (
+            'imageId'  => constant('TESTS_ZEND_SERVICE_RACKSPACE_SERVER_IMAGEID'),
+            'flavorId' => constant('TESTS_ZEND_SERVICE_RACKSPACE_SERVER_FLAVORID'),
+            'metadata' => array (
+                'foo' => 'bar'
+            )
+        );
+        $instance = $this->infrastructure->createInstance(constant('TESTS_ZEND_SERVICE_RACKSPACE_SERVER_IMAGE_NAME'), $options);
+        self::$instanceId= $instance->getId();
+        $this->assertEquals(constant('TESTS_ZEND_SERVICE_RACKSPACE_SERVER_IMAGEID'), $instance->getImageId());
+    }
+    /**
+     * Test last HTTP request
+     */
+    public function testGetLastHttpRequest()
+    {
+        $lastHttpRequest = $this->infrastructure->getLastHttpRequest();
+        $this->assertTrue(!empty($lastHttpRequest));
+    }
+    /**
+     * Test last HTTP response
+     */
+    public function testGetLastHttpResponse()
+    {
+        $lastHttpResponse = $this->infrastructure->getLastHttpResponse();
+        $this->assertTrue(!empty($lastHttpResponse));
+    }
+    /**
+     * Test list of an instance
+     */
+    public function testListInstance()
+    {
+        $instances = $this->infrastructure->listInstances(self::$instanceId);
+        $this->assertTrue(!empty($instances));
+    }
+    /**
+     * Test images instance
+     */
+    public function testImagesInstance()
+    {
+        $images = $this->infrastructure->imagesInstance();
+        $this->assertTrue(!empty($images));
+    }
+    /**
+     * Test zones instance
+     */
+    public function testZonesInstance()
+    {
+        $zones = $this->infrastructure->zonesInstance();
+        $this->assertTrue(!empty($zones));
+    }
+    /**
+     * Test monitor instance
+     */
+    public function testMonitorInstance()
+    {
+        $this->markTestSkipped('Test monitor instance skipped');
+    }
+    /**
+     * Test deploy instance
+     */
+    public function testDeployInstance()
+    {
+        $this->markTestSkipped('Test deploy instance skipped');
+    }
+    /**
+     * Test stop an instance
+     */
+    public function testStopInstance()
+    {
+        $this->markTestSkipped('Test stop instance skipped');
+    }
+    /**
+     * Test start an instance
+     */
+    public function testStartInstance()
+    {
+        $this->markTestSkipped('Test start instance skipped');   
+    }
+    /**
+     * Test reboot and instance
+     */
+    public function testRebootInstance()
+    {
+        $this->assertTrue($this->infrastructure->rebootInstance(self::$instanceId));    
+    }
+    /**
+     * Test destroy instance
+     */
+    public function testDestroyInstance()
+    {
+        $this->assertTrue($this->infrastructure->destroyInstance(self::$instanceId));
+    }
+}
+
+if (PHPUnit_MAIN_METHOD == 'Zend_Cloud_Infrastructure_Adapter_RackspaceTest::main') {
+    Zend_Cloud_Infrastructure_Adapter_RackspaceTest::main();
+}

+ 9 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testCreateInstance.request

@@ -0,0 +1,9 @@
+POST / HTTP/1.1
+Host: us-east-1.ec2.amazonaws.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 243
+
+Action=DescribeInstances&InstanceId.1=i-6cfcb00c&AWSAccessKeyId=0123456789&SignatureVersion=2&Timestamp=2011-10-04T10%3A20%3A31Z&Version=2009-04-04&SignatureMethod=HmacSHA256&Signature=qK4FN3uM%2BfXuoUzhqY6HWv7vTYFHooGpD9HYY0WT5Lw%3D

+ 45 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testCreateInstance.response

@@ -0,0 +1,45 @@
+HTTP/1.1 200 OK
+Content-type: text/xml;charset=UTF-8
+Vary: Accept-Encoding
+Date: Tue, 04 Oct 2011 10:20:31 GMT
+Server: AmazonEC2
+
+<?xml version="1.0" encoding="UTF-8"?>
+<DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2009-04-04/">
+    <requestId>da504c82-2696-4a3c-8165-d2b2869b6b78</requestId>
+    <reservationSet>
+        <item>
+            <reservationId>r-14f4287a</reservationId>
+            <ownerId>788695787266</ownerId>
+            <groupSet>
+                <item>
+                    <groupId>default</groupId>
+                </item>
+            </groupSet>
+            <instancesSet>
+                <item>
+                    <instanceId>i-6cfcb00c</instanceId>
+                    <imageId>ami-7f418316</imageId>
+                    <instanceState>
+                        <code>16</code>
+                        <name>running</name>
+                    </instanceState>
+                    <privateDnsName>ip-10-36-34-11.ec2.internal</privateDnsName>
+                    <dnsName>ec2-184-72-66-78.compute-1.amazonaws.com</dnsName>
+                    <reason/>
+                    <amiLaunchIndex>0</amiLaunchIndex>
+                    <productCodes/>
+                    <instanceType>m1.small</instanceType>
+                    <launchTime>2011-10-04T10:20:14.000Z</launchTime>
+                    <placement>
+                        <availabilityZone>us-east-1b</availabilityZone>
+                    </placement>
+                    <kernelId>aki-805ea7e9</kernelId>
+                    <monitoring>
+                        <state>disabled</state>
+                    </monitoring>
+                </item>
+            </instancesSet>
+        </item>
+    </reservationSet>
+</DescribeInstancesResponse>

+ 9 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testDeployInstance.request

@@ -0,0 +1,9 @@
+POST / HTTP/1.1
+Host: us-east-1.monitoring.amazonaws.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 465
+
+Action=GetMetricStatistics&MeasureName=CPUUtilization&Period=60&Namespace=AWS%2FEC2&Statistics.member.1=Average&StartTime=2011-10-04T09%3A20%3A52%2B00%3A00&EndTime=2011-10-04T10%3A20%3A52%2B00%3A00&Dimensions.member.1.Name=InstanceId&Dimensions.member.1.Value=i-6cfcb00c&AWSAccessKeyId=0123456789&SignatureVersion=2&Timestamp=2011-10-04T10%3A20%3A52Z&Version=2009-05-15&SignatureMethod=HmacSHA256&Signature=7Lqkjxw2gB%2FKwcUYImKBnyTHzyacUzhkc4YlnqoPFfg%3D

+ 15 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testDeployInstance.response

@@ -0,0 +1,15 @@
+HTTP/1.1 200 OK
+X-amzn-requestid: 8a324eb6-ee72-11e0-9b3c-15df1bb85597
+Content-type: text/xml
+Content-length: 337
+Date: Tue, 04 Oct 2011 10:20:52 GMT
+
+<GetMetricStatisticsResponse xmlns="http://monitoring.amazonaws.com/doc/2009-05-15/">
+  <GetMetricStatisticsResult>
+    <Datapoints/>
+    <Label>CPUUtilization</Label>
+  </GetMetricStatisticsResult>
+  <ResponseMetadata>
+    <RequestId>8a324eb6-ee72-11e0-9b3c-15df1bb85597</RequestId>
+  </ResponseMetadata>
+</GetMetricStatisticsResponse>

+ 9 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testDestroyInstance.request

@@ -0,0 +1,9 @@
+POST / HTTP/1.1
+Host: us-east-1.ec2.amazonaws.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 248
+
+Action=TerminateInstances&InstanceId.1=i-6cfcb00c&AWSAccessKeyId=0123456789&SignatureVersion=2&Timestamp=2011-10-04T10%3A21%3A05Z&Version=2009-04-04&SignatureMethod=HmacSHA256&Signature=ngm%2F0jV%2Fbss%2B4ZCVqvp53Y9ZWXvEG89ASrFywxmRnQU%3D

+ 23 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testDestroyInstance.response

@@ -0,0 +1,23 @@
+HTTP/1.1 200 OK
+Content-type: text/xml;charset=UTF-8
+Vary: Accept-Encoding
+Date: Tue, 04 Oct 2011 10:21:05 GMT
+Server: AmazonEC2
+
+<?xml version="1.0" encoding="UTF-8"?>
+<TerminateInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2009-04-04/">
+    <requestId>2a205e9a-2ee8-47dd-bc39-3587b493b5a1</requestId>
+    <instancesSet>
+        <item>
+            <instanceId>i-6cfcb00c</instanceId>
+            <shutdownState>
+                <code>32</code>
+                <name>shutting-down</name>
+            </shutdownState>
+            <previousState>
+                <code>16</code>
+                <name>running</name>
+            </previousState>
+        </item>
+    </instancesSet>
+</TerminateInstancesResponse>

+ 9 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testImagesInstance.request

@@ -0,0 +1,9 @@
+POST / HTTP/1.1
+Host: us-east-1.ec2.amazonaws.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 224
+
+Action=DescribeImages&AWSAccessKeyId=0123456789&SignatureVersion=2&Timestamp=2011-10-04T10%3A20%3A43Z&Version=2009-04-04&SignatureMethod=HmacSHA256&Signature=5q6Q%2F9Xv%2BBr%2FuISP1eKjK1lnPSC%2F9b%2FtkkykHytfpg8%3D

+ 62 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testImagesInstance.response

@@ -0,0 +1,62 @@
+HTTP/1.1 200 OK
+Content-type: text/xml;charset=UTF-8
+Vary: Accept-Encoding
+Date: Tue, 04 Oct 2011 10:20:44 GMT
+Server: AmazonEC2
+
+<?xml version="1.0" encoding="UTF-8"?>
+<DescribeImagesResponse xmlns="http://ec2.amazonaws.com/doc/2009-04-04/">
+    <requestId>34047429-a993-405c-9c49-6bb16996f333</requestId>
+    <imagesSet>
+        <item>
+            <imageId>aki-00806369</imageId>
+            <imageLocation>karmic-kernel-zul/ubuntu-kernel-2.6.31-300-ec2-i386-20091001-test-04.manifest.xml</imageLocation>
+            <imageState>available</imageState>
+            <imageOwnerId>099720109477</imageOwnerId>
+            <isPublic>true</isPublic>
+            <architecture>i386</architecture>
+            <imageType>kernel</imageType>
+        </item>
+        <item>
+            <imageId>aki-00896a69</imageId>
+            <imageLocation>karmic-kernel-zul/ubuntu-kernel-2.6.31-300-ec2-i386-20091002-test-04.manifest.xml</imageLocation>
+            <imageState>available</imageState>
+            <imageOwnerId>099720109477</imageOwnerId>
+            <isPublic>true</isPublic>
+            <architecture>i386</architecture>
+            <imageType>kernel</imageType>
+        </item>
+        <item>
+            <imageId>aki-008b6869</imageId>
+            <imageLocation>redhat-cloud/RHEL-5-Server/5.4/x86_64/kernels/kernel-2.6.18-164.x86_64.manifest.xml</imageLocation>
+            <imageState>available</imageState>
+            <imageOwnerId>432018295444</imageOwnerId>
+            <isPublic>true</isPublic>
+            <productCodes>
+                <item>
+                    <productCode>54DBF944</productCode>
+                </item>
+            </productCodes>
+            <architecture>x86_64</architecture>
+            <imageType>kernel</imageType>
+        </item>
+        <item>
+            <imageId>aki-00f41769</imageId>
+            <imageLocation>karmic-kernel-zul/ubuntu-kernel-2.6.31-301-ec2-i386-20091012-test-06.manifest.xml</imageLocation>
+            <imageState>available</imageState>
+            <imageOwnerId>099720109477</imageOwnerId>
+            <isPublic>true</isPublic>
+            <architecture>i386</architecture>
+            <imageType>kernel</imageType>
+        </item>
+        <item>
+            <imageId>aki-010be668</imageId>
+            <imageLocation>ubuntu-kernels-milestone-us/ubuntu-lucid-i386-linux-image-2.6.32-301-ec2-v-2.6.32-301.4-kernel.img.manifest.xml</imageLocation>
+            <imageState>available</imageState>
+            <imageOwnerId>099720109477</imageOwnerId>
+            <isPublic>true</isPublic>
+            <architecture>i386</architecture>
+            <imageType>kernel</imageType>
+        </item>
+    </imagesSet>
+</DescribeImagesResponse>

+ 9 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testListInstance.request

@@ -0,0 +1,9 @@
+POST / HTTP/1.1
+Host: us-east-1.ec2.amazonaws.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 225
+
+Action=DescribeInstances&AWSAccessKeyId=0123456789&SignatureVersion=2&Timestamp=2011-10-04T10%3A20%3A40Z&Version=2009-04-04&SignatureMethod=HmacSHA256&Signature=GZdRM%2F5%2BJR08AxXm6UojuwpC7ab%2Fn4k8N%2BClHmiG6CE%3D

+ 45 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testListInstance.response

@@ -0,0 +1,45 @@
+HTTP/1.1 200 OK
+Content-type: text/xml;charset=UTF-8
+Vary: Accept-Encoding
+Date: Tue, 04 Oct 2011 10:20:41 GMT
+Server: AmazonEC2
+
+<?xml version="1.0" encoding="UTF-8"?>
+<DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2009-04-04/">
+    <requestId>4ed2fdda-47e9-4ec9-9c45-9d97752db505</requestId>
+    <reservationSet>
+        <item>
+            <reservationId>r-14f4287a</reservationId>
+            <ownerId>788695787266</ownerId>
+            <groupSet>
+                <item>
+                    <groupId>default</groupId>
+                </item>
+            </groupSet>
+            <instancesSet>
+                <item>
+                    <instanceId>i-6cfcb00c</instanceId>
+                    <imageId>ami-7f418316</imageId>
+                    <instanceState>
+                        <code>16</code>
+                        <name>running</name>
+                    </instanceState>
+                    <privateDnsName>ip-10-36-34-11.ec2.internal</privateDnsName>
+                    <dnsName>ec2-184-72-66-78.compute-1.amazonaws.com</dnsName>
+                    <reason/>
+                    <amiLaunchIndex>0</amiLaunchIndex>
+                    <productCodes/>
+                    <instanceType>m1.small</instanceType>
+                    <launchTime>2011-10-04T10:20:14.000Z</launchTime>
+                    <placement>
+                        <availabilityZone>us-east-1b</availabilityZone>
+                    </placement>
+                    <kernelId>aki-805ea7e9</kernelId>
+                    <monitoring>
+                        <state>disabled</state>
+                    </monitoring>
+                </item>
+            </instancesSet>
+        </item>
+    </reservationSet>
+</DescribeInstancesResponse>

+ 9 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testMonitorInstance.request

@@ -0,0 +1,9 @@
+POST / HTTP/1.1
+Host: us-east-1.monitoring.amazonaws.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 465
+
+Action=GetMetricStatistics&MeasureName=CPUUtilization&Period=60&Namespace=AWS%2FEC2&Statistics.member.1=Average&StartTime=2011-10-04T09%3A20%3A52%2B00%3A00&EndTime=2011-10-04T10%3A20%3A52%2B00%3A00&Dimensions.member.1.Name=InstanceId&Dimensions.member.1.Value=i-6cfcb00c&AWSAccessKeyId=0123456789&SignatureVersion=2&Timestamp=2011-10-04T10%3A20%3A52Z&Version=2009-05-15&SignatureMethod=HmacSHA256&Signature=7Lqkjxw2gB%2FKwcUYImKBnyTHzyacUzhkc4YlnqoPFfg%3D

+ 15 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testMonitorInstance.response

@@ -0,0 +1,15 @@
+HTTP/1.1 200 OK
+X-amzn-requestid: 8a324eb6-ee72-11e0-9b3c-15df1bb85597
+Content-type: text/xml
+Content-length: 337
+Date: Tue, 04 Oct 2011 10:20:52 GMT
+
+<GetMetricStatisticsResponse xmlns="http://monitoring.amazonaws.com/doc/2009-05-15/">
+  <GetMetricStatisticsResult>
+    <Datapoints/>
+    <Label>CPUUtilization</Label>
+  </GetMetricStatisticsResult>
+  <ResponseMetadata>
+    <RequestId>8a324eb6-ee72-11e0-9b3c-15df1bb85597</RequestId>
+  </ResponseMetadata>
+</GetMetricStatisticsResponse>

+ 9 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testRebootInstance.request

@@ -0,0 +1,9 @@
+POST / HTTP/1.1
+Host: us-east-1.ec2.amazonaws.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 241
+
+Action=RebootInstances&InstanceId.1=i-6cfcb00c&AWSAccessKeyId=0123456789&SignatureVersion=2&Timestamp=2011-10-04T10%3A21%3A02Z&Version=2009-04-04&SignatureMethod=HmacSHA256&Signature=X%2BFv9Gy2yh49z5yunyrTiD1NNe5y3zQTB8ia3QChoS4%3D

+ 11 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testRebootInstance.response

@@ -0,0 +1,11 @@
+HTTP/1.1 200 OK
+Content-type: text/xml;charset=UTF-8
+Vary: Accept-Encoding
+Date: Tue, 04 Oct 2011 10:21:02 GMT
+Server: AmazonEC2
+
+<?xml version="1.0" encoding="UTF-8"?>
+<RebootInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2009-04-04/">
+    <requestId>6c98e1ad-bbfd-494f-99b7-f522f18fd255</requestId>
+    <return>true</return>
+</RebootInstancesResponse>

+ 9 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testStartInstance.request

@@ -0,0 +1,9 @@
+POST / HTTP/1.1
+Host: us-east-1.monitoring.amazonaws.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 465
+
+Action=GetMetricStatistics&MeasureName=CPUUtilization&Period=60&Namespace=AWS%2FEC2&Statistics.member.1=Average&StartTime=2011-10-04T09%3A20%3A52%2B00%3A00&EndTime=2011-10-04T10%3A20%3A52%2B00%3A00&Dimensions.member.1.Name=InstanceId&Dimensions.member.1.Value=i-6cfcb00c&AWSAccessKeyId=0123456789&SignatureVersion=2&Timestamp=2011-10-04T10%3A20%3A52Z&Version=2009-05-15&SignatureMethod=HmacSHA256&Signature=7Lqkjxw2gB%2FKwcUYImKBnyTHzyacUzhkc4YlnqoPFfg%3D

+ 15 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testStartInstance.response

@@ -0,0 +1,15 @@
+HTTP/1.1 200 OK
+X-amzn-requestid: 8a324eb6-ee72-11e0-9b3c-15df1bb85597
+Content-type: text/xml
+Content-length: 337
+Date: Tue, 04 Oct 2011 10:20:52 GMT
+
+<GetMetricStatisticsResponse xmlns="http://monitoring.amazonaws.com/doc/2009-05-15/">
+  <GetMetricStatisticsResult>
+    <Datapoints/>
+    <Label>CPUUtilization</Label>
+  </GetMetricStatisticsResult>
+  <ResponseMetadata>
+    <RequestId>8a324eb6-ee72-11e0-9b3c-15df1bb85597</RequestId>
+  </ResponseMetadata>
+</GetMetricStatisticsResponse>

+ 9 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testStopInstance.request

@@ -0,0 +1,9 @@
+POST / HTTP/1.1
+Host: us-east-1.monitoring.amazonaws.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 465
+
+Action=GetMetricStatistics&MeasureName=CPUUtilization&Period=60&Namespace=AWS%2FEC2&Statistics.member.1=Average&StartTime=2011-10-04T09%3A20%3A52%2B00%3A00&EndTime=2011-10-04T10%3A20%3A52%2B00%3A00&Dimensions.member.1.Name=InstanceId&Dimensions.member.1.Value=i-6cfcb00c&AWSAccessKeyId=0123456789&SignatureVersion=2&Timestamp=2011-10-04T10%3A20%3A52Z&Version=2009-05-15&SignatureMethod=HmacSHA256&Signature=7Lqkjxw2gB%2FKwcUYImKBnyTHzyacUzhkc4YlnqoPFfg%3D

+ 15 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testStopInstance.response

@@ -0,0 +1,15 @@
+HTTP/1.1 200 OK
+X-amzn-requestid: 8a324eb6-ee72-11e0-9b3c-15df1bb85597
+Content-type: text/xml
+Content-length: 337
+Date: Tue, 04 Oct 2011 10:20:52 GMT
+
+<GetMetricStatisticsResponse xmlns="http://monitoring.amazonaws.com/doc/2009-05-15/">
+  <GetMetricStatisticsResult>
+    <Datapoints/>
+    <Label>CPUUtilization</Label>
+  </GetMetricStatisticsResult>
+  <ResponseMetadata>
+    <RequestId>8a324eb6-ee72-11e0-9b3c-15df1bb85597</RequestId>
+  </ResponseMetadata>
+</GetMetricStatisticsResponse>

+ 9 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testZonesInstance.request

@@ -0,0 +1,9 @@
+POST / HTTP/1.1
+Host: us-east-1.ec2.amazonaws.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 233
+
+Action=DescribeAvailabilityZones&AWSAccessKeyId=0123456789&SignatureVersion=2&Timestamp=2011-10-04T10%3A20%3A49Z&Version=2009-04-04&SignatureMethod=HmacSHA256&Signature=LVze4BB8t%2FDxjV%2FHBaMAwihBGSfJOACF75dEg1%2Ff%2BrQ%3D

+ 32 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/Ec2Test_testZonesInstance.response

@@ -0,0 +1,32 @@
+HTTP/1.1 200 OK
+Content-type: text/xml;charset=UTF-8
+Vary: Accept-Encoding
+Date: Tue, 04 Oct 2011 10:20:49 GMT
+Server: AmazonEC2
+
+<?xml version="1.0" encoding="UTF-8"?>
+<DescribeAvailabilityZonesResponse xmlns="http://ec2.amazonaws.com/doc/2009-04-04/">
+    <requestId>9b5f3c62-9e3c-41ef-ba6b-57069dbb2da3</requestId>
+    <availabilityZoneInfo>
+        <item>
+            <zoneName>us-east-1a</zoneName>
+            <zoneState>available</zoneState>
+            <regionName>us-east-1</regionName>
+        </item>
+        <item>
+            <zoneName>us-east-1b</zoneName>
+            <zoneState>available</zoneState>
+            <regionName>us-east-1</regionName>
+        </item>
+        <item>
+            <zoneName>us-east-1c</zoneName>
+            <zoneState>available</zoneState>
+            <regionName>us-east-1</regionName>
+        </item>
+        <item>
+            <zoneName>us-east-1d</zoneName>
+            <zoneState>available</zoneState>
+            <regionName>us-east-1</regionName>
+        </item>
+    </availabilityZoneInfo>
+</DescribeAvailabilityZonesResponse>

+ 10 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testCreateInstance.request

@@ -0,0 +1,10 @@
+POST /v1.0/583923/servers?format=json HTTP/1.1
+Host: servers.api.rackspacecloud.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+X-Auth-Token: 1234567890
+Content-Type: application/json
+Content-Length: 88
+
+{"server":{"imageId":49,"flavorId":1,"name":"ZFunitTestImage","metadata":{"foo":"bar"}}}

+ 14 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testCreateInstance.response

@@ -0,0 +1,14 @@
+HTTP/1.1 202 Accepted
+Server: Apache-Coyote/1.1
+Vary: Accept, Accept-Encoding, X-Auth-Token
+Vary: Accept-Encoding
+Cache-control: no-cache
+Content-type: application/json
+Content-length: 227
+Date: Tue, 04 Oct 2011 16:20:55 GMT
+X-varnish: 2005231364
+Age: 0
+Via: 1.1 varnish
+Connection: close
+
+{"server":{"progress":0,"id":20265545,"imageId":49,"flavorId":1,"status":"BUILD","adminPass":"ZFunitTestImageWt040ivTR","name":"ZFunitTestImage","hostId":"69b25e1262157df1f36a63102be0a601","addresses":{"public":["50.57.38.207"],"private":["10.182.38.79"]},"metadata":{"foo":"bar"}}}

+ 7 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testDeployInstance.request

@@ -0,0 +1,7 @@
+GET /v1.0/583923/images/detail?format=json HTTP/1.1
+Host: servers.api.rackspacecloud.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+X-Auth-Token: 1234567890
+

Diff do ficheiro suprimidas por serem muito extensas
+ 15 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testDeployInstance.response


+ 7 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testDestroyInstance.request

@@ -0,0 +1,7 @@
+DELETE /v1.0/583923/servers/20265545?format=json HTTP/1.1
+Host: servers.api.rackspacecloud.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+X-Auth-Token: 1234567890
+

+ 12 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testDestroyInstance.response

@@ -0,0 +1,12 @@
+HTTP/1.1 202 Accepted
+Server: Apache-Coyote/1.1
+Vary: Accept, Accept-Encoding, X-Auth-Token
+Cache-control: no-cache
+Content-type: text/xml
+Content-length: 0
+Date: Tue, 04 Oct 2011 16:21:57 GMT
+X-varnish: 2005258767
+Age: 0
+Via: 1.1 varnish
+Connection: close
+

+ 7 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testImagesInstance.request

@@ -0,0 +1,7 @@
+GET /v1.0/583923/images/detail?format=json HTTP/1.1
+Host: servers.api.rackspacecloud.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+X-Auth-Token: 1234567890
+

Diff do ficheiro suprimidas por serem muito extensas
+ 15 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testImagesInstance.response


+ 7 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testListInstance.request

@@ -0,0 +1,7 @@
+GET /v1.0/583923/servers/detail?format=json HTTP/1.1
+Host: servers.api.rackspacecloud.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+X-Auth-Token: 1234567890
+

+ 15 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testListInstance.response

@@ -0,0 +1,15 @@
+HTTP/1.1 200 OK
+Server: Apache-Coyote/1.1
+Vary: Accept, Accept-Encoding, X-Auth-Token
+Vary: Accept-Encoding
+Last-modified: Tue, 04 Oct 2011 16:21:03 GMT
+Cache-control: no-cache
+Content-type: application/json
+Content-length: 210
+Date: Tue, 04 Oct 2011 16:21:06 GMT
+X-varnish: 2005238383
+Age: 0
+Via: 1.1 varnish
+Connection: close
+
+{"servers":[{"progress":100,"id":20265545,"imageId":49,"flavorId":1,"status":"BUILD","name":"ZFunitTestImage","hostId":"69b25e1262157df1f36a63102be0a601","addresses":{"public":["50.57.38.207"],"private":["10.182.38.79"]},"metadata":{"foo":"bar"}}]}

+ 7 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testMonitorInstance.request

@@ -0,0 +1,7 @@
+GET /v1.0/583923/images/detail?format=json HTTP/1.1
+Host: servers.api.rackspacecloud.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+X-Auth-Token: 1234567890
+

Diff do ficheiro suprimidas por serem muito extensas
+ 15 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testMonitorInstance.response


+ 10 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testRebootInstance.request

@@ -0,0 +1,10 @@
+POST /v1.0/583923/servers/20265545/action?format=json HTTP/1.1
+Host: servers.api.rackspacecloud.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+X-Auth-Token: 1234567890
+Content-Type: application/json
+Content-Length: 26
+
+{"reboot":{"type":"HARD"}}

+ 12 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testRebootInstance.response

@@ -0,0 +1,12 @@
+HTTP/1.1 202 Accepted
+Server: Apache-Coyote/1.1
+Vary: Accept, Accept-Encoding, X-Auth-Token
+Cache-control: no-cache
+Content-type: text/xml
+Content-length: 0
+Date: Tue, 04 Oct 2011 16:21:44 GMT
+X-varnish: 2005255169
+Age: 0
+Via: 1.1 varnish
+Connection: close
+

+ 7 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testStartInstance.request

@@ -0,0 +1,7 @@
+GET /v1.0/583923/images/detail?format=json HTTP/1.1
+Host: servers.api.rackspacecloud.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+X-Auth-Token: 1234567890
+

Diff do ficheiro suprimidas por serem muito extensas
+ 15 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testStartInstance.response


+ 7 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testStopInstance.request

@@ -0,0 +1,7 @@
+GET /v1.0/583923/images/detail?format=json HTTP/1.1
+Host: servers.api.rackspacecloud.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+X-Auth-Token: 1234567890
+

Diff do ficheiro suprimidas por serem muito extensas
+ 15 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testStopInstance.response


+ 7 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testZonesInstance.request

@@ -0,0 +1,7 @@
+GET /v1.0/583923/images/detail?format=json HTTP/1.1
+Host: servers.api.rackspacecloud.com
+Connection: close
+Accept-encoding: gzip, deflate
+User-Agent: Zend_Http_Client
+X-Auth-Token: 1234567890
+

Diff do ficheiro suprimidas por serem muito extensas
+ 15 - 0
tests/Zend/Cloud/Infrastructure/Adapter/_files/RackspaceTest_testZonesInstance.response


Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff