incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1000805 - in /incubator/deltacloud/trunk: server/lib/deltacloud/base_driver/mock_driver.rb tests/ec2/api.feature tests/ec2/support/s3/ tests/ec2/support/s3/buckets.da39a3ee5e6b4b0d3255bfef95601890afd80709
Date Fri, 24 Sep 2010 11:03:46 GMT
Author: mfojtik
Date: Fri Sep 24 11:03:45 2010
New Revision: 1000805

URL: http://svn.apache.org/viewvc?rev=1000805&view=rev
Log:
Fixed EC2 Cucumber features. Added S3 mocking for Cucumber.

Added:
    incubator/deltacloud/trunk/tests/ec2/support/s3/
    incubator/deltacloud/trunk/tests/ec2/support/s3/buckets.da39a3ee5e6b4b0d3255bfef95601890afd80709
Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/mock_driver.rb
    incubator/deltacloud/trunk/tests/ec2/api.feature

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/mock_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/mock_driver.rb?rev=1000805&r1=1000804&r2=1000805&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/mock_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/mock_driver.rb Fri Sep 24
11:03:45 2010
@@ -3,6 +3,19 @@ require 'deltacloud/method_serializer'
 # Create 'mock' version of original driver client/gem:
 
 module Mock
+
+  class S3 < RightAws::S3
+    include MethodSerializer::Cache
+
+    def self.cached_methods
+      [
+        :buckets
+      ]
+    end
+
+    MethodSerializer::Cache::wrap_methods(self, :cache_dir => File.join(File.dirname(__FILE__),
'..', '..', '..', '..', 'tests', 'ec2', 'support'))
+  end
+
   class EC2 < AWS::EC2::Base
 
     include MethodSerializer::Cache
@@ -29,6 +42,7 @@ end
 # Replace original client with mock client
 Deltacloud::Drivers::EC2::EC2Driver.class_eval do
   alias_method :original_new_client, :new_client
+  alias_method :original_s3_client, :s3_client
 
   def new_client(credentials, opts={})
     Mock::EC2.new(
@@ -37,4 +51,8 @@ Deltacloud::Drivers::EC2::EC2Driver.clas
     )
   end
 
+  def s3_client(credentials)
+    Mock::S3.new(credentials.user, credentials.password)
+  end
+
 end

Modified: incubator/deltacloud/trunk/tests/ec2/api.feature
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/tests/ec2/api.feature?rev=1000805&r1=1000804&r2=1000805&view=diff
==============================================================================
--- incubator/deltacloud/trunk/tests/ec2/api.feature (original)
+++ incubator/deltacloud/trunk/tests/ec2/api.feature Fri Sep 24 11:03:45 2010
@@ -16,6 +16,7 @@ Feature: Accessing API entry points
     | realms     |
     | instances  |
     | keys  |
+    | buckets |
     | images     |
     | instance_states |
     | hardware_profiles  |

Added: incubator/deltacloud/trunk/tests/ec2/support/s3/buckets.da39a3ee5e6b4b0d3255bfef95601890afd80709
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/tests/ec2/support/s3/buckets.da39a3ee5e6b4b0d3255bfef95601890afd80709?rev=1000805&view=auto
==============================================================================
--- incubator/deltacloud/trunk/tests/ec2/support/s3/buckets.da39a3ee5e6b4b0d3255bfef95601890afd80709
(added)
+++ incubator/deltacloud/trunk/tests/ec2/support/s3/buckets.da39a3ee5e6b4b0d3255bfef95601890afd80709
Fri Sep 24 11:03:45 2010
@@ -0,0 +1 @@
+BAhbAA==



Mime
View raw message