deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@redhat.com
Subject [PATCH 5/6] CIMI tests: baseURI is mandatory for the CEP
Date Sat, 11 Aug 2012 01:03:26 GMT
From: David Lutterkort <lutter@redhat.com>

---
 server/lib/cimi/models/cloud_entry_point.rb |    2 ++
 tests/cimi/cep_test.rb                      |    7 +++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/server/lib/cimi/models/cloud_entry_point.rb b/server/lib/cimi/models/cloud_entry_point.rb
index 1095741..9ec3446 100644
--- a/server/lib/cimi/models/cloud_entry_point.rb
+++ b/server/lib/cimi/models/cloud_entry_point.rb
@@ -15,6 +15,7 @@
 
 class CIMI::Model::CloudEntryPoint < CIMI::Model::Base
 
+  text  :base_uri, :xml_name => "baseURI", :json_name => "baseURI"
   array :entity_metadata do
     scalar :href
   end
@@ -33,6 +34,7 @@ class CIMI::Model::CloudEntryPoint < CIMI::Model::Base
       :name => context.driver.name,
       :description => "Cloud Entry Point for the Deltacloud #{context.driver.name} driver",
       :id => context.cloudEntryPoint_url,
+      :base_uri => context.root_url,
       :created => Time.now,
       :entity_metadata => CIMI::Model::EntityMetadata.all_uri(context)
     }))
diff --git a/tests/cimi/cep_test.rb b/tests/cimi/cep_test.rb
index 647db0c..04a45cc 100644
--- a/tests/cimi/cep_test.rb
+++ b/tests/cimi/cep_test.rb
@@ -39,6 +39,9 @@ describe "CIMI Entry Point" do
       (res.xml/"CloudEntryPoint/id").text.must_equal api.cep_url
     end
 
+    it "should have a baseURI" do
+      (res.xml/"CloudEntryPoint/baseURI").text.must_be_uri
+    end
   end
 
   describe "JSON form" do
@@ -53,5 +56,9 @@ describe "CIMI Entry Point" do
       res.headers[:content_type].must_equal "application/json"
       res.json["id"].must_equal api.cep_url
     end
+
+    it "should have a baseURI" do
+      res.json["baseURI"].must_be_uri
+    end
   end
 end
-- 
1.7.7.6


Mime
View raw message