You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ma...@redhat.com on 2011/11/21 16:44:48 UTC

[PATCH 1/3] Adds CIMI Volume Configuration model+spec/test

From: marios <ma...@redhat.com>


Signed-off-by: marios <ma...@redhat.com>
---
 server/lib/cimi/model.rb                           |    1 +
 server/lib/cimi/model/volume_configuration.rb      |   24 +++++++++++++
 server/spec/cimi/data/volume_configuration.json    |   16 ++++++++
 server/spec/cimi/data/volume_configuration.xml     |   12 ++++++
 .../spec/cimi/model/volume_configuration_spec.rb   |   37 ++++++++++++++++++++
 5 files changed, 90 insertions(+), 0 deletions(-)
 create mode 100644 server/lib/cimi/model/volume_configuration.rb
 create mode 100644 server/spec/cimi/data/volume_configuration.json
 create mode 100644 server/spec/cimi/data/volume_configuration.xml
 create mode 100644 server/spec/cimi/model/volume_configuration_spec.rb

diff --git a/server/lib/cimi/model.rb b/server/lib/cimi/model.rb
index c436074..c66bbff 100644
--- a/server/lib/cimi/model.rb
+++ b/server/lib/cimi/model.rb
@@ -26,3 +26,4 @@ require 'cimi/model/machine_template'
 require 'cimi/model/machine_image'
 require 'cimi/model/machine_configuration'
 require 'cimi/model/volume'
+require 'cimi/model/volume_configuration'
diff --git a/server/lib/cimi/model/volume_configuration.rb b/server/lib/cimi/model/volume_configuration.rb
new file mode 100644
index 0000000..e82b527
--- /dev/null
+++ b/server/lib/cimi/model/volume_configuration.rb
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+class CIMI::Model::VolumeConfiguration < CIMI::Model::Base
+  text :format
+  struct :capacity do
+    scalar :quantity
+    scalar :units
+  end
+  text :supports_snapshots
+  text :guest_interface
+end
diff --git a/server/spec/cimi/data/volume_configuration.json b/server/spec/cimi/data/volume_configuration.json
new file mode 100644
index 0000000..c9769ee
--- /dev/null
+++ b/server/spec/cimi/data/volume_configuration.json
@@ -0,0 +1,16 @@
+{
+  "uri": "http://cimi.example.org/volume_configurations/1",
+  "name": "volume_config_1",
+  "description": "Volume Configuration One",
+  "created": "2011-11-21",
+  "format": "ext3",
+  "capacity": { "quantity": "10", "units": "gigabyte" },
+  "supportsSnapshots": "false",
+  "guestInterface": "NFS",
+  "operations": [
+    { "rel": "edit",
+      "href": "http://cimi.example.org/volume_configurations/1/edit" },
+    { "rel": "delete",
+      "href": "http://cimi.example.org/volume_configurations/1/delete" }
+  ]
+}
diff --git a/server/spec/cimi/data/volume_configuration.xml b/server/spec/cimi/data/volume_configuration.xml
new file mode 100644
index 0000000..fe8fb07
--- /dev/null
+++ b/server/spec/cimi/data/volume_configuration.xml
@@ -0,0 +1,12 @@
+<VolumeConfiguration xmlns="http://www.dmtf.org/cimi">
+  <uri>http://cimi.example.org/volume_configurations/1</uri>
+  <name>volume_config_1</name>
+  <description>Volume Configuration One</description>
+  <created>2011-11-21</created>
+  <capacity quantity="10" units="gigabyte"/>
+  <supportsSnapshots>false</supportsSnapshots>
+  <guestInterface>NFS</guestInterface>
+  <format>ext3</format>
+  <operation rel="edit" href="http://cimi.example.org/volume_configurations/1/edit"/>
+  <operation rel="delete" href="http://cimi.example.org/volume_configurations/1/delete"/>
+</VolumeConfiguration>
diff --git a/server/spec/cimi/model/volume_configuration_spec.rb b/server/spec/cimi/model/volume_configuration_spec.rb
new file mode 100644
index 0000000..c0a31f7
--- /dev/null
+++ b/server/spec/cimi/model/volume_configuration_spec.rb
@@ -0,0 +1,37 @@
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+describe "Volume Configuration model" do
+
+  before(:all) do
+    @xml = IO::read(File::join(DATA_DIR, "volume_configuration.xml"))
+    @json = IO::read(File::join(DATA_DIR, "volume_configuration.json"))
+  end
+
+  it "can be constructed from XML" do
+    conf = CIMI::Model::VolumeConfiguration.from_xml(@xml)
+    conf.should_not be_nil
+    should_serialize_from_xml! conf, @xml, @json
+  end
+
+  it "can be constructed from JSON" do
+    conf = CIMI::Model::VolumeConfiguration.from_json(@json)
+    conf.should_not be_nil
+    should_serialize_from_json! conf, @xml, @json
+  end
+
+end
-- 
1.7.6.4


Re: [PATCH 3/3] Adds CIMI Volume Template model+spec/test

Posted by Michal Fojtik <mf...@redhat.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ACK

 -- Michal

marios@redhat.com wrote:
> From: marios <ma...@redhat.com>
> 
> 
> Signed-off-by: marios <ma...@redhat.com> --- 
> server/lib/cimi/model.rb                       |    1 + 
> server/lib/cimi/model/volume_template.rb       |   19 ++++++++++++ 
> server/spec/cimi/data/volume_template.json     |   14 +++++++++ 
> server/spec/cimi/data/volume_template.xml      |   10 ++++++ 
> server/spec/cimi/model/volume_template_spec.rb |   36
> ++++++++++++++++++++++++ 5 files changed, 80 insertions(+), 0
> deletions(-) create mode 100644
> server/lib/cimi/model/volume_template.rb create mode 100644
> server/spec/cimi/data/volume_template.json create mode 100644
> server/spec/cimi/data/volume_template.xml create mode 100644
> server/spec/cimi/model/volume_template_spec.rb
> 
> diff --git a/server/lib/cimi/model.rb b/server/lib/cimi/model.rb 
> index 0a9236a..d6a879f 100644 --- a/server/lib/cimi/model.rb +++
> b/server/lib/cimi/model.rb @@ -28,3 +28,4 @@ require
> 'cimi/model/machine_configuration' require 'cimi/model/volume' 
> require 'cimi/model/volume_configuration' require
> 'cimi/model/volume_image' +require 'cimi/model/volume_template' diff
> --git a/server/lib/cimi/model/volume_template.rb
> b/server/lib/cimi/model/volume_template.rb new file mode 100644 index
> 0000000..51248d6 --- /dev/null +++
> b/server/lib/cimi/model/volume_template.rb @@ -0,0 +1,19 @@ +#
> Licensed to the Apache Software Foundation (ASF) under one or more +#
> contributor license agreements.  See the NOTICE file distributed
> with +# this work for additional information regarding copyright
> ownership.  The +# ASF licenses this file to you under the Apache
> License, Version 2.0 (the +# "License"); you may not use this file
> except in compliance with the +# License.  You may obtain a copy of
> the License at +# +#
> http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by
> applicable law or agreed to in writing, software +# distributed under
> the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES
> OR CONDITIONS OF ANY KIND, either express or implied.  See the +#
> License for the specific language governing permissions and
> limitations +# under the License. + +class
> CIMI::Model::VolumeTemplate < CIMI::Model::Base +  href
> :volume_config +  href :volume_image +end diff --git
> a/server/spec/cimi/data/volume_template.json
> b/server/spec/cimi/data/volume_template.json new file mode 100644 
> index 0000000..3fd47b6 --- /dev/null +++
> b/server/spec/cimi/data/volume_template.json @@ -0,0 +1,14 @@ +{ +
> "uri": "http://cimi.example.org/volume_templates/1", +  "name":
> "volume_template_1", +  "description": "Volume Template One", +
> "created": "2011-11-21", +  "volumeConfig":{ "href":
> "http://cimi.example.com/volume_configurations/1" }, +
> "volumeImage":{ "href": "http://cimi.example.com/volume_images/1" }, 
> +  "operations": [ +    { "rel": "edit", +      "href":
> "http://cimi.example.org/volume_templates/1/edit" }, +    { "rel":
> "delete", +      "href":
> "http://cimi.example.org/volume_templates/1/delete" } +  ] +} diff
> --git a/server/spec/cimi/data/volume_template.xml
> b/server/spec/cimi/data/volume_template.xml new file mode 100644 
> index 0000000..e7b5e0a --- /dev/null +++
> b/server/spec/cimi/data/volume_template.xml @@ -0,0 +1,10 @@ 
> +<VolumeTemplate xmlns="http://www.dmtf.org/cimi"> +
> <uri>http://cimi.example.org/volume_templates/1</uri> +
> <name>volume_template_1</name> +  <description>Volume Template
> One</description> +  <created>2011-11-21</created> +  <volumeImage
> href="http://cimi.example.com/volume_images/1"/> +  <volumeConfig
> href="http://cimi.example.com/volume_configurations/1"/> +
> <operation rel="edit"
> href="http://cimi.example.org/volume_templates/1/edit"/> +
> <operation rel="delete"
> href="http://cimi.example.org/volume_templates/1/delete"/> 
> +</VolumeTemplate> diff --git
> a/server/spec/cimi/model/volume_template_spec.rb
> b/server/spec/cimi/model/volume_template_spec.rb new file mode
> 100644 index 0000000..2c765d4 --- /dev/null +++
> b/server/spec/cimi/model/volume_template_spec.rb @@ -0,0 +1,36 @@ +#
> Licensed to the Apache Software Foundation (ASF) under one or more +#
> contributor license agreements.  See the NOTICE file distributed
> with +# this work for additional information regarding copyright
> ownership.  The +# ASF licenses this file to you under the Apache
> License, Version 2.0 (the +# "License"); you may not use this file
> except in compliance with the +# License.  You may obtain a copy of
> the License at +# +#
> http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by
> applicable law or agreed to in writing, software +# distributed under
> the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES
> OR CONDITIONS OF ANY KIND, either express or implied.  See the +#
> License for the specific language governing permissions and
> limitations +# under the License. +# + +describe "Volume Template
> model" do + +  before(:all) do +    @xml =
> IO::read(File::join(DATA_DIR, "volume_template.xml")) +    @json =
> IO::read(File::join(DATA_DIR, "volume_template.json")) +  end + +  it
> "can be constructed from XML" do +    conf =
> CIMI::Model::VolumeTemplate.from_xml(@xml) +    conf.should_not
> be_nil +    should_serialize_from_xml! conf, @xml, @json +  end + +
> it "can be constructed from JSON" do +    conf =
> CIMI::Model::VolumeTemplate.from_json(@json) +    conf.should_not
> be_nil +    should_serialize_from_json! conf, @xml, @json +  end + 
> +end

- -- 
- --
Michal Fojtik, mfojtik@redhat.com
Deltacloud API: http://deltacloud.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOy3VaAAoJEEnFpmY+LvFR9cMH/RE5LaB4GeZHmYCij5uNiRRJ
Xr6RfNItrt/Bp77AUdPPvQ1obEOs85qBRfltB3EfD1gFHAl+rvOMIj/IyvAFFUOh
ihumsWFoApUx0NgqBm1dE3p2HijWfScp1AYCs20L1+fI9nLTqlabLAur1fYqAewP
F+oE9AInoV8gELjMESjKIWODje3zHFEI3QoQHyDGl32HMPDEobxkaXwbQ9aroUh+
b6iSbg80RnPnVYozUVq/F8B+q/LRfQpKqyoW008G2y4p9k6lE2CABut1sn3ONmoC
zjKMYjyTB0MJhM2qFS9QreqrHK8AU+XCrPOQSRofAbizpuNmxVtWJJsuRI3nKhA=
=T7Cz
-----END PGP SIGNATURE-----

[PATCH 3/3] Adds CIMI Volume Template model+spec/test

Posted by ma...@redhat.com.
From: marios <ma...@redhat.com>


Signed-off-by: marios <ma...@redhat.com>
---
 server/lib/cimi/model.rb                       |    1 +
 server/lib/cimi/model/volume_template.rb       |   19 ++++++++++++
 server/spec/cimi/data/volume_template.json     |   14 +++++++++
 server/spec/cimi/data/volume_template.xml      |   10 ++++++
 server/spec/cimi/model/volume_template_spec.rb |   36 ++++++++++++++++++++++++
 5 files changed, 80 insertions(+), 0 deletions(-)
 create mode 100644 server/lib/cimi/model/volume_template.rb
 create mode 100644 server/spec/cimi/data/volume_template.json
 create mode 100644 server/spec/cimi/data/volume_template.xml
 create mode 100644 server/spec/cimi/model/volume_template_spec.rb

diff --git a/server/lib/cimi/model.rb b/server/lib/cimi/model.rb
index 0a9236a..d6a879f 100644
--- a/server/lib/cimi/model.rb
+++ b/server/lib/cimi/model.rb
@@ -28,3 +28,4 @@ require 'cimi/model/machine_configuration'
 require 'cimi/model/volume'
 require 'cimi/model/volume_configuration'
 require 'cimi/model/volume_image'
+require 'cimi/model/volume_template'
diff --git a/server/lib/cimi/model/volume_template.rb b/server/lib/cimi/model/volume_template.rb
new file mode 100644
index 0000000..51248d6
--- /dev/null
+++ b/server/lib/cimi/model/volume_template.rb
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+class CIMI::Model::VolumeTemplate < CIMI::Model::Base
+  href :volume_config
+  href :volume_image
+end
diff --git a/server/spec/cimi/data/volume_template.json b/server/spec/cimi/data/volume_template.json
new file mode 100644
index 0000000..3fd47b6
--- /dev/null
+++ b/server/spec/cimi/data/volume_template.json
@@ -0,0 +1,14 @@
+{
+  "uri": "http://cimi.example.org/volume_templates/1",
+  "name": "volume_template_1",
+  "description": "Volume Template One",
+  "created": "2011-11-21",
+  "volumeConfig":{ "href": "http://cimi.example.com/volume_configurations/1" },
+  "volumeImage":{ "href": "http://cimi.example.com/volume_images/1" },
+  "operations": [
+    { "rel": "edit",
+      "href": "http://cimi.example.org/volume_templates/1/edit" },
+    { "rel": "delete",
+      "href": "http://cimi.example.org/volume_templates/1/delete" }
+  ]
+}
diff --git a/server/spec/cimi/data/volume_template.xml b/server/spec/cimi/data/volume_template.xml
new file mode 100644
index 0000000..e7b5e0a
--- /dev/null
+++ b/server/spec/cimi/data/volume_template.xml
@@ -0,0 +1,10 @@
+<VolumeTemplate xmlns="http://www.dmtf.org/cimi">
+  <uri>http://cimi.example.org/volume_templates/1</uri>
+  <name>volume_template_1</name>
+  <description>Volume Template One</description>
+  <created>2011-11-21</created>
+  <volumeImage href="http://cimi.example.com/volume_images/1"/>
+  <volumeConfig href="http://cimi.example.com/volume_configurations/1"/>
+  <operation rel="edit" href="http://cimi.example.org/volume_templates/1/edit"/>
+  <operation rel="delete" href="http://cimi.example.org/volume_templates/1/delete"/>
+</VolumeTemplate>
diff --git a/server/spec/cimi/model/volume_template_spec.rb b/server/spec/cimi/model/volume_template_spec.rb
new file mode 100644
index 0000000..2c765d4
--- /dev/null
+++ b/server/spec/cimi/model/volume_template_spec.rb
@@ -0,0 +1,36 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+describe "Volume Template model" do
+
+  before(:all) do
+    @xml = IO::read(File::join(DATA_DIR, "volume_template.xml"))
+    @json = IO::read(File::join(DATA_DIR, "volume_template.json"))
+  end
+
+  it "can be constructed from XML" do
+    conf = CIMI::Model::VolumeTemplate.from_xml(@xml)
+    conf.should_not be_nil
+    should_serialize_from_xml! conf, @xml, @json
+  end
+
+  it "can be constructed from JSON" do
+    conf = CIMI::Model::VolumeTemplate.from_json(@json)
+    conf.should_not be_nil
+    should_serialize_from_json! conf, @xml, @json
+  end
+
+end
-- 
1.7.6.4


[PATCH 2/3] Adds CIMI Volume Image model+spec/test

Posted by ma...@redhat.com.
From: marios <ma...@redhat.com>


Signed-off-by: marios <ma...@redhat.com>
---
 server/lib/cimi/model.rb                    |    1 +
 server/lib/cimi/model/volume_image.rb       |   20 +++++++++++++++
 server/spec/cimi/data/volume_image.json     |   14 ++++++++++
 server/spec/cimi/data/volume_image.xml      |   10 +++++++
 server/spec/cimi/model/volume_image_spec.rb |   36 +++++++++++++++++++++++++++
 5 files changed, 81 insertions(+), 0 deletions(-)
 create mode 100644 server/lib/cimi/model/volume_image.rb
 create mode 100644 server/spec/cimi/data/volume_image.json
 create mode 100644 server/spec/cimi/data/volume_image.xml
 create mode 100644 server/spec/cimi/model/volume_image_spec.rb

diff --git a/server/lib/cimi/model.rb b/server/lib/cimi/model.rb
index c66bbff..0a9236a 100644
--- a/server/lib/cimi/model.rb
+++ b/server/lib/cimi/model.rb
@@ -27,3 +27,4 @@ require 'cimi/model/machine_image'
 require 'cimi/model/machine_configuration'
 require 'cimi/model/volume'
 require 'cimi/model/volume_configuration'
+require 'cimi/model/volume_image'
diff --git a/server/lib/cimi/model/volume_image.rb b/server/lib/cimi/model/volume_image.rb
new file mode 100644
index 0000000..29a9f02
--- /dev/null
+++ b/server/lib/cimi/model/volume_image.rb
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+class CIMI::Model::VolumeImage < CIMI::Model::Base
+  href :image_location
+  text :image_data
+  text :bootable
+end
diff --git a/server/spec/cimi/data/volume_image.json b/server/spec/cimi/data/volume_image.json
new file mode 100644
index 0000000..47bac8d
--- /dev/null
+++ b/server/spec/cimi/data/volume_image.json
@@ -0,0 +1,14 @@
+{
+  "uri": "http://cimi.example.org/volume_images/1",
+  "name": "volume_image_1",
+  "description": "Volume Image One",
+  "created": "2011-11-21",
+  "bootable": "false",
+  "imageLocation":{ "href": "nfs://cimi.example.com/volume_images/vol_image_1.img" },
+  "operations": [
+    { "rel": "edit",
+      "href": "http://cimi.example.org/volume_images/1/edit" },
+    { "rel": "delete",
+      "href": "http://cimi.example.org/volume_images/1/delete" }
+  ]
+}
diff --git a/server/spec/cimi/data/volume_image.xml b/server/spec/cimi/data/volume_image.xml
new file mode 100644
index 0000000..901d0a7
--- /dev/null
+++ b/server/spec/cimi/data/volume_image.xml
@@ -0,0 +1,10 @@
+<VolumeImage xmlns="http://www.dmtf.org/cimi">
+  <uri>http://cimi.example.org/volume_images/1</uri>
+  <name>volume_image_1</name>
+  <description>Volume Image One</description>
+  <created>2011-11-21</created>
+  <bootable>false</bootable>
+  <imageLocation href="nfs://cimi.example.com/volume_images/vol_image_1.img"/>
+  <operation rel="edit" href="http://cimi.example.org/volume_images/1/edit"/>
+  <operation rel="delete" href="http://cimi.example.org/volume_images/1/delete"/>
+</VolumeImage>
diff --git a/server/spec/cimi/model/volume_image_spec.rb b/server/spec/cimi/model/volume_image_spec.rb
new file mode 100644
index 0000000..7b5346a
--- /dev/null
+++ b/server/spec/cimi/model/volume_image_spec.rb
@@ -0,0 +1,36 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+describe "Volume Image model" do
+
+  before(:all) do
+    @xml = IO::read(File::join(DATA_DIR, "volume_image.xml"))
+    @json = IO::read(File::join(DATA_DIR, "volume_image.json"))
+  end
+
+  it "can be constructed from XML" do
+    conf = CIMI::Model::VolumeImage.from_xml(@xml)
+    conf.should_not be_nil
+    should_serialize_from_xml! conf, @xml, @json
+  end
+
+  it "can be constructed from JSON" do
+    conf = CIMI::Model::VolumeImage.from_json(@json)
+    conf.should_not be_nil
+    should_serialize_from_json! conf, @xml, @json
+  end
+
+end
-- 
1.7.6.4