deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject [9/10] git commit: CIMI: fix the names of *Configuration collections in the CEP
Date Mon, 24 Sep 2012 23:52:48 GMT
CIMI: fix the names of *Configuration collections in the CEP


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/0d12a6f9
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/0d12a6f9
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/0d12a6f9

Branch: refs/heads/master
Commit: 0d12a6f96a371b50eb048bcc2e57bb703a4dc7c3
Parents: c6b642b
Author: David Lutterkort <lutter@redhat.com>
Authored: Tue Sep 18 13:40:45 2012 -0700
Committer: David Lutterkort <lutter@redhat.com>
Committed: Mon Sep 24 16:33:40 2012 -0700

----------------------------------------------------------------------
 server/lib/cimi/models/machine_configuration.rb    |    2 +-
 server/lib/cimi/models/network_configuration.rb    |    2 +-
 .../lib/cimi/models/network_port_configuration.rb  |    2 +-
 server/lib/cimi/models/volume_configuration.rb     |    2 +-
 tests/cimi/cep_test.rb                             |   24 +++++++++++++++
 5 files changed, 28 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/0d12a6f9/server/lib/cimi/models/machine_configuration.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/machine_configuration.rb b/server/lib/cimi/models/machine_configuration.rb
index 41a140c..36ebcf7 100644
--- a/server/lib/cimi/models/machine_configuration.rb
+++ b/server/lib/cimi/models/machine_configuration.rb
@@ -15,7 +15,7 @@
 
 class CIMI::Model::MachineConfiguration < CIMI::Model::Base
 
-  acts_as_root_entity
+  acts_as_root_entity :as => "machineConfigs"
 
   text :memory
   text :cpu

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/0d12a6f9/server/lib/cimi/models/network_configuration.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/network_configuration.rb b/server/lib/cimi/models/network_configuration.rb
index 007beb5..1010d54 100644
--- a/server/lib/cimi/models/network_configuration.rb
+++ b/server/lib/cimi/models/network_configuration.rb
@@ -15,7 +15,7 @@
 
 class CIMI::Model::NetworkConfiguration < CIMI::Model::Base
 
-  acts_as_root_entity
+  acts_as_root_entity :as => "networkConfigs"
 
   text :network_type
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/0d12a6f9/server/lib/cimi/models/network_port_configuration.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/network_port_configuration.rb b/server/lib/cimi/models/network_port_configuration.rb
index 1c3ae4f..3789b35 100644
--- a/server/lib/cimi/models/network_port_configuration.rb
+++ b/server/lib/cimi/models/network_port_configuration.rb
@@ -15,7 +15,7 @@
 
 class CIMI::Model::NetworkPortConfiguration < CIMI::Model::Base
 
-  acts_as_root_entity
+  acts_as_root_entity :as => "networkPortConfigs"
 
   text :class_of_service
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/0d12a6f9/server/lib/cimi/models/volume_configuration.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/volume_configuration.rb b/server/lib/cimi/models/volume_configuration.rb
index 55f3d3a..9721a3c 100644
--- a/server/lib/cimi/models/volume_configuration.rb
+++ b/server/lib/cimi/models/volume_configuration.rb
@@ -15,7 +15,7 @@
 
 class CIMI::Model::VolumeConfiguration < CIMI::Model::Base
 
-  acts_as_root_entity
+  acts_as_root_entity :as => "volumeConfigs"
 
   text :format
   struct :capacity do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/0d12a6f9/tests/cimi/cep_test.rb
----------------------------------------------------------------------
diff --git a/tests/cimi/cep_test.rb b/tests/cimi/cep_test.rb
index fcce068..56a41fd 100644
--- a/tests/cimi/cep_test.rb
+++ b/tests/cimi/cep_test.rb
@@ -19,6 +19,17 @@ $:.unshift File.join(File.dirname(__FILE__))
 require "test_helper.rb"
 
 describe "CIMI Entry Point Behavior" do
+  ROOTS = [ "resourceMetadata", "systems", "systemTemplates",
+            "machines" , "machineTemplates", "machineConfigs",
+            "machineImages", "credentials", "credentialTemplates",
+            "volumes", "volumeTemplates", "volumeConfigs", "volumeImages",
+            "networks", "networkTemplates", "networkConfigs", "networkPorts",
+            "networkPortTemplates", "networkPortConfigs",
+            "addresses", "addressTemplates", "forwardingGroups",
+            "forwardingGroupTemplates",
+            "jobs", "meters", "meterTemplates", "meterConfigs",
+            "eventLogs", "eventLogTemplates" ]
+
   # We'd like to call this :cep, but there's already a method by that name
   model :subject, CIMI::Model::CloudEntryPoint, :cache => true do |fmt|
     cep(:accept => fmt)
@@ -35,4 +46,17 @@ describe "CIMI Entry Point Behavior" do
   it "should have a name" do
     subject.name.wont_be_empty
   end
+
+  it "should have root collections" do
+    ROOTS.each do |root|
+      r = root.underscore.to_sym
+      if subject.respond_to?(r)
+        coll = subject.send(r)
+        coll.must_respond_to :href, "#{root} collection"
+        unless coll.href.nil?
+          coll.href.must_be_uri "#{root} collection"
+        end
+      end
+    end
+  end
 end


Mime
View raw message