You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2012/08/14 23:47:25 UTC
[2/6] git commit: CIMI tests: baseURI is mandatory for the CEP
CIMI tests: baseURI is mandatory for the CEP
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/49bcff7c
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/49bcff7c
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/49bcff7c
Branch: refs/heads/master
Commit: 49bcff7c24b772c34fb8e043c3b57eb6902f63a3
Parents: 90c1c9d
Author: David Lutterkort <lu...@redhat.com>
Authored: Fri Aug 10 17:52:00 2012 -0700
Committer: David Lutterkort <lu...@redhat.com>
Committed: Tue Aug 14 14:44:18 2012 -0700
----------------------------------------------------------------------
server/lib/cimi/models/cloud_entry_point.rb | 2 ++
tests/cimi/cep_test.rb | 7 +++++++
2 files changed, 9 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/49bcff7c/server/lib/cimi/models/cloud_entry_point.rb
----------------------------------------------------------------------
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)
}))
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/49bcff7c/tests/cimi/cep_test.rb
----------------------------------------------------------------------
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