On Oct 25, 2010, at 3:12 PM, [email protected] wrote:

> From: Jan Provaznik <[email protected]>
> 
> Also updated example repository json fixtures.
> ---
> src/features/step_definitions/template_steps.rb |    7 +-
> src/features/template.feature                   |   10 +-
> src/spec/fixtures/packagegroupcategories.json   |   11 ++
> src/spec/fixtures/packagegroups.json            |   51 +------
> src/spec/fixtures/packages.json                 |  167 ++++++-----------------
> src/spec/fixtures/repositories.json             |   18 ++--
> 6 files changed, 77 insertions(+), 187 deletions(-)
> create mode 100644 src/spec/fixtures/packagegroupcategories.json
> 
> diff --git a/src/features/step_definitions/template_steps.rb 
> b/src/features/step_definitions/template_steps.rb
> index b59808d..c793e01 100644
> --- a/src/features/step_definitions/template_steps.rb
> +++ b/src/features/step_definitions/template_steps.rb
> @@ -4,12 +4,15 @@ Given /^There is a mock pulp repository$/ do
>   hydra.stub(:get, "http://pulptest/repositories/";).and_return(
>     Typhoeus::Response.new(:code => 200,
>                            :body => File.read(File.join(dir, 
> 'repositories.json'))))
> -  hydra.stub(:get, 
> "http://pulptest/repositories/jboss/packagegroups/";).and_return(
> +  hydra.stub(:get, 
> "http://pulptest/repositories/fedora/packagegroups/";).and_return(
>     Typhoeus::Response.new(:code => 200,
>                            :body => File.read(File.join(dir, 
> 'packagegroups.json'))))
> -  hydra.stub(:get, 
> "http://pulptest/repositories/jboss/packages/";).and_return(
> +  hydra.stub(:get, 
> "http://pulptest/repositories/fedora/packages/";).and_return(
>     Typhoeus::Response.new(:code => 200,
>                            :body => File.read(File.join(dir, 
> 'packages.json'))))
> +  hydra.stub(:get, 
> "http://pulptest/repositories/fedora/packagegroupcategories/";).and_return(
> +    Typhoeus::Response.new(:code => 200,
> +                           :body => File.read(File.join(dir, 
> 'packagegroupcategories.json'))))
> 
> end
> 
> diff --git a/src/features/template.feature b/src/features/template.feature
> index 29d963e..73de5ca 100644
> --- a/src/features/template.feature
> +++ b/src/features/template.feature
> @@ -15,7 +15,6 @@ Feature: Manage Templates
>     When I fill in the following:
>       | tpl_name         | mocktemplate  |
>       | tpl_platform     | fedora        |
> -      | tpl_platform     | 11            |
>       | tpl_summary      | mockdesc      |
>     When I press "Save"
>     Then I should be on the templates page
> @@ -30,14 +29,15 @@ Feature: Manage Templates
>       | tpl_name         | mocktemplate  |
>     And I press "Add Software"
>     Then I should see "Managed Content Selection"
> -    When I check "group_JBoss_Core_Packages"
> +    When I press "Collections"
> +    And I check "group_deltacloud"
>     And I press "Add Selected"
>     Then I should see "Managed Content to Bundle"
>     And the "tpl[name]" field by name should contain "mocktemplate"
> -    And the page should contain "#selected_package_jboss-as5" selector
> -    When I press "remove_package_jboss-as5"
> +    And the page should contain "#package_libdeltacloud" selector
> +    When I press "remove_package_libdeltacloud"
>     Then I should see "Managed Content to Bundle"
> -    And the page should not contain "#selected_package_jboss-as5" selector
> +    And the page should not contain "#package_libdeltacloud" selector
>     When I press "Save"
>     Then I should be on the templates page
>     And I should see "Template saved"
> diff --git a/src/spec/fixtures/packagegroupcategories.json 
> b/src/spec/fixtures/packagegroupcategories.json
> new file mode 100644
> index 0000000..5b0a05e
> --- /dev/null
> +++ b/src/spec/fixtures/packagegroupcategories.json
> @@ -0,0 +1,11 @@
> +{ "base-system" : { "_id" : "base-system",
> +      "description" : "Various core pieces of the system.",
> +      "display_order" : 99,
> +      "id" : "base-system",
> +      "immutable" : true,
> +      "name" : "Base System",
> +      "packagegroupids" : [ "deltacloud" ],
> +      "repo_defined" : true,
> +      "translated_description" : {  },
> +      "translated_name" : {  }
> +    } }
> diff --git a/src/spec/fixtures/packagegroups.json 
> b/src/spec/fixtures/packagegroups.json
> index 9dd6008..357b59e 100644
> --- a/src/spec/fixtures/packagegroups.json
> +++ b/src/spec/fixtures/packagegroups.json
> @@ -1,54 +1,19 @@
> -{ "JBoss   Social Networking Web Application" : { "_id" : "JBoss Social 
> Networking Web  Application",
> +{ "deltacloud" : { "_id" : "deltacloud",
>       "conditional_package_names" : {  },
>       "default" : true,
> -      "default_package_names" : [  ],
> -      "description" : "This group contains a JBoss social networking 
> application",
> -      "display_order" : 1024,
> -      "id" : "JBoss Social Networking Web Application",
> -      "immutable" : true,
> -      "langonly" : null,
> -      "mandatory_package_names" : [  ],
> -      "name" : "JBoss Social Networking Web Application",
> -      "optional_package_names" : [ "JSocNet" ],
> -      "repo_defined" : true,
> -      "translated_description" : {  },
> -      "translated_name" : {  },
> -      "user_visible" : true
> -    },
> -  "JBoss Drools" : { "_id" : "JBoss Drools",
> -      "conditional_package_names" : {  },
> -      "default" : true,
> -      "default_package_names" : [  ],
> -      "description" : "This group contains the JBoss Drools component",
> -      "display_order" : 1024,
> -      "id" : "JBoss Drools",
> -      "immutable" : true,
> -      "langonly" : null,
> -      "mandatory_package_names" : [  ],
> -      "name" : "JBoss Drools",
> -      "optional_package_names" : [ "drools-guvnor" ],
> -      "repo_defined" : true,
> -      "translated_description" : {  },
> -      "translated_name" : {  },
> -      "user_visible" : true
> -    },
> -  "JBoss" : { "_id" : "JBoss",
> -      "conditional_package_names" : {  },
> -      "default" : true,
> -      "default_package_names" : [ "jboss-jgroups",
> -          "jboss-as5"
> +      "default_package_names" : [ "libdeltacloud",
> +          "deltacloud-portal"
>         ],
> -      "description" : "This group is a collection of core JBoss packages",
> +      "description" : "Deltacloud description",
>       "display_order" : 1024,
> -      "id" : "JBoss",
> +      "id" : "deltacloud",
>       "immutable" : true,
>       "langonly" : null,
>       "mandatory_package_names" : [  ],
> -      "name" : "JBoss Core Packages",
> -      "optional_package_names" : [ "jboss-       rails" ],
> +      "name" : "Deltacloud",
> +      "optional_package_names" : [  ],
>       "repo_defined" : true,
>       "translated_description" : {  },
>       "translated_name" : {  },
>       "user_visible" : true
> -    }
> -}
> +    } }
> diff --git a/src/spec/fixtures/packages.json b/src/spec/fixtures/packages.json
> index bb98881..aff7484 100644
> --- a/src/spec/fixtures/packages.json
> +++ b/src/spec/fixtures/packages.json
> @@ -1,128 +1,39 @@
> -{ "101f17d4-018b-4af4-bfed-46b142c8b721" : { "_id" : 
> "101f17d4-018b-4af4-bfed-46b142c8b721",
> -      "_ns" : "packages",
> -      "arch" : "noarch",
> -      "checksum" : { "sha256" : "ec00a837f6995b4af77b0eaa5edf69570e0149a8" },
> -      "description" : "The Drools Guvnor Repository for JBoss AS 5",
> -      "download_url" : 
> "http://localhost//pub/jboss/J-SocialNet-1.0.1.GA-1.noarch.rpm";,
> -      "epoch" : "0",
> -      "filename" : "J-SocialNet-1.0.1.GA-1.noarch.rpm",
> -      "id" : "101f17d4-018b-4af4-bfed-46b142c8b721",
> -      "name" : "J-SocialNet",
> -      "provides" : [ "J-SocialNet" ],
> -      "release" : "1",
> -      "requires" : [ "/bin/sh",
> -          "jboss- as5"
> -        ],
> -      "vendor" : null,
> -      "version" : "1.0.1.    GA"
> -    },
> -  "124eef28-0d3d-46eb-8b8b-ae1acba104e0" : { "_id" : 
> "124eef28-0d3d-46eb-8b8b-ae1acba104e0",
> -      "_ns" : "packages",
> -      "arch" : "noarch",
> -      "checksum" : { "sha256" : "cf09c311b72b9b0fb0a93ab94fa40aa8c31550de" },
> -      "description" : "JBoss JGroups",
> -      "download_url" : 
> "http://localhost//pub/jboss/jboss-jgroups-2.6.7.GA-1.   noarch.rpm",
> -      "epoch" : "0",
> -      "filename" : "jboss-jgroups-2.6.7.GA-1.noarch.rpm",
> -      "id" : "124eef28-0d3d-46eb-8b8b-ae1acba104e0",
> -      "name" : "jboss-jgroups",
> -      "provides" : [ "jboss-jgroups" ],
> -      "release" : "1",
> -      "requires" : [ "/bin/sh" ],
> -      "vendor" : null,
> -      "version" : "2.6.7.GA"
> -    },
> -  "1668d633-b86d-4cf0-86d9-745b023c1a16" : { "_id" : 
> "1668d633-b86d-4cf0-86d9-745b023c1a16",
> -      "_ns" : "packages",
> -      "arch" : "noarch",
> -      "checksum" : { "sha256" : "7b3c66d475357a7d1fc1697f81bc8076388d35aa" },
> -      "description" : "The JBoss Rails deployer for AS5",
> -      "download_url" : 
> "http://localhost//pub/jboss/jboss-rails-1.0.0.Beta3-1.noarch.rpm";,
> -      "epoch" : "0",
> -      "filename" : "jboss-rails-1.0.0.Beta3-1.noarch.rpm",
> -      "id" : "1668d633-b86d-4cf0-86d9-745b023c1a16",
> -      "name" : "jboss-rails",
> -      "provides" : [ "perl(jdbc_adapter)",
> -          "jboss-rails"
> -        ],
> -      "release" : "1",
> -      "requires" : [ "/bin/sh" ],
> -      "vendor" : null,
> -      "version" : "1.0.0.Beta3"
> -    },
> -  "229f8733-0996-4d38-af2d-8e10ceea6661" : { "_id" : 
> "229f8733-0996-4d38-af2d-8e10ceea6661",
> -      "_ns" : "packages",
> -      "arch" : "noarch",
> -      "checksum" : { "sha256" : "5148c747ced6a5e25728e49b55f97b5cb8d2e7a0" },
> -      "description" : "The Drools Guvnor Repository for JBoss AS 5",
> -      "download_url" : 
> "http://localhost//pub/jboss/drools-guvnor-5.0.1.GA-1.noarch.rpm";,
> -      "epoch" : "0",
> -      "filename" : "drools-guvnor-5.0.1.GA-1.noarch.rpm",
> -      "id" : "229f8733-0996-4d38-af2d-8e10ceea6661",
> -      "name" : "drools-guvnor",
> -      "provides" : [ "drools-guvnor" ],
> -      "release" : "1",
> -      "requires" : [ "/bin/sh",
> -          "jboss-as5"
> -        ],
> -      "vendor" : null,
> -      "version" : "5.0.1.GA"
> -    },
> -  "9fcca05a-af6e-47f0-a4ea-0e31d4a38192" : { "_id" : 
> "9fcca05a-af6e-47f0-a4ea-0e31d4a38192",
> -      "_ns" : "packages",
> -      "arch" : "noarch",
> -      "checksum" : { "sha256" : "d373add70015c6aa4d0ef24175ea4ca74f26e54f" },
> -      "description" : "A script that produces javadoc-style documentation 
> from\nwell-formed JavaScript sourcefiles. At the moment, this means 
> it\nsupports    sourcefiles where all functions are mapped to a class\nusing 
> prototype-based inheritance.  Anonymous function\ndefinitions (e.g. 
> Circle.prototype.getRadius =         function(){ ...} )\nare supported.",
> -      "download_url" : 
> "http://localhost//pub/jboss/JSDoc-1.10.2-7.fc11.noarch.rpm";,
> -      "epoch" : "0",
> -      "filename" : "JSDoc-1.10.2-7.fc11.noarch.rpm",
> -      "id" : "9fcca05a-af6e-47f0-a4ea-          0e31d4a38192",
> -      "name" : "JSDoc",
> -      "provides" : [ "perl(JSDoc::XML)",
> -          "perl(JSDoc)",
> -          "JSDoc",
> -          "perl(JavaScript::Syntax::HTML)",
> -          "perl(JSDoc::XMI)"
> -        ],
> -      "release" : "7.fc11",
> -      "requires" : [ "perl(Data::Dumper)",
> -          "perl(constant)",
> -          "perl(:MODULE_COMPAT_5.10.0)",
> -          "perl(File::Basename)",
> -          "perl(JavaScript::Syntax::HTML)",
> -          "perl(warnings)",
> -          "perl(JSDoc)",
> -          "perl(File::Path)",
> -          "perl(JSDoc::XML)",
> -          "perl(lib)",
> -          "perl(Exporter)",
> -          "perl",
> -          "/usr/bin/perl",
> -          "perl(HTML::         Template)",
> -          "perl(Getopt::Long)",
> -          "perl(vars)",
> -          "perl(File::Copy)",
> -          "perl(File::Find)",
> -          "perl(JSDoc::XMI)",
> -          "perl(strict)"
> -        ],
> -      "vendor" : null,
> -      "version" : "1.10.2"
> -    },
> -  "a2d1440e-2f22-480f-ace9-04d40361856f" : { "_id" : 
> "a2d1440e-2f22-480f-ace9-04d40361856f",
> -      "_ns" : "packages",
> -      "arch" : "noarch",
> -      "checksum" : { "sha256" : "0c77cb7f6c57a39b00ec6ece7fb372ac6ed08277" },
> -      "description" : "The JBossAS 5 Java Application Server",
> -      "download_url" : 
> "http://localhost//pub/jboss/jboss-as5-5.0.0.GA-1.noarch.rpm";,
> -      "epoch" : "0",
> -      "filename" : "jboss-as5-5.0.0.GA-1.noarch.rpm",
> -      "id" : "a2d1440e-2f22-480f-ace9-04d40361856f",
> -      "name" : "jboss-as5",
> -      "provides" : [ "jboss-as5" ],
> -      "release" : "1",
> -      "requires" : [ "/bin/sh" ],
> -      "vendor" : null,
> -      "version" : "5.0.0.GA"
> -    }
> -}
> +[ { "_id" : "ad9d9738-6756-4e2a-9258-6aff01f98daf",
> +    "_ns" : "packages",
> +    "arch" : "src",
> +    "checksum" : { "sha256" : 
> "ddecd306f32c90323ed4a9c5064f4fe971b24f7adcf0c6cb9cab936a4ac080b3" },
> +    "description" : "Libdeltacloud is a library for accessing deltacloud via 
> a\nconvenient C API.",
> +    "download_url" : 
> "http://localhost//pub/deltacloud/libdeltacloud-0.3-1.fc12.src.rpm";,
> +    "epoch" : "0",
> +    "filename" : "libdeltacloud-0.3-1.fc12.src.rpm",
> +    "id" : "ad9d9738-6756-4e2a-9258-6aff01f98daf",
> +    "name" : "libdeltacloud",
> +    "provides" : [  ],
> +    "release" : "1.fc12",
> +    "requires" : [ "libcurl-devel",
> +        "libxml2-devel"
> +      ],
> +    "vendor" : null,
> +    "version" : "0.3"
> +  },
> +  { "_id" : "e7f2bd45-4afa-412a-98f8-004b40748b82",
> +    "_ns" : "packages",
> +    "arch" : "src",
> +    "checksum" : { "sha256" : 
> "ae415673a3cb07b72d4fe33d9da2a69b0ad1c1e274bd3f04a41f863f17d39035" },
> +    "description" : "The Portal for deltacloud.",
> +    "download_url" : 
> "http://localhost//pub/deltacloud/deltacloud-portal-0.0.1-1.fc11.src.rpm";,
> +    "epoch" : "0",
> +    "filename" : "deltacloud-portal-0.0.1-1.fc11.src.rpm",
> +    "id" : "e7f2bd45-4afa-412a-98f8-004b40748b82",
> +    "name" : "deltacloud-portal",
> +    "provides" : [  ],
> +    "release" : "1.fc11",
> +    "requires" : [ "ruby-devel",
> +        "rubygem(rake)",
> +        "rubygem(gettext)",
> +        "ruby"
> +      ],
> +    "vendor" : null,
> +    "version" : "0.0.1"
> +  }
> +]
> diff --git a/src/spec/fixtures/repositories.json 
> b/src/spec/fixtures/repositories.json
> index f3a2723..4f9a6c8 100644
> --- a/src/spec/fixtures/repositories.json
> +++ b/src/spec/fixtures/repositories.json
> @@ -1,19 +1,19 @@
> -[ { "_id" : "jboss",
> +[ { "_id" : "fedora",
>     "arch" : "x86_64",
> -    "errata" : "/repositories/jboss/errata/",
> -    "id" : "jboss",
> -    "name" : "jboss",
> -    "packagegroupcategories" : "/repositories/jboss/packagegroupcategories/",
> -    "packagegroups" : "/repositories/jboss/packagegroups/",
> -    "packages" : "/repositories/jboss/packages/",
> +    "errata" : "/repositories/fedora/errata/",
> +    "id" : "fedora",
> +    "name" : "fedora",
> +    "packagegroupcategories" : 
> "/repositories/fedora/packagegroupcategories/",
> +    "packagegroups" : "/repositories/fedora/packagegroups/",
> +    "packages" : "/repositories/fedora/packages/",
>     "source" : { "supported_types" : [ "yum",
>             "local",
>             "rhn"
>           ],
>         "type" : "yum",
> -        "url" : "http://example/jboss";
> +        "url" : "http://example/fedora";
>       },
>     "sync_schedule" : null,
> -    "uri_ref" : "/repositories/jboss/",
> +    "uri_ref" : "/repositories/fedora/",
>     "use_symlinks" : false
>   } ]
> -- 
> 1.7.2.3
> 
> _______________________________________________
> deltacloud-devel mailing list
> [email protected]
> https://fedorahosted.org/mailman/listinfo/deltacloud-devel

ACK

-- Ladislav

_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to