diff --git a/mozilla/webtools/testopia/.bzrrev b/mozilla/webtools/testopia/.bzrrev index aa10449136f..a869e998c0e 100644 --- a/mozilla/webtools/testopia/.bzrrev +++ b/mozilla/webtools/testopia/.bzrrev @@ -1 +1 @@ -637 +638 \ No newline at end of file diff --git a/mozilla/webtools/testopia/extensions/testopia/ChangeLog b/mozilla/webtools/testopia/extensions/Testopia/ChangeLog similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/ChangeLog rename to mozilla/webtools/testopia/extensions/Testopia/ChangeLog diff --git a/mozilla/webtools/testopia/extensions/testopia/code/install-requirements.pl b/mozilla/webtools/testopia/extensions/Testopia/Config.pm similarity index 64% rename from mozilla/webtools/testopia/extensions/testopia/code/install-requirements.pl rename to mozilla/webtools/testopia/extensions/Testopia/Config.pm index 292035d8ba7..2f643713c16 100644 --- a/mozilla/webtools/testopia/extensions/testopia/code/install-requirements.pl +++ b/mozilla/webtools/testopia/extensions/Testopia/Config.pm @@ -1,7 +1,8 @@ -#!/usr/bin/perl -w +package Bugzilla::Extension::Testopia; +use strict; +use constant NAME => 'Testopia'; -sub REQUIRED_MODULES { - my @modules = ( +use constant REQUIRED_MODULES => [ { package => 'JSON', module => 'JSON', @@ -17,38 +18,33 @@ sub REQUIRED_MODULES { module => 'GD::Graph3d', version => '0.63' }, - ); - return \@modules; -}; +]; -sub OPTIONAL_MODULES { - my @modules = ( +use constant OPTIONAL_MODULES => [ { package => 'Text-CSV', module => 'Text::CSV', version => '1.06', - feature => 'CSV Importing of test cases' + feature => ['CSV Importing of test cases'] }, { package => 'XML Schema Validator', module => 'XML::Validator::Schema', version => '1.10', - feature => 'XML Importing of test cases and plans' + feature => ['XML Importing of test cases and plans'] }, { package => 'XML Schema Parser', module => 'XML::SAX::ParserFactory', version => 0, - feature => 'XML Importing of test cases and plans' + feature => ['XML Importing of test cases and plans'] }, { package => 'XML Twig', module => 'XML::Twig', version => 0, - feature => 'XML Importing of test cases and plans' + feature => ['XML Importing of test cases and plans'] } - ); - - return \@modules; -}; - \ No newline at end of file +]; + +__PACKAGE__->NAME; diff --git a/mozilla/webtools/testopia/extensions/Testopia/Extension.pm b/mozilla/webtools/testopia/extensions/Testopia/Extension.pm new file mode 100644 index 00000000000..8a124c6b352 --- /dev/null +++ b/mozilla/webtools/testopia/extensions/Testopia/Extension.pm @@ -0,0 +1,1945 @@ +package Bugzilla::Extension::Testopia; +use strict; +use base qw(Bugzilla::Extension); + +use Bugzilla::Extension::Testopia::Product; +use Bugzilla::Extension::Testopia::TestCase; +use Bugzilla::Extension::Testopia::TestPlan; +use Bugzilla::Extension::Testopia::TestRun; +use Bugzilla::Group; +use Bugzilla::Status; +use Bugzilla::User::Setting; +use Bugzilla::Util; +use File::Path; + +our $VERSION = '2.3.1'; + +sub bug_end_of_update { + my ($self, $args) = @_; + + + + my $bug = $args->{'bug'}; + my $timestamp = $args->{'timestamp'}; + my $changes = $args->{'changes'}; + my $dbh = Bugzilla->dbh; + + foreach my $field (keys %$changes) { + my $used_to_be = $changes->{$field}->[0]; + my $now_it_is = $changes->{$field}->[1]; + } + + my $tcrs = $dbh->selectcol_arrayref("SELECT case_id FROM test_case_bugs WHERE bug_id = ?", undef, $bug->id); + + my $status_message; + if (my $status_change = $changes->{'bug_status'}) { + my $old_status = new Bugzilla::Status({ name => $status_change->[0] }); + my $new_status = new Bugzilla::Status({ name => $status_change->[1] }); + if ($new_status->is_open && !$old_status->is_open) { + for my $tcr(@$tcrs) { + my $tc = Bugzilla::Extension::Testopia::TestCase->new($tcr); + $tc->remove_tag('BUGFIXED'); + } + } + if (!$new_status->is_open && $old_status->is_open) { + for my $tcr(@$tcrs) { + my $tc = Bugzilla::Extension::Testopia::TestCase->new($tcr); + $tc->add_tag('BUGFIXED'); + } + } + } +} + +sub buglist_columns { + my ($self, $args) = @_; + + + my $columns = $args->{'columns'}; + $columns->{'test_cases'} = { 'name' => 'tcb.case_id' , 'title' => 'Test Cases' }; +} + +sub colchange_columns { + my ($self, $args) = @_; + + + + my $columns = $args->{'columns'}; + push (@$columns, "test_cases") +} + +sub config_add_panels { + my ($self, $args) = @_; + + my $modules = $args->{panel_modules}; + $modules->{Testopia} = "Bugzilla::Extension::Testopia::Config"; +} + +sub db_schema_abstract_schema { + my ($self, $args) = @_; + + my $schema = $args->{schema}; + + $schema->{test_attachments} = { + FIELDS => [ + attachment_id => { TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + submitter_id => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'profiles', + COLUMN => 'userid' + } + }, + description => { TYPE => 'MEDIUMTEXT' }, + filename => { TYPE => 'MEDIUMTEXT' }, + creation_ts => { TYPE => 'DATETIME', NOTNULL => 1 }, + mime_type => { TYPE => 'varchar(100)', NOTNULL => 1 }, + ], + INDEXES => [ test_attachments_submitter_idx => ['submitter_id'], ], + }, + $schema->{test_case_attachments} = { + FIELDS => [ + attachment_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_attachments', + COLUMN => 'attachment_id', + DELETE => 'CASCADE' + } + }, + case_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + } + }, + case_run_id => { + TYPE => 'INT4', + REFERENCES => { + TABLE => 'test_case_runs', + COLUMN => 'case_run_id', + DELETE => 'CASCADE' + } + + }, + ], + INDEXES => [ + test_case_attachments_primary_idx => ['attachment_id'], + attachment_case_id_idx => ['case_id'], + attachment_caserun_id_idx => ['case_run_id'], + ], + }, + $schema->{test_plan_attachments} = { + FIELDS => [ + attachment_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_attachments', + COLUMN => 'attachment_id', + DELETE => 'CASCADE' + } + }, + plan_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_plans', + COLUMN => 'plan_id', + DELETE => 'CASCADE' + } + }, + ], + INDEXES => [ + test_plan_attachments_primary_idx => ['attachment_id'], + attachment_plan_id_idx => ['plan_id'], + ], + }, + $schema->{test_case_categories} = { + FIELDS => [ + category_id => { TYPE => 'SMALLSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + product_id => { + TYPE => 'INT2', + NOTNULL => 1, + REFERENCES => { + TABLE => 'products', + COLUMN => 'id', + DELETE => 'CASCADE' + } + }, + name => { TYPE => 'varchar(240)', NOTNULL => 1 }, + description => { TYPE => 'MEDIUMTEXT' }, + ], + INDEXES => [ + category_product_id_name_idx => { FIELDS => [qw(product_id name)], TYPE => 'UNIQUE' }, + category_product_idx => { FIELDS => [qw(category_id product_id)], TYPE => 'UNIQUE' }, + category_name_idx_v2 => ['name'], + ], + }, + $schema->{test_cases} = { + FIELDS => [ + case_id => { TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + case_status_id => { + TYPE => 'INT2', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_case_status', + COLUMN => 'case_status_id', + DELETE => 'CASCADE' + } + }, + category_id => { + TYPE => 'INT2', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_case_categories', + COLUMN => 'category_id', + DELETE => 'CASCADE' + } + }, + priority_id => { + TYPE => 'INT2', + REFERENCES => { + TABLE => 'priority', + COLUMN => 'id', + DELETE => 'RESTRICT' + } + }, + author_id => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'profiles', + COLUMN => 'userid', + } + }, + default_tester_id => { + TYPE => 'INT3', + }, + creation_date => { TYPE => 'DATETIME', NOTNULL => 1 }, + estimated_time => { TYPE => 'TIME' }, + isautomated => { TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => '0' }, + sortkey => { TYPE => 'INT4' }, + script => { TYPE => 'MEDIUMTEXT' }, + arguments => { TYPE => 'MEDIUMTEXT' }, + summary => { TYPE => 'varchar(255)' }, + requirement => { TYPE => 'varchar(255)' }, + alias => { TYPE => 'varchar(255)' }, + ], + INDEXES => [ + test_case_category_idx => ['category_id'], + test_case_author_idx => ['author_id'], + test_case_creation_date_idx => ['creation_date'], + test_case_sortkey_idx => ['sortkey'], + test_case_shortname_idx => ['alias'], + test_case_requirement_idx => ['requirement'], + test_case_status_idx => ['case_status_id'], + test_case_tester_idx => ['default_tester_id'], + ], + }, + $schema->{test_case_bugs} = { + FIELDS => [ + bug_id => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'bugs', + COLUMN => 'bug_id', + DELETE => 'CASCADE' + } + }, + case_run_id => { + TYPE => 'INT4', + REFERENCES => { + TABLE => 'test_case_runs', + COLUMN => 'case_run_id', + DELETE => 'CASCADE' + } + }, + case_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + } + }, + ], + INDEXES => [ + case_bugs_bug_id_idx => ['bug_id'], + case_bugs_case_id_idx => ['case_id'], + case_bugs_case_run_id_idx => ['case_run_id'], + ], + }, + $schema->{test_case_runs} = { + FIELDS => [ + case_run_id => { TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + run_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_runs', + COLUMN => 'run_id', + DELETE => 'CASCADE' + } + }, + case_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + } + }, + assignee => { + TYPE => 'INT3' + }, + testedby => { + TYPE => 'INT3' + }, + case_run_status_id => { + TYPE => 'INT2', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_case_run_status', + COLUMN => 'case_run_status_id', + DELETE => 'CASCADE' + } + }, + case_text_version => { TYPE => 'INT3', NOTNULL => 1 }, + build_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_builds', + COLUMN => 'build_id', + DELETE => 'CASCADE' + } + }, + running_date => { TYPE => 'DATETIME' }, + close_date => { TYPE => 'DATETIME' }, + notes => { TYPE => 'TEXT' }, + iscurrent => { TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => '0' }, + sortkey => { TYPE => 'INT4' }, + environment_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_environments', + COLUMN => 'environment_id', + DELETE => 'CASCADE' + } + }, + priority_id => { + TYPE => 'INT2', + REFERENCES => { + TABLE => 'priority', + COLUMN => 'id', + DELETE => 'RESTRICT' + } + }, + + ], + INDEXES => [ + case_run_case_id_idx => ['case_id'], + case_run_assignee_idx => ['assignee'], + case_run_testedby_idx => ['testedby'], + case_run_close_date_idx => ['close_date'], + case_run_build_env_idx => { + FIELDS => [qw(run_id case_id build_id environment_id)], + TYPE => 'UNIQUE' + }, + case_run_status_idx => ['case_run_status_id'], + case_run_text_ver_idx => ['case_text_version'], + case_run_build_idx_v2 => ['build_id'], + case_run_env_idx_v2 => ['environment_id'], + case_run_priority_idx => ['priority_id'], + ], + }, + $schema->{test_case_texts} = { + FIELDS => [ + case_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + } + }, + case_text_version => { TYPE => 'INT3', NOTNULL => 1 }, + who => { + TYPE => 'INT3', + NOTNULL => 1, + }, + creation_ts => { TYPE => 'DATETIME', NOTNULL => 1 }, + action => { TYPE => 'MEDIUMTEXT' }, + effect => { TYPE => 'MEDIUMTEXT' }, + setup => { TYPE => 'MEDIUMTEXT' }, + breakdown => { TYPE => 'MEDIUMTEXT' }, + ], + INDEXES => [ + case_versions_idx => { + FIELDS => [qw(case_id case_text_version)], + TYPE => 'UNIQUE' + }, + case_versions_who_idx => ['who'], + case_versions_creation_ts_idx => ['creation_ts'], + ], + }, + $schema->{test_tags} = { + FIELDS => [ + tag_id => { TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + tag_name => { TYPE => 'varchar(255)', NOTNULL => 1 }, + ], + INDEXES => [ test_tag_name_idx_v2 => [qw(tag_name)] ], + }, + $schema->{test_case_tags} = { + FIELDS => [ + tag_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_tags', + COLUMN => 'tag_id', + DELETE => 'CASCADE' + } + }, + case_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + } + }, + userid => { + TYPE => 'INT3', + NOTNULL => 1, + }, + ], + INDEXES => [ + case_tags_primary_idx => { FIELDS => [qw(tag_id case_id userid)], TYPE => 'UNIQUE' }, + case_tags_secondary_idx => { FIELDS => [qw(tag_id case_id)], TYPE => 'UNIQUE' }, + case_tags_case_id_idx_v3 => [qw(case_id)], + case_tags_userid_idx => [qw(userid)], + ], + }, + $schema->{test_run_tags} = { + FIELDS => [ + tag_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_tags', + COLUMN => 'tag_id', + DELETE => 'CASCADE' + } + }, + run_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_runs', + COLUMN => 'run_id', + DELETE => 'CASCADE' + } + + }, + userid => { + TYPE => 'INT3', + NOTNULL => 1, + }, + ], + INDEXES => [ + run_tags_primary_idx => { FIELDS => [qw(tag_id run_id userid)], TYPE => 'UNIQUE' }, + run_tags_secondary_idx => { FIELDS => [qw(tag_id run_id)], TYPE => 'UNIQUE' }, + run_tags_run_id_idx => [qw(run_id)], + run_tags_userid_idx => [qw(userid)], + ], + }, + $schema->{test_plan_tags} = { + FIELDS => [ + tag_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_tags', + COLUMN => 'tag_id', + DELETE => 'CASCADE' + } + }, + plan_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_plans', + COLUMN => 'plan_id', + DELETE => 'CASCADE' + } + }, + userid => { + TYPE => 'INT3', + NOTNULL => 1, + }, + ], + INDEXES => [ + plan_tags_primary_idx => { FIELDS => [qw(tag_id plan_id userid)], TYPE => 'UNIQUE' }, + plan_tags_secondary_idx => { FIELDS => [qw(tag_id plan_id)], TYPE => 'UNIQUE' }, + plan_tags_plan_id_idx => [qw(plan_id)], + plan_tags_userid_idx => [qw(userid)], + ], + }, + $schema->{test_plans} = { + FIELDS => [ + plan_id => { TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + product_id => { + TYPE => 'INT2', + NOTNULL => 1, + REFERENCES => { + TABLE => 'products', + COLUMN => 'id', + DELETE => 'CASCADE' + } + + }, + author_id => { + TYPE => 'INT3', + NOTNULL => 1, + }, + type_id => { + TYPE => 'INT2', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_plan_types', + COLUMN => 'type_id', + DELETE => 'CASCADE' + } + }, + default_product_version => { TYPE => 'MEDIUMTEXT', NOTNULL => 1 }, + name => { TYPE => 'varchar(255)', NOTNULL => 1 }, + creation_date => { TYPE => 'DATETIME', NOTNULL => 1 }, + isactive => { TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => '1' }, + ], + INDEXES => [ + plan_product_plan_id_idx => [qw(product_id plan_id)], + plan_author_idx => ['author_id'], + plan_type_idx => ['type_id'], + plan_isactive_idx => ['isactive'], + plan_name_idx => ['name'], + ], + }, + $schema->{test_plan_permissions} = { + FIELDS => [ + userid => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'profiles', + COLUMN => 'userid', + DELETE => 'CASCADE' + } + + }, + plan_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_plans', + COLUMN => 'plan_id', + DELETE => 'CASCADE' + } + + }, + permissions => { TYPE => 'INT1', NOTNULL => 1 }, + grant_type => { TYPE => 'INT1', NOTNULL => 1 }, + ], + INDEXES => [ + testers_plan_user_idx => { FIELDS => [qw(userid plan_id grant_type)], TYPE => 'UNIQUE' }, + testers_plan_user_plan_idx => ['plan_id'], + testers_plan_grant_idx => ['grant_type'], + ], + }, + $schema->{test_plan_permissions_regexp} = { + FIELDS => [ + plan_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_plans', + COLUMN => 'plan_id', + DELETE => 'CASCADE' + } + }, + user_regexp => { TYPE => 'TEXT', NOTNULL => 1 }, + permissions => { TYPE => 'INT1', NOTNULL => 1 }, + ], + INDEXES => [ testers_plan_regexp_idx => { FIELDS => [qw(plan_id)], TYPE => 'UNIQUE' }, ], + }, + $schema->{test_plan_texts} = { + FIELDS => [ + plan_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_plans', + COLUMN => 'plan_id', + DELETE => 'CASCADE' + } + }, + plan_text_version => { TYPE => 'INT4', NOTNULL => 1 }, + who => { + TYPE => 'INT3', + NOTNULL => 1, + }, + creation_ts => { TYPE => 'DATETIME', NOTNULL => 1 }, + plan_text => { TYPE => 'MEDIUMTEXT' }, + ], + INDEXES => [ + test_plan_text_version_idx => [qw(plan_id plan_text_version)], + test_plan_text_who_idx => ['who'], + ], + }, + + # Tiny table -- don't add keys besides primary key. + $schema->{test_plan_types} = { + FIELDS => [ + type_id => { TYPE => 'SMALLSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + name => { TYPE => 'varchar(64)', NOTNULL => 1 }, + description => { TYPE => 'MEDIUMTEXT' }, + ], + }, + $schema->{test_runs} = { + FIELDS => [ + run_id => { TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + plan_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_plans', + COLUMN => 'plan_id', + DELETE => 'CASCADE' + } + }, + environment_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_environments', + COLUMN => 'environment_id', + DELETE => 'CASCADE' + } + }, + product_version => { TYPE => 'MEDIUMTEXT' }, + build_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_builds', + COLUMN => 'build_id', + DELETE => 'CASCADE' + } + }, + plan_text_version => { TYPE => 'INT4', NOTNULL => 1 }, + manager_id => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'profiles', + COLUMN => 'userid', + DELETE => 'CASCADE' + } + }, + default_tester_id => { + TYPE => 'INT3', + }, + start_date => { TYPE => 'DATETIME', NOTNULL => 1 }, + stop_date => { TYPE => 'DATETIME' }, + summary => { TYPE => 'TINYTEXT', NOTNULL => 1 }, + notes => { TYPE => 'MEDIUMTEXT' }, + target_pass => { TYPE => 'INT1' }, + target_completion => { TYPE => 'INT1' }, + + ], + INDEXES => [ + test_run_plan_id_run_id_idx => [qw(plan_id run_id)], + test_run_manager_idx => ['manager_id'], + test_run_start_date_idx => ['start_date'], + test_run_stop_date_idx => ['stop_date'], + test_run_env_idx => ['environment_id'], + test_run_build_idx => ['build_id'], + test_run_plan_ver_idx => ['plan_text_version'], + test_run_tester_idx => ['default_tester_id'], + ], + }, + $schema->{test_case_plans} = { + FIELDS => [ + plan_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_plans', + COLUMN => 'plan_id', + DELETE => 'CASCADE' + } + }, + case_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + } + }, + ], + INDEXES => [ + test_case_plans_primary_idx => { FIELDS => [qw(plan_id case_id)], TYPE => 'UNIQUE' }, + test_case_plans_case_idx => [qw(case_id)], + ], + }, + $schema->{test_case_activity} = { + FIELDS => [ + case_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + } + }, + fieldid => { + TYPE => 'INT2', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_fielddefs', + COLUMN => 'fieldid', + DELETE => 'CASCADE' + } + }, + who => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'profiles', + COLUMN => 'userid', + } + }, + changed => { TYPE => 'DATETIME', NOTNULL => 1 }, + oldvalue => { TYPE => 'MEDIUMTEXT' }, + newvalue => { TYPE => 'MEDIUMTEXT' }, + ], + INDEXES => [ + case_activity_case_id_idx => ['case_id'], + case_activity_who_idx => ['who'], + case_activity_when_idx => ['changed'], + case_activity_field_idx => ['fieldid'], + ], + }, + + # Tiny table -- don't add keys besides primary key. + $schema->{test_fielddefs} = { + FIELDS => [ + fieldid => { TYPE => 'SMALLSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + name => { TYPE => 'varchar(100)', NOTNULL => 1 }, + description => { TYPE => 'MEDIUMTEXT' }, + table_name => { TYPE => 'varchar(100)', NOTNULL => 1 }, + ], + }, + $schema->{test_plan_activity} = { + FIELDS => [ + plan_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_plans', + COLUMN => 'plan_id', + DELETE => 'CASCADE' + } + }, + fieldid => { + TYPE => 'INT2', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_fielddefs', + COLUMN => 'fieldid', + DELETE => 'CASCADE' + } + }, + who => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'profiles', + COLUMN => 'userid', + } + }, + changed => { TYPE => 'DATETIME', NOTNULL => 1 }, + oldvalue => { TYPE => 'MEDIUMTEXT' }, + newvalue => { TYPE => 'MEDIUMTEXT' }, + ], + INDEXES => [ + plan_activity_primary_idx => ['plan_id'], + plan_activity_field_idx => ['fieldid'], + plan_activity_who_idx => ['who'], + plan_activity_changed_idx => ['changed'], + ], + }, + $schema->{test_case_components} = { + FIELDS => [ + case_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + } + }, + component_id => { + TYPE => 'INT2', + NOTNULL => 1, + REFERENCES => { + TABLE => 'components', + COLUMN => 'id', + DELETE => 'CASCADE' + } + + }, + ], + INDEXES => [ + components_case_id_idx => { FIELDS => [qw(case_id component_id)], TYPE => 'UNIQUE' }, + components_component_id_idx => ['component_id'], + ], + }, + $schema->{test_run_activity} = { + FIELDS => [ + run_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_runs', + COLUMN => 'run_id', + DELETE => 'CASCADE' + } + }, + fieldid => { + TYPE => 'INT2', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_fielddefs', + COLUMN => 'fieldid', + DELETE => 'CASCADE' + } + }, + who => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'profiles', + COLUMN => 'userid', + } + }, + changed => { TYPE => 'DATETIME', NOTNULL => 1 }, + oldvalue => { TYPE => 'MEDIUMTEXT' }, + newvalue => { TYPE => 'MEDIUMTEXT' }, + ], + INDEXES => [ + run_activity_run_id_idx => ['run_id'], + run_activity_field_idx => ['fieldid'], + run_activity_who_idx => ['who'], + run_activity_when_idx => ['changed'], + ], + }, + $schema->{test_run_cc} = { + FIELDS => [ + run_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_runs', + COLUMN => 'run_id', + DELETE => 'CASCADE' + } + }, + who => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'profiles', + COLUMN => 'userid', + DELETE => 'CASCADE' + } + }, + ], + INDEXES => [ + test_run_cc_primary_idx => { FIELDS => [qw(run_id who)], TYPE => 'UNIQUE' }, + test_run_cc_who_idx => [qw(who)], + ], + }, + $schema->{test_email_settings} = { + FIELDS => [ + userid => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'profiles', + COLUMN => 'userid', + } + }, + eventid => { + TYPE => 'INT1', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_events', + COLUMN => 'eventid', + DELETE => 'CASCADE' + } + }, + relationship_id => { + TYPE => 'INT1', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_relationships', + COLUMN => 'relationship_id', + DELETE => 'CASCADE' + } + }, + ], + INDEXES => [ + test_email_setting_user_id_idx => { + FIELDS => [qw(userid relationship_id eventid)], + TYPE => 'UNIQUE' + }, + ], + }, + $schema->{test_events} = { + FIELDS => [ + eventid => { TYPE => 'INT1', PRIMARYKEY => 1, NOTNULL => 1 }, + name => { TYPE => 'varchar(50)' }, + ], + INDEXES => [ test_event_name_idx => ['name'], ], + }, + $schema->{test_relationships} = { + FIELDS => [ + relationship_id => { TYPE => 'INT1', PRIMARYKEY => 1, NOTNULL => 1 }, + name => { TYPE => 'varchar(50)' }, + ], + }, + + # Tiny table -- don't add keys besides primary key. + $schema->{test_case_run_status} = { + FIELDS => [ + case_run_status_id => { TYPE => 'SMALLSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + name => { TYPE => 'varchar(20)' }, + sortkey => { TYPE => 'INT4' }, + description => { TYPE => 'TEXT' }, + ], + }, + + # Tiny table -- don't add keys besides primary key. + $schema->{test_case_status} = { + FIELDS => [ + case_status_id => { TYPE => 'SMALLSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + name => { TYPE => 'varchar(255)', NOTNULL => 1 }, + description => { TYPE => 'TEXT' }, + ], + }, + $schema->{test_case_dependencies} = { + FIELDS => [ + dependson => { TYPE => 'INT4', NOTNULL => 1 }, + blocked => { TYPE => 'INT4', NOTNULL => 1 }, + ], + INDEXES => [ + case_dependencies_primary_idx => { FIELDS => [qw(dependson blocked)], TYPE => 'UNIQUE' }, + case_dependencies_blocked_idx => ['blocked'], + ], + }, + $schema->{test_environments} = { + FIELDS => [ + environment_id => { TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + product_id => { + TYPE => 'INT2', + NOTNULL => 1, + REFERENCES => { + TABLE => 'products', + COLUMN => 'id', + DELETE => 'CASCADE' + } + }, + name => { TYPE => 'varchar(255)' }, + isactive => { TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => '1' }, + ], + INDEXES => [ + test_environments_key1 => { FIELDS => [qw(environment_id product_id)], TYPE => 'UNIQUE' }, + test_environments_key2 => { FIELDS => [qw(product_id name)], TYPE => 'UNIQUE' }, + environment_name_idx_v2 => ['name'], + ], + }, + $schema->{test_builds} = { + FIELDS => [ + build_id => { TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + product_id => { + TYPE => 'INT2', + NOTNULL => 1, + REFERENCES => { + TABLE => 'products', + COLUMN => 'id', + DELETE => 'CASCADE' + } + }, + milestone => { TYPE => 'varchar(20)' }, + name => { TYPE => 'varchar(255)' }, + description => { TYPE => 'TEXT' }, + isactive => { TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => '1' }, + ], + INDEXES => [ + build_name_idx => ['name'], + build_milestone_idx => ['milestone'], + build_product_id_name_idx => { FIELDS => [qw(product_id name)], TYPE => 'UNIQUE' }, + build_prod_idx => { FIELDS => [qw(build_id product_id)], TYPE => 'UNIQUE' }, + ], + }, + $schema->{test_attachment_data} = { + FIELDS => [ + attachment_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_attachments', + COLUMN => 'attachment_id', + DELETE => 'CASCADE' + } + }, + contents => { TYPE => 'LONGBLOB' }, + ], + INDEXES => [ test_attachment_data_primary_idx => ['attachment_id'], ], + }, + $schema->{test_named_queries} = { + FIELDS => [ + userid => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'profiles', + COLUMN => 'userid', + DELETE => 'CASCADE' + } + }, + name => { TYPE => 'varchar(64)', NOTNULL => 1 }, + isvisible => { TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 1 }, + query => { TYPE => 'MEDIUMTEXT', NOTNULL => 1 }, + type => { TYPE => 'INT3', NOTNULL => 1, DEFAULT => 0 }, + ], + INDEXES => [ + test_namedquery_primary_idx => { FIELDS => [qw(userid name)], TYPE => 'UNIQUE' }, + test_namedquery_name_idx => ['name'], + ], + }, + $schema->{test_environment_map} = { + FIELDS => [ + environment_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_environments', + COLUMN => 'environment_id', + DELETE => 'CASCADE' + } + }, + property_id => { + TYPE => 'INT4', + NOTNULL => 1, + }, + element_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_environment_element', + COLUMN => 'element_id', + DELETE => 'CASCADE' + } + }, + value_selected => { TYPE => 'TINYTEXT' }, + ], + INDEXES => [ + env_map_env_element_idx => [qw(environment_id element_id)], + env_map_property_idx => [qw(environment_id property_id)], + test_environment_map_key3 => { FIELDS => [qw(environment_id element_id property_id)], TYPE => 'UNIQUE' }, + ], + }, + $schema->{test_environment_element} = { + FIELDS => [ + element_id => { TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + env_category_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_environment_category', + COLUMN => 'env_category_id', + DELETE => 'CASCADE' + } + }, + name => { TYPE => 'varchar(255)' }, + parent_id => { TYPE => 'INT4' }, + isprivate => { TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 0 }, + ], + INDEXES => [ + test_environment_element_key1 => { FIELDS => [qw(element_id env_category_id)], TYPE => 'UNIQUE' }, + test_environment_element_key2 => { FIELDS => [qw(env_category_id name)], TYPE => 'UNIQUE' }, + ], + }, + $schema->{test_environment_category} = { + FIELDS => [ + env_category_id => { TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + product_id => { + TYPE => 'INT2', + NOTNULL => 1, + }, + name => { TYPE => 'varchar(255)' }, + ], + INDEXES => [ + test_environment_category_key1 => { FIELDS => [qw(env_category_id product_id)], TYPE => 'UNIQUE' }, + test_environment_category_key2 => { FIELDS => [qw(product_id name)], TYPE => 'UNIQUE' }, + ], + }, + $schema->{test_environment_property} = { + FIELDS => [ + property_id => { TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1 }, + element_id => { + TYPE => 'INT4', + NOTNULL => 1, + REFERENCES => { + TABLE => 'test_environment_element', + COLUMN => 'element_id', + DELETE => 'CASCADE' + } + }, + name => { TYPE => 'varchar(255)' }, + validexp => { TYPE => 'TEXT' }, + ], + INDEXES => [ + test_environment_property_key1 => { FIELDS => [qw(property_id element_id)], TYPE => 'UNIQUE' }, + test_environment_property_key2 => { FIELDS => [qw(element_id name)], TYPE => 'UNIQUE' }, + ], + }, +} + +sub enter_bug_entrydefaultvars { + my ($self, $args) = @_; + + my $vars = $args->{vars}; + my $cgi = Bugzilla->cgi; + + $vars->{'case_id'} = $cgi->param('case_id'); + $vars->{'caserun_id'} = $cgi->param('caserun_id'); +} + +sub install_before_final_checks { + my ($self, $args) = @_; + + + add_setting('view_testopia', ['on', 'off'], 'on'); + + if ( -e './testopia/patch-3.2'){ + print < extensions/Testopia/ + Bugzilla/Testopia/ (dir) -> extensions/Testopia/lib + Bugzilla/WebService/Testopia/ (dir) -> extensions/Testopia/lig/WebService + Bugzilla/Config/Testopia.pm -> extensions/Testopia/lib/Testopia/Config.pm + skins/standard/testopia.css -> extensions/Testopia/css/testopia.css + template/en/default/testopia/ (dir) -> extensions/Testopia/template/en/default + + The following templates and template hooks have been moved to the + extensions/Testopia/template directory: + + template/en/default/admin/params/testopia.html.tmpl + template/en/default/hook/admin/products/confirm-delete.html.tmpl + template/en/default/hook/admin/products/confirm-delete.html.tmpl/confirmation/testopia.html.tmpl + template/en/default/hook/bug/create/created.html.tmpl/message/tr.html.tmpl + template/en/default/hook/bug/create/create.html.tmpl/end/tr.html.tmpl + template/en/default/hook/bug/create/create.html.tmpl/form/tr.html.tmpl + template/en/default/hook/bug/edit.html.tmpl/after_custom_fields/tr.html.tmpl + template/en/default/hook/bug/process/results.html.tmpl/links/tr.html.tmpl + template/en/default/hook/global/banner.html.tmpl/version/testopia.html.tmpl + template/en/default/hook/global/code-error.html.tmpl/errors/testopia_errors.html.tmpl + template/en/default/hook/global/common-links.html.tmpl/link-row/testopia.html.tmpl + template/en/default/hook/global/header.html.tmpl/additional_header/testopia_styles.html.tmpl + template/en/default/hook/global/useful-links.html.tmpl/end/tr.html.tmpl + template/en/default/hook/global/user-error.html.tmpl/errors/tr-user-error.html.tmpl + template/en/default/hook/index.html.tmpl/links/tr.html.tmpl + template/en/default/hook/list/list.html.tmpl/links/tr.html.tmpl + + The following files are no longer needed and will be removed: + + testopia.dtd (use extensions/Testopia/testopia.xsd instead) + tr_csv2xml.pl (use tr_importer.cgi instead) + tr_xmlrpc.cgi (use bugzilla's xmlrpc or create a link to it) + + If you have changes to merge, you should answer NO. Otherwise answer YES. + Do you wish to continue and delete these files? (YES/no) + +END + my $response = ; + die "Exiting... \n" if $response !~ /y/i; + + my @files = qw( + testopia + testopia.dtd + tr_csv2xml.pl + tr_xmlrpc.cgi + Bugzilla/Testopia/ + Bugzilla/WebService/Testopia/ + Bugzilla/Config/Testopia.pm + skins/standard/testopia.css + template/en/default/testopia/ + template/en/default/admin/params/testopia.html.tmpl + template/en/default/hook/admin/products/confirm-delete.html.tmpl + template/en/default/hook/admin/products/confirm-delete.html.tmpl/confirmation/testopia.html.tmpl + template/en/default/hook/bug/create/created.html.tmpl/message/tr.html.tmpl + template/en/default/hook/bug/create/create.html.tmpl/end/tr.html.tmpl + template/en/default/hook/bug/create/create.html.tmpl/form/tr.html.tmpl + template/en/default/hook/bug/edit.html.tmpl/after_custom_fields/tr.html.tmpl + template/en/default/hook/bug/process/results.html.tmpl/links/tr.html.tmpl + template/en/default/hook/global/banner.html.tmpl/version/testopia.html.tmpl + template/en/default/hook/global/code-error.html.tmpl/errors/testopia_errors.html.tmpl + template/en/default/hook/global/common-links.html.tmpl/link-row/testopia.html.tmpl + template/en/default/hook/global/header.html.tmpl/additional_header/testopia_styles.html.tmpl + template/en/default/hook/global/useful-links.html.tmpl/end/tr.html.tmpl + template/en/default/hook/global/user-error.html.tmpl/errors/tr-user-error.html.tmpl + template/en/default/hook/index.html.tmpl/links/tr.html.tmpl + template/en/default/hook/list/list.html.tmpl/links/tr.html.tmpl + ); + + rmtree(@files, 1); + } +} + +sub install_update_db { + my ($self, $args) = @_; + + + # Start of main(). + print "\nChecking Testopia setup ...\n"; + testopiaUpdateDB(); + updateACLs(); + migrateAttachments(); + createGroup(); + finalFixups(); + print "Done checking Testopia setup.\n\n"; + # End of main(). + + sub testopiaUpdateDB { + my $dbh = Bugzilla->dbh; + + # If the database contains Testopia tables but bz_schema doesn't + # know about them, then we need to update bz_schema. + if (grep(/^test_cases$/, $dbh->bz_table_list_real) and + !$dbh->_bz_real_schema->get_table_abstract('test_cases')) { + my $msg = "Sorry, we cannot upgrade from Testopia 1.0 using this " . + "database. Upgrades are supported only with MySQL."; + die($msg) unless $dbh->isa('Bugzilla::DB::Mysql'); + my $built_schema = $dbh->_bz_build_schema_from_disk; + foreach my $table (grep(/^test_/, $built_schema->get_table_list())) { + $dbh->_bz_real_schema->add_table($table, + $built_schema->get_table_abstract($table)); + } + $dbh->_bz_store_real_schema; + } + + $dbh->bz_setup_database(); + + $dbh->bz_drop_table('test_case_group_map'); + $dbh->bz_drop_table('test_category_templates'); + $dbh->bz_drop_table('test_plan_testers'); + $dbh->bz_drop_table('test_plan_group_map'); + $dbh->bz_drop_column('test_plans', 'editor_id'); + + $dbh->bz_drop_fk('test_cases', 'priority_id') if $dbh->bz_column_info('test_cases','priority_id')->{REFERENCES}->{DELETE} eq 'CASCADE'; + $dbh->bz_drop_fk('test_environment_map', 'property_id'); + + $dbh->bz_add_column('test_case_bugs', 'case_id', {TYPE => 'INT4'}); + $dbh->bz_add_column('test_case_runs', 'environment_id', {TYPE => 'INT4', NOTNULL => 1}, 0); + $dbh->bz_add_column('test_case_tags', 'userid', {TYPE => 'INT3', NOTNULL => 1}, 0); + $dbh->bz_add_column('test_case_texts', 'setup', {TYPE => 'MEDIUMTEXT'}); + $dbh->bz_add_column('test_case_texts', 'breakdown', {TYPE => 'MEDIUMTEXT'}); + $dbh->bz_add_column('test_environments', 'product_id', {TYPE => 'INT2', NOTNULL => 1}, 0); + $dbh->bz_add_column('test_environments', 'isactive', {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => '1'}, 1); + $dbh->bz_add_column('test_plan_tags', 'userid', {TYPE => 'INT3', NOTNULL => 1}, 0); + $dbh->bz_add_column('test_runs', 'default_tester_id', {TYPE => 'INT3'}); + $dbh->bz_add_column('test_runs', 'target_pass', {TYPE => 'INT1'}); + $dbh->bz_add_column('test_runs', 'target_completion', {TYPE => 'INT1'}); + $dbh->bz_add_column('test_run_tags', 'userid', {TYPE => 'INT3', NOTNULL => 1}, 0); + $dbh->bz_add_column('test_builds', 'isactive', {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => '1'}, 1); + $dbh->bz_add_column('test_cases', 'estimated_time', {TYPE => 'TIME'}, 0); + $dbh->bz_add_column('test_case_runs', 'running_date', {TYPE => 'DATETIME'}, 0); + $dbh->bz_add_column('test_plan_types', 'description', {TYPE => 'MEDIUMTEXT'}, 0); + $dbh->bz_add_column('test_case_status', 'description', {TYPE => 'MEDIUMTEXT'}, 0); + $dbh->bz_add_column('test_case_run_status', 'description', {TYPE => 'MEDIUMTEXT'}, 0); + $dbh->bz_add_column('test_case_runs', 'iscurrent', {TYPE => 'INT1', NOTNULL => 1, DEFAULT => 0}, 0); + $dbh->bz_add_column('test_case_runs', 'priority_id', {TYPE => 'INT2', NOTNULL => 1, DEFAULT => 0}, 0); + $dbh->bz_add_column('test_named_queries', 'type', {TYPE => 'INT3', NOTNULL => 1, DEFAULT => 0}, 0); + fixTables(); + + $dbh->bz_alter_column('test_attachment_data', 'attachment_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_attachments', + COLUMN => 'attachment_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_attachments', 'attachment_id', {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1}); + $dbh->bz_alter_column('test_attachments', 'creation_ts', {TYPE => 'DATETIME', NOTNULL => 1}); + $dbh->bz_alter_column('test_builds', 'build_id', {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1}); + $dbh->bz_alter_column('test_case_activity', 'case_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_case_bugs', 'case_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_case_bugs', 'case_run_id', {TYPE => 'INT4', REFERENCES => { + TABLE => 'test_case_runs', + COLUMN => 'case_run_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_case_components', 'case_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_case_dependencies', 'blocked', {TYPE => 'INT4', NOTNULL => 1}); + $dbh->bz_alter_column('test_case_dependencies', 'dependson', {TYPE => 'INT4', NOTNULL => 1}); + $dbh->bz_alter_column('test_case_plans', 'case_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_case_plans', 'plan_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_plans', + COLUMN => 'plan_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_case_runs', 'build_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_builds', + COLUMN => 'build_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_case_runs', 'case_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_case_runs', 'case_run_status_id', {TYPE => 'INT2', NOTNULL => 1}); + $dbh->bz_alter_column('test_case_runs', 'case_run_id', {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1}); + $dbh->bz_alter_column('test_case_runs', 'environment_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_environments', + COLUMN => 'environment_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_case_runs', 'iscurrent', {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => '0'}); + $dbh->bz_alter_column('test_case_runs', 'run_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_runs', + COLUMN => 'run_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_case_run_status', 'case_run_status_id', {TYPE => 'SMALLSERIAL', PRIMARYKEY => 1, NOTNULL => 1}); + $dbh->bz_alter_column('test_cases', 'case_id', {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1}); + $dbh->bz_alter_column('test_cases', 'case_status_id', {TYPE => 'INT2', NOTNULL => 1}); + $dbh->bz_alter_column('test_case_status', 'case_status_id', {TYPE => 'SMALLSERIAL', PRIMARYKEY => 1, NOTNULL => 1}); + $dbh->bz_alter_column('test_case_tags', 'case_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_case_texts', 'case_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_case_texts', 'creation_ts', {TYPE => 'DATETIME', NOTNULL => 1, REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_environment_map', 'environment_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_cases', + COLUMN => 'case_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_environment_map', 'property_id', {TYPE => 'INT4'}); + $dbh->bz_alter_column('test_environment_property', 'property_id', {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1}); + $dbh->bz_alter_column('test_environments', 'environment_id', {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1}); + $dbh->bz_alter_column('test_named_queries', 'isvisible', {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 1}); + $dbh->bz_alter_column('test_plan_activity', 'plan_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_plans', + COLUMN => 'plan_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_plans', 'plan_id', {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1}); + $dbh->bz_alter_column('test_plans', 'type_id', {TYPE => 'INT2', NOTNULL => 1}); + $dbh->bz_alter_column('test_plan_types', 'type_id', {TYPE => 'SMALLSERIAL', NOTNULL => 1, PRIMARYKEY => 1}, 0); + $dbh->bz_alter_column('test_plan_tags', 'plan_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_tags', + COLUMN => 'tag_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_plan_texts', 'creation_ts', {TYPE => 'DATETIME', NOTNULL => 1}); + $dbh->bz_alter_column('test_plan_texts', 'plan_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_plans', + COLUMN => 'plan_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_plan_texts', 'plan_text', {TYPE => 'MEDIUMTEXT'}); + $dbh->bz_alter_column('test_run_activity', 'run_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_runs', + COLUMN => 'run_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_run_cc', 'run_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_runs', + COLUMN => 'run_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_runs', 'build_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_builds', + COLUMN => 'build_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_runs', 'environment_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_environments', + COLUMN => 'environment_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_runs', 'plan_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_plans', + COLUMN => 'plan_id', + DELETE => 'CASCADE' + }}); + $dbh->bz_alter_column('test_runs', 'run_id', {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1}); + $dbh->bz_alter_column('test_runs', 'start_date', {TYPE => 'DATETIME', NOTNULL => 1}); + $dbh->bz_alter_column('test_run_tags', 'run_id', {TYPE => 'INT4', NOTNULL => 1, REFERENCES => { + TABLE => 'test_runs', + COLUMN => 'run_id', + DELETE => 'CASCADE' + }}); + + $dbh->bz_drop_index('test_attachments', 'AI_attachment_id'); + $dbh->bz_drop_index('test_attachments', 'attachment_id'); + $dbh->bz_drop_index('test_builds', 'build_id'); + $dbh->bz_drop_index('test_case_bugs', 'case_run_bug_id_idx'); + $dbh->bz_drop_index('test_case_bugs', 'case_run_id_idx'); + $dbh->bz_drop_index('test_case_categories', 'AI_category_id'); + $dbh->bz_drop_index('test_case_categories', 'category_name_idx'); + $dbh->bz_drop_index('test_case_categories', 'category_name_indx'); + $dbh->bz_drop_index('test_case_components', 'case_commponents_component_id_idx'); + $dbh->bz_drop_index('test_case_components', 'case_components_case_id_idx'); + $dbh->bz_drop_index('test_case_components', 'case_components_component_id_idx'); + $dbh->bz_drop_index('test_case_plans', 'case_plans_case_id_idx'); + $dbh->bz_drop_index('test_case_plans', 'case_plans_plan_id_idx'); + $dbh->bz_drop_index('test_case_runs', 'AI_case_run_id'); + $dbh->bz_drop_index('test_case_runs', 'case_run_build_idx'); + $dbh->bz_drop_index('test_case_runs', 'case_run_env_idx'); + $dbh->bz_drop_index('test_case_runs', 'case_run_id'); + $dbh->bz_drop_index('test_case_runs', 'case_run_id_2'); + $dbh->bz_drop_index('test_case_runs', 'case_run_run_id_idx'); + $dbh->bz_drop_index('test_case_runs', 'case_run_shortkey_idx'); + $dbh->bz_drop_index('test_case_runs', 'case_run_sortkey_idx'); + $dbh->bz_drop_index('test_case_run_status', 'AI_case_run_status_id'); + $dbh->bz_drop_index('test_case_run_status', 'case_run_status_name_idx'); + $dbh->bz_drop_index('test_case_run_status', 'case_run_status_sortkey_idx'); + $dbh->bz_drop_index('test_case_run_status', 'sortkey'); + $dbh->bz_drop_index('test_cases', 'AI_case_id'); + $dbh->bz_drop_index('test_cases', 'alias'); + $dbh->bz_drop_index('test_cases', 'case_id'); + $dbh->bz_drop_index('test_cases', 'case_id_2'); + $dbh->bz_drop_index('test_case_status', 'AI_case_status_id'); + $dbh->bz_drop_index('test_case_status', 'case_status_id'); + $dbh->bz_drop_index('test_case_status', 'test_case_status_name_idx'); + $dbh->bz_drop_index('test_cases', 'test_case_requirment_idx'); + $dbh->bz_drop_index('test_case_tags', 'case_tags_case_id_idx'); + $dbh->bz_drop_index('test_case_tags', 'case_tags_case_id_idx_v2'); + $dbh->bz_drop_index('test_case_tags', 'case_tags_tag_id_idx'); + $dbh->bz_drop_index('test_case_tags', 'case_tags_user_idx'); + $dbh->bz_drop_index('test_email_settings', 'test_event_user_event_dx'); + $dbh->bz_drop_index('test_email_settings', 'test_event_user_event_idx'); + $dbh->bz_drop_index('test_email_settings', 'test_event_user_relationship_idx'); + $dbh->bz_drop_index('test_environment_category', 'env_category_idx'); + $dbh->bz_drop_index('test_environment_element', 'env_element_category_idx'); + $dbh->bz_drop_index('test_environment_property', 'env_element_property_idx'); + $dbh->bz_drop_index('test_environments', 'environment_id'); + $dbh->bz_drop_index('test_environments', 'environment_name_idx'); + $dbh->bz_drop_index('test_fielddefs', 'AI_fieldid'); + $dbh->bz_drop_index('test_fielddefs', 'fielddefs_name_idx') if $dbh->isa('Bugzilla::DB::Mysql'); + $dbh->bz_drop_index('test_fielddefs', 'test_fielddefs_name_idx'); + $dbh->bz_drop_index('test_plans', 'AI_plan_id'); + $dbh->bz_drop_index('test_plans', 'plan_id'); + $dbh->bz_drop_index('test_plans', 'plan_id_2'); + $dbh->bz_drop_index('test_plan_tags', 'plan_tags_idx'); + $dbh->bz_drop_index('test_plan_tags', 'plan_tags_user_idx'); + $dbh->bz_drop_index('test_plan_types', 'AI_type_id'); + $dbh->bz_drop_index('test_plan_types', 'plan_type_name_idx'); + $dbh->bz_drop_index('test_run_cc', 'run_cc_run_id_who_idx'); + $dbh->bz_drop_index('test_runs', 'AI_run_id'); + $dbh->bz_drop_index('test_runs', 'run_id'); + $dbh->bz_drop_index('test_runs', 'run_id_2'); + $dbh->bz_drop_index('test_runs', 'test_run_plan_id_run_id__idx'); + $dbh->bz_drop_index('test_run_tags', 'run_tags_idx'); + $dbh->bz_drop_index('test_run_tags', 'run_tags_user_idx'); + $dbh->bz_drop_index('test_tags', 'AI_tag_id'); + $dbh->bz_drop_index('test_tags', 'tag_name'); + $dbh->bz_drop_index('test_tags', 'test_tag_name_idx'); + $dbh->bz_drop_index('test_tags', 'test_tag_name_indx'); + $dbh->bz_drop_index('test_runs', 'test_runs_summary_idx'); + + $dbh->bz_add_index('test_attachment_data', 'test_attachment_data_primary_idx', ['attachment_id']); + $dbh->bz_add_index('test_attachments', 'test_attachments_submitter_idx', ['submitter_id']); + $dbh->bz_add_index('test_builds', 'build_milestone_idx', ['milestone']); + $dbh->bz_add_index('test_builds', 'build_name_idx', ['name']); + $dbh->bz_add_index('test_builds', 'build_prod_idx', {FIELDS => [qw(build_id product_id)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_builds', 'build_product_id_name_idx', {FIELDS => [qw(product_id name)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_case_attachments', 'test_case_attachments_primary_idx', ['attachment_id']); + $dbh->bz_add_index('test_case_bugs', 'case_bugs_bug_id_idx', ['bug_id']); + $dbh->bz_add_index('test_case_bugs', 'case_bugs_case_id_idx', ['case_id']); + $dbh->bz_add_index('test_case_bugs', 'case_bugs_case_run_id_idx', ['case_run_id']); + $dbh->bz_add_index('test_case_categories', 'category_name_idx_v2', ['name']); + $dbh->bz_add_index('test_case_categories', 'category_product_id_name_idx', {FIELDS => [qw(product_id name)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_case_categories', 'category_product_idx', {FIELDS => [qw(category_id product_id)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_case_components', 'components_case_id_idx', {FIELDS => [qw(case_id component_id)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_case_components', 'components_component_id_idx', ['component_id']); + $dbh->bz_add_index('test_case_dependencies', 'case_dependencies_blocked_idx', ['blocked']); + $dbh->bz_add_index('test_case_dependencies', 'case_dependencies_primary_idx', {FIELDS => [qw(dependson blocked)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_case_plans', 'test_case_plans_case_idx', [qw(case_id)]); + $dbh->bz_add_index('test_case_plans', 'test_case_plans_primary_idx', {FIELDS => [qw(plan_id case_id)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_case_runs', 'case_run_build_env_idx', {FIELDS => [qw(run_id case_id build_id environment_id)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_case_runs', 'case_run_build_idx_v2', ['build_id']); + $dbh->bz_add_index('test_case_runs', 'case_run_env_idx_v2', ['environment_id']); + $dbh->bz_add_index('test_case_runs', 'case_run_status_idx', ['case_run_status_id']); + $dbh->bz_add_index('test_case_runs', 'case_run_text_ver_idx', ['case_text_version']); + $dbh->bz_add_index('test_case_runs', 'case_run_priority_idx', ['priority_id']); + $dbh->bz_add_index('test_cases', 'test_case_requirement_idx', ['requirement']); + $dbh->bz_add_index('test_cases', 'test_case_status_idx', ['case_status_id']); + $dbh->bz_add_index('test_cases', 'test_case_tester_idx', ['default_tester_id']); + $dbh->bz_add_index('test_case_tags', 'case_tags_case_id_idx_v3', [qw(case_id)]); + $dbh->bz_add_index('test_case_tags', 'case_tags_primary_idx', {FIELDS => [qw(tag_id case_id userid)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_case_tags', 'case_tags_secondary_idx', {FIELDS => [qw(tag_id case_id)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_case_tags', 'case_tags_userid_idx', [qw(userid)]); + $dbh->bz_add_index('test_email_settings', 'test_email_setting_user_id_idx', {FIELDS => [qw(userid relationship_id eventid)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_environment_category', 'test_environment_category_key1', {FIELDS => [qw(env_category_id product_id)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_environment_category', 'test_environment_category_key2', {FIELDS => [qw(product_id name)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_environment_element', 'test_environment_element_key1', {FIELDS => [qw(element_id env_category_id)], TYPE => 'UNIQUE'},); + $dbh->bz_add_index('test_environment_element', 'test_environment_element_key2', {FIELDS => [qw(env_category_id name)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_environment_map', 'test_environment_map_key3', {FIELDS => [qw(environment_id element_id property_id)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_environment_property', 'test_environment_property_key1', {FIELDS => [qw(property_id element_id)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_environment_property', 'test_environment_property_key2', {FIELDS => [qw(element_id name)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_environments', 'environment_name_idx_v2', ['name']); + $dbh->bz_add_index('test_environments', 'test_environments_key1', {FIELDS => [qw(environment_id product_id)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_environments', 'test_environments_key2', {FIELDS => [qw(product_id name)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_named_queries', 'test_namedquery_primary_idx', {FIELDS => [qw(userid name)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_plan_activity', 'plan_activity_changed_idx', ['changed']); + $dbh->bz_add_index('test_plan_activity', 'plan_activity_field_idx', ['fieldid']); + $dbh->bz_add_index('test_plan_activity', 'plan_activity_primary_idx', ['plan_id']); + $dbh->bz_add_index('test_plan_attachments', 'test_plan_attachments_primary_idx', ['attachment_id']); + $dbh->bz_add_index('test_plan_permissions', 'testers_plan_grant_idx', ['grant_type']); + $dbh->bz_add_index('test_plan_tags', 'plan_tags_plan_id_idx', [qw(plan_id)]); + $dbh->bz_add_index('test_plan_tags', 'plan_tags_primary_idx', {FIELDS => [qw(tag_id plan_id userid)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_plan_tags', 'plan_tags_secondary_idx', {FIELDS => [qw(tag_id plan_id)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_plan_tags', 'plan_tags_userid_idx', [qw(userid)]); + $dbh->bz_add_index('test_run_activity', 'run_activity_field_idx', ['fieldid']); + $dbh->bz_add_index('test_run_cc', 'test_run_cc_primary_idx', {FIELDS => [qw(run_id who)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_run_cc', 'test_run_cc_who_idx', [qw(who)]); + $dbh->bz_add_index('test_runs', 'test_run_build_idx', ['build_id']); + $dbh->bz_add_index('test_runs', 'test_run_env_idx', ['environment_id']); + $dbh->bz_add_index('test_runs', 'test_run_plan_id_run_id_idx', [qw(plan_id run_id)]); + $dbh->bz_add_index('test_runs', 'test_run_plan_ver_idx', ['plan_text_version']); + $dbh->bz_add_index('test_runs', 'test_run_tester_idx', ['default_tester_id']); + $dbh->bz_add_index('test_run_tags', 'run_tags_primary_idx', {FIELDS => [qw(tag_id run_id userid)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_run_tags', 'run_tags_run_id_idx', [qw(run_id)]); + $dbh->bz_add_index('test_run_tags', 'run_tags_secondary_idx', {FIELDS => [qw(tag_id run_id)], TYPE => 'UNIQUE'}); + $dbh->bz_add_index('test_run_tags', 'run_tags_userid_idx', [qw(userid)]); + $dbh->bz_add_index('test_tags', 'test_tag_name_idx_v2', [qw(tag_name)]); + + populateMiscTables(); + populateEnvTables(); + migrateEnvData(); + } + + sub updateACLs { + my $dbh = Bugzilla->dbh; + return unless $dbh->selectrow_array("SELECT COUNT(*) FROM test_plan_permissions") == 0; + + print "Populating test plan ACLs ...\n"; + my $ref = $dbh->selectall_arrayref("SELECT plan_id, author_id FROM test_plans", {'Slice' =>{}}); + foreach my $plan (@$ref){ + my ($finished) = $dbh->selectrow_array( + "SELECT COUNT(*) FROM test_plan_permissions + WHERE plan_id = ? AND userid = ?", + undef, ($plan->{'plan_id'}, $plan->{'author_id'})); + next if ($finished); + $dbh->do("INSERT INTO test_plan_permissions(userid, plan_id, permissions) + VALUES(?,?,?)", + undef, ($plan->{'author_id'}, $plan->{'plan_id'}, 15)); + } + } + + sub migrateAttachments { + my $dbh = Bugzilla->dbh; + return unless $dbh->bz_column_info('test_attachments', 'case_id'); + print "Migrating attachments...\n"; + + my $rows = $dbh->selectall_arrayref( + "SELECT attachment_id, case_id, plan_id + FROM test_attachments", {'Slice' => {}}); + + foreach my $row (@$rows){ + if ($row->{'case_id'}){ + $dbh->do("INSERT INTO test_case_attachments (attachment_id, case_id) + VALUES (?,?)", undef, ($row->{'attachment_id'}, $row->{'case_id'})); + } + elsif ($row->{'plan_id'}){ + $dbh->do("INSERT INTO test_plan_attachments (attachment_id, plan_id) + VALUES (?,?)", undef, ($row->{'attachment_id'}, $row->{'plan_id'})); + } + } + $dbh->bz_drop_column('test_attachments', 'case_id'); + $dbh->bz_drop_column('test_attachments', 'plan_id'); + } + + sub populateMiscTables { + my $dbh = Bugzilla->dbh; + + # Fix and add values to an existing intall. + + $dbh->do("INSERT INTO test_case_run_status (name, sortkey) VALUES ('ERROR', 7)") + if $dbh->selectrow_array("SELECT COUNT(*) FROM test_case_run_status") + && ! $dbh->selectrow_array("SELECT COUNT(*) FROM test_case_run_status WHERE name = ?", undef, 'ERROR'); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('target_pass', 'Target Pass Rate', 'test_runs')") + if $dbh->selectrow_array("SELECT COUNT(*) FROM test_fielddefs") + && ! $dbh->selectrow_array("SELECT COUNT(*) FROM test_fielddefs WHERE name = ?", undef, 'target_pass'); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('target_completion', 'Target Completion Rate', 'test_runs')") + if $dbh->selectrow_array("SELECT COUNT(*) FROM test_fielddefs") + && ! $dbh->selectrow_array("SELECT COUNT(*) FROM test_fielddefs WHERE name = ?", undef, 'target_completion'); + $dbh->do("UPDATE test_environment_map SET property_id = ? where property_id = ?",undef, undef, 0); + + if ($dbh->selectrow_array("SELECT COUNT(*) FROM test_case_run_status")){ + $dbh->do("UPDATE test_case_run_status SET name='IDLE', sortkey=1 where case_run_status_id=1"); + $dbh->do("UPDATE test_case_run_status SET name='PASSED', sortkey=4 where case_run_status_id=2"); + $dbh->do("UPDATE test_case_run_status SET name='FAILED', sortkey=5 where case_run_status_id=3"); + $dbh->do("UPDATE test_case_run_status SET name='RUNNING', sortkey=2 where case_run_status_id=4"); + $dbh->do("UPDATE test_case_run_status SET name='PAUSED', sortkey=3 where case_run_status_id=5"); + $dbh->do("UPDATE test_case_run_status SET name='BLOCKED', sortkey=6 where case_run_status_id=6"); + $dbh->do("UPDATE test_case_run_status SET name='ERROR', sortkey=7 where case_run_status_id=7"); + } + + # Insert initial values in static tables. Going out on a limb and + # assuming that if one table is empty, they all are. + return if $dbh->selectrow_array("SELECT COUNT(*) FROM test_case_status"); + + print "Populating test_case_run_status table ...\n"; + print "Populating test_case_status table ...\n"; + print "Populating test_plan_types table ...\n"; + print "Populating test_fielddefs table ...\n"; + + $dbh->do("INSERT INTO test_case_run_status (name, sortkey) VALUES ('IDLE', 1)"); + $dbh->do("INSERT INTO test_case_run_status (name, sortkey) VALUES ('PASSED', 4)"); + $dbh->do("INSERT INTO test_case_run_status (name, sortkey) VALUES ('FAILED', 5)"); + $dbh->do("INSERT INTO test_case_run_status (name, sortkey) VALUES ('RUNNING', 2)"); + $dbh->do("INSERT INTO test_case_run_status (name, sortkey) VALUES ('PAUSED', 3)"); + $dbh->do("INSERT INTO test_case_run_status (name, sortkey) VALUES ('BLOCKED', 6)"); + $dbh->do("INSERT INTO test_case_run_status (name, sortkey) VALUES ('ERROR', 7)"); + $dbh->do("INSERT INTO test_case_status (name) VALUES ('PROPOSED')"); + $dbh->do("INSERT INTO test_case_status (name) VALUES ('CONFIRMED')"); + $dbh->do("INSERT INTO test_case_status (name) VALUES ('DISABLED')"); + $dbh->do("INSERT INTO test_plan_types (name) VALUES ('Unit')"); + $dbh->do("INSERT INTO test_plan_types (name) VALUES ('Integration')"); + $dbh->do("INSERT INTO test_plan_types (name) VALUES ('Function')"); + $dbh->do("INSERT INTO test_plan_types (name) VALUES ('System')"); + $dbh->do("INSERT INTO test_plan_types (name) VALUES ('Acceptance')"); + $dbh->do("INSERT INTO test_plan_types (name) VALUES ('Installation')"); + $dbh->do("INSERT INTO test_plan_types (name) VALUES ('Performance')"); + $dbh->do("INSERT INTO test_plan_types (name) VALUES ('Product')"); + $dbh->do("INSERT INTO test_plan_types (name) VALUES ('Interoperability')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('isactive', 'Archived', 'test_plans')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('name', 'Plan Name', 'test_plans')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('type_id', 'Plan Type', 'test_plans')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('case_status_id', 'Case Status', 'test_cases')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('category_id', 'Category', 'test_cases')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('priority_id', 'Priority', 'test_cases')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('summary', 'Run Summary', 'test_cases')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('isautomated', 'Automated', 'test_cases')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('alias', 'Alias', 'test_cases')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('requirement', 'Requirement', 'test_cases')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('script', 'Script', 'test_cases')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('arguments', 'Argument', 'test_cases')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('product_id', 'Product', 'test_plans')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('default_product_version', 'Default Product Version', 'test_plans')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('environment_id', 'Environment', 'test_runs')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('product_version', 'Product Version', 'test_runs')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('build_id', 'Default Build', 'test_runs')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('plan_text_version', 'Plan Text Version', 'test_runs')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('manager_id', 'Manager', 'test_runs')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('default_tester_id', 'Default Tester', 'test_cases')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('stop_date', 'Stop Date', 'test_runs')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('summary', 'Run Summary', 'test_runs')"); + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('notes', 'Notes', 'test_runs')"); + } + + sub populateEnvTables { + my $dbh = Bugzilla->dbh; + + my $sth; + my $ary_ref; + my $value; + + return unless $dbh->selectrow_array("SELECT COUNT(*) FROM test_environment_category") == 0; + if ($dbh->selectrow_array("SELECT COUNT(*) FROM test_environment_element") != 0) { + print STDERR "\npopulateEnv: Fatal Error: test_environment_category " . + "is empty but\ntest_environment_element is not. This ought " . + "to be impossible.\n\n"; + return; + } + + $dbh->bz_start_transaction(); + + print "Populating test_environment_category table ...\n"; + $dbh->do("INSERT INTO test_environment_category (product_id, name) " . + "VALUES (0, 'Operating System')"); + $dbh->do("INSERT INTO test_environment_category (product_id, name) " . + "VALUES (0, 'Hardware')"); + + print "Populating test_environment_element table ...\n"; + $sth = $dbh->prepare("INSERT INTO test_environment_element " . + "(env_category_id, name, parent_id, isprivate) " . + "VALUES (?, ?, ?, ?)"); + $ary_ref = $dbh->selectcol_arrayref("SELECT value FROM op_sys"); + foreach $value (@$ary_ref) { + $sth->execute(1, $value, 0, 0); + } + $ary_ref = $dbh->selectcol_arrayref("SELECT value FROM rep_platform"); + foreach $value (@$ary_ref) { + $sth->execute(2, $value, 0, 0); + } + + $dbh->bz_commit_transaction(); + } + + sub migrateEnvData { + my $dbh = Bugzilla->dbh; + my $sth; + my $value; + my $os_mapping; + my $platform_mapping; + my $ary_ref; + my $i; + + return unless $dbh->bz_column_info('test_environments', 'op_sys_id'); + + # Map between IDs in op_sys table and IDs in + # test_environment_element table. + $os_mapping = $dbh->selectall_hashref("SELECT " . + "os.id AS op_sys_id, " . + "env_elem.element_id AS element_id " . + "FROM op_sys os, test_environment_element env_elem " . + "WHERE os.value = env_elem.name " . + "AND env_elem.env_category_id = 1", + 'op_sys_id'); + + # Map between IDs in rep_platform table and IDs in + # test_environment_element table. + $platform_mapping = $dbh->selectall_hashref("SELECT " . + "platform.id AS rep_platform_id, " . + "env_elem.element_id AS element_id " . + "FROM rep_platform platform, test_environment_element env_elem " . + "WHERE platform.value = env_elem.name " . + "AND env_elem.env_category_id = 2", + 'rep_platform_id'); + + $dbh->bz_start_transaction(); + print "Migrating data from test_environments to test_environment_map ...\n"; + $sth = $dbh->prepare("INSERT INTO test_environment_map " . + "(environment_id, property_id, element_id, value_selected) " . + "VALUES (?, ?, ?, ?)"); + $ary_ref = $dbh->selectall_arrayref("SELECT environment_id, op_sys_id " . + "FROM test_environments"); + foreach $i (@$ary_ref) { + $sth->execute(@$i[0], 0, $os_mapping->{@$i[1]}->{'element_id'}, ''); + } + $ary_ref = $dbh->selectall_arrayref("SELECT environment_id, rep_platform_id " . + "FROM test_environments"); + foreach $i (@$ary_ref) { + $sth->execute(@$i[0], 0, $platform_mapping->{@$i[1]}->{'element_id'}, ''); + } + $dbh->bz_commit_transaction(); + + print "Saving data from test_environments.xml column into text files ...\n"; + $ary_ref = $dbh->selectall_arrayref("SELECT environment_id, name, xml " . + "FROM test_environments WHERE xml != ''"); + foreach $value (@$ary_ref) { + open(FH, ">environment_" . @$value[0] . "_xml.txt"); + print FH "environment ID: @$value[0]\n"; + print FH "environment name: @$value[1]\n"; + print FH "environment xml:\n@$value[2]\n"; + close(FH); + } + + $dbh->bz_drop_column('test_environments', 'op_sys_id'); + $dbh->bz_drop_column('test_environments', 'rep_platform_id'); + $dbh->bz_drop_column('test_environments', 'xml'); + } + + sub fixTables { + my $dbh = Bugzilla->dbh; + + # Fix test_case_bugs table so that all case_id fields are not null. + my ($count) = $dbh->selectrow_array("SELECT COUNT(*) FROM test_case_bugs WHERE case_id IS NULL"); + if ($count){ + require Bugzilla::Extension::Testopia::TestCaseRun; + my $caseruns = $dbh->selectcol_arrayref("SELECT case_run_id FROM test_case_bugs WHERE case_id IS NULL"); + my $sth = $dbh->prepare_cached("UPDATE test_case_bugs SET case_id = ? WHERE case_run_id = ?"); + foreach my $cr (@$caseruns){ + my $caserun = Bugzilla::Extension::Testopia::TestCaseRun->new($cr); + $sth->execute($caserun->case->id, $cr); + } + } + + # If we can't add a unique index to (case_id,component_id), then we + # need to remove duplicate rows from test_case_components. + eval{ + $dbh->bz_add_index('test_case_components', 'components_case_id_idx', {FIELDS => [qw(case_id component_id)], TYPE => 'UNIQUE'}); + }; + if ($@){ + print "Running component fix...\n"; + my $rows = $dbh->selectall_arrayref("SELECT * FROM test_case_components", {"Slice" => {}}); + my $seen; + foreach my $row (@$rows){ + my $line = $row->{'case_id'} . "-" . $row->{'component_id'}; + if (!$seen->{$line}){ + $seen->{$line} = 'seen'; + } + elsif ($seen->{$line} eq 'seen'){ + $dbh->do("DELETE FROM test_case_components + WHERE case_id = ? AND component_id = ?", + undef, ($row->{'case_id'}, $row->{'component_id'})); + $dbh->do("INSERT INTO test_case_components + VALUES(?,?)", + undef, ($row->{'case_id'}, $row->{'component_id'})); + $seen->{$line} = 'fixed'; + } + elsif ($seen->{$line} eq 'fixed'){ + next; + } + } + } + } + + sub createGroup { + Bugzilla::Group->create({ + name => 'Testers', + description => 'Can read and write all test plans, runs, and cases.', + isbuggroup => 0 }) unless new Bugzilla::Group({name => 'Testers'}); + } + + # A spot for fixing stuff at the very end. + sub finalFixups { + my $dbh = Bugzilla->dbh; + + # We added the estimated_time field later, so we can't add it + # inside populateMiscTables(). + unless ($dbh->selectrow_array("SELECT COUNT(*) FROM test_fielddefs " . + "WHERE name = 'estimated_time'")) { + $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) " . + "VALUES ('estimated_time', 'Estimated Time', 'test_cases')"); + } + if ($dbh->selectrow_array("SELECT COUNT(*) FROM test_case_runs WHERE priority_id = 0")){ + print "Updating case_run priorities...\n"; + my $cases = $dbh->selectall_arrayref("SELECT case_id, priority_id FROM test_cases",{'Slice'=>{}}); + my $sth = $dbh->prepare_cached("UPDATE test_case_runs SET priority_id = ? WHERE case_id = ?"); + foreach my $c (@$cases){ + $sth->execute($c->{priority_id},$c->{case_id}) + } + # Anything left over should get the default priority + $dbh->do("UPDATE test_case_runs + SET priority_id = (SELECT id + FROM priority + WHERE value = ?) + WHERE priority_id = 0", undef, Bugzilla->params->{defaultpriority}); + } + } +} + +sub post_bug_after_creation { + my ($self, $args) = @_; + + + my $vars = $args->{vars}; + my $cgi = Bugzilla->cgi; + + my $caserun_id = $cgi->param('caserun_id'); + my $case_id = $cgi->param('case_id'); + if (detaint_natural($caserun_id)) { + my $caserun = Bugzilla::Extension::Testopia::TestCaseRun->new($cgi->param('caserun_id')); + ThrowUserError("invalid-test-id-non-existent", {'id' => $caserun_id, 'type' => 'Case-Run'}) unless $caserun; + ThrowUserError("testopia-read-only", {'object' => $caserun}) unless $caserun->canedit; + + $caserun->attach_bug($vars->{'id'}); + + $vars->{'caserun'} = $caserun; + } + elsif (detaint_natural($case_id)) { + my $case = Bugzilla::Extension::Testopia::TestCase->new($cgi->param('case_id')); + ThrowUserError("invalid-test-id-non-existent", {'id' => $case_id, 'type' => 'Case'}) unless $case; + ThrowUserError("testopia-read-only", {'object' => $case}) unless $case->canedit; + + $case->attach_bug($vars->{'id'}); + + $vars->{'case'} = $case; + } + +} + +sub product_confirm_delete { + my ($self, $args) = @_; + + + + my $vars = $args->{vars}; + + $vars->{'testopia_product'} = new Bugzilla::Extension::Testopia::Product($vars->{product}->id); +} + +sub webservice { + my ($self, $args) = @_; + + + my $dispatch = $args->{dispatch}; + + $dispatch->{TestPlan} = "Bugzilla::Extension::Testopia::WebService::TestPlan"; + $dispatch->{TestCase} = "Bugzilla::Extension::Testopia::WebService::TestCase"; + $dispatch->{TestRun} = "Bugzilla::Extension::Testopia::WebService::TestRun"; + $dispatch->{TestCaseRun} = "Bugzilla::Extension::Testopia::WebService::TestCaseRun"; + $dispatch->{Product} = "Bugzilla::Extension::Testopia::WebService::Product"; + $dispatch->{Environment} = "Bugzilla::Extension::Testopia::WebService::Environment"; + $dispatch->{Build} = "Bugzilla::Extension::Testopia::WebService::Build"; + $dispatch->{Testopia} = "Bugzilla::Extension::Testopia::WebService::Testopia"; + +} + + +__PACKAGE__->NAME; diff --git a/mozilla/webtools/testopia/extensions/testopia/README b/mozilla/webtools/testopia/extensions/Testopia/README similarity index 98% rename from mozilla/webtools/testopia/extensions/testopia/README rename to mozilla/webtools/testopia/extensions/Testopia/README index 4490afd9826..a0353410945 100644 --- a/mozilla/webtools/testopia/extensions/testopia/README +++ b/mozilla/webtools/testopia/extensions/Testopia/README @@ -32,10 +32,10 @@ something like this: $> cd /path/to/bugzilla $> tar xzvf testopia-.tar.gz -Next you need to patch the Bugzilla files. Find the patch file in the extensions/testopia directory matching your version of Bugzilla. +Next you need to patch the Bugzilla files. Find the patch file in the extensions/Testopia directory matching your version of Bugzilla. For example, if you are running Bugzilla 3.4.3 you will apply the patch-3.4.3 patch file. - $> patch -p0 -i extensions/testopia/patch-3.4.3 + $> patch -p0 -i extensions/Testopia/patch-3.4.3 Finally, you need to run checksetup.pl diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/cvs_update.sh b/mozilla/webtools/testopia/extensions/Testopia/contrib/cvs_update.sh similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/cvs_update.sh rename to mozilla/webtools/testopia/extensions/Testopia/contrib/cvs_update.sh diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/README b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/README similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/README rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/README diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/.classpath b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/.classpath similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/.classpath rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/.classpath diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/.project b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/.project similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/.project rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/.project diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/OptionalData.xml b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/OptionalData.xml similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/OptionalData.xml rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/OptionalData.xml diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/TESTS-TestSuites.xml b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/TESTS-TestSuites.xml similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/TESTS-TestSuites.xml rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/TESTS-TestSuites.xml diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/build.xml b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/build.xml similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/build.xml rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/build.xml diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/allclasses-frame.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/allclasses-frame.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/allclasses-frame.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/allclasses-frame.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/allclasses-noframe.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/allclasses-noframe.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/allclasses-noframe.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/allclasses-noframe.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/constant-values.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/constant-values.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/constant-values.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/constant-values.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/deprecated-list.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/deprecated-list.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/deprecated-list.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/deprecated-list.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/help-doc.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/help-doc.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/help-doc.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/help-doc.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-1.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-1.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-1.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-1.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-10.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-10.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-10.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-10.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-11.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-11.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-11.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-11.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-2.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-2.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-2.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-2.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-3.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-3.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-3.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-3.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-4.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-4.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-4.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-4.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-5.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-5.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-5.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-5.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-6.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-6.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-6.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-6.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-7.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-7.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-7.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-7.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-8.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-8.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-8.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-8.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-9.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-9.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index-files/index-9.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index-files/index-9.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/index.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/index.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/overview-tree.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/overview-tree.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/overview-tree.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/overview-tree.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/package-list b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/package-list similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/package-list rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/package-list diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/resources/inherit.gif b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/resources/inherit.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/resources/inherit.gif rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/resources/inherit.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/stylesheet.css b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/stylesheet.css similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/stylesheet.css rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/stylesheet.css diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/Build.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/Build.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/Build.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/Build.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/Component.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/Component.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/Component.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/Component.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/Environment.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/Environment.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/Environment.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/Environment.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/Product.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/Product.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/Product.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/Product.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/TestAPI.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/TestAPI.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/TestAPI.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/TestAPI.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/TestCaseRun.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/TestCaseRun.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/TestCaseRun.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/TestCaseRun.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/TestPlan.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/TestPlan.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/TestPlan.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/TestPlan.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/TestRun.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/TestRun.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/TestRun.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/TestRun.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/TestopiaTestCase.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/TestopiaTestCase.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/TestopiaTestCase.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/TestopiaTestCase.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/User.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/User.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/User.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/User.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/Build.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/Build.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/Build.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/Build.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/Component.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/Component.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/Component.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/Component.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/Environment.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/Environment.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/Environment.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/Environment.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/Product.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/Product.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/Product.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/Product.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/TestAPI.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/TestAPI.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/TestAPI.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/TestAPI.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/TestCaseRun.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/TestCaseRun.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/TestCaseRun.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/TestCaseRun.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/TestPlan.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/TestPlan.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/TestPlan.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/TestPlan.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/TestRun.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/TestRun.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/TestRun.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/TestRun.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/TestopiaTestCase.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/TestopiaTestCase.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/TestopiaTestCase.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/TestopiaTestCase.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/User.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/User.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/class-use/User.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/class-use/User.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/package-frame.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/package-frame.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/package-frame.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/package-frame.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/package-summary.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/package-summary.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/package-summary.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/package-summary.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/package-tree.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/package-tree.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/package-tree.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/package-tree.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/package-use.html b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/package-use.html similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/doc/testopia/API/package-use.html rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/doc/testopia/API/package-use.html diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/jar/README b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/jar/README similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/jar/README rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/jar/README diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/Build.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/Build.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/Build.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/Build.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/Component.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/Component.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/Component.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/Component.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/Environment.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/Environment.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/Environment.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/Environment.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/Lookup.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/Lookup.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/Lookup.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/Lookup.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/Product.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/Product.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/Product.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/Product.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/TestCaseRun.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/TestCaseRun.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/TestCaseRun.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/TestCaseRun.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/TestPlan.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/TestPlan.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/TestPlan.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/TestPlan.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/TestRun.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/TestRun.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/TestRun.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/TestRun.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/TestopiaTestCase.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/TestopiaTestCase.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/TestopiaTestCase.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/TestopiaTestCase.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/User.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/User.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/User.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/User.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/lookupHelp.txt b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/lookupHelp.txt similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/API/lookupHelp.txt rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/API/lookupHelp.txt diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/Test/JunitToTestopia.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/Test/JunitToTestopia.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/Test/JunitToTestopia.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/Test/JunitToTestopia.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/Test/OptionalData.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/Test/OptionalData.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/Test/OptionalData.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/Test/OptionalData.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/Test/OptionalValues.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/Test/OptionalValues.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/Test/OptionalValues.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/Test/OptionalValues.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/Test/ParseAnt.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/Test/ParseAnt.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/Test/ParseAnt.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/Test/ParseAnt.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/Test/TestCaseRunnable.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/Test/TestCaseRunnable.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/Test/TestCaseRunnable.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/Test/TestCaseRunnable.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/Test/TestopiaConnector.java b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/Test/TestopiaConnector.java similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopia/Test/TestopiaConnector.java rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopia/Test/TestopiaConnector.java diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopiaData.xml b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopiaData.xml similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/java/testopiaData.xml rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/java/testopiaData.xml diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/perl/client.pl b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/perl/client.pl similarity index 98% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/perl/client.pl rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/perl/client.pl index df2615f19e7..f14d215deea 100644 --- a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/perl/client.pl +++ b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/perl/client.pl @@ -151,7 +151,7 @@ $soapresult = $proxy->call('Testopia.testopia_version'); #$soapresult = $proxy->call('Build.check_build', 'Linux', 2); #$soapresult = $proxy->call('Build.check_build', 'Linux', 'Bugzilla'); -#$soapresult = $proxy->call('Build.check_build', 'Linux', Testopia::Product->new(2)); +#$soapresult = $proxy->call('Build.check_build', 'Linux', Bugzilla::Extension::Testopia::Product->new(2)); #$soapresult = $proxy->call('Build.create', {name=>'Build '. time(), product_id=>2, isactive=>0, description=> 'API Test Build - IGNORE'}); #$soapresult = $proxy->call('Build.get', 1140); #$soapresult = $proxy->call('Build.update', 1140, { description=>'This is a description', milestone=>'3.0', isactive=>0}); @@ -161,7 +161,7 @@ $soapresult = $proxy->call('Testopia.testopia_version'); ########################### #$soapresult = $proxy->call('Environment.check_environment', 'Linux', 2); #$soapresult = $proxy->call('Environment.check_environment', 'Linux', 'Bugzilla'); -#$soapresult = $proxy->call('Environment.check_environment', 'Linux', Testopia::Product->new(2)); +#$soapresult = $proxy->call('Environment.check_environment', 'Linux', Bugzilla::Extension::Testopia::Product->new(2)); #$soapresult = $proxy->call('Environment.create', {product_id=>2, name=>'Environment '.time() , isactive=>1}); #$soapresult = $proxy->call('Environment.get', 1018); #$soapresult = $proxy->call('Environment.list', {environment_id=>330}); diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/php/.xmlrpc.inc.php b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/php/.xmlrpc.inc.php similarity index 99% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/php/.xmlrpc.inc.php rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/php/.xmlrpc.inc.php index c9232c8cd84..0dcfe695b3c 100644 --- a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/php/.xmlrpc.inc.php +++ b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/php/.xmlrpc.inc.php @@ -1,7 +1,7 @@ -// $Id: .xmlrpc.inc.php,v 1.1 2009-08-27 16:19:23 ghendricks%novell.com Exp $ +// $Id: .xmlrpc.inc.php,v 1.1 2010-07-06 15:08:43 mkanat%bugzilla.org Exp $ // Copyright (c) 1999,2000,2002 Edd Dumbill. // All rights reserved. diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/php/testopia.inc.php b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/php/testopia.inc.php similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/php/testopia.inc.php rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/php/testopia.inc.php diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/drivers/python/testopia.py b/mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/python/testopia.py similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/drivers/python/testopia.py rename to mozilla/webtools/testopia/extensions/Testopia/contrib/drivers/python/testopia.py diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/fix_unsigned.pl b/mozilla/webtools/testopia/extensions/Testopia/contrib/fix_unsigned.pl similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/fix_unsigned.pl rename to mozilla/webtools/testopia/extensions/Testopia/contrib/fix_unsigned.pl diff --git a/mozilla/webtools/testopia/extensions/testopia/contrib/tesrunner2testopia.txt b/mozilla/webtools/testopia/extensions/Testopia/contrib/tesrunner2testopia.txt similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/contrib/tesrunner2testopia.txt rename to mozilla/webtools/testopia/extensions/Testopia/contrib/tesrunner2testopia.txt diff --git a/mozilla/webtools/testopia/extensions/testopia/css/print.css b/mozilla/webtools/testopia/extensions/Testopia/css/print.css similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/css/print.css rename to mozilla/webtools/testopia/extensions/Testopia/css/print.css diff --git a/mozilla/webtools/testopia/extensions/testopia/css/testopia.css b/mozilla/webtools/testopia/extensions/Testopia/css/testopia.css similarity index 92% rename from mozilla/webtools/testopia/extensions/testopia/css/testopia.css rename to mozilla/webtools/testopia/extensions/Testopia/css/testopia.css index 34af404ec2e..cab3f25aeab 100644 --- a/mozilla/webtools/testopia/extensions/testopia/css/testopia.css +++ b/mozilla/webtools/testopia/extensions/Testopia/css/testopia.css @@ -29,6 +29,18 @@ border:none; } +#footer .testopia_links { + padding-left: 1ex; +} + +#footer #links-saved { + padding-left: 1em; +} + +#footer #tr-links-saved { + padding: 1em; +} + /* old default.css */ textarea { /* background-color: #fff; */ @@ -234,15 +246,15 @@ dt { } .plan_archived { - background: url(../../testopia/img/archived.png); + background: url(../../Testopia/img/archived.png); background-repeat: no-repeat; width: 120px; height: 32px; } -.x-progress-bar-red{height:18px;float:left;width:0;background:#9CBFEE url( ../../testopia/img/red_bar.gif ) repeat-x left center;border-top:1px solid #D1E4FD;border-bottom:1px solid #7FA9E4;} -.x-progress-bar-green{height:18px;float:left;width:0;background:#9CBFEE url( ../../testopia/img/green_bar.gif ) repeat-x left center;border-top:1px solid #D1E4FD;border-bottom:1px solid #7FA9E4;} -.x-progress-bar-orange{height:18px;float:left;width:0;background:#9CBFEE url( ../../testopia/img/orange_bar.gif ) repeat-x left center;border-top:1px solid #D1E4FD;border-bottom:1px solid #7FA9E4;} +.x-progress-bar-red{height:18px;float:left;width:0;background:#9CBFEE url( ../../Testopia/img/red_bar.gif ) repeat-x left center;border-top:1px solid #D1E4FD;border-bottom:1px solid #7FA9E4;} +.x-progress-bar-green{height:18px;float:left;width:0;background:#9CBFEE url( ../../Testopia/img/green_bar.gif ) repeat-x left center;border-top:1px solid #D1E4FD;border-bottom:1px solid #7FA9E4;} +.x-progress-bar-orange{height:18px;float:left;width:0;background:#9CBFEE url( ../../Testopia/img/orange_bar.gif ) repeat-x left center;border-top:1px solid #D1E4FD;border-bottom:1px solid #7FA9E4;} .x-progress-text-main{font-size:11px;font-weight:bold;color:#fff;padding:3px 5px;overflow:hidden;position:absolute;left:0;text-align:center;} .x-progress-text-back-main{color:#000;line-height:16px;font-weight:bold;} diff --git a/mozilla/webtools/testopia/extensions/testopia/doc/Manual.odt b/mozilla/webtools/testopia/extensions/Testopia/doc/Manual.odt similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/doc/Manual.odt rename to mozilla/webtools/testopia/extensions/Testopia/doc/Manual.odt diff --git a/mozilla/webtools/testopia/extensions/testopia/doc/Manual.pdf b/mozilla/webtools/testopia/extensions/Testopia/doc/Manual.pdf similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/doc/Manual.pdf rename to mozilla/webtools/testopia/extensions/Testopia/doc/Manual.pdf diff --git a/mozilla/webtools/testopia/extensions/testopia/doc/Manual.rtf b/mozilla/webtools/testopia/extensions/Testopia/doc/Manual.rtf similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/doc/Manual.rtf rename to mozilla/webtools/testopia/extensions/Testopia/doc/Manual.rtf diff --git a/mozilla/webtools/testopia/extensions/testopia/doc/Manual.xhtml b/mozilla/webtools/testopia/extensions/Testopia/doc/Manual.xhtml similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/doc/Manual.xhtml rename to mozilla/webtools/testopia/extensions/Testopia/doc/Manual.xhtml diff --git a/mozilla/webtools/testopia/extensions/testopia/doc/Testopia.dia b/mozilla/webtools/testopia/extensions/Testopia/doc/Testopia.dia similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/doc/Testopia.dia rename to mozilla/webtools/testopia/extensions/Testopia/doc/Testopia.dia diff --git a/mozilla/webtools/testopia/extensions/testopia/doc/pod/webservice/CHANGELOG b/mozilla/webtools/testopia/extensions/Testopia/doc/pod/webservice/CHANGELOG similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/doc/pod/webservice/CHANGELOG rename to mozilla/webtools/testopia/extensions/Testopia/doc/pod/webservice/CHANGELOG diff --git a/mozilla/webtools/testopia/extensions/testopia/doc/ru/Manual-rus.odt b/mozilla/webtools/testopia/extensions/Testopia/doc/ru/Manual-rus.odt similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/doc/ru/Manual-rus.odt rename to mozilla/webtools/testopia/extensions/Testopia/doc/ru/Manual-rus.odt diff --git a/mozilla/webtools/testopia/extensions/testopia/doc/ru/Manual-rus.pdf b/mozilla/webtools/testopia/extensions/Testopia/doc/ru/Manual-rus.pdf similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/doc/ru/Manual-rus.pdf rename to mozilla/webtools/testopia/extensions/Testopia/doc/ru/Manual-rus.pdf diff --git a/mozilla/webtools/testopia/extensions/testopia/doc/training.odp b/mozilla/webtools/testopia/extensions/Testopia/doc/training.odp similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/doc/training.odp rename to mozilla/webtools/testopia/extensions/Testopia/doc/training.odp diff --git a/mozilla/webtools/testopia/extensions/testopia/environment.dtd b/mozilla/webtools/testopia/extensions/Testopia/environment.dtd similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/environment.dtd rename to mozilla/webtools/testopia/extensions/Testopia/environment.dtd diff --git a/mozilla/webtools/testopia/extensions/testopia/img/1x1.gif b/mozilla/webtools/testopia/extensions/Testopia/img/1x1.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/1x1.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/1x1.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/BLOCKED.gif b/mozilla/webtools/testopia/extensions/Testopia/img/BLOCKED.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/BLOCKED.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/BLOCKED.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/BLOCKED_gray.gif b/mozilla/webtools/testopia/extensions/Testopia/img/BLOCKED_gray.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/BLOCKED_gray.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/BLOCKED_gray.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/BLOCKED_small.gif b/mozilla/webtools/testopia/extensions/Testopia/img/BLOCKED_small.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/BLOCKED_small.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/BLOCKED_small.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/ERROR.gif b/mozilla/webtools/testopia/extensions/Testopia/img/ERROR.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/ERROR.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/ERROR.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/ERROR_small.gif b/mozilla/webtools/testopia/extensions/Testopia/img/ERROR_small.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/ERROR_small.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/ERROR_small.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/FAILED.gif b/mozilla/webtools/testopia/extensions/Testopia/img/FAILED.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/FAILED.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/FAILED.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/FAILED_gray.gif b/mozilla/webtools/testopia/extensions/Testopia/img/FAILED_gray.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/FAILED_gray.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/FAILED_gray.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/FAILED_small.gif b/mozilla/webtools/testopia/extensions/Testopia/img/FAILED_small.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/FAILED_small.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/FAILED_small.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/IDLE.gif b/mozilla/webtools/testopia/extensions/Testopia/img/IDLE.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/IDLE.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/IDLE.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/IDLE_gray.gif b/mozilla/webtools/testopia/extensions/Testopia/img/IDLE_gray.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/IDLE_gray.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/IDLE_gray.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/IDLE_small.gif b/mozilla/webtools/testopia/extensions/Testopia/img/IDLE_small.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/IDLE_small.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/IDLE_small.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/PASSED.gif b/mozilla/webtools/testopia/extensions/Testopia/img/PASSED.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/PASSED.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/PASSED.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/PASSED_gray.gif b/mozilla/webtools/testopia/extensions/Testopia/img/PASSED_gray.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/PASSED_gray.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/PASSED_gray.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/PASSED_small.gif b/mozilla/webtools/testopia/extensions/Testopia/img/PASSED_small.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/PASSED_small.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/PASSED_small.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/PAUSED.gif b/mozilla/webtools/testopia/extensions/Testopia/img/PAUSED.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/PAUSED.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/PAUSED.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/PAUSED_gray.gif b/mozilla/webtools/testopia/extensions/Testopia/img/PAUSED_gray.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/PAUSED_gray.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/PAUSED_gray.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/PAUSED_small.gif b/mozilla/webtools/testopia/extensions/Testopia/img/PAUSED_small.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/PAUSED_small.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/PAUSED_small.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/RUNNING.gif b/mozilla/webtools/testopia/extensions/Testopia/img/RUNNING.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/RUNNING.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/RUNNING.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/RUNNING_gray.gif b/mozilla/webtools/testopia/extensions/Testopia/img/RUNNING_gray.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/RUNNING_gray.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/RUNNING_gray.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/RUNNING_small.gif b/mozilla/webtools/testopia/extensions/Testopia/img/RUNNING_small.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/RUNNING_small.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/RUNNING_small.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/Testopia_pocket.eps b/mozilla/webtools/testopia/extensions/Testopia/img/Testopia_pocket.eps similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/Testopia_pocket.eps rename to mozilla/webtools/testopia/extensions/Testopia/img/Testopia_pocket.eps diff --git a/mozilla/webtools/testopia/extensions/testopia/img/add.png b/mozilla/webtools/testopia/extensions/Testopia/img/add.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/add.png rename to mozilla/webtools/testopia/extensions/Testopia/img/add.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/add.svg b/mozilla/webtools/testopia/extensions/Testopia/img/add.svg similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/add.svg rename to mozilla/webtools/testopia/extensions/Testopia/img/add.svg diff --git a/mozilla/webtools/testopia/extensions/testopia/img/archived.png b/mozilla/webtools/testopia/extensions/Testopia/img/archived.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/archived.png rename to mozilla/webtools/testopia/extensions/Testopia/img/archived.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/archived.svg b/mozilla/webtools/testopia/extensions/Testopia/img/archived.svg similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/archived.svg rename to mozilla/webtools/testopia/extensions/Testopia/img/archived.svg diff --git a/mozilla/webtools/testopia/extensions/testopia/img/aw.gif b/mozilla/webtools/testopia/extensions/Testopia/img/aw.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/aw.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/aw.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/awg.gif b/mozilla/webtools/testopia/extensions/Testopia/img/awg.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/awg.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/awg.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/cancel.gif b/mozilla/webtools/testopia/extensions/Testopia/img/cancel.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/cancel.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/cancel.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/category.gif b/mozilla/webtools/testopia/extensions/Testopia/img/category.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/category.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/category.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/circle.gif b/mozilla/webtools/testopia/extensions/Testopia/img/circle.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/circle.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/circle.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/circle.png b/mozilla/webtools/testopia/extensions/Testopia/img/circle.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/circle.png rename to mozilla/webtools/testopia/extensions/Testopia/img/circle.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/city.eps b/mozilla/webtools/testopia/extensions/Testopia/img/city.eps similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/city.eps rename to mozilla/webtools/testopia/extensions/Testopia/img/city.eps diff --git a/mozilla/webtools/testopia/extensions/testopia/img/confirm.png b/mozilla/webtools/testopia/extensions/Testopia/img/confirm.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/confirm.png rename to mozilla/webtools/testopia/extensions/Testopia/img/confirm.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/confirm.svg b/mozilla/webtools/testopia/extensions/Testopia/img/confirm.svg similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/confirm.svg rename to mozilla/webtools/testopia/extensions/Testopia/img/confirm.svg diff --git a/mozilla/webtools/testopia/extensions/testopia/img/copy.gif b/mozilla/webtools/testopia/extensions/Testopia/img/copy.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/copy.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/copy.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/copy.png b/mozilla/webtools/testopia/extensions/Testopia/img/copy.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/copy.png rename to mozilla/webtools/testopia/extensions/Testopia/img/copy.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/copy.svg b/mozilla/webtools/testopia/extensions/Testopia/img/copy.svg similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/copy.svg rename to mozilla/webtools/testopia/extensions/Testopia/img/copy.svg diff --git a/mozilla/webtools/testopia/extensions/testopia/img/csv.png b/mozilla/webtools/testopia/extensions/Testopia/img/csv.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/csv.png rename to mozilla/webtools/testopia/extensions/Testopia/img/csv.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/csv.svg b/mozilla/webtools/testopia/extensions/Testopia/img/csv.svg similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/csv.svg rename to mozilla/webtools/testopia/extensions/Testopia/img/csv.svg diff --git a/mozilla/webtools/testopia/extensions/testopia/img/delete.png b/mozilla/webtools/testopia/extensions/Testopia/img/delete.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/delete.png rename to mozilla/webtools/testopia/extensions/Testopia/img/delete.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/delete.svg b/mozilla/webtools/testopia/extensions/Testopia/img/delete.svg similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/delete.svg rename to mozilla/webtools/testopia/extensions/Testopia/img/delete.svg diff --git a/mozilla/webtools/testopia/extensions/testopia/img/edit.png b/mozilla/webtools/testopia/extensions/Testopia/img/edit.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/edit.png rename to mozilla/webtools/testopia/extensions/Testopia/img/edit.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/edit.svg b/mozilla/webtools/testopia/extensions/Testopia/img/edit.svg similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/edit.svg rename to mozilla/webtools/testopia/extensions/Testopia/img/edit.svg diff --git a/mozilla/webtools/testopia/extensions/testopia/img/element.gif b/mozilla/webtools/testopia/extensions/Testopia/img/element.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/element.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/element.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/env_lookup.png b/mozilla/webtools/testopia/extensions/Testopia/img/env_lookup.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/env_lookup.png rename to mozilla/webtools/testopia/extensions/Testopia/img/env_lookup.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/env_lookup.svg b/mozilla/webtools/testopia/extensions/Testopia/img/env_lookup.svg similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/env_lookup.svg rename to mozilla/webtools/testopia/extensions/Testopia/img/env_lookup.svg diff --git a/mozilla/webtools/testopia/extensions/testopia/img/folder.gif b/mozilla/webtools/testopia/extensions/Testopia/img/folder.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/folder.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/folder.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/folder_blue.gif b/mozilla/webtools/testopia/extensions/Testopia/img/folder_blue.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/folder_blue.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/folder_blue.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/folder_red.gif b/mozilla/webtools/testopia/extensions/Testopia/img/folder_red.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/folder_red.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/folder_red.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/go.png b/mozilla/webtools/testopia/extensions/Testopia/img/go.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/go.png rename to mozilla/webtools/testopia/extensions/Testopia/img/go.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/go.svg b/mozilla/webtools/testopia/extensions/Testopia/img/go.svg similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/go.svg rename to mozilla/webtools/testopia/extensions/Testopia/img/go.svg diff --git a/mozilla/webtools/testopia/extensions/testopia/img/green_bar.gif b/mozilla/webtools/testopia/extensions/Testopia/img/green_bar.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/green_bar.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/green_bar.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/link.png b/mozilla/webtools/testopia/extensions/Testopia/img/link.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/link.png rename to mozilla/webtools/testopia/extensions/Testopia/img/link.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/link.svg b/mozilla/webtools/testopia/extensions/Testopia/img/link.svg similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/link.svg rename to mozilla/webtools/testopia/extensions/Testopia/img/link.svg diff --git a/mozilla/webtools/testopia/extensions/testopia/img/lk.gif b/mozilla/webtools/testopia/extensions/Testopia/img/lk.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/lk.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/lk.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/new.png b/mozilla/webtools/testopia/extensions/Testopia/img/new.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/new.png rename to mozilla/webtools/testopia/extensions/Testopia/img/new.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/new.svg b/mozilla/webtools/testopia/extensions/Testopia/img/new.svg similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/new.svg rename to mozilla/webtools/testopia/extensions/Testopia/img/new.svg diff --git a/mozilla/webtools/testopia/extensions/testopia/img/orange_bar.gif b/mozilla/webtools/testopia/extensions/Testopia/img/orange_bar.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/orange_bar.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/orange_bar.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/pb.gif b/mozilla/webtools/testopia/extensions/Testopia/img/pb.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/pb.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/pb.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/pg.gif b/mozilla/webtools/testopia/extensions/Testopia/img/pg.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/pg.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/pg.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/product.gif b/mozilla/webtools/testopia/extensions/Testopia/img/product.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/product.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/product.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/property.gif b/mozilla/webtools/testopia/extensions/Testopia/img/property.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/property.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/property.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/red_bar.gif b/mozilla/webtools/testopia/extensions/Testopia/img/red_bar.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/red_bar.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/red_bar.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/refresh.png b/mozilla/webtools/testopia/extensions/Testopia/img/refresh.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/refresh.png rename to mozilla/webtools/testopia/extensions/Testopia/img/refresh.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/refresh.svg b/mozilla/webtools/testopia/extensions/Testopia/img/refresh.svg similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/refresh.svg rename to mozilla/webtools/testopia/extensions/Testopia/img/refresh.svg diff --git a/mozilla/webtools/testopia/extensions/testopia/img/save.png b/mozilla/webtools/testopia/extensions/Testopia/img/save.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/save.png rename to mozilla/webtools/testopia/extensions/Testopia/img/save.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/save.svg b/mozilla/webtools/testopia/extensions/Testopia/img/save.svg similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/save.svg rename to mozilla/webtools/testopia/extensions/Testopia/img/save.svg diff --git a/mozilla/webtools/testopia/extensions/testopia/img/saw.gif b/mozilla/webtools/testopia/extensions/Testopia/img/saw.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/saw.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/saw.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/selected_value.png b/mozilla/webtools/testopia/extensions/Testopia/img/selected_value.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/selected_value.png rename to mozilla/webtools/testopia/extensions/Testopia/img/selected_value.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/square.gif b/mozilla/webtools/testopia/extensions/Testopia/img/square.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/square.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/square.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/square.png b/mozilla/webtools/testopia/extensions/Testopia/img/square.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/square.png rename to mozilla/webtools/testopia/extensions/Testopia/img/square.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/stop.png b/mozilla/webtools/testopia/extensions/Testopia/img/stop.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/stop.png rename to mozilla/webtools/testopia/extensions/Testopia/img/stop.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/stop.svg b/mozilla/webtools/testopia/extensions/Testopia/img/stop.svg similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/stop.svg rename to mozilla/webtools/testopia/extensions/Testopia/img/stop.svg diff --git a/mozilla/webtools/testopia/extensions/testopia/img/td.gif b/mozilla/webtools/testopia/extensions/Testopia/img/td.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/td.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/td.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/testopia_big_picture.png b/mozilla/webtools/testopia/extensions/Testopia/img/testopia_big_picture.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/testopia_big_picture.png rename to mozilla/webtools/testopia/extensions/Testopia/img/testopia_big_picture.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/testopia_city_128.png b/mozilla/webtools/testopia/extensions/Testopia/img/testopia_city_128.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/testopia_city_128.png rename to mozilla/webtools/testopia/extensions/Testopia/img/testopia_city_128.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/testopia_city_256.png b/mozilla/webtools/testopia/extensions/Testopia/img/testopia_city_256.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/testopia_city_256.png rename to mozilla/webtools/testopia/extensions/Testopia/img/testopia_city_256.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/testopia_city_512.png b/mozilla/webtools/testopia/extensions/Testopia/img/testopia_city_512.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/testopia_city_512.png rename to mozilla/webtools/testopia/extensions/Testopia/img/testopia_city_512.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/testopia_logo_128.png b/mozilla/webtools/testopia/extensions/Testopia/img/testopia_logo_128.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/testopia_logo_128.png rename to mozilla/webtools/testopia/extensions/Testopia/img/testopia_logo_128.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/testopia_logo_256.png b/mozilla/webtools/testopia/extensions/Testopia/img/testopia_logo_256.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/testopia_logo_256.png rename to mozilla/webtools/testopia/extensions/Testopia/img/testopia_logo_256.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/tr.gif b/mozilla/webtools/testopia/extensions/Testopia/img/tr.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/tr.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/tr.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/triangle.gif b/mozilla/webtools/testopia/extensions/Testopia/img/triangle.gif similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/triangle.gif rename to mozilla/webtools/testopia/extensions/Testopia/img/triangle.gif diff --git a/mozilla/webtools/testopia/extensions/testopia/img/triangle.png b/mozilla/webtools/testopia/extensions/Testopia/img/triangle.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/triangle.png rename to mozilla/webtools/testopia/extensions/Testopia/img/triangle.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/validexpRed.png b/mozilla/webtools/testopia/extensions/Testopia/img/validexpRed.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/validexpRed.png rename to mozilla/webtools/testopia/extensions/Testopia/img/validexpRed.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/validexpYellow.png b/mozilla/webtools/testopia/extensions/Testopia/img/validexpYellow.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/validexpYellow.png rename to mozilla/webtools/testopia/extensions/Testopia/img/validexpYellow.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/xml.png b/mozilla/webtools/testopia/extensions/Testopia/img/xml.png similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/xml.png rename to mozilla/webtools/testopia/extensions/Testopia/img/xml.png diff --git a/mozilla/webtools/testopia/extensions/testopia/img/xml.svg b/mozilla/webtools/testopia/extensions/Testopia/img/xml.svg similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/img/xml.svg rename to mozilla/webtools/testopia/extensions/Testopia/img/xml.svg diff --git a/mozilla/webtools/testopia/extensions/testopia/import_example.csv b/mozilla/webtools/testopia/extensions/Testopia/import_example.csv similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/import_example.csv rename to mozilla/webtools/testopia/extensions/Testopia/import_example.csv diff --git a/mozilla/webtools/testopia/extensions/testopia/js/attachments.js b/mozilla/webtools/testopia/extensions/Testopia/js/attachments.js similarity index 98% rename from mozilla/webtools/testopia/extensions/testopia/js/attachments.js rename to mozilla/webtools/testopia/extensions/Testopia/js/attachments.js index d0db382e95c..929d24c00f6 100644 --- a/mozilla/webtools/testopia/extensions/testopia/js/attachments.js +++ b/mozilla/webtools/testopia/extensions/Testopia/js/attachments.js @@ -153,7 +153,7 @@ Testopia.Attachment.Grid = function(object){ tbar: ['->', { xtype: 'button', id: 'edit_attachment_btn', - icon: 'extensions/testopia/img/edit.png', + icon: 'extensions/Testopia/img/edit.png', iconCls: 'img_button_16x', disabled: true, tooltip: 'Edit Attachments', @@ -163,14 +163,14 @@ Testopia.Attachment.Grid = function(object){ }, { xtype: 'button', id: 'add_attachment_btn', - icon: 'extensions/testopia/img/add.png', + icon: 'extensions/Testopia/img/add.png', iconCls: 'img_button_16x', tooltip: 'Attach a new file', handler: this.newAttachment.createDelegate(this) }, { xtype: 'button', id: 'delete_attachment_btn', - icon: 'extensions/testopia/img/delete.png', + icon: 'extensions/Testopia/img/delete.png', iconCls: 'img_button_16x', disabled: true, tooltip: 'Remove selected attachments', @@ -215,7 +215,7 @@ Ext.extend(Testopia.Attachment.Grid, Ext.grid.GridPanel, { items: [{ text: "Delete Selected Attachments", id: 'attach_delete_mnu', - icon: 'extensions/testopia/img/delete.png', + icon: 'extensions/Testopia/img/delete.png', iconCls: 'img_button_16x', disabled: true, handler: this.deleteAttachment.createDelegate(this) diff --git a/mozilla/webtools/testopia/extensions/testopia/js/build.js b/mozilla/webtools/testopia/extensions/Testopia/js/build.js similarity index 97% rename from mozilla/webtools/testopia/extensions/testopia/js/build.js rename to mozilla/webtools/testopia/extensions/Testopia/js/build.js index 09d6b213db6..f41ff3a02f8 100644 --- a/mozilla/webtools/testopia/extensions/testopia/js/build.js +++ b/mozilla/webtools/testopia/extensions/Testopia/js/build.js @@ -159,7 +159,7 @@ Testopia.Build.Grid = function(product_id){ tbar: [new Ext.Toolbar.Fill(), { xtype: 'button', id: 'edit_build_btn', - icon: 'extensions/testopia/img/edit.png', + icon: 'extensions/Testopia/img/edit.png', iconCls: 'img_button_16x', tooltip: 'Edit Selected Build', handler: function(){ @@ -168,7 +168,7 @@ Testopia.Build.Grid = function(product_id){ }, { xtype: 'button', id: 'add_build_btn', - icon: 'extensions/testopia/img/add.png', + icon: 'extensions/Testopia/img/add.png', iconCls: 'img_button_16x', tooltip: 'Add a new Build', handler: this.newRecord @@ -235,19 +235,19 @@ Ext.extend(Testopia.Build.Grid, Ext.grid.GridPanel, { } }, { text: 'Add a Build', - icon: 'extensions/testopia/img/add.png', + icon: 'extensions/Testopia/img/add.png', iconCls: 'img_button_16x', handler: this.newRecord }, { text: 'Edit This Build', - icon: 'extensions/testopia/img/edit.png', + icon: 'extensions/Testopia/img/edit.png', iconCls: 'img_button_16x', handler: function(){ Testopia.Util.editFirstSelection(grid); } }, { text: 'Refresh', - icon: 'extensions/testopia/img/refresh.png', + icon: 'extensions/Testopia/img/refresh.png', iconCls: 'img_button_16x', handler: function(){ grid.store.reload(); diff --git a/mozilla/webtools/testopia/extensions/testopia/js/case.js b/mozilla/webtools/testopia/extensions/Testopia/js/case.js similarity index 98% rename from mozilla/webtools/testopia/extensions/testopia/js/case.js rename to mozilla/webtools/testopia/extensions/Testopia/js/case.js index 3930adf49fa..944848d1864 100644 --- a/mozilla/webtools/testopia/extensions/testopia/js/case.js +++ b/mozilla/webtools/testopia/extensions/Testopia/js/case.js @@ -554,7 +554,7 @@ Testopia.TestCase.Grid = function(params, cfg){ { xtype: 'button', id: 'case_grid_tocsv', - icon: 'extensions/testopia/img/csv.png', + icon: 'extensions/Testopia/img/csv.png', iconCls: 'img_button_16x', tooltip: 'Export Test Cases to CSV', handler: function(){ @@ -563,7 +563,7 @@ Testopia.TestCase.Grid = function(params, cfg){ },{ xtype: 'button', id: 'case_grid_toxml', - icon: 'extensions/testopia/img/xml.png', + icon: 'extensions/Testopia/img/xml.png', iconCls: 'img_button_16x', tooltip: 'Export Test Cases to XML', handler: function(){ @@ -572,7 +572,7 @@ Testopia.TestCase.Grid = function(params, cfg){ },{ xtype: 'button', id: 'save_case_list_btn', - icon: 'extensions/testopia/img/save.png', + icon: 'extensions/Testopia/img/save.png', iconCls: 'img_button_16x', tooltip: 'Save this search', handler: function(b, e){ @@ -581,7 +581,7 @@ Testopia.TestCase.Grid = function(params, cfg){ }, { xtype: 'button', id: 'link_case_list_btn', - icon: 'extensions/testopia/img/link.png', + icon: 'extensions/Testopia/img/link.png', iconCls: 'img_button_16x', tooltip: 'Create a link to this list', handler: function(b, e){ @@ -590,7 +590,7 @@ Testopia.TestCase.Grid = function(params, cfg){ }, { xtype: 'button', id: 'edit_case_list_btn', - icon: 'extensions/testopia/img/edit.png', + icon: 'extensions/Testopia/img/edit.png', disabled: true, iconCls: 'img_button_16x', tooltip: 'Edit Selected Test Case', @@ -600,7 +600,7 @@ Testopia.TestCase.Grid = function(params, cfg){ }, { xtype: 'button', id: 'add_case_list_btn', - icon: 'extensions/testopia/img/new.png', + icon: 'extensions/Testopia/img/new.png', iconCls: 'img_button_16x', tooltip: 'Create a New Test Case', handler: function(){ @@ -617,7 +617,7 @@ Testopia.TestCase.Grid = function(params, cfg){ xtype: 'button', id: 'delete_case_list_btn', disabled: true, - icon: 'extensions/testopia/img/delete.png', + icon: 'extensions/Testopia/img/delete.png', iconCls: 'img_button_16x', tooltip: 'Delete Selected Test Cases', handler: this.deleteList.createDelegate(this) @@ -647,7 +647,7 @@ Ext.extend(Testopia.TestCase.Grid, Ext.grid.GridPanel, { enableScrolling: false, items: [{ text: 'Modify Selected Test Cases', - icon: 'extensions/testopia/img/edit.png', + icon: 'extensions/Testopia/img/edit.png', iconCls: 'img_button_16x', menu: { enableScrolling: false, @@ -877,7 +877,7 @@ Ext.extend(Testopia.TestCase.Grid, Ext.grid.GridPanel, { } }, { text: 'Delete Selected Test Cases', - icon: 'extensions/testopia/img/delete.png', + icon: 'extensions/Testopia/img/delete.png', iconCls: 'img_button_16x', handler: this.deleteList.createDelegate(this) @@ -963,7 +963,7 @@ Ext.extend(Testopia.TestCase.Grid, Ext.grid.GridPanel, { } }, { text: 'Refresh List', - icon: 'extensions/testopia/img/refresh.png', + icon: 'extensions/Testopia/img/refresh.png', iconCls: 'img_button_16x', handler: function(){ grid.store.reload(); @@ -1456,7 +1456,7 @@ Testopia.TestCase.PlanList = function(tcid, product_id){ }); var addButton = new Ext.Button({ - icon: 'extensions/testopia/img/add.png', + icon: 'extensions/Testopia/img/add.png', iconCls: 'img_button_16x', tooltip: 'Link to plan', handler: function(){ @@ -1477,7 +1477,7 @@ Testopia.TestCase.PlanList = function(tcid, product_id){ }); var deleteButton = new Ext.Button({ - icon: 'extensions/testopia/img/delete.png', + icon: 'extensions/Testopia/img/delete.png', iconCls: 'img_button_16x', tooltip: 'Unlink Selected Plans', handler: this.remove @@ -1525,7 +1525,7 @@ Ext.extend(Testopia.TestCase.PlanList, Ext.grid.GridPanel, { items: [{ text: 'Unlink Selected Plans', id: 'plan_remove_mnu', - icon: 'extensions/testopia/img/delete.png', + icon: 'extensions/Testopia/img/delete.png', iconCls: 'img_button_16x', handler: grid.remove }, { @@ -1535,7 +1535,7 @@ Ext.extend(Testopia.TestCase.PlanList, Ext.grid.GridPanel, { } }, { text: 'Refresh', - icon: 'extensions/testopia/img/refresh.png', + icon: 'extensions/Testopia/img/refresh.png', iconCls: 'img_button_16x', handler: function(){ grid.store.reload(); diff --git a/mozilla/webtools/testopia/extensions/testopia/js/caserun.js b/mozilla/webtools/testopia/extensions/Testopia/js/caserun.js similarity index 96% rename from mozilla/webtools/testopia/extensions/testopia/js/caserun.js rename to mozilla/webtools/testopia/extensions/Testopia/js/caserun.js index 8ab125acf5c..bf904a54fc5 100755 --- a/mozilla/webtools/testopia/extensions/testopia/js/caserun.js +++ b/mozilla/webtools/testopia/extensions/Testopia/js/caserun.js @@ -20,6 +20,736 @@ * Daniel Parker */ +Testopia.TestCase.Bugs.Grid = function(id){ + var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {}); + function bug_link(id){ + return '' + id + ''; + } + + var tcid; + if (id) { + tcid = id; + } + + this.tcid = tcid; + this.store = new Ext.data.JsonStore({ + url: 'tr_process_case.cgi', + root: 'bugs', + listeners: { 'exception': Testopia.Util.loadError }, + baseParams: { + action: 'getbugs' + }, + fields: [{ + name: 'run_id', + mapping: 'run_id' + }, { + name: 'build', + mapping: 'build' + }, { + name: 'env', + mapping: 'env' + }, { + name: 'summary', + mapping: 'summary' + }, { + name: 'case_run_id', + mapping: 'case_run_id' + }, { + name: 'bug_id', + mapping: 'bug_id' + }, { + name: 'status', + mapping: 'status' + }, { + name: 'resolution', + mapping: 'resolution' + }, { + name: 'assignee', + mapping: 'assignee' + }, { + name: 'severity', + mapping: 'severity' + }, { + name: 'priority', + mapping: 'priority' + }] + }); + addbug = function(){ + tcid = this.tcid; + var ids; + var type = 'case'; + if (Ext.getCmp('caserun_grid')) { + type = 'caserun'; + ids = Testopia.Util.getSelectedObjects(Ext.getCmp('caserun_grid'), 'caserun_id'); + } + else { + ids = tcid; + } + testopia_form.submit({ + url: 'tr_list_cases.cgi', + params: { + action: 'update_bugs', + bug_action: 'attach', + bugs: Ext.getCmp('attachbug').getValue(), + type: type, + ids: ids + }, + success: function(){ + ds.load({ + params: { + case_id: tcid + } + }); + Ext.getCmp('attachbug').reset(); + }, + failure: Testopia.Util.error + }); + }; + removebug = function(){ + tcid = this.tcid; + var type = 'case'; + if (Ext.getCmp('caserun_grid')) { + type = 'caserun'; + ids = Testopia.Util.getSelectedObjects(Ext.getCmp('caserun_grid'), 'caserun_id'); + } + else { + ids = tcid; + } + testopia_form.submit({ + url: 'tr_list_cases.cgi', + params: { + action: 'update_bugs', + bugs: Testopia.Util.getSelectedObjects(Ext.getCmp('case_bugs_panel'), 'bug_id'), + type: type, + ids: ids + }, + success: function(){ + ds.load({ + params: { + case_id: tcid + } + }); + }, + failure: Testopia.Util.error + }); + }; + newbug = function(){ + var bug_panel = new Ext.Panel({ + id: 'new_bug_panel' + }); + var caserun_id; + if (Ext.getCmp('caserun_grid') && Ext.getCmp('caserun_grid').getSelectionModel().getCount()) { + caserun_id = Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('caserun_id'); + } + + var store = new Ext.data.Store({ + url: 'tr_process_case.cgi', + baseParams: { + action: 'case_to_bug', + case_id: this.tcid, + caserun_id: caserun_id + }, + reader: new Ext.data.XmlReader({ + record: 'newbug', + id: 'case_id' + }, [{ + name: 'product', + mapping: 'product' + }, { + name: 'version', + mapping: 'version' + }, { + name: 'component', + mapping: 'component' + }, { + name: 'comment', + mapping: 'comment' + }, { + name: 'case_id', + mapping: 'case_id' + }, { + name: 'assigned_to', + mapping: 'assigned_to' + }, { + name: 'qa_contact', + mapping: 'qa_contact' + }, { + name: 'short_desc', + mapping: 'short_desc' + }]) + }); + store.load(); + store.on('load', function(){ +// var url = 'enter_bug.cgi?'; + var f = document.createElement("form"); + f.setAttribute("method", "post"); + f.setAttribute("action", "enter_bug.cgi"); + f.setAttribute("target", "_blank"); + f.setAttribute("style", "display: none"); + + for (var i = 0; i < store.fields.keys.length; i++) { +// url = url + store.fields.keys[i] + '=' + escape(store.getAt(0).get(store.fields.keys[i])) + '&'; + if (store.fields.keys[i] == 'comment'){ + h = document.createElement("textarea"); + h.setAttribute("name", store.fields.keys[i]); + h.value = store.getAt(0).get(store.fields.keys[i]); + } + else { + h = document.createElement("input"); + h.setAttribute("name", store.fields.keys[i]); + txt = store.getAt(0).get(store.fields.keys[i]).replace(/\n/,' '); + h.setAttribute("value", store.getAt(0).get(store.fields.keys[i])); + } + f.appendChild(h); + } + h = document.createElement("input"); + h.setAttribute("name", "caserun_id"); + h.setAttribute("value", caserun_id); + f.appendChild(h); + document.body.appendChild(f); + f.submit(); +// url = url + 'caserun_id=' + caserun_id; +// window.open(url); + }); + }; + var ds = this.store; + this.columns = [{ + header: "Bug", + width: 150, + dataIndex: 'bug_id', + sortable: true, + renderer: bug_link + }, { + header: "Found In Run", + width: 50, + dataIndex: 'run_id', + sortable: true, + renderer: Testopia.Util.makeLink.createDelegate(this,['run'],true) + }, { + header: "With Build", + width: 50, + dataIndex: 'build', + sortable: true + }, { + header: "Environment", + width: 50, + dataIndex: 'env', + sortable: true + }, { + id: 'bugs_summary', + header: "Summary", + width: 200, + dataIndex: 'summary', + sortable: true + }, { + header: "Status", + width: 50, + dataIndex: 'status', + sortable: true + }, { + header: "Resolution", + width: 50, + dataIndex: 'resolution', + sortable: true + }, { + header: "Severity", + width: 50, + dataIndex: 'severity', + sortable: true + }, { + header: "Asignee", + width: 150, + dataIndex: 'assignee', + sortable: true + }, { + header: "Priority", + width: 50, + dataIndex: 'priority', + sortable: true + }]; + Testopia.TestCase.Bugs.Grid.superclass.constructor.call(this, { + tbar: [new Ext.form.TextField({ + width: 50, + id: 'attachbug' + }), { + xtype: 'button', + tooltip: "Attach a Bug", + icon: 'extensions/Testopia/img/add.png', + iconCls: 'img_button_16x', + handler: addbug.createDelegate(this) + }, { + xtype: 'button', + tooltip: "File new Bug", + icon: 'extensions/Testopia/img/new.png', + iconCls: 'img_button_16x', + handler: newbug.createDelegate(this) + }, { + xtype: 'button', + tooltip: "Remove selected bugs from test case or run", + icon: 'extensions/Testopia/img/delete.png', + iconCls: 'img_button_16x', + handler: removebug.createDelegate(this) + }, '-', 'This view includes all bugs attached to the selected test case regardless of run'], + border: false, + title: 'Bugs', + id: 'case_bugs_panel', + bodyBorder: false, + autoExpandColumn: 'bugs_summary', + loadMask: { + msg: 'Loading...' + }, + autoScroll: true, + sm: new Ext.grid.RowSelectionModel({ + singleSelect: true + }) + }); + this.on('rowcontextmenu', this.onContextClick, this); + this.on('activate', this.onActivate, this); +}; +Ext.extend(Testopia.TestCase.Bugs.Grid, Ext.grid.GridPanel, { + onContextClick: function(grid, index, e){ + this.menu = new Ext.menu.Menu({ + id: 'tags-ctx-menu', + items: [{ + text: 'Refresh List', + icon: 'extensions/Testopia/img/refresh.png', + iconCls: 'img_button_16x', + handler: function(){ + grid.store.reload(); + } + }, { + text: 'Attach Selected Bug to Current Run/Build/Environment', + id: 'reattach_bug', + icon: 'extensions/Testopia/img/add.png', + disabled: Ext.getCmp('caserun_grid') ? false : true, + iconCls: 'img_button_16x', + handler: function(){ + var r = grid.store.getAt(index); + var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {}); + testopia_form.submit({ + url: 'tr_list_cases.cgi', + params: { + action: 'update_bugs', + bug_action: 'attach', + bugs: Testopia.Util.getSelectedObjects(Ext.getCmp('case_bugs_panel'), 'bug_id'), + type: 'caserun', + ids: Testopia.Util.getSelectedObjects(Ext.getCmp('caserun_grid'), 'caserun_id') + }, + success: function(){ + Ext.getCmp('caserun_grid').store.reload(); + grid.store.reload(); + Ext.getCmp('attachbug').reset(); + }, + failure: Testopia.Util.error + }); + } + }] + }); + e.stopEvent(); + if (grid.getSelectionModel().getCount() < 1) { + grid.getSelectionModel().selectRow(index); + } + this.menu.showAt(e.getXY()); + }, + onActivate: function(event){ + this.store.load({ + params: { + case_id: this.tcid + } + }); + } +}); + +Testopia.TestCase.Components = function(id){ + var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {}); + var tcid; + var product_id; + if (id) { + tcid = id; + } + else { + if (Ext.getCmp('caserun_grid').getSelectionModel().getCount()) { + tcid = Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('case_id'); + } + } + try { + if (run) { + product_id = run.plan.product_id; + } + } + catch (err) { + try{ + if (tcase) { + product_id = tcase.product_id; + } + } + catch (e) {} + } + this.tcid = tcid; + this.store = new Ext.data.JsonStore({ + url: 'tr_process_case.cgi', + root: 'comps', + listeners: { 'exception': Testopia.Util.loadError }, + baseParams: { + action: 'getcomponents' + }, + id: 'component_id', + fields: [{ + name: 'name', + mapping: 'name' + }, { + name: 'id', + mapping: 'id' + }, { + name: 'product', + mapping: 'product' + }] + }); + var ds = this.store; + this.columns = [{ + header: "ID", + width: 150, + dataIndex: 'id', + sortable: false, + hidden: true + }, { + id: 'comp_name', + header: "Component", + width: 150, + dataIndex: 'name', + sortable: true + }, { + id: 'product', + header: "Product", + width: 150, + dataIndex: 'product', + sortable: true + }]; + + var pchooser = new Testopia.Product.Combo({ + id: 'comp_product_chooser', + mode: 'local', + value: product_id + }); + var compchooser = new Testopia.TestCase.ComponentCombo({ + params: { + product_id: product_id + } + }); + this.pchooser = pchooser; + pchooser.on('select', function(){ + compchooser.reset(); + compchooser.store.baseParams = { + product_id: pchooser.getValue(), + action: 'getcomponents' + }; + compchooser.store.load(); + }); + addcomp = function(){ + tcid = this.tcid; + if (typeof tcid == 'object') { + testopia_form.submit({ + url: 'tr_list_cases.cgi', + params: { + action: 'update', + comp_action: 'add', + components: compchooser.getValue(), + ids: Testopia.Util.getSelectedObjects(tcid, 'case_id') + }, + success: function(){ + Testopia.Util.notify.msg('Component Added', 'Added component {0} to {1} cases(s)', compchooser.getRawValue(), tcid.getSelectionModel().getCount()); + }, + failure: Testopia.Util.error + }); + return; + } + testopia_form.submit({ + url: 'tr_process_case.cgi', + params: { + action: 'addcomponent', + component_id: compchooser.getValue(), + case_id: this.tcid + }, + success: function(){ + ds.load({ + params: { + case_id: tcid + } + }); + }, + failure: Testopia.Util.error + }); + }; + removecomp = function(){ + tcid = this.tcid; + if (typeof tcid == 'object') { + testopia_form.submit({ + url: 'tr_list_cases.cgi', + params: { + action: 'update', + comp_action: 'rem', + components: compchooser.getValue(), + ids: Testopia.Util.getSelectedObjects(tcid, 'case_id') + }, + success: function(){ + Testopia.Util.notify.msg('Component Removed', 'Removed component {0} from {1} cases(s)', compchooser.getRawValue(), tcid.getSelectionModel().getCount()); + }, + failure: Testopia.Util.error + }); + return; + } + testopia_form.submit({ + url: 'tr_process_case.cgi', + params: { + action: 'removecomponent', + component_id: Testopia.Util.getSelectedObjects(Ext.getCmp('case_comps_panel'), 'id'), + case_id: this.tcid + }, + success: function(){ + ds.load({ + params: { + case_id: tcid + } + }); + }, + failure: Testopia.Util.error + }); + }; + Testopia.TestCase.Components.superclass.constructor.call(this, { + tbar: [pchooser, compchooser, { + xtype: 'button', + tooltip: "Attach selected component", + icon: 'extensions/Testopia/img/add.png', + iconCls: 'img_button_16x', + handler: addcomp.createDelegate(this) + }, { + xtype: 'button', + tooltip: "Remove component from test case", + icon: 'extensions/Testopia/img/delete.png', + iconCls: 'img_button_16x', + handler: removecomp.createDelegate(this) + + }], + border: false, + title: 'Components', + id: 'case_comps_panel', + bodyBorder: false, + autoExpandColumn: 'comp_name', + loadMask: { + msg: 'Loading...' + }, + autoScroll: true, + sm: new Ext.grid.RowSelectionModel({ + singleSelect: false + }) + }); + this.on('rowcontextmenu', this.onContextClick, this); + this.on('activate', this.onActivate, this); +}; +Ext.extend(Testopia.TestCase.Components, Ext.grid.GridPanel, { + onContextClick: function(grid, index, e){ + if (!this.menu) { // create context menu on first right click + this.menu = new Ext.menu.Menu({ + id: 'tags-ctx-menu', + items: [{ + text: 'Refresh List', + icon: 'extensions/Testopia/img/refresh.png', + iconCls: 'img_button_16x', + handler: function(){ + grid.store.reload(); + } + }] + }); + } + e.stopEvent(); + if (grid.getSelectionModel().getCount() < 1) { + grid.getSelectionModel().selectRow(index); + } + this.menu.showAt(e.getXY()); + }, + onActivate: function(event){ + this.store.load({ + params: { + case_id: this.tcid + }, + callback: function(r, o, s){ + if (s === false) { + Testopia.Util.loadError(); + } + } + }); + this.pchooser.store.load(); + } +}); + +Testopia.TestCase.Bugs.update = function(grid){ + function commitBug(action, value, grid){ + var form = new Ext.form.BasicForm('testopia_helper_frm', {}); + form.submit({ + url: 'tr_list_cases.cgi', + params: { + action: 'update_bugs', + bug_action: action, + bugs: value, + type: 'case', + ids: Testopia.Util.getSelectedObjects(grid, 'case_id') + }, + success: function(){ + }, + failure: Testopia.Util.error + }); + } + var win = new Ext.Window({ + title: 'Add or Remove Bugs', + id: 'bugs_edit_win', + layout: 'fit', + split: true, + plain: true, + shadow: false, + listeners: {'afterlayout':function(){Ext.getCmp('bug_field').focus('',10);}}, + width: 350, + height: 150, + items: [new Ext.FormPanel({ + labelWidth: '40', + bodyStyle: 'padding: 5px', + items: [{ + xtype: 'textfield', + name: 'bugs', + id: 'bug_field', + fieldLabel: 'Bugs' + }] + })], + buttons: [{ + text: 'Attach Bug', + handler: function(){ + commitBug('attach', Ext.getCmp('bug_field').getValue(), grid); + win.close(); + } + }, { + text: 'Remove Bug', + handler: function(){ + commitBug('remove', Ext.getCmp('bug_field').getValue(), grid); + win.close(); + } + }, { + text: 'Close', + handler: function(){ + win.close(); + } + }] + }); + win.show(); +}; + +Testopia.TestCaseRun.History = function(){ + this.store = new Ext.data.JsonStore({ + url: 'tr_caserun.cgi', + listeners: { 'exception': Testopia.Util.loadError }, + baseParams: { + action: 'gethistory' + }, + root: 'records', + fields: [{ + name: 'caserun_id', + mapping: 'case_run_id' + }, { + name: 'build', + mapping: 'build_name' + }, { + name: 'environment', + mapping: 'env_name' + }, { + name: 'status', + mapping: 'status_name' + }, { + name: 'testedby', + mapping: 'testedby' + }, { + name: 'closed', + mapping: 'close_date' + }, { + name: 'isactive', + mapping: 'isactive' + }, { + name: "bug_list", + mapping: "bug_list" + }] + }); + this.columns = [{ + header: "Build", + width: 150, + dataIndex: 'build', + sortable: true + }, { + header: "Environment", + width: 150, + dataIndex: 'environment', + sortable: true + }, { + header: "Status", + width: 50, + dataIndex: 'status', + sortable: true, + renderer: Testopia.Util.displayStatusIcon + }, { + header: "Tested By", + width: 200, + dataIndex: 'testedby', + sortable: true + }, { + header: "Closed", + width: 150, + dataIndex: 'closed', + sortable: true + }, { + header: "Bugs In This Build and Environment", + width: 100, + dataIndex: "bug_list", + sortable: false, + hideable: true, + renderer: function(v){ + if (!v) { + return; + } + var bugs = v.bugs; + var rets = ''; + for (var i = 0; i < bugs.length; i++) { + if (typeof bugs[i] != 'function') { + rets = rets + '' + bugs[i].bug_id + ', '; + } + + } + return rets; + } + }]; + Testopia.TestCaseRun.History.superclass.constructor.call(this, { + border: false, + title: 'History', + id: 'caserun_history_panel', + bodyBorder: false, + loadMask: { + msg: 'Loading Test Cases...' + }, + autoScroll: true, + sm: new Ext.grid.RowSelectionModel({ + singleSelect: true + }) + }); + this.on('activate', this.onActivate, this); +}; + +Ext.extend(Testopia.TestCaseRun.History, Ext.grid.GridPanel, { + onActivate: function(event){ + this.store.load({ + params: { + action: 'gethistory', + caserun_id: Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('caserun_id') + } + + }); + } +}); + Testopia.TestCaseRun.StatusListStore = function(auto){ Testopia.TestCaseRun.StatusListStore.superclass.constructor.call(this, { url: 'tr_quicksearch.cgi', @@ -388,7 +1118,7 @@ Testopia.TestCaseRun.List = function(params, cfg){ { xtype: 'button', id: 'caserun_grid_tocsv', - icon: 'extensions/testopia/img/csv.png', + icon: 'extensions/Testopia/img/csv.png', iconCls: 'img_button_16x', tooltip: 'Export Results to CSV', handler: function(){ @@ -397,7 +1127,7 @@ Testopia.TestCaseRun.List = function(params, cfg){ },{ xtype: 'button', id: 'save_caserun_list_btn', - icon: 'extensions/testopia/img/save.png', + icon: 'extensions/Testopia/img/save.png', iconCls: 'img_button_16x', tooltip: 'Save this search', handler: function(b, e){ @@ -406,7 +1136,7 @@ Testopia.TestCaseRun.List = function(params, cfg){ }, { xtype: 'button', id: 'link_case_list_btn', - icon: 'extensions/testopia/img/link.png', + icon: 'extensions/Testopia/img/link.png', iconCls: 'img_button_16x', tooltip: 'Create a link to this list', handler: function(b, e){ @@ -787,7 +1517,7 @@ Testopia.TestCaseRun.Grid = function(params, run){ items: [{ xtype: 'button', template: imgButtonTpl, - text: 'extensions/testopia/img/IDLE.gif', + text: '', tooltip: 'Mark as IDLE (Not Run)', disabled: true, handler: function(){ @@ -799,7 +1529,7 @@ Testopia.TestCaseRun.Grid = function(params, run){ }, { xtype: 'button', template: imgButtonTpl, - text: 'extensions/testopia/img/PASSED.gif', + text: '', tooltip: 'Mark as PASSED', disabled: true, handler: function(){ @@ -812,7 +1542,7 @@ Testopia.TestCaseRun.Grid = function(params, run){ }, { xtype: 'button', template: imgButtonTpl, - text: 'extensions/testopia/img/FAILED.gif', + text: '', tooltip: 'Mark as FAILED', disabled: true, handler: function(){ @@ -825,7 +1555,7 @@ Testopia.TestCaseRun.Grid = function(params, run){ }, { xtype: 'button', template: imgButtonTpl, - text: 'extensions/testopia/img/RUNNING.gif', + text: '', tooltip: 'Mark as RUNNING', disabled: true, handler: function(){ @@ -838,7 +1568,7 @@ Testopia.TestCaseRun.Grid = function(params, run){ break; } } - if (isowner == 0) { + if (isowner === 0) { Ext.Msg.show({ title: "Reassign Test Case?", msg: 'Setting this test case to Running will lock it so that only the assignee can update it. Would you like to make yourself the assignee?', @@ -867,7 +1597,7 @@ Testopia.TestCaseRun.Grid = function(params, run){ }, { xtype: 'button', template: imgButtonTpl, - text: 'extensions/testopia/img/PAUSED.gif', + text: '', tooltip: 'Mark as PAUSED', disabled: true, handler: function(){ @@ -879,7 +1609,7 @@ Testopia.TestCaseRun.Grid = function(params, run){ }, { xtype: 'button', template: imgButtonTpl, - text: 'extensions/testopia/img/BLOCKED.gif', + text: '', tooltip: 'Mark as BLOCKED', disabled: true, handler: function(){ @@ -891,7 +1621,7 @@ Testopia.TestCaseRun.Grid = function(params, run){ }, { xtype: 'button', template: imgButtonTpl, - text: 'extensions/testopia/img/ERROR.gif', + text: '', tooltip: 'Mark as ERROR', disabled: true, handler: function(){ @@ -907,7 +1637,7 @@ Testopia.TestCaseRun.Grid = function(params, run){ { xtype: 'button', id: 'caserun_grid_tocsv', - icon: 'extensions/testopia/img/csv.png', + icon: 'extensions/Testopia/img/csv.png', iconCls: 'img_button_16x', tooltip: 'Export Results to CSV', handler: function(){ @@ -917,7 +1647,7 @@ Testopia.TestCaseRun.Grid = function(params, run){ xtype: 'button', id: 'add_case_to_run_btn', tooltip: "Add cases to this run", - icon: 'extensions/testopia/img/add.png', + icon: 'extensions/Testopia/img/add.png', iconCls: 'img_button_16x', handler: function(){ Testopia.TestRun.AddCasePopup(run); @@ -926,7 +1656,7 @@ Testopia.TestCaseRun.Grid = function(params, run){ xtype: 'button', id: 'new_case_to_run_btn', tooltip: "Create a new case and add it to this run", - icon: 'extensions/testopia/img/new.png', + icon: 'extensions/Testopia/img/new.png', iconCls: 'img_button_16x', handler: function(){ Testopia.TestCase.NewCasePopup(run.plan_id, run.product_id, run.run_id); @@ -934,7 +1664,7 @@ Testopia.TestCaseRun.Grid = function(params, run){ }, { xtype: 'button', id: 'caserun_grid_edit_btn', - icon: 'extensions/testopia/img/edit.png', + icon: 'extensions/Testopia/img/edit.png', iconCls: 'img_button_16x', tooltip: 'Edit Selected Test Case', handler: function(){ @@ -943,7 +1673,7 @@ Testopia.TestCaseRun.Grid = function(params, run){ }, { xtype: 'button', id: 'caserun_grid_delete_btn', - icon: 'extensions/testopia/img/delete.png', + icon: 'extensions/Testopia/img/delete.png', iconCls: 'img_button_16x', tooltip: 'Remove Selected Test Cases from This Run', handler: this.deleteList.createDelegate(this) @@ -1006,7 +1736,7 @@ Testopia.TestCaseRun.Grid = function(params, run){ return; } var sel = []; - for (i = 0; i < sm.grid.store.data.items.length; i++) { + for (var i = 0; i < sm.grid.store.data.items.length; i++) { if (sm.grid.getSelectionModel().isSelected(i)) { sel.push(sm.grid.store.getAt(i).get('case_id')); } @@ -1063,7 +1793,7 @@ Ext.extend(Testopia.TestCaseRun.Grid, Ext.grid.EditorGridPanel, { id: 'caserun-ctx-menu', items: [{ text: 'Change', - icon: 'extensions/testopia/img/edit.png', + icon: 'extensions/Testopia/img/edit.png', iconCls: 'img_button_16x', menu: { items: [{ @@ -1076,7 +1806,7 @@ Ext.extend(Testopia.TestCaseRun.Grid, Ext.grid.EditorGridPanel, { shadow: false, width: 320, height: 150, - listeners: {'afterlayout':function(){Ext.getCmp('multi_build').focus('',10)}}, + listeners: {'afterlayout':function(){Ext.getCmp('multi_build').focus('',10);}}, layout: 'form', bodyStyle: 'padding: 5px', items: [new Testopia.Build.Combo({ @@ -1121,7 +1851,7 @@ Ext.extend(Testopia.TestCaseRun.Grid, Ext.grid.EditorGridPanel, { shadow: false, width: 320, height: 150, - listeners: {'afterlayout':function(){Ext.getCmp('multi_env').focus('',10)}}, + listeners: {'afterlayout':function(){Ext.getCmp('multi_env').focus('',10);}}, layout: 'form', bodyStyle: 'padding: 5px', items: [new Testopia.Environment.Combo({ @@ -1166,7 +1896,7 @@ Ext.extend(Testopia.TestCaseRun.Grid, Ext.grid.EditorGridPanel, { shadow: false, width: 320, height: 150, - listeners: {'afterlayout':function(){Ext.getCmp('multi_priority').focus('',10)}}, + listeners: {'afterlayout':function(){Ext.getCmp('multi_priority').focus('',10);}}, layout: 'form', bodyStyle: 'padding: 5px', items: [new Testopia.TestCase.PriorityCombo({ @@ -1203,7 +1933,7 @@ Ext.extend(Testopia.TestCaseRun.Grid, Ext.grid.EditorGridPanel, { shadow: false, width: 300, height: 150, - listeners: {'afterlayout':function(){Ext.getCmp('multi_category').focus('',10)}}, + listeners: {'afterlayout':function(){Ext.getCmp('multi_category').focus('',10);}}, items: [new Testopia.Category.Combo({ fieldLabel: 'Category', id: 'multi_category', @@ -1239,7 +1969,7 @@ Ext.extend(Testopia.TestCaseRun.Grid, Ext.grid.EditorGridPanel, { shadow: false, width: 320, height: 150, - listeners: {'afterlayout':function(){Ext.getCmp('multi_assignee').focus('',10)}}, + listeners: {'afterlayout':function(){Ext.getCmp('multi_assignee').focus('',10);}}, layout: 'form', bodyStyle: 'padding: 5px', items: [new Testopia.User.Lookup({ @@ -1274,7 +2004,7 @@ Ext.extend(Testopia.TestCaseRun.Grid, Ext.grid.EditorGridPanel, { } }, { text: 'Remove Selected Cases', - icon: 'extensions/testopia/img/delete.png', + icon: 'extensions/Testopia/img/delete.png', iconCls: 'img_button_16x', handler: this.deleteList.createDelegate(this) }, { @@ -1313,7 +2043,7 @@ Ext.extend(Testopia.TestCaseRun.Grid, Ext.grid.EditorGridPanel, { } }, { text: 'Refresh List', - icon: 'extensions/testopia/img/refresh.png', + icon: 'extensions/Testopia/img/refresh.png', iconCls: 'img_button_16x', handler: function(){ grid.store.reload(); @@ -1567,13 +2297,14 @@ Testopia.TestCaseRun.Info = function(){ }, failure: Testopia.Util.error }); - } + }; var summary_tb = new Ext.Toolbar({ id: 'summary_tb', disabled: true, - items: [new Ext.Button({ + items: [{ template: imgButtonTpl, - text: 'extensions/testopia/img/IDLE.gif', + xtype: 'button', + text: '', tooltip: 'Mark as IDLE (Not Run)', handler: function(){ Testopia.Util.updateFromList('caserun', { @@ -1581,9 +2312,10 @@ Testopia.TestCaseRun.Info = function(){ ids: Testopia.Util.getSelectedObjects(Ext.getCmp('caserun_grid'), 'caserun_id') }, Ext.getCmp('caserun_grid')); } - }), new Ext.Button({ + }, { template: imgButtonTpl, - text: 'extensions/testopia/img/PASSED.gif', + xtype: 'button', + text: '', tooltip: 'Mark as PASSED', handler: function(){ Testopia.Util.updateFromList('caserun', { @@ -1592,9 +2324,10 @@ Testopia.TestCaseRun.Info = function(){ update_bug: Ext.getCmp('update_bugs').getValue() }, Ext.getCmp('caserun_grid')); } - }), new Ext.Button({ + }, { template: imgButtonTpl, - text: 'extensions/testopia/img/FAILED.gif', + xtype: 'button', + text: '', tooltip: 'Mark as FAILED', handler: function(){ Testopia.Util.updateFromList('caserun', { @@ -1603,9 +2336,10 @@ Testopia.TestCaseRun.Info = function(){ update_bug: Ext.getCmp('update_bugs').getValue() }, Ext.getCmp('caserun_grid')); } - }), new Ext.Button({ + }, { template: imgButtonTpl, - text: 'extensions/testopia/img/RUNNING.gif', + xtype: 'button', + text: '', tooltip: 'Mark as RUNNING', handler: function(){ var reassign = 0; @@ -1617,7 +2351,7 @@ Testopia.TestCaseRun.Info = function(){ break; } } - if (isowner == 0) { + if (isowner === 0) { Ext.Msg.show({ title: "Reassign Test Case?", msg: 'Setting this test case to Running will lock it so that only the assignee can update it. Would you like to make yourself the assignee?', @@ -1643,9 +2377,10 @@ Testopia.TestCaseRun.Info = function(){ }, Ext.getCmp('caserun_grid')); } } - }), new Ext.Button({ + }, { template: imgButtonTpl, - text: 'extensions/testopia/img/PAUSED.gif', + xtype: 'button', + text: '', tooltip: 'Mark as PAUSED', handler: function(){ Testopia.Util.updateFromList('caserun', { @@ -1653,9 +2388,10 @@ Testopia.TestCaseRun.Info = function(){ ids: Testopia.Util.getSelectedObjects(Ext.getCmp('caserun_grid'), 'caserun_id') }, Ext.getCmp('caserun_grid')); } - }), new Ext.Button({ + }, { template: imgButtonTpl, - text: 'extensions/testopia/img/BLOCKED.gif', + xtype: 'button', + text: '', tooltip: 'Mark as BLOCKED', handler: function(){ Testopia.Util.updateFromList('caserun', { @@ -1663,9 +2399,10 @@ Testopia.TestCaseRun.Info = function(){ ids: Testopia.Util.getSelectedObjects(Ext.getCmp('caserun_grid'), 'caserun_id') }, Ext.getCmp('caserun_grid')); } - }), new Ext.Button({ + }, { template: imgButtonTpl, - text: 'extensions/testopia/img/ERROR.gif', + xtype: 'button', + text: '', tooltip: 'Mark as ERROR', handler: function(){ Testopia.Util.updateFromList('caserun', { @@ -1673,7 +2410,7 @@ Testopia.TestCaseRun.Info = function(){ ids: Testopia.Util.getSelectedObjects(Ext.getCmp('caserun_grid'), 'caserun_id') }, Ext.getCmp('caserun_grid')); } - }), new Ext.Toolbar.TextItem({text:'', id:'caserun_tb_summary'})] + }, new Ext.Toolbar.TextItem({text:'', id:'caserun_tb_summary'})] }); Testopia.TestCaseRun.Info.superclass.constructor.call(this, { id: 'case_details_panel', @@ -1792,7 +2529,7 @@ Testopia.TestCaseRun.Info = function(){ xtype: 'textfield', id: 'caserun_append_note_fld', listeners: {'afterrender': function(){ - this.setWidth(Ext.getCmp('caserun_notes_panel').container.getWidth() - 150) + this.setWidth(Ext.getCmp('caserun_notes_panel').container.getWidth() - 150); }}, width: 650 }, { @@ -1800,740 +2537,15 @@ Testopia.TestCaseRun.Info = function(){ text: 'Append Note', handler: appendNote.createDelegate(this) }] - }, new Testopia.TestCaseRun.History(), new Testopia.Attachment.Grid({ - id: 0, - type: 'caserun' - }), new Testopia.TestCase.Bugs.Grid(), new Testopia.TestCase.Components(), new Testopia.Tags.ObjectTags('case', 0)] + }, + new Testopia.TestCaseRun.History(), + new Testopia.Attachment.Grid({id: 0,type: 'caserun'}), + new Testopia.TestCase.Bugs.Grid('caserun_bugs_grid'), + new Testopia.TestCase.Components(), + new Testopia.Tags.ObjectTags('case', 0) + ] }] }); }; Ext.extend(Testopia.TestCaseRun.Info, Ext.Panel, this); -Testopia.TestCaseRun.History = function(){ - this.store = new Ext.data.JsonStore({ - url: 'tr_caserun.cgi', - listeners: { 'exception': Testopia.Util.loadError }, - baseParams: { - action: 'gethistory' - }, - root: 'records', - fields: [{ - name: 'caserun_id', - mapping: 'case_run_id' - }, { - name: 'build', - mapping: 'build_name' - }, { - name: 'environment', - mapping: 'env_name' - }, { - name: 'status', - mapping: 'status_name' - }, { - name: 'testedby', - mapping: 'testedby' - }, { - name: 'closed', - mapping: 'close_date' - }, { - name: 'isactive', - mapping: 'isactive' - }, { - name: "bug_list", - mapping: "bug_list" - }] - }); - this.columns = [{ - header: "Build", - width: 150, - dataIndex: 'build', - sortable: true - }, { - header: "Environment", - width: 150, - dataIndex: 'environment', - sortable: true - }, { - header: "Status", - width: 50, - dataIndex: 'status', - sortable: true, - renderer: Testopia.Util.displayStatusIcon - }, { - header: "Tested By", - width: 200, - dataIndex: 'testedby', - sortable: true - }, { - header: "Closed", - width: 150, - dataIndex: 'closed', - sortable: true - }, { - header: "Bugs In This Build and Environment", - width: 100, - dataIndex: "bug_list", - sortable: false, - hideable: true, - renderer: function(v){ - if (!v) { - return; - } - var bugs = v.bugs; - var rets = ''; - for (var i = 0; i < bugs.length; i++) { - if (typeof bugs[i] != 'function') { - rets = rets + '' + bugs[i].bug_id + ', '; - } - - } - return rets; - } - }]; - Testopia.TestCaseRun.History.superclass.constructor.call(this, { - border: false, - title: 'History', - id: 'caserun_history_panel', - bodyBorder: false, - loadMask: { - msg: 'Loading Test Cases...' - }, - autoScroll: true, - sm: new Ext.grid.RowSelectionModel({ - singleSelect: true - }) - }); - this.on('activate', this.onActivate, this); -}; - -Ext.extend(Testopia.TestCaseRun.History, Ext.grid.GridPanel, { - onActivate: function(event){ - this.store.load({ - params: { - action: 'gethistory', - caserun_id: Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('caserun_id') - } - - }); - } -}); - -Testopia.TestCase.Bugs.Grid = function(id){ - var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {}); - function bug_link(id){ - return '' + id + ''; - } - - var tcid; - if (id) { - tcid = id; - } - - this.tcid = tcid; - this.store = new Ext.data.JsonStore({ - url: 'tr_process_case.cgi', - root: 'bugs', - listeners: { 'exception': Testopia.Util.loadError }, - baseParams: { - action: 'getbugs' - }, - fields: [{ - name: 'run_id', - mapping: 'run_id' - }, { - name: 'build', - mapping: 'build' - }, { - name: 'env', - mapping: 'env' - }, { - name: 'summary', - mapping: 'summary' - }, { - name: 'case_run_id', - mapping: 'case_run_id' - }, { - name: 'bug_id', - mapping: 'bug_id' - }, { - name: 'status', - mapping: 'status' - }, { - name: 'resolution', - mapping: 'resolution' - }, { - name: 'assignee', - mapping: 'assignee' - }, { - name: 'severity', - mapping: 'severity' - }, { - name: 'priority', - mapping: 'priority' - }] - }); - addbug = function(){ - tcid = this.tcid; - var ids; - var type = 'case'; - if (Ext.getCmp('caserun_grid')) { - type = 'caserun'; - ids = Testopia.Util.getSelectedObjects(Ext.getCmp('caserun_grid'), 'caserun_id'); - } - else { - ids = tcid; - } - testopia_form.submit({ - url: 'tr_list_cases.cgi', - params: { - action: 'update_bugs', - bug_action: 'attach', - bugs: Ext.getCmp('attachbug').getValue(), - type: type, - ids: ids - }, - success: function(){ - ds.load({ - params: { - case_id: tcid - } - }); - Ext.getCmp('attachbug').reset(); - }, - failure: Testopia.Util.error - }); - }; - removebug = function(){ - tcid = this.tcid; - var type = 'case'; - if (Ext.getCmp('caserun_grid')) { - type = 'caserun'; - ids = Testopia.Util.getSelectedObjects(Ext.getCmp('caserun_grid'), 'caserun_id'); - } - else { - ids = tcid; - } - testopia_form.submit({ - url: 'tr_list_cases.cgi', - params: { - action: 'update_bugs', - bugs: Testopia.Util.getSelectedObjects(Ext.getCmp('case_bugs_panel'), 'bug_id'), - type: type, - ids: ids - }, - success: function(){ - ds.load({ - params: { - case_id: tcid - } - }); - }, - failure: Testopia.Util.error - }); - }; - newbug = function(){ - var bug_panel = new Ext.Panel({ - id: 'new_bug_panel' - }); - var caserun_id; - if (Ext.getCmp('caserun_grid') && Ext.getCmp('caserun_grid').getSelectionModel().getCount()) { - caserun_id = Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('caserun_id'); - } - - var store = new Ext.data.Store({ - url: 'tr_process_case.cgi', - baseParams: { - action: 'case_to_bug', - case_id: this.tcid, - caserun_id: caserun_id - }, - reader: new Ext.data.XmlReader({ - record: 'newbug', - id: 'case_id' - }, [{ - name: 'product', - mapping: 'product' - }, { - name: 'version', - mapping: 'version' - }, { - name: 'component', - mapping: 'component' - }, { - name: 'comment', - mapping: 'comment' - }, { - name: 'case_id', - mapping: 'case_id' - }, { - name: 'assigned_to', - mapping: 'assigned_to' - }, { - name: 'qa_contact', - mapping: 'qa_contact' - }, { - name: 'short_desc', - mapping: 'short_desc' - }]) - }); - store.load(); - store.on('load', function(){ -// var url = 'enter_bug.cgi?'; - var f = document.createElement("form"); - f.setAttribute("method", "post"); - f.setAttribute("action", "enter_bug.cgi"); - f.setAttribute("target", "_blank"); - - for (var i = 0; i < store.fields.keys.length; i++) { -// url = url + store.fields.keys[i] + '=' + escape(store.getAt(0).get(store.fields.keys[i])) + '&'; - if (store.fields.keys[i] == 'comment'){ - h = document.createElement("textarea"); - h.setAttribute("name", store.fields.keys[i]); - h.value = store.getAt(0).get(store.fields.keys[i]); - } - else { - h = document.createElement("input"); - h.setAttribute("name", store.fields.keys[i]); - txt = store.getAt(0).get(store.fields.keys[i]).replace(/\n/,' '); - h.setAttribute("value", store.getAt(0).get(store.fields.keys[i])); - } - f.appendChild(h); - } - h = document.createElement("input"); - h.setAttribute("name", "caserun_id"); - h.setAttribute("value", caserun_id); - f.appendChild(h); - document.body.appendChild(f); - f.submit(); -// url = url + 'caserun_id=' + caserun_id; -// window.open(url); - }); - }; - var ds = this.store; - this.columns = [{ - header: "Bug", - width: 150, - dataIndex: 'bug_id', - sortable: true, - renderer: bug_link - }, { - header: "Found In Run", - width: 50, - dataIndex: 'run_id', - sortable: true, - renderer: Testopia.Util.makeLink.createDelegate(this,['run'],true) - }, { - header: "With Build", - width: 50, - dataIndex: 'build', - sortable: true - }, { - header: "Environment", - width: 50, - dataIndex: 'env', - sortable: true - }, { - id: 'bugs_summary', - header: "Summary", - width: 200, - dataIndex: 'summary', - sortable: true - }, { - header: "Status", - width: 50, - dataIndex: 'status', - sortable: true - }, { - header: "Resolution", - width: 50, - dataIndex: 'resolution', - sortable: true - }, { - header: "Severity", - width: 50, - dataIndex: 'severity', - sortable: true - }, { - header: "Asignee", - width: 150, - dataIndex: 'assignee', - sortable: true - }, { - header: "Priority", - width: 50, - dataIndex: 'priority', - sortable: true - }]; - Testopia.TestCase.Bugs.Grid.superclass.constructor.call(this, { - tbar: [new Ext.form.TextField({ - width: 50, - id: 'attachbug' - }), { - xtype: 'button', - tooltip: "Attach a Bug", - icon: 'extensions/testopia/img/add.png', - iconCls: 'img_button_16x', - handler: addbug.createDelegate(this) - }, { - xtype: 'button', - tooltip: "File new Bug", - icon: 'extensions/testopia/img/new.png', - iconCls: 'img_button_16x', - handler: newbug.createDelegate(this) - }, { - xtype: 'button', - tooltip: "Remove selected bugs from test case or run", - icon: 'extensions/testopia/img/delete.png', - iconCls: 'img_button_16x', - handler: removebug.createDelegate(this) - }, '-', 'This view includes all bugs attached to the selected test case regardless of run'], - border: false, - title: 'Bugs', - id: 'case_bugs_panel', - bodyBorder: false, - autoExpandColumn: 'bugs_summary', - loadMask: { - msg: 'Loading...' - }, - autoScroll: true, - sm: new Ext.grid.RowSelectionModel({ - singleSelect: true - }) - }); - this.on('rowcontextmenu', this.onContextClick, this); - this.on('activate', this.onActivate, this); -}; -Ext.extend(Testopia.TestCase.Bugs.Grid, Ext.grid.GridPanel, { - onContextClick: function(grid, index, e){ - this.menu = new Ext.menu.Menu({ - id: 'tags-ctx-menu', - items: [{ - text: 'Refresh List', - icon: 'extensions/testopia/img/refresh.png', - iconCls: 'img_button_16x', - handler: function(){ - grid.store.reload(); - } - }, { - text: 'Attach Selected Bug to Current Run/Build/Environment', - id: 'reattach_bug', - icon: 'extensions/testopia/img/add.png', - disabled: Ext.getCmp('caserun_grid') ? false : true, - iconCls: 'img_button_16x', - handler: function(){ - var r = grid.store.getAt(index); - var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {}); - testopia_form.submit({ - url: 'tr_list_cases.cgi', - params: { - action: 'update_bugs', - bug_action: 'attach', - bugs: Testopia.Util.getSelectedObjects(Ext.getCmp('case_bugs_panel'), 'bug_id'), - type: 'caserun', - ids: Testopia.Util.getSelectedObjects(Ext.getCmp('caserun_grid'), 'caserun_id') - }, - success: function(){ - Ext.getCmp('caserun_grid').store.reload(); - grid.store.reload(); - Ext.getCmp('attachbug').reset(); - }, - failure: Testopia.Util.error - }); - } - }] - }); - e.stopEvent(); - if (grid.getSelectionModel().getCount() < 1) { - grid.getSelectionModel().selectRow(index); - } - this.menu.showAt(e.getXY()); - }, - onActivate: function(event){ - this.store.load({ - params: { - case_id: this.tcid - } - }); - } -}); - -Testopia.TestCase.Components = function(id){ - var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {}); - var tcid; - var product_id; - if (id) { - tcid = id; - } - else { - if (Ext.getCmp('caserun_grid').getSelectionModel().getCount()) { - tcid = Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('case_id'); - } - } - try { - if (run) { - product_id = run.plan.product_id; - } - } - catch (err) { - try{ - if (tcase) { - product_id = tcase.product_id; - } - } - catch (e) {} - } - this.tcid = tcid; - this.store = new Ext.data.JsonStore({ - url: 'tr_process_case.cgi', - root: 'comps', - listeners: { 'exception': Testopia.Util.loadError }, - baseParams: { - action: 'getcomponents' - }, - id: 'component_id', - fields: [{ - name: 'name', - mapping: 'name' - }, { - name: 'id', - mapping: 'id' - }, { - name: 'product', - mapping: 'product' - }] - }); - var ds = this.store; - this.columns = [{ - header: "ID", - width: 150, - dataIndex: 'id', - sortable: false, - hidden: true - }, { - id: 'comp_name', - header: "Component", - width: 150, - dataIndex: 'name', - sortable: true - }, { - id: 'product', - header: "Product", - width: 150, - dataIndex: 'product', - sortable: true - }]; - - var pchooser = new Testopia.Product.Combo({ - id: 'comp_product_chooser', - mode: 'local', - value: product_id - }); - var compchooser = new Testopia.TestCase.ComponentCombo({ - params: { - product_id: product_id - } - }); - this.pchooser = pchooser; - pchooser.on('select', function(){ - compchooser.reset(); - compchooser.store.baseParams = { - product_id: pchooser.getValue(), - action: 'getcomponents' - }; - compchooser.store.load(); - }); - addcomp = function(){ - tcid = this.tcid; - if (typeof tcid == 'object') { - testopia_form.submit({ - url: 'tr_list_cases.cgi', - params: { - action: 'update', - comp_action: 'add', - components: compchooser.getValue(), - ids: Testopia.Util.getSelectedObjects(tcid, 'case_id') - }, - success: function(){ - Testopia.Util.notify.msg('Component Added', 'Added component {0} to {1} cases(s)', compchooser.getRawValue(), tcid.getSelectionModel().getCount()); - }, - failure: Testopia.Util.error - }); - return; - } - testopia_form.submit({ - url: 'tr_process_case.cgi', - params: { - action: 'addcomponent', - component_id: compchooser.getValue(), - case_id: this.tcid - }, - success: function(){ - ds.load({ - params: { - case_id: tcid - } - }); - }, - failure: Testopia.Util.error - }); - }; - removecomp = function(){ - tcid = this.tcid; - if (typeof tcid == 'object') { - testopia_form.submit({ - url: 'tr_list_cases.cgi', - params: { - action: 'update', - comp_action: 'rem', - components: compchooser.getValue(), - ids: Testopia.Util.getSelectedObjects(tcid, 'case_id') - }, - success: function(){ - Testopia.Util.notify.msg('Component Removed', 'Removed component {0} from {1} cases(s)', compchooser.getRawValue(), tcid.getSelectionModel().getCount()); - }, - failure: Testopia.Util.error - }); - return; - } - testopia_form.submit({ - url: 'tr_process_case.cgi', - params: { - action: 'removecomponent', - component_id: Testopia.Util.getSelectedObjects(Ext.getCmp('case_comps_panel'), 'id'), - case_id: this.tcid - }, - success: function(){ - ds.load({ - params: { - case_id: tcid - } - }); - }, - failure: Testopia.Util.error - }); - }; - Testopia.TestCase.Components.superclass.constructor.call(this, { - tbar: [pchooser, compchooser, { - xtype: 'button', - tooltip: "Attach selected component", - icon: 'extensions/testopia/img/add.png', - iconCls: 'img_button_16x', - handler: addcomp.createDelegate(this) - }, { - xtype: 'button', - tooltip: "Remove component from test case", - icon: 'extensions/testopia/img/delete.png', - iconCls: 'img_button_16x', - handler: removecomp.createDelegate(this) - - }], - border: false, - title: 'Components', - id: 'case_comps_panel', - bodyBorder: false, - autoExpandColumn: 'comp_name', - loadMask: { - msg: 'Loading...' - }, - autoScroll: true, - sm: new Ext.grid.RowSelectionModel({ - singleSelect: false - }) - }); - this.on('rowcontextmenu', this.onContextClick, this); - this.on('activate', this.onActivate, this); -}; -Ext.extend(Testopia.TestCase.Components, Ext.grid.GridPanel, { - onContextClick: function(grid, index, e){ - if (!this.menu) { // create context menu on first right click - this.menu = new Ext.menu.Menu({ - id: 'tags-ctx-menu', - items: [{ - text: 'Refresh List', - icon: 'extensions/testopia/img/refresh.png', - iconCls: 'img_button_16x', - handler: function(){ - grid.store.reload(); - } - }] - }); - } - e.stopEvent(); - if (grid.getSelectionModel().getCount() < 1) { - grid.getSelectionModel().selectRow(index); - } - this.menu.showAt(e.getXY()); - }, - onActivate: function(event){ - this.store.load({ - params: { - case_id: this.tcid - }, - callback: function(r, o, s){ - if (s === false) { - Testopia.Util.loadError(); - } - } - }); - this.pchooser.store.load(); - } -}); - -Testopia.TestCase.Bugs.update = function(grid){ - function commitBug(action, value, grid){ - var form = new Ext.form.BasicForm('testopia_helper_frm', {}); - form.submit({ - url: 'tr_list_cases.cgi', - params: { - action: 'update_bugs', - bug_action: action, - bugs: value, - type: 'case', - ids: Testopia.Util.getSelectedObjects(grid, 'case_id') - }, - success: function(){ - }, - failure: Testopia.Util.error - }); - } - var win = new Ext.Window({ - title: 'Add or Remove Bugs', - id: 'bugs_edit_win', - layout: 'fit', - split: true, - plain: true, - shadow: false, - listeners: {'afterlayout':function(){Ext.getCmp('bug_field').focus('',10)}}, - width: 350, - height: 150, - items: [new Ext.FormPanel({ - labelWidth: '40', - bodyStyle: 'padding: 5px', - items: [{ - xtype: 'textfield', - name: 'bugs', - id: 'bug_field', - fieldLabel: 'Bugs' - }] - })], - buttons: [{ - text: 'Attach Bug', - handler: function(){ - commitBug('attach', Ext.getCmp('bug_field').getValue(), grid); - win.close(); - } - }, { - text: 'Remove Bug', - handler: function(){ - commitBug('remove', Ext.getCmp('bug_field').getValue(), grid); - win.close(); - } - }, { - text: 'Close', - handler: function(){ - win.close(); - } - }] - }); - win.show(); -}; diff --git a/mozilla/webtools/testopia/extensions/testopia/js/category.js b/mozilla/webtools/testopia/extensions/Testopia/js/category.js similarity index 96% rename from mozilla/webtools/testopia/extensions/testopia/js/category.js rename to mozilla/webtools/testopia/extensions/Testopia/js/category.js index d5d9ef5d8cf..a96f3cfa73c 100644 --- a/mozilla/webtools/testopia/extensions/testopia/js/category.js +++ b/mozilla/webtools/testopia/extensions/Testopia/js/category.js @@ -118,7 +118,7 @@ Testopia.Category.Grid = function(product_id){ tbar: [new Ext.Toolbar.Fill(), { xtype: 'button', id: 'edit_category_btn', - icon: 'extensions/testopia/img/edit.png', + icon: 'extensions/Testopia/img/edit.png', iconCls: 'img_button_16x', tooltip: 'Edit Selected Category', handler: function(){ @@ -127,13 +127,13 @@ Testopia.Category.Grid = function(product_id){ }, { xtype: 'button', id: 'add_category_btn', - icon: 'extensions/testopia/img/add.png', + icon: 'extensions/Testopia/img/add.png', iconCls: 'img_button_16x', tooltip: 'Add a new Category', handler: this.newRecord }, { xtype: 'button', - icon: 'extensions/testopia/img/delete.png', + icon: 'extensions/Testopia/img/delete.png', iconCls: 'img_button_16x', tooltip: 'Delete this Category', handler: function(){ @@ -177,19 +177,19 @@ Ext.extend(Testopia.Category.Grid, Ext.grid.GridPanel, { enableScrolling: false, items: [{ text: 'Add a Category', - icon: 'extensions/testopia/img/add.png', + icon: 'extensions/Testopia/img/add.png', iconCls: 'img_button_16x', handler: this.newRecord }, { text: 'Edit This Category', - icon: 'extensions/testopia/img/edit.png', + icon: 'extensions/Testopia/img/edit.png', iconCls: 'img_button_16x', handler: function(){ Testopia.Util.editFirstSelection(grid); } }, { text: 'Refresh', - icon: 'extensions/testopia/img/refresh.png', + icon: 'extensions/Testopia/img/refresh.png', iconCls: 'img_button_16x', handler: function(){ grid.store.reload(); diff --git a/mozilla/webtools/testopia/extensions/testopia/js/diff-tabs.js b/mozilla/webtools/testopia/extensions/Testopia/js/diff-tabs.js similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/js/diff-tabs.js rename to mozilla/webtools/testopia/extensions/Testopia/js/diff-tabs.js diff --git a/mozilla/webtools/testopia/extensions/testopia/js/environment.js b/mozilla/webtools/testopia/extensions/Testopia/js/environment.js similarity index 98% rename from mozilla/webtools/testopia/extensions/testopia/js/environment.js rename to mozilla/webtools/testopia/extensions/Testopia/js/environment.js index 5a42d48fc70..f96b1d2964a 100644 --- a/mozilla/webtools/testopia/extensions/testopia/js/environment.js +++ b/mozilla/webtools/testopia/extensions/Testopia/js/environment.js @@ -171,7 +171,7 @@ Testopia.Environment.Grid = function(params, cfg){ }, new Ext.Toolbar.Fill(), { xtype: 'button', id: 'add_env_list_btn', - icon: 'extensions/testopia/img/add.png', + icon: 'extensions/Testopia/img/add.png', iconCls: 'img_button_16x', tooltip: 'Add an Environment', handler: this.createEnv.createDelegate(this, ['', 'add']) @@ -179,7 +179,7 @@ Testopia.Environment.Grid = function(params, cfg){ xtype: 'button', id: 'clone_env_list_btn', disabled: true, - icon: 'extensions/testopia/img/copy.png', + icon: 'extensions/Testopia/img/copy.png', iconCls: 'img_button_16x', tooltip: 'Clone this Environment', handler: this.cloneEnv.createDelegate(this) @@ -187,7 +187,7 @@ Testopia.Environment.Grid = function(params, cfg){ xtype: 'button', id: 'delete_env_list_btn', disabled: true, - icon: 'extensions/testopia/img/delete.png', + icon: 'extensions/Testopia/img/delete.png', iconCls: 'img_button_16x', tooltip: 'Delete this Environment', handler: this.deleteEnv.createDelegate(this) @@ -216,7 +216,7 @@ Ext.extend(Testopia.Environment.Grid, Ext.grid.EditorGridPanel, { handler: this.deleteEnv.createDelegate(this) }, { text: 'Refresh List', - icon: 'extensions/testopia/img/refresh.png', + icon: 'extensions/Testopia/img/refresh.png', iconCls: 'img_button_16x', handler: function(){ grid.store.reload(); diff --git a/mozilla/webtools/testopia/extensions/testopia/js/plan.js b/mozilla/webtools/testopia/extensions/Testopia/js/plan.js similarity index 98% rename from mozilla/webtools/testopia/extensions/testopia/js/plan.js rename to mozilla/webtools/testopia/extensions/Testopia/js/plan.js index d1ba8f67496..76ba54eef66 100644 --- a/mozilla/webtools/testopia/extensions/testopia/js/plan.js +++ b/mozilla/webtools/testopia/extensions/Testopia/js/plan.js @@ -329,7 +329,7 @@ Testopia.TestPlan.Grid = function(params, cfg){ }, new Ext.Toolbar.Fill(), { xtype: 'button', id: 'save_plan_list_btn', - icon: 'extensions/testopia/img/save.png', + icon: 'extensions/Testopia/img/save.png', iconCls: 'img_button_16x', tooltip: 'Save this search', handler: function(b, e){ @@ -338,7 +338,7 @@ Testopia.TestPlan.Grid = function(params, cfg){ }, { xtype: 'button', id: 'link_plan_list_btn', - icon: 'extensions/testopia/img/link.png', + icon: 'extensions/Testopia/img/link.png', iconCls: 'img_button_16x', tooltip: 'Create a link to this list', handler: function(b, e){ @@ -347,7 +347,7 @@ Testopia.TestPlan.Grid = function(params, cfg){ }, { xtype: 'button', id: 'edit_plan_list_btn', - icon: 'extensions/testopia/img/edit.png', + icon: 'extensions/Testopia/img/edit.png', iconCls: 'img_button_16x', disabled: true, tooltip: 'Edit Selected Test Plan', @@ -357,7 +357,7 @@ Testopia.TestPlan.Grid = function(params, cfg){ }, { xtype: 'button', id: 'new_plan_list_btn', - icon: 'extensions/testopia/img/new.png', + icon: 'extensions/Testopia/img/new.png', iconCls: 'img_button_16x', tooltip: 'Create a New Test Plan', handler: function(){ @@ -385,7 +385,7 @@ Ext.extend(Testopia.TestPlan.Grid, Ext.grid.GridPanel, { items: [{ text: 'Create a New Test Plan', id: 'plan_menu_new_plan', - icon: 'extensions/testopia/img/new.png', + icon: 'extensions/Testopia/img/new.png', iconCls: 'img_button_16x', handler: this.newPlan.createDelegate(this) }, { @@ -620,7 +620,7 @@ Ext.extend(Testopia.TestPlan.Grid, Ext.grid.GridPanel, { } }, { text: 'Refresh List', - icon: 'extensions/testopia/img/refresh.png', + icon: 'extensions/Testopia/img/refresh.png', iconCls: 'img_button_16x', handler: function(){ grid.store.reload(); @@ -682,7 +682,7 @@ Ext.extend(Testopia.TestPlan.Grid, Ext.grid.GridPanel, { newCase: function(){ var form = new Ext.form.BasicForm('testopia_helper_frm', {}); var p = {plan_id: Testopia.Util.getSelectedObjects(this, 'plan_id'), action: 'check_plan_rights'}; - var records = this.getSelectionModel().getSelected(); + var records = Testopia.Util.getSelectedObjects(this, 'plan_id') var prod = this.getSelectionModel().getSelected().get('product_id'); form.submit({ url: 'tr_quicksearch.cgi', @@ -878,6 +878,7 @@ Testopia.TestPlan.ClonePanel = function(plan){ id: 'plan_clone_build_chooser', mode: 'local', hiddenName: 'new_run_build', + width: 200, params: { product_id: plan.product_id, activeonly: 1 @@ -887,6 +888,7 @@ Testopia.TestPlan.ClonePanel = function(plan){ fieldLabel: 'Select an Environment', id: 'plan_clone_environment_chooser', mode: 'local', + width: 200, hiddenName: 'new_run_env', params: { product_id: plan.product_id, diff --git a/mozilla/webtools/testopia/extensions/testopia/js/product.js b/mozilla/webtools/testopia/extensions/Testopia/js/product.js similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/js/product.js rename to mozilla/webtools/testopia/extensions/Testopia/js/product.js diff --git a/mozilla/webtools/testopia/extensions/testopia/js/run.js b/mozilla/webtools/testopia/extensions/Testopia/js/run.js similarity index 99% rename from mozilla/webtools/testopia/extensions/testopia/js/run.js rename to mozilla/webtools/testopia/extensions/Testopia/js/run.js index 324362a4432..279751b1b34 100644 --- a/mozilla/webtools/testopia/extensions/testopia/js/run.js +++ b/mozilla/webtools/testopia/extensions/Testopia/js/run.js @@ -304,7 +304,7 @@ Testopia.TestRun.Grid = function(params, cfg){ }, new Ext.Toolbar.Fill(), { xtype: 'button', id: 'save_run_list_btn', - icon: 'extensions/testopia/img/save.png', + icon: 'extensions/Testopia/img/save.png', iconCls: 'img_button_16x', tooltip: 'Save this search', handler: function(b, e){ @@ -313,7 +313,7 @@ Testopia.TestRun.Grid = function(params, cfg){ }, { xtype: 'button', id: 'link_run_list_btn', - icon: 'extensions/testopia/img/link.png', + icon: 'extensions/Testopia/img/link.png', iconCls: 'img_button_16x', tooltip: 'Create a link to this list', handler: function(b, e){ @@ -322,7 +322,7 @@ Testopia.TestRun.Grid = function(params, cfg){ }, { xtype: 'button', id: 'edit_run_list_btn', - icon: 'extensions/testopia/img/edit.png', + icon: 'extensions/Testopia/img/edit.png', iconCls: 'img_button_16x', disabled: true, tooltip: 'Edit Selected Test Run', @@ -332,7 +332,7 @@ Testopia.TestRun.Grid = function(params, cfg){ }, { xtype: 'button', id: 'add_run_list_btn', - icon: 'extensions/testopia/img/new.png', + icon: 'extensions/Testopia/img/new.png', iconCls: 'img_button_16x', tooltip: 'Create a New Test Run', handler: function(){ @@ -348,7 +348,7 @@ Testopia.TestRun.Grid = function(params, cfg){ }, { xtype: 'button', id: 'delete_run_list_btn', - icon: 'extensions/testopia/img/delete.png', + icon: 'extensions/Testopia/img/delete.png', iconCls: 'img_button_16x', disabled: true, tooltip: 'Delete Selected Test Runs', @@ -646,7 +646,7 @@ Ext.extend(Testopia.TestRun.Grid, Ext.grid.GridPanel, { } }, { text: 'Clone Selected Test Runs', - icon: 'extensions/testopia/img/copy.png', + icon: 'extensions/Testopia/img/copy.png', iconCls: 'img_button_16x', handler: function(){ Testopia.TestRun.ClonePopup(grid.getSelectionModel().getSelected().get('product_id'), Testopia.Util.getSelectedObjects(grid, 'run_id')); @@ -654,13 +654,13 @@ Ext.extend(Testopia.TestRun.Grid, Ext.grid.GridPanel, { }, { text: 'Delete Selected Test Runs', - icon: 'extensions/testopia/img/delete.png', + icon: 'extensions/Testopia/img/delete.png', iconCls: 'img_button_16x', handler: this.deleteList.createDelegate(this) }, { text: 'Refresh List', - icon: 'extensions/testopia/img/refresh.png', + icon: 'extensions/Testopia/img/refresh.png', iconCls: 'img_button_16x', handler: function(){ grid.store.reload(); @@ -949,11 +949,11 @@ Testopia.TestRun.NewRunForm = function(plan){ values.case_ids = Testopia.Util.getSelectedObjects(casegrid, 'case_id'); } - if (!Ext.getCmp('build_combo').getValue()) { - values.new_build = Ext.getCmp('build_combo').getRawValue(); + if (Ext.getCmp('build_combo').selectedIndex == -1) { + values.new_build = Ext.getCmp('build_combo').getValue(); } - if (!Ext.getCmp('environment_combo').getValue()) { - values.new_env = Ext.getCmp('environment_combo').getRawValue(); + if (Ext.getCmp('environment_combo').selectedIndex == -1) { + values.new_env = Ext.getCmp('environment_combo').getValue(); } Ext.getCmp('newrunsouth').getForm().submit({ diff --git a/mozilla/webtools/testopia/extensions/testopia/js/search.js b/mozilla/webtools/testopia/extensions/Testopia/js/search.js similarity index 97% rename from mozilla/webtools/testopia/extensions/testopia/js/search.js rename to mozilla/webtools/testopia/extensions/Testopia/js/search.js index 00632d703b7..ae2b8355eb3 100644 --- a/mozilla/webtools/testopia/extensions/testopia/js/search.js +++ b/mozilla/webtools/testopia/extensions/Testopia/js/search.js @@ -256,7 +256,7 @@ Testopia.Search.PlansForm = function(params){ { xtype: 'button', id: 'save_plan_report_btn', - icon: 'extensions/testopia/img/save.png', + icon: 'extensions/Testopia/img/save.png', iconCls: 'img_button_16x', tooltip: 'Save this report', handler: function(b,e){ @@ -265,7 +265,7 @@ Testopia.Search.PlansForm = function(params){ },{ xtype: 'button', id: 'link_plan_report_btn', - icon: 'extensions/testopia/img/link.png', + icon: 'extensions/Testopia/img/link.png', iconCls: 'img_button_16x', tooltip: 'Create a link to this report', handler: function(b,e){ @@ -356,7 +356,7 @@ Testopia.Search.CasesForm = function(params){ { xtype: 'button', id: 'save_case_report_btn', - icon: 'extensions/testopia/img/save.png', + icon: 'extensions/Testopia/img/save.png', iconCls: 'img_button_16x', tooltip: 'Save this report', handler: function(b,e){ @@ -365,7 +365,7 @@ Testopia.Search.CasesForm = function(params){ },{ xtype: 'button', id: 'link_case_report_btn', - icon: 'extensions/testopia/img/link.png', + icon: 'extensions/Testopia/img/link.png', iconCls: 'img_button_16x', tooltip: 'Create a link to this report', handler: function(b,e){ @@ -458,7 +458,7 @@ Testopia.Search.RunsForm = function(params){ { xtype: 'button', id: 'save_run_report_btn', - icon: 'extensions/testopia/img/save.png', + icon: 'extensions/Testopia/img/save.png', iconCls: 'img_button_16x', tooltip: 'Save this report', handler: function(b,e){ @@ -467,7 +467,7 @@ Testopia.Search.RunsForm = function(params){ },{ xtype: 'button', id: 'link_run_report_btn', - icon: 'extensions/testopia/img/link.png', + icon: 'extensions/Testopia/img/link.png', iconCls: 'img_button_16x', tooltip: 'Create a link to this report', handler: function(b,e){ @@ -558,7 +558,7 @@ Testopia.Search.CaseRunsForm = function(params){ { xtype: 'button', id: 'save_caserun_report_btn', - icon: 'extensions/testopia/img/save.png', + icon: 'extensions/Testopia/img/save.png', iconCls: 'img_button_16x', tooltip: 'Save this report', handler: function(b,e){ @@ -567,7 +567,7 @@ Testopia.Search.CaseRunsForm = function(params){ },{ xtype: 'button', id: 'link_plan_list_btn', - icon: 'extensions/testopia/img/link.png', + icon: 'extensions/Testopia/img/link.png', iconCls: 'img_button_16x', tooltip: 'Create a link to this report', handler: function(b,e){ @@ -710,7 +710,7 @@ Ext.extend(Testopia.Search.SavedReportsList, Ext.grid.GridPanel, { } },{ text: 'Edit', - icon: 'extensions/testopia/img/edit.png', + icon: 'extensions/Testopia/img/edit.png', iconCls: 'img_button_16x', disabled: d ? false : true, handler: function(){ @@ -738,7 +738,7 @@ Ext.extend(Testopia.Search.SavedReportsList, Ext.grid.GridPanel, { } },{ text: 'Delete', - icon: 'extensions/testopia/img/delete.png', + icon: 'extensions/Testopia/img/delete.png', iconCls: 'img_button_16x', handler: function (){ var form = new Ext.form.BasicForm('testopia_helper_frm',{}); @@ -765,7 +765,7 @@ Ext.extend(Testopia.Search.SavedReportsList, Ext.grid.GridPanel, { } },{ text: 'Refresh List', - icon: 'extensions/testopia/img/refresh.png', + icon: 'extensions/Testopia/img/refresh.png', iconCls: 'img_button_16x', handler: function(){ grid.store.reload(); @@ -794,7 +794,7 @@ Ext.extend(Testopia.Search.SavedReportsList, Ext.grid.GridPanel, { Ext.getCmp('search' + r.get('name')).getTopToolbar().add({ xtype: 'button', id: 'link_dashboard_btn', - icon: 'extensions/testopia/img/link.png', + icon: 'extensions/Testopia/img/link.png', iconCls: 'img_button_16x', tooltip: 'Create a link to this dashboard', handler: function(b,e){ @@ -895,7 +895,7 @@ PortalTools = [{ } },{ text: 'Refresh', - icon: 'extensions/testopia/img/refresh.png', + icon: 'extensions/Testopia/img/refresh.png', iconCls: 'img_button_16x', handler: function(){ panel.load({url: panel.url}); diff --git a/mozilla/webtools/testopia/extensions/testopia/js/strings.js b/mozilla/webtools/testopia/extensions/Testopia/js/strings.js similarity index 91% rename from mozilla/webtools/testopia/extensions/testopia/js/strings.js rename to mozilla/webtools/testopia/extensions/Testopia/js/strings.js index 7765d6f8b0b..f1c58a9ad9e 100644 --- a/mozilla/webtools/testopia/extensions/testopia/js/strings.js +++ b/mozilla/webtools/testopia/extensions/Testopia/js/strings.js @@ -26,5 +26,5 @@ PLAN_DELETE_WARNING = 'You are about to delete the selected test plans including RUN_DELETE_WARNING = 'You are about to delete the selected test runs including all children and history. This action cannot be undone. Are you sure you want to continue?'; CASERUN_DELETE_WARNING = 'You are about to remove the selected test cases from this run including all history. This action cannot be undone. Are you sure you want to continue?'; ENVIRONMENT_DELETE_WARNING = 'You are about to delete the selected test environment including associated test run data. This action cannot be undone. Are you sure you want to continue?'; -PRODUCT_PLAN_IMPORT = 'Accepts XML files under 2 MB in size.
See testopia.xsd for proper format.'; -PLAN_CASES_IMPORT = 'Accepts CSV and XML files under 2 MB in size.
See import_example.csv and testopia.xsd for proper format.'; \ No newline at end of file +PRODUCT_PLAN_IMPORT = 'Accepts XML files under 2 MB in size.
See testopia.xsd for proper format.'; +PLAN_CASES_IMPORT = 'Accepts CSV and XML files under 2 MB in size.
See import_example.csv and testopia.xsd for proper format.'; \ No newline at end of file diff --git a/mozilla/webtools/testopia/extensions/testopia/js/tags.js b/mozilla/webtools/testopia/extensions/Testopia/js/tags.js similarity index 97% rename from mozilla/webtools/testopia/extensions/testopia/js/tags.js rename to mozilla/webtools/testopia/extensions/Testopia/js/tags.js index d150a0e6531..8c5f57f7366 100644 --- a/mozilla/webtools/testopia/extensions/testopia/js/tags.js +++ b/mozilla/webtools/testopia/extensions/Testopia/js/tags.js @@ -199,13 +199,13 @@ Testopia.Tags.ObjectTags = function(obj, obj_id){ var addButton = new Ext.Button({ id: 'tag_add_btn', - icon: 'extensions/testopia/img/add.png', + icon: 'extensions/Testopia/img/add.png', iconCls: 'img_button_16x', handler: this.add.createDelegate(this) }); var deleteButton = new Ext.Button({ - icon: 'extensions/testopia/img/delete.png', + icon: 'extensions/Testopia/img/delete.png', iconCls: 'img_button_16x', handler: this.remove.createDelegate(this) }); @@ -246,13 +246,13 @@ Ext.extend(Testopia.Tags.ObjectTags, Ext.grid.GridPanel, { enableScrolling: false, items: [{ text: 'Remove Selected Tags', - icon: 'extensions/testopia/img/delete.png', + icon: 'extensions/Testopia/img/delete.png', iconCls: 'img_button_16x', obj_id: this.obj_id, handler: this.remove }, { text: 'Refresh List', - icon: 'extensions/testopia/img/refresh.png', + icon: 'extensions/Testopia/img/refresh.png', iconCls: 'img_button_16x', handler: function(){ grid.store.reload(); @@ -378,7 +378,7 @@ Ext.extend(Testopia.Tags.ProductTags, Ext.grid.GridPanel, { enableScrolling: false, items: [{ text: 'Refresh', - icon: 'extensions/testopia/img/refresh.png', + icon: 'extensions/Testopia/img/refresh.png', iconCls: 'img_button_16x', handler: function(){ ds.reload(); diff --git a/mozilla/webtools/testopia/extensions/testopia/js/util.js b/mozilla/webtools/testopia/extensions/Testopia/js/util.js similarity index 99% rename from mozilla/webtools/testopia/extensions/testopia/js/util.js rename to mozilla/webtools/testopia/extensions/Testopia/js/util.js index 9c279c0e02e..1ebe1b5c27d 100755 --- a/mozilla/webtools/testopia/extensions/testopia/js/util.js +++ b/mozilla/webtools/testopia/extensions/Testopia/js/util.js @@ -21,7 +21,7 @@ */ Testopia.Util.displayStatusIcon = function(name){ - return '' + name + ''; + return '' + name + ''; }; Testopia.Util.makeLink = function(id, m, r, ri, ci, s, type){ @@ -339,7 +339,7 @@ Ext.extend(Testopia.Util.HistoryList, Ext.grid.GridPanel, { enableScrolling: false, items: [{ text: 'Refresh', - icon: 'extensions/testopia/img/refresh.png', + icon: 'extensions/Testopia/img/refresh.png', iconCls: 'img_button_16x', handler: function(){ grid.store.reload(); diff --git a/mozilla/webtools/testopia/extensions/testopia/js/vars.js b/mozilla/webtools/testopia/extensions/Testopia/js/vars.js similarity index 88% rename from mozilla/webtools/testopia/extensions/testopia/js/vars.js rename to mozilla/webtools/testopia/extensions/Testopia/js/vars.js index 2d55fff378f..15f9006e207 100644 --- a/mozilla/webtools/testopia/extensions/testopia/js/vars.js +++ b/mozilla/webtools/testopia/extensions/Testopia/js/vars.js @@ -49,7 +49,7 @@ Ext.data.Connection.timeout = 120000; Ext.Updater.defaults.timeout = 120000; Ext.Ajax.timeout = 120000; -Ext.BLANK_IMAGE_URL = 'extensions/testopia/extjs/resources/images/default/s.gif'; +Ext.BLANK_IMAGE_URL = 'extensions/Testopia/extjs/resources/images/default/s.gif'; // Customized handler for the search field in the paging toolbar. // From JeffHowden at http://extjs.com/forum/showthread.php?t=17532 @@ -112,7 +112,17 @@ Ext.grid.CheckColumn.prototype = { return '
 
'; } }; +Testopia.StatusButton = function(cfg){ + Ext.apply(this, cfg); +} -var imgButtonTpl = new Ext.Template('' + -'' + +Ext.extend(Testopia.StatusButton, Ext.Button, { + getTemplateArgs : function(){ + return [this.icon]; + } +}); + +var imgButtonTpl = new Ext.Template( +'
' + +'' + '
'); diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Attachment.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Attachment.pm similarity index 95% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Attachment.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Attachment.pm index c393f0b6f7c..65048b305e4 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Attachment.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Attachment.pm @@ -21,7 +21,7 @@ # # Contributor(s): Greg Hendricks -package Testopia::Attachment; +package Bugzilla::Extension::Testopia::Attachment; use strict; @@ -31,8 +31,8 @@ use Bugzilla::Error; use Bugzilla::Constants; use Bugzilla::User; -use Testopia::Constants; -use Testopia::Util; +use Bugzilla::Extension::Testopia::Constants; +use Bugzilla::Extension::Testopia::Util; use base qw(Exporter Bugzilla::Object); @@ -81,14 +81,14 @@ sub _validate_data { sub _check_plan { my ($invocant, $plan_id) = @_; - Testopia::Util::validate_test_id($plan_id, 'plan'); + Bugzilla::Extension::Testopia::Util::validate_test_id($plan_id, 'plan'); trick_taint($plan_id); return $plan_id; } sub _check_case { my ($invocant, $case_id) = @_; - Testopia::Util::validate_test_id($case_id, 'case'); + Bugzilla::Extension::Testopia::Util::validate_test_id($case_id, 'case'); trick_taint($case_id); return $case_id; } @@ -183,7 +183,7 @@ sub create { } $field_values->{contents} = _validate_data($field_values->{contents}); - $field_values->{creation_ts} = Testopia::Util::get_time_stamp(); + $field_values->{creation_ts} = Bugzilla::Extension::Testopia::Util::get_time_stamp(); $field_values->{mime_type} ||= 'application/octet-stream'; my $contents = $field_values->{contents}; @@ -457,7 +457,7 @@ sub cases { my ($self) = @_; my $dbh = Bugzilla->dbh; - require Testopia::TestCase; + require Bugzilla::Extension::Testopia::TestCase; return $self->{'cases'} if exists $self->{'cases'}; my $caseids = $dbh->selectcol_arrayref( @@ -466,7 +466,7 @@ sub cases { undef, $self->id); my @cases; foreach my $id (@{$caseids}){ - push @cases, Testopia::TestCase->new($id); + push @cases, Bugzilla::Extension::Testopia::TestCase->new($id); } $self->{'cases'} = \@cases; @@ -477,7 +477,7 @@ sub plans { my ($self) = @_; my $dbh = Bugzilla->dbh; - require Testopia::TestPlan; + require Bugzilla::Extension::Testopia::TestPlan; return $self->{'plans'} if exists $self->{'plans'}; my $planids = $dbh->selectcol_arrayref( @@ -486,7 +486,7 @@ sub plans { undef, $self->id); my @plans; foreach my $id (@{$planids}){ - push @plans, Testopia::TestPlan->new($id); + push @plans, Bugzilla::Extension::Testopia::TestPlan->new($id); } $self->{'plans'} = \@plans; @@ -505,7 +505,7 @@ __END__ =head1 NAME -Testopia::Attachment - Attachment object for Testopia +Bugzilla::Extension::Testopia::Attachment - Attachment object for Testopia =head1 EXTENDS @@ -522,10 +522,10 @@ an optional id for the case_run in which it was linked. =head2 Creating - $attachment = Testopia::Attachment->new($attachment_id); - $attachment = Testopia::Attachment->new({name => $name}); + $attachment = Bugzilla::Extension::Testopia::Attachment->new($attachment_id); + $attachment = Bugzilla::Extension::Testopia::Attachment->new({name => $name}); - $new_attachment = Testopia::Attachment->create({name => $name, + $new_attachment = Bugzilla::Extension::Testopia::Attachment->create({name => $name, description => $desc ... }); @@ -614,7 +614,7 @@ The ID of the person that uploaded the attachment. or a hash with the "name" key representing the named attachment in the database. - Returns: A blessed Testopia::Attachment object + Returns: A blessed Bugzilla::Extension::Testopia::Attachment object =item C @@ -806,8 +806,8 @@ The ID of the person that uploaded the attachment. =over -L -L +L +L L =back diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Build.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Build.pm similarity index 93% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Build.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Build.pm index bb523b206aa..94d9a4ca37c 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Build.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Build.pm @@ -18,17 +18,17 @@ # # Contributor(s): Greg Hendricks -package Testopia::Build; +package Bugzilla::Extension::Testopia::Build; use strict; use Bugzilla::Util; use Bugzilla::Error; -use Testopia::Product; +use Bugzilla::Extension::Testopia::Product; use JSON; use base qw(Exporter Bugzilla::Object); -@Testopia::Build::EXPORT = qw(check_build); +our @EXPORT = qw(check_build); ############################### #### Initialization #### @@ -67,7 +67,7 @@ sub _check_product { $product = Bugzilla::Product::check_product($product_id); } else { - $product = Testopia::Product->new($product_id); + $product = Bugzilla::Extension::Testopia::Product->new($product_id); } if (ref $invocant){ @@ -199,7 +199,7 @@ sub check_build { undef, $name, $pid); if ($throw){ ThrowUserError('invalid-test-id-non-existent', {type => 'Build', id => $name}) unless $is; - return Testopia::Build->new($is); + return Bugzilla::Extension::Testopia::Build->new($is); } return $is; } @@ -254,7 +254,7 @@ sub product { return $self->{'product'} if exists $self->{'product'}; - $self->{'product'} = Testopia::Product->new($self->product_id); + $self->{'product'} = Bugzilla::Extension::Testopia::Product->new($self->product_id); return $self->{'product'}; } @@ -303,14 +303,14 @@ sub runs { my $dbh = Bugzilla->dbh; return $self->{'runs'} if exists $self->{'runs'}; - require Testopia::TestRun; + require Bugzilla::Extension::Testopia::TestRun; my $runids = $dbh->selectcol_arrayref("SELECT run_id FROM test_runs WHERE build_id = ?", undef, $self->id); my @runs; foreach my $id (@{$runids}){ - push @runs, Testopia::TestRun->new($id); + push @runs, Bugzilla::Extension::Testopia::TestRun->new($id); } $self->{'runs'} = \@runs; @@ -328,14 +328,14 @@ sub caseruns { my $dbh = Bugzilla->dbh; return $self->{'caseruns'} if exists $self->{'caseruns'}; - require Testopia::TestCaseRun; + require Bugzilla::Extension::Testopia::TestCaseRun; my $ids = $dbh->selectcol_arrayref("SELECT case_run_id FROM test_case_runs WHERE build_id = ?", undef, $self->id); my @caseruns; foreach my $id (@{$ids}){ - push @caseruns, Testopia::TestCaseRun->new($id); + push @caseruns, Bugzilla::Extension::Testopia::TestCaseRun->new($id); } $self->{'caseruns'} = \@caseruns; @@ -348,7 +348,7 @@ __END__ =head1 NAME -Testopia::Build +Bugzilla::Extension::Testopia::Build =head1 EXTENDS @@ -364,10 +364,10 @@ and are associated with a milestone if targetmilestones are used in Bugzilla. =head2 Creating - $build = Testopia::Build->new($build_id); - $build = Testopia::Build->new({name => $name}); + $build = Bugzilla::Extension::Testopia::Build->new($build_id); + $build = Bugzilla::Extension::Testopia::Build->new({name => $name}); - $new_build = Testopia::Build->create({name => $name, + $new_build = Bugzilla::Extension::Testopia::Build->create({name => $name, description => $desc ... }); @@ -461,7 +461,7 @@ Boolean - Determines whether to show this build in lists for selection. or a hash with the "name" key representing the named build in the database. - Returns: A blessed Testopia::Build object + Returns: A blessed Bugzilla::Extension::Testopia::Build object =item C @@ -555,7 +555,7 @@ Boolean - Determines whether to show this build in lists for selection. =item C - Returns a Testopia::Product object of the product this build is of. + Returns a Bugzilla::Extension::Testopia::Product object of the product this build is of. =item C @@ -577,8 +577,8 @@ Boolean - Determines whether to show this build in lists for selection. =over -L -L +L +L L =back diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Category.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Category.pm similarity index 93% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Category.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Category.pm index 5b6c0d53df5..c6f78db1362 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Category.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Category.pm @@ -18,18 +18,18 @@ # # Contributor(s): Greg Hendricks -package Testopia::Category; +package Bugzilla::Extension::Testopia::Category; use strict; use Bugzilla::Util; use Bugzilla::Error; -use Testopia::Product; +use Bugzilla::Extension::Testopia::Product; use JSON; use base qw(Exporter Bugzilla::Object); -@Testopia::Category::EXPORT = qw(check_case_category); +our @EXPORT = qw(check_case_category); ############################### #### Initialization #### @@ -63,10 +63,10 @@ sub _check_product { my $product; if (trim($product_id) !~ /^\d+$/ ){ $product = Bugzilla::Product::check_product($product_id); - $product = Testopia::Product->new($product->id); + $product = Bugzilla::Extension::Testopia::Product->new($product->id); } else { - $product = Testopia::Product->new($product_id); + $product = Bugzilla::Extension::Testopia::Product->new($product_id); } @@ -230,7 +230,7 @@ sub product { return $self->{'product'} if exists $self->{'product'}; - $self->{'product'} = Testopia::Product->new($self->product_id); + $self->{'product'} = Bugzilla::Extension::Testopia::Product->new($self->product_id); return $self->{'product'}; } @@ -269,7 +269,7 @@ __END__ =head1 NAME -Testopia::Category - An object representing a test case category +Bugzilla::Extension::Testopia::Category - An object representing a test case category =head1 EXTENDS @@ -285,10 +285,10 @@ Every plan in a product will have access to that product's categories. =head2 Creating - $category = Testopia::Category->new($category_id); - $category = Testopia::Category->new({name => $name}); + $category = Bugzilla::Extension::Testopia::Category->new($category_id); + $category = Bugzilla::Extension::Testopia::Category->new({name => $name}); - $new_category = Testopia::Category->create({name => $name, + $new_category = Bugzilla::Extension::Testopia::Category->create({name => $name, description => $desc}); =head2 Updating @@ -367,7 +367,7 @@ A detailed description for this category. or a hash with the "name" key representing the named category in the database. - Returns: A blessed Testopia::Category object + Returns: A blessed Bugzilla::Extension::Testopia::Category object =back @@ -509,9 +509,9 @@ A detailed description for this category. =head1 SEE ALSO -L +L -L +L L diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Classification.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Classification.pm similarity index 95% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Classification.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Classification.pm index 3bcc3b8dacb..53c0483b3cb 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Classification.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Classification.pm @@ -19,7 +19,7 @@ # Contributor(s): Greg Hendricks # Andrew Nelson -package Testopia::Classification; +package Bugzilla::Extension::Testopia::Classification; use strict; @@ -60,7 +60,7 @@ sub user_visible_products { my @products; foreach my $product_id (@$product_ids) { - push (@products, new Testopia::Product($product_id)); + push (@products, new Bugzilla::Extension::Testopia::Product($product_id)); } $self->{'user_visible_products'} = \@products; } diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Config.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Config.pm similarity index 98% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Config.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Config.pm index 45355d179b5..c40c452935a 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Config.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Config.pm @@ -20,7 +20,7 @@ # Ed Fuentetaja # Greg Hendricks -package extensions::testopia::lib::Testopia::Config; +package Bugzilla::Extension::Testopia::Config; use strict; diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Constants.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Constants.pm similarity index 97% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Constants.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Constants.pm index 39445f12367..ea2ccef82e8 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Constants.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Constants.pm @@ -18,11 +18,11 @@ # # Contributor(s): Greg Hendricks -package Testopia::Constants; +package Bugzilla::Extension::Testopia::Constants; use strict; use base qw(Exporter); -@Testopia::Constants::EXPORT = qw( +our @EXPORT = qw( TESTOPIA_VERSION PROPOSED diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Environment.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Environment.pm similarity index 93% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Environment.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Environment.pm index 0ef3f10fa9c..f0c822968a9 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Environment.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Environment.pm @@ -23,7 +23,7 @@ =head1 NAME -Testopia::Environment - A test environment +Bugzilla::Extension::Testopia::Environment - A test environment =head1 DESCRIPTION @@ -38,12 +38,12 @@ of the possible values. =head1 SYNOPSIS - $env = Testopia::Environment->new($env_id); - $env = Testopia::Environment->new(\%env_hash); + $env = Bugzilla::Extension::Testopia::Environment->new($env_id); + $env = Bugzilla::Extension::Testopia::Environment->new(\%env_hash); =cut -package Testopia::Environment; +package Bugzilla::Extension::Testopia::Environment; use strict; @@ -52,14 +52,14 @@ use Bugzilla::Error; use Bugzilla::User; use Bugzilla::Config; -use Testopia::Environment::Category; -use Testopia::Environment::Element; -use Testopia::Environment::Property; +use Bugzilla::Extension::Testopia::Environment::Category; +use Bugzilla::Extension::Testopia::Environment::Element; +use Bugzilla::Extension::Testopia::Environment::Property; use JSON; use base qw(Exporter Bugzilla::Object); -@Testopia::Environment::EXPORT = qw(check_environment); +our @EXPORT = qw(check_environment); ############################### #### Initialization #### @@ -100,15 +100,15 @@ sub _check_product { $product_id = trim($product_id); - require Testopia::Product; + require Bugzilla::Extension::Testopia::Product; my $product; if (trim($product_id) !~ /^\d+$/ ){ $product = Bugzilla::Product::check_product($product_id); - $product = Testopia::Product->new($product->id); + $product = Bugzilla::Extension::Testopia::Product->new($product->id); } else { - $product = Testopia::Product->new($product_id); + $product = Bugzilla::Extension::Testopia::Product->new($product_id); } ThrowUserError("testopia-create-denied", {'object' => 'environment'}) unless $product->canedit; @@ -221,8 +221,8 @@ sub create_full { # first, get ALL rows to add to test_environment_map table # and store them in @environment_map array foreach my $key (keys(%{$environment})){ - require Testopia::Environment::Category; - my $cat = Testopia::Environment::Category->new({'product_id' => $prod_id}); + require Bugzilla::Extension::Testopia::Environment::Category; + my $cat = Bugzilla::Extension::Testopia::Environment::Category->new({'product_id' => $prod_id}); my $cat_id = $cat->check_category($key); if (!$cat_id) { warn "category: $key for id: $cat did not exist"; return 0; } _parseElementsRecursively($environment->{$key}, $cat_id, 'category'); @@ -295,8 +295,8 @@ sub _parseElementsRecursively { foreach my $key (keys(%{$hash})) { if(ref($hash->{$key})){ # must be element, since property contains value instead of another hash - require Testopia::Environment::Element; - my $elem = Testopia::Environment::Element->new({}); + require Bugzilla::Extension::Testopia::Environment::Element; + my $elem = Bugzilla::Extension::Testopia::Environment::Element->new({}); # get exising element OR create new one my ($elem_id) = $elem->check_element($key, $callerid); if(!$elem_id){ @@ -310,8 +310,8 @@ sub _parseElementsRecursively { } _parseElementsRecursively($hash->{$key}, $elem_id, 'element', $categoryid); } else { - require Testopia::Environment::Property; - my $prop = Testopia::Environment::Property->new({}); + require Bugzilla::Extension::Testopia::Environment::Property; + my $prop = Bugzilla::Extension::Testopia::Environment::Property->new({}); my ($prop_id) = $prop->check_property($key, $callerid); # get existing property OR create new one if(!$prop_id){ @@ -323,7 +323,7 @@ sub _parseElementsRecursively { $modified_environment_structure = 1; } else { # if property exists, still update validexp if needed - $prop = Testopia::Environment::Property->new($prop_id); + $prop = Bugzilla::Extension::Testopia::Environment::Property->new($prop_id); my $validexp = $prop->validexp; if ($validexp !~ m/\Q$hash->{$key}/){ my $newexp = $validexp . ((!length($validexp)) ? "" : "|") . $hash->{$key}; @@ -367,7 +367,7 @@ sub get_environment_elements{ my @elements; foreach my $val (@$ref){ - push @elements, Testopia::Environment::Element->new($val); + push @elements, Bugzilla::Extension::Testopia::Environment::Element->new($val); } $self->{'elements'} = \@elements; @@ -393,7 +393,7 @@ sub element_categories { my @elements; foreach my $val (@$ref){ - push @elements, Testopia::Environment::Category->new($val); + push @elements, Bugzilla::Extension::Testopia::Environment::Category->new($val); } $self->{'categories'} = \@elements; @@ -440,7 +440,7 @@ sub mapped_category_elements_to_json { my @elements; foreach my $id (@$ref){ - my $element = Testopia::Environment::Element->new($id); + my $element = Bugzilla::Extension::Testopia::Environment::Element->new($id); push @elements, { text => $element->{'name'}, id => $element->id, @@ -565,7 +565,7 @@ sub get_all_elements{ my @elements; foreach my $val (@$ref){ - push @elements, Testopia::Environment::Element->new($val); + push @elements, Bugzilla::Extension::Testopia::Environment::Element->new($val); } return \@elements; @@ -584,7 +584,7 @@ sub check_environment{ undef, ($name, $pid)); if ($throw){ ThrowUserError('invalid-test-id-non-existent', {type => 'Environment', id => $name}) unless $used; - return Testopia::Environment->new($used); + return Bugzilla::Extension::Testopia::Environment->new($used); } return $used; @@ -909,7 +909,7 @@ sub product { my $self = shift; my $dbh = Bugzilla->dbh; return $self->{'product'} if exists $self->{'product'}; - require Testopia::Product; + require Bugzilla::Extension::Testopia::Product; $self->{'product'} = Bugzilla::Product->new($self->{'product_id'}); return $self->{'product'}; } @@ -925,14 +925,14 @@ sub runs { my $dbh = Bugzilla->dbh; return $self->{'runs'} if exists $self->{'runs'}; - require Testopia::TestRun; + require Bugzilla::Extension::Testopia::TestRun; my $runids = $dbh->selectcol_arrayref("SELECT run_id FROM test_runs WHERE environment_id = ?", undef, $self->id); my @runs; foreach my $id (@{$runids}){ - push @runs, Testopia::TestRun->new($id); + push @runs, Bugzilla::Extension::Testopia::TestRun->new($id); } $self->{'runs'} = \@runs; @@ -950,14 +950,14 @@ sub caseruns { my $dbh = Bugzilla->dbh; return $self->{'caseruns'} if exists $self->{'caseruns'}; - require Testopia::TestCaseRun; + require Bugzilla::Extension::Testopia::TestCaseRun; my $ids = $dbh->selectcol_arrayref("SELECT case_run_id FROM test_case_runs WHERE environment_id = ?", undef, $self->id); my @caseruns; foreach my $id (@{$ids}){ - push @caseruns, Testopia::TestCaseRun->new($id); + push @caseruns, Bugzilla::Extension::Testopia::TestCaseRun->new($id); } $self->{'caseruns'} = \@caseruns; diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Environment/Category.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Environment/Category.pm similarity index 92% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Environment/Category.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Environment/Category.pm index 0606f83dcd8..c5d2a4213b8 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Environment/Category.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Environment/Category.pm @@ -23,7 +23,7 @@ =head1 NAME -Testopia::Environment::Category - A test element category +Bugzilla::Extension::Testopia::Environment::Category - A test element category =head1 DESCRIPTION @@ -31,12 +31,12 @@ Categories are used to organize environment elements. =head1 SYNOPSIS - $prop = Testopia::Environment::Category->new($env_category_id); - $prop = Testopia::Environment::Category->new(\%cat_hash); + $prop = Bugzilla::Extension::Testopia::Environment::Category->new($env_category_id); + $prop = Bugzilla::Extension::Testopia::Environment::Category->new(\%cat_hash); =cut -package Testopia::Environment::Category; +package Bugzilla::Extension::Testopia::Environment::Category; use strict; @@ -45,8 +45,8 @@ use Bugzilla::Error; use Bugzilla::Config; use Bugzilla::User; use Bugzilla::Constants; -use Testopia::Environment::Element; -use Testopia::Product; +use Bugzilla::Extension::Testopia::Environment::Element; +use Bugzilla::Extension::Testopia::Product; ############################### #### Initialization #### @@ -143,7 +143,7 @@ sub get_elements_by_category { my @elements; foreach my $val (@$ref) { - push @elements, Testopia::Environment::Element->new($val); + push @elements, Bugzilla::Extension::Testopia::Environment::Element->new($val); } return \@elements; @@ -170,7 +170,7 @@ sub get_parent_elements { my @elements; foreach my $val (@$ref) { - push @elements, Testopia::Environment::Element->new($val); + push @elements, Bugzilla::Extension::Testopia::Environment::Element->new($val); } return \@elements; @@ -318,7 +318,7 @@ sub get_element_categories_by_product { ); my @objs; foreach my $id ( @{$ref} ) { - push @objs, Testopia::Environment::Category->new($id); + push @objs, Bugzilla::Extension::Testopia::Environment::Category->new($id); } return \@objs; } @@ -399,7 +399,7 @@ sub store { # Exclude the auto-incremented field from the column list. my $columns = join( ", ", grep { $_ ne 'env_category_id' } DB_COLUMNS ); - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); return 0 if $self->check_category( $self->{'name'}, $self->{'product_id'} ); @@ -470,7 +470,7 @@ sub obliterate { ); foreach my $id (@$children) { - my $element = Testopia::Environment::Element->new($id); + my $element = Bugzilla::Extension::Testopia::Environment::Element->new($id); $element->obliterate; } $dbh->do( "DELETE FROM test_environment_category WHERE env_category_id = ?", @@ -526,7 +526,7 @@ sub product_id { return $_[0]->{'product_id'}; } sub product { my $self = shift; - $self->{'product'} = Testopia::Product->new( $self->product_id ); + $self->{'product'} = Bugzilla::Extension::Testopia::Product->new( $self->product_id ); return $self->{'product'}; } diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Environment/Element.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Environment/Element.pm similarity index 92% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Environment/Element.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Environment/Element.pm index a57faf5f3b4..af8c7069292 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Environment/Element.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Environment/Element.pm @@ -23,7 +23,7 @@ =head1 NAME -Testopia::Environment::Element - A test environment element +Bugzilla::Extension::Testopia::Environment::Element - A test environment element =head1 DESCRIPTION @@ -34,19 +34,19 @@ Elements can have child elements. =head1 SYNOPSIS - $elem = Testopia::Environment::Element->new($elem_id); - $elem = Testopia::Environment::Element->new(\%elem_hash); + $elem = Bugzilla::Extension::Testopia::Environment::Element->new($elem_id); + $elem = Bugzilla::Extension::Testopia::Environment::Element->new(\%elem_hash); =cut -package Testopia::Environment::Element; +package Bugzilla::Extension::Testopia::Environment::Element; use strict; use Bugzilla::Util; use Bugzilla::Error; use Bugzilla::User; -use Testopia::Product; +use Bugzilla::Extension::Testopia::Product; use JSON; ############################### @@ -180,7 +180,7 @@ sub get_child_elements { my @children; foreach my $val (@$ref) { - my $child = Testopia::Environment::Element->new($val); + my $child = Bugzilla::Extension::Testopia::Environment::Element->new($val); $child->get_child_elements( 'depth' => $depth ); push( @children, $child ); } @@ -209,7 +209,7 @@ sub get_properties { my @properties; foreach my $val (@$ref) { - my $property = Testopia::Environment::Property->new($val); + my $property = Bugzilla::Extension::Testopia::Environment::Property->new($val); push( @properties, $property ); } @@ -371,7 +371,7 @@ sub store { # Exclude the auto-incremented field from the column list. my $columns = join( ", ", grep { $_ ne 'element_id' } DB_COLUMNS ); - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); # Verify name is available return undef @@ -398,7 +398,7 @@ Updates the element in the database sub set_name { my $self = shift; - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); my ($name) = (@_); @@ -421,7 +421,7 @@ Updates the category of the element in the database sub update_element_category { my $self = shift; - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); my ($catid) = (@_); @@ -442,7 +442,7 @@ Updates the parent_id of the element in the database sub update_element_parent { my $self = shift; - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); my ($parent_id) = (@_); @@ -539,7 +539,7 @@ sub get_parent { return $self->new( $self->{'parent_id'} ); } else { - return Testopia::Environment::Category->new( + return Bugzilla::Extension::Testopia::Environment::Category->new( $self->{'env_category_id'} ); } } @@ -555,7 +555,7 @@ sub is_parent_a_category { sub product { my $self = shift; return $self->{'product'} if exists $self->{'product'}; - $self->{'product'} = Testopia::Product->new( $self->product_id ); + $self->{'product'} = Bugzilla::Extension::Testopia::Product->new( $self->product_id ); return $self->{'product'}; } diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Environment/Property.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Environment/Property.pm similarity index 90% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Environment/Property.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Environment/Property.pm index 6cdffd77fd4..48395e57bcb 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Environment/Property.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Environment/Property.pm @@ -22,7 +22,7 @@ =head1 NAME -Testopia::Environment::Property - A test environment element property +Bugzilla::Extension::Testopia::Environment::Property - A test environment element property =head1 DESCRIPTION @@ -33,19 +33,19 @@ for each property. =head1 SYNOPSIS - $prop = Testopia::Environment::Property->new($prop_id); - $prop = Testopia::Environment::Property->new(\%prop_hash); + $prop = Bugzilla::Extension::Testopia::Environment::Property->new($prop_id); + $prop = Bugzilla::Extension::Testopia::Environment::Property->new(\%prop_hash); =cut -package Testopia::Environment::Property; +package Bugzilla::Extension::Testopia::Environment::Property; use strict; use Bugzilla::Util; use Bugzilla::Error; use Bugzilla::User; -use Testopia::Environment::Element; +use Bugzilla::Extension::Testopia::Environment::Element; ############################### #### Initialization #### @@ -225,7 +225,7 @@ sub store { # Exclude the auto-incremented field from the column list. my $columns = join( ", ", grep { $_ ne 'property_id' } DB_COLUMNS ); - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); # Verify name is available return undef @@ -247,7 +247,7 @@ Updates the property name in the database sub set_name { my $self = shift; - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); my ($name) = (@_); @@ -268,7 +268,7 @@ Updates the elmnt_id in the database sub set_element { my $self = shift; - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); my ($id) = (@_); @@ -288,7 +288,7 @@ Updates the property valid expression in the database =cut sub update_property_validexp { - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); my $self = shift; my ($validexp) = (@_); @@ -305,7 +305,7 @@ sub value_to_json { my $self = shift; my ($env_id) = @_; - my $env = Testopia::Environment->new($env_id) if $env_id; + my $env = Bugzilla::Extension::Testopia::Environment->new($env_id) if $env_id; my @values = split( /\|/, $self->get_validexp ); my @json; @@ -377,7 +377,7 @@ sub is_mapped { sub canview { my $self = shift; my $element = - Testopia::Environment::Element->new( $self->element_id ); + Bugzilla::Extension::Testopia::Environment::Element->new( $self->element_id ); return 1 if $element->canview; return 0; } @@ -385,7 +385,7 @@ sub canview { sub canedit { my $self = shift; my $element = - Testopia::Environment::Element->new( $self->element_id ); + Bugzilla::Extension::Testopia::Environment::Element->new( $self->element_id ); return 1 if $element->canedit; return 0; } diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Environment/Xml.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Environment/Xml.pm similarity index 91% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Environment/Xml.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Environment/Xml.pm index 63ed535bb1f..e0d46c3b105 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Environment/Xml.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Environment/Xml.pm @@ -21,7 +21,7 @@ =head1 NAME -Testopia::Environment::Xml - An XML representation of the Environment Object. +Bugzilla::Extension::Testopia::Environment::Xml - An XML representation of the Environment Object. =head1 DESCRIPTION @@ -33,7 +33,7 @@ initialized using new and passing it an XML scalar. It can also take two other $max_depth - the max depth of child elements to import. Example: - my $env_xml = Testopia::Environment::Xml->new($xml, 1, 5); + my $env_xml = Bugzilla::Extension::Testopia::Environment::Xml->new($xml, 1, 5); Other subroutines can be called on the object. For example: parse - takes the same three parameters as new @@ -51,17 +51,17 @@ Import XML Environment Implementation Example: see tr_import_environment.cgi To export an environment by env_id to XML use export Example: - my $xml = Testopia::Environment::Xml->export($env_id); + my $xml = Bugzilla::Extension::Testopia::Environment::Xml->export($env_id); Export Environment XML Implementation Example: see tr_export_environment.cgi =head1 SYNOPSIS -use Testopia::Environment::Xml; +use Bugzilla::Extension::Testopia::Environment::Xml; =cut -package Testopia::Environment::Xml; +package Bugzilla::Extension::Testopia::Environment::Xml; #************************************************** Uses ****************************************************# use strict; @@ -75,19 +75,19 @@ use Bugzilla::Config; use Bugzilla::Constants; use Bugzilla::Error; use Bugzilla::Product; -use Testopia::Util; -use Testopia::Environment; -use Testopia::Product; -use Testopia::Environment::Category; -use Testopia::Environment::Element; -use Testopia::Environment::Property; +use Bugzilla::Extension::Testopia::Util; +use Bugzilla::Extension::Testopia::Environment; +use Bugzilla::Extension::Testopia::Product; +use Bugzilla::Extension::Testopia::Environment::Category; +use Bugzilla::Extension::Testopia::Environment::Element; +use Bugzilla::Extension::Testopia::Environment::Property; our constant $max_depth = 7; =head2 new -Instantiates a new Testopia::Environment::Xml object +Instantiates a new Bugzilla::Extension::Testopia::Environment::Xml object =cut @@ -102,7 +102,7 @@ sub new { =head2 _init -Private constructor for the Testopia::Environment::XML class +Private constructor for the Bugzilla::Extension::Testopia::Environment::XML class =cut @@ -158,7 +158,7 @@ sub parse() { } else { $self->{'message'} .= "..Checking if $product_name PRODUCT already exists..."; - ($product_id) = Testopia::Product->check_product_by_name($product_name); + ($product_id) = Bugzilla::Extension::Testopia::Product->check_product_by_name($product_name); if ($product_id) { $self->{'message'} .= "EXISTS.
"; } @@ -173,7 +173,7 @@ sub parse() { my $environment_name = $root->{'att'}->{'name'}; $self->{'name'} = $environment_name; $self->{'message'} .= "..Checking if $environment_name ENVIRONMENT NAME already exists for the $product_name PRODUCT..."; - my $environment = Testopia::Environment->new({}); + my $environment = Bugzilla::Extension::Testopia::Environment->new({}); my ($env_id) = $environment->check_environment($environment_name, $product_id); my $environment_id; if ($env_id < 1) { @@ -182,7 +182,7 @@ sub parse() { if ($admin) { $self->{'message'} .= "....Storing new $environment_name ENVIRONMENT NAME in the $self->{'product_name'} PRODUCT..."; $environment->{'name'} = $environment_name; - ($environment_id) = Testopia::Environment->store_environment_name($self->{'name'}, $product_id); + ($environment_id) = Bugzilla::Extension::Testopia::Environment->store_environment_name($self->{'name'}, $product_id); $self->{'message'} .= "DONE.
"; } } @@ -198,7 +198,7 @@ sub parse() { foreach my $twig_category ($root->children("category")) { my $category_name = $twig_category->{'att'}->{'name'}; # Makes sure to get the category_id by name and product_id - my $category = Testopia::Environment::Category->new({}); + my $category = Bugzilla::Extension::Testopia::Environment::Category->new({}); my ($cat_id) = $category->check_category($category_name, $product_id); my $category_id; # Checking if Categories already exist. @@ -258,7 +258,7 @@ sub parse_child_elements() { } $self->{'message'} .= "Checking if $element_name ELEMENT already exists in the $category_name CATEGORY..."; my ($product_id) = $self->{'product_id'}; - my $element = Testopia::Environment::Element->new({}); + my $element = Bugzilla::Extension::Testopia::Environment::Element->new({}); my ($elem_id) = $element->check_element($element_name, $env_category_id); my $element_id; if ($elem_id < 1) { @@ -300,7 +300,7 @@ sub parse_child_elements() { $self->{'message'} .= "...."; } $self->{'message'} .= "....Checking if $property_name PROPERTY already exists..."; - my $property = Testopia::Environment::Property->new({}); + my $property = Bugzilla::Extension::Testopia::Environment::Property->new({}); my ($prop_id) = $property->check_property($property_name, $element_id); my $property_id; if ($prop_id < 1) { @@ -324,7 +324,7 @@ sub parse_child_elements() { ($property_id) = $prop_id; $self->{'message'} .= "EXISTS.
"; } - $property = Testopia::Environment::Property->new($property_id); + $property = Bugzilla::Extension::Testopia::Environment::Property->new($property_id); # Checking if new Selected Value and Valid Expression exist. my $validexp; if ($property) { @@ -373,7 +373,7 @@ sub parse_child_elements() { $self->{'message'} .= "...."; } $self->{'message'} .= "............Storing new VALUE SELECTED $value..."; - my $environment = Testopia::Environment->new($self->{'environment_id'}); + my $environment = Bugzilla::Extension::Testopia::Environment->new($self->{'environment_id'}); $environment->store_property_value($property_id, $element_id, $value); $self->{'message'} .= "DONE.
"; } @@ -446,9 +446,9 @@ sub store() { my $self = shift; $self->{'message'} .= "Storing new XML Environment..."; if (!$self->{'environment_id'}) { - $self->{'environment_id'} = Testopia::Environment->store_environment_name($self->{'name'}, $self->{'product_id'}); + $self->{'environment_id'} = Bugzilla::Extension::Testopia::Environment->store_environment_name($self->{'name'}, $self->{'product_id'}); } - my $environment = Testopia::Environment->new($self); + my $environment = Bugzilla::Extension::Testopia::Environment->new($self); my $success = $environment->update(); if (!$success) { $self->{'message'} .= "ABORTED!
"; @@ -474,7 +474,7 @@ sub export() { my $xml; - my $environment = Testopia::Environment->new($env_id); + my $environment = Bugzilla::Extension::Testopia::Environment->new($env_id); $xml = "" . @@ -564,7 +564,7 @@ sub export_element_and_children() { my $properties = $element->{'properties'}; foreach my $property (@$properties) { - my $value_selected = Testopia::Environment->get_value_selected( + my $value_selected = Bugzilla::Extension::Testopia::Environment->get_value_selected( $env_id, $element->{'element_id'}, $property->{'property_id'}); if (defined($value_selected)) { $xml .= diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Importer.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Importer.pm similarity index 89% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Importer.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Importer.pm index 5a4b2699b56..e31bb6d1172 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Importer.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Importer.pm @@ -20,15 +20,15 @@ # Greg Hendricks # Jeff Dayley -package Testopia::Importer; +package Bugzilla::Extension::Testopia::Importer; use strict; use Bugzilla::Error; -use Testopia::Attachment; -use Testopia::TestPlan; -use Testopia::TestCase; -use Testopia::Category; +use Bugzilla::Extension::Testopia::Attachment; +use Bugzilla::Extension::Testopia::TestPlan; +use Bugzilla::Extension::Testopia::TestCase; +use Bugzilla::Extension::Testopia::Category; use Class::Struct; use Data::Dumper; @@ -43,14 +43,14 @@ local our @runs; local our $xref = { 'cases' => {}, 'plans' => {}, 'runs' => {} }; local our $debug = 0; -struct( 'Testopia::Importer', {debug => '$'} ); +struct( 'Bugzilla::Extension::Testopia::Importer', {debug => '$'} ); sub _check_category { my ( $twig, $e ) = @_; print "Checking categories...\n" if $debug; my $product = Bugzilla::Product::check_product( $e->field('tr:product') ); if ( !Testopia::Category::check_case_category( $e->field('tr:name'), $product ) ) { - Testopia::Category->create( + Bugzilla::Extension::Testopia::Category->create( { product_id => $product->id, name => $e->field('tr:name'), @@ -65,7 +65,7 @@ sub _check_build { print "Checking builds...\n" if $debug; my $product = Bugzilla::Product::check_product( $e->field('tr:product') ); if ( !Testopia::Build::check_build( $e->field('tr:name'), $product ) ) { - Testopia::Build->create( + Bugzilla::Extension::Testopia::Build->create( { product_id => $product->id, name => $e->field('tr:name'), @@ -80,7 +80,7 @@ sub _check_environment { print "Checking environments...\n" if $debug; my $product = Bugzilla::Product::check_product( $e->field('tr:product') ); if ( !Testopia::Environment::check_environment( $e->field('tr:name'), $product ) ) { - Testopia::Environment->create( + Bugzilla::Extension::Testopia::Environment->create( { product_id => $product->id, name => $e->field('tr:name'), @@ -116,7 +116,7 @@ sub process_caserun { $params->{running_date} = $e->field('tr:running_date') || undef; $params->{close_date} = $e->field('tr:close_date') || undef; - Testopia::TestCaseRun->run_import_validators($params); + Bugzilla::Extension::Testopia::TestCaseRun->run_import_validators($params); push @caseruns, $params; return 1; @@ -139,7 +139,7 @@ sub process_attachment { $params->{contents} = $e->field('tr:contents'); } } - Testopia::Attachment->run_create_validators($params); + Bugzilla::Extension::Testopia::Attachment->run_create_validators($params); push @attachments, $params; return 1; } @@ -192,7 +192,7 @@ sub process_case { $xref->{cases}->{ $e->{'att'}->{'id'} } = undef; - Testopia::TestCase->run_import_validators($params); + Bugzilla::Extension::Testopia::TestCase->run_import_validators($params); push @cases, $params; return 1; @@ -226,7 +226,7 @@ sub process_run { $xref->{runs}->{ $e->{'att'}->{'id'} } = undef; - Testopia::TestRun->run_import_validators($params); + Bugzilla::Extension::Testopia::TestRun->run_import_validators($params); push @runs, $params; return 1; @@ -253,7 +253,7 @@ sub process_plan { $xref->{plans}->{ $e->{'att'}->{'id'} } = undef; - Testopia::TestPlan->run_create_validators($params); + Bugzilla::Extension::Testopia::TestPlan->run_create_validators($params); push @plans, $params; return 1; @@ -262,7 +262,7 @@ sub process_plan { sub parse { my ( $self, $xml, $product, $plans ) = @_; $debug = $self->debug; - my $validator = XML::Validator::Schema->new( file => 'extensions/testopia/testopia.xsd' ); + my $validator = XML::Validator::Schema->new( file => 'extensions/Testopia/testopia.xsd' ); my $parser = XML::SAX::ParserFactory->parser( Handler => $validator ); my $twig = XML::Twig->new( @@ -319,10 +319,10 @@ sub parse { delete $params->{xid}; delete $params->{attachments}; - my $plan = Testopia::TestPlan->create($params); + my $plan = Bugzilla::Extension::Testopia::TestPlan->create($params); foreach my $a (@$attachments) { $a->{'plan_id'} = $plan->id; - Testopia::Attachment->create($a); + Bugzilla::Extension::Testopia::Attachment->create($a); } $xref->{plans}->{$xid} = $plan->id; @@ -331,7 +331,7 @@ sub parse { my @caseplans; if ($plans) { - push @caseplans, new Testopia::TestPlan($_) foreach split( ',', $plans ); + push @caseplans, new Bugzilla::Extension::Testopia::TestPlan($_) foreach split( ',', $plans ); } foreach my $params (@cases) { @@ -342,7 +342,7 @@ sub parse { my @linkedplans; foreach my $pid ( @{ $params->{plans} } ) { if ( $xref->{plans}->{$pid} ) { - push @linkedplans, new Testopia::TestPlan( $xref->{plans}->{$pid} ); + push @linkedplans, new Bugzilla::Extension::Testopia::TestPlan( $xref->{plans}->{$pid} ); } } ThrowUserError('plan_needed') unless scalar @linkedplans; @@ -355,10 +355,10 @@ sub parse { delete $params->{xid}; delete $params->{attachments}; - my $case = Testopia::TestCase->create($params); + my $case = Bugzilla::Extension::Testopia::TestCase->create($params); foreach my $a (@$attachments) { $a->{'case_id'} = $case->id; - Testopia::Attachment->create($a); + Bugzilla::Extension::Testopia::Attachment->create($a); } $xref->{cases}->{$xid} = $case->id; @@ -374,7 +374,7 @@ sub parse { foreach my $tb ( split( /[\s,]+/, $params->{dependson} ) ) { push @dependson, $xref->{cases}->{$tb} if $xref->{cases}->{$tb}; } - my $case = Testopia::TestCase->new( $params->{xid} ); + my $case = Bugzilla::Extension::Testopia::TestCase->new( $params->{xid} ); $case->set_blocks( join( ',', @blocks ) ); $case->set_dependson( join( ',', @dependson ) ); $case->update(); @@ -394,7 +394,7 @@ sub parse { $params->{plan_id} = $xref->{plans}->{$params->{plan_id}}; - my $run = Testopia::TestRun->create($params); + my $run = Bugzilla::Extension::Testopia::TestRun->create($params); foreach my $c (@$caseruns) { if ($xref->{cases}->{$c->{case_id}}){ @@ -403,7 +403,7 @@ sub parse { $c->{case_id} = $xref->{cases}->{$c->{case_id}}; $c->{run_id} = $run->id; - Testopia::TestCaseRun->create($c); + Bugzilla::Extension::Testopia::TestCaseRun->create($c); } } diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Product.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Product.pm similarity index 91% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Product.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Product.pm index 225de1ab139..6219f5dd77a 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Product.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Product.pm @@ -18,7 +18,7 @@ # # Contributor(s): Greg Hendricks -package Testopia::Product; +package Bugzilla::Extension::Testopia::Product; use strict; @@ -34,7 +34,7 @@ sub environments { return $self->{'environments'} if defined $self->{'environments'}; - require Testopia::Environment; + require Bugzilla::Extension::Testopia::Environment; my $query = "SELECT environment_id"; $query .= " FROM test_environments"; @@ -51,7 +51,7 @@ sub environments { my @objs; foreach my $id (@{$ref}){ - push @objs, Testopia::Environment->new($id); + push @objs, Bugzilla::Extension::Testopia::Environment->new($id); } $self->{'environments'} = \@objs; @@ -63,7 +63,7 @@ sub builds { my($active, $current) = @_; my $dbh = Bugzilla->dbh; - require Testopia::Build; + require Bugzilla::Extension::Testopia::Build; my $query = "SELECT build_id FROM test_builds WHERE product_id = ?"; if ($active && $current){ @@ -87,7 +87,7 @@ sub builds { my @objs; foreach my $id (@{$ref}){ - push @objs, Testopia::Build->new($id); + push @objs, Bugzilla::Extension::Testopia::Build->new($id); } $self->{'builds'} = \@objs; @@ -105,9 +105,9 @@ sub categories { ORDER BY name", undef, $self->{'id'}); my @objs; - require Testopia::Category; + require Bugzilla::Extension::Testopia::Category; foreach my $id (@{$ref}){ - push @objs, Testopia::Category->new($id); + push @objs, Bugzilla::Extension::Testopia::Category->new($id); } $self->{'categories'} = \@objs; return $self->{'categories'}; @@ -119,7 +119,7 @@ sub plans { return $self->{'plans'} if exists $self->{'plans'}; - require Testopia::TestPlan; + require Bugzilla::Extension::Testopia::TestPlan; my $ref = $dbh->selectcol_arrayref( "SELECT plan_id @@ -130,7 +130,7 @@ sub plans { my @objs; foreach my $id (@{$ref}){ - push @objs, Testopia::TestPlan->new($id); + push @objs, Bugzilla::Extension::Testopia::TestPlan->new($id); } $self->{'plans'} = \@objs; return $self->{'plans'}; @@ -141,7 +141,7 @@ sub cases { my $dbh = Bugzilla->dbh; return $self->{'cases'} if exists $self->{'cases'}; - require Testopia::TestCase; + require Bugzilla::Extension::Testopia::TestCase; my $caseids = $dbh->selectcol_arrayref( "SELECT case_id FROM test_case_plans @@ -151,7 +151,7 @@ sub cases { my @cases; foreach my $id (@{$caseids}){ - push @cases, Testopia::TestCase->new($id); + push @cases, Bugzilla::Extension::Testopia::TestCase->new($id); } $self->{'cases'} = \@cases; @@ -163,7 +163,7 @@ sub runs { my $dbh = Bugzilla->dbh; return $self->{'runs'} if exists $self->{'runs'}; - require Testopia::TestRun; + require Bugzilla::Extension::Testopia::TestRun; my $runids = $dbh->selectcol_arrayref( "SELECT run_id FROM test_runs @@ -173,7 +173,7 @@ sub runs { my @runs; foreach my $id (@{$runids}){ - push @runs, Testopia::TestRun->new($id); + push @runs, Bugzilla::Extension::Testopia::TestRun->new($id); } $self->{'runs'} = \@runs; @@ -190,9 +190,9 @@ sub environment_categories { WHERE product_id = ?", undef, $self->id); my @objs; - require Testopia::Environment::Category; + require Bugzilla::Extension::Testopia::Environment::Category; foreach my $id (@{$ref}){ - push @objs, Testopia::Environment::Category->new($id); + push @objs, Bugzilla::Extension::Testopia::Environment::Category->new($id); } $self->{'environment_categories'} = \@objs; return $self->{'environment_categories'}; @@ -245,7 +245,7 @@ sub tags { my $self = shift; my $dbh = Bugzilla->dbh; - require Testopia::TestTag; + require Bugzilla::Extension::Testopia::TestTag; my $ref = $dbh->selectcol_arrayref( "(SELECT test_tags.tag_id, test_tags.tag_name AS name @@ -272,7 +272,7 @@ sub tags { my @product_tags; foreach my $id (@$ref){ - push @product_tags, Testopia::TestTag->new($id); + push @product_tags, Bugzilla::Extension::Testopia::TestTag->new($id); } $self->{'tags'} = \@product_tags; @@ -325,7 +325,7 @@ __END__ =head1 NAME -Testopia::Product +Bugzilla::Extension::Testopia::Product =head1 EXTENDS @@ -341,8 +341,8 @@ creating new products, see Bugzilla::Product. =head2 Creating - $build = Testopia::Product->new($product_id); - $build = Testopia::Product->new({name => $name}); + $build = Bugzilla::Extension::Testopia::Product->new($product_id); + $build = Bugzilla::Extension::Testopia::Product->new({name => $name}); =head1 METHODS @@ -469,7 +469,7 @@ creating new products, see Bugzilla::Product. =over -L +L L diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Report.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Report.pm similarity index 97% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Report.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Report.pm index 954b0fba157..a9b866dbf57 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Report.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Report.pm @@ -23,7 +23,7 @@ =head1 NAME -Testopia::Report - Generates report data. +Bugzilla::Extension::Testopia::Report - Generates report data. =head1 DESCRIPTION @@ -38,15 +38,15 @@ Reports =cut -package Testopia::Report; +package Bugzilla::Extension::Testopia::Report; use strict; use Bugzilla; use Bugzilla::Util; use Bugzilla::Error; -use Testopia::Util; -use Testopia::Search; +use Bugzilla::Extension::Testopia::Util; +use Bugzilla::Extension::Testopia::Search; ############################### @@ -200,7 +200,7 @@ sub init { $cgi->param('viewall', 1); my $dbh = Bugzilla->switch_to_shadow_db; - my $search = Testopia::Search->new($cgi, \@selectnames); + my $search = Bugzilla::Extension::Testopia::Search->new($cgi, \@selectnames); my $results = $dbh->selectall_arrayref($search->query); $dbh = Bugzilla->switch_to_main_db; diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Search.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Search.pm similarity index 99% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Search.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Search.pm index 27563c8820c..c592edacbd3 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Search.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Search.pm @@ -32,11 +32,11 @@ =head1 NAME -Testopia::Search - A module to support searches in Testopis +Bugzilla::Extension::Testopia::Search - A module to support searches in Testopis =head1 DESCRIPTION -Testopia::Search is based heavilly on Bugzilla::Search. It takes a +Bugzilla::Extension::Testopia::Search is based heavilly on Bugzilla::Search. It takes a CGI instance and parses its parameters to generate an SQL query that can be used to get a result set from the database. The query is usually passed to Table.pm to execute and display the results. @@ -46,11 +46,11 @@ on one column at a time in ascending order. =head1 SYNOPSIS - $search = Testopia::Search($cgi); + $search = Bugzilla::Extension::Testopia::Search($cgi); =cut -package Testopia::Search; +package Bugzilla::Extension::Testopia::Search; use strict; @@ -58,8 +58,8 @@ use Bugzilla::Util; use Bugzilla::User; use Bugzilla::Config; use Bugzilla::Error; -use Testopia::Util; -use Testopia::TestCase; +use Bugzilla::Extension::Testopia::Util; +use Bugzilla::Extension::Testopia::TestCase; use Date::Format; use Date::Parse; @@ -119,7 +119,7 @@ sub init { my @plan_ids = split(',',$cgi->param('plan_ids')); my @plans; foreach my $p (@plan_ids){ - my $plan = Testopia::TestPlan->new(trim($p)); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new(trim($p)); push @plans, $plan->id if $plan && $plan->canview; } my $plans = join(',',@plans); @@ -1874,7 +1874,7 @@ sub GetByWordListSubstr { =head1 SEE ALSO -Testopia::Table Bugzilla::Search +Bugzilla::Extension::Testopia::Table Bugzilla::Search =head1 AUTHOR diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Table.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Table.pm similarity index 91% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Table.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Table.pm index f90ec4912df..a9c56a949b5 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Table.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Table.pm @@ -20,7 +20,7 @@ =head1 NAME -Testopia::Table - Produces display tables for Testopia lists +Bugzilla::Extension::Testopia::Table - Produces display tables for Testopia lists =head1 DESCRIPTION @@ -45,22 +45,22 @@ arguments: =head1 SYNOPSIS - $table = Testopia::Table->new($type, $url, $cgi, $list, $query); + $table = Bugzilla::Extension::Testopia::Table->new($type, $url, $cgi, $list, $query); =cut -package Testopia::Table; +package Bugzilla::Extension::Testopia::Table; use strict; use Bugzilla; use Bugzilla::Util; use Bugzilla::Error; -use Testopia::Util; -use Testopia::TestCase; -use Testopia::TestPlan; -use Testopia::TestRun; -use Testopia::TestCaseRun; +use Bugzilla::Extension::Testopia::Util; +use Bugzilla::Extension::Testopia::TestCase; +use Bugzilla::Extension::Testopia::TestPlan; +use Bugzilla::Extension::Testopia::TestRun; +use Bugzilla::Extension::Testopia::TestCaseRun; ############################### #### Initialization #### @@ -128,19 +128,19 @@ sub init { foreach my $id (@$list){ my $o; if ($type eq 'case'){ - $o = Testopia::TestCase->new($id); + $o = Bugzilla::Extension::Testopia::TestCase->new($id); } elsif ($type eq 'plan'){ - $o = Testopia::TestPlan->new($id); + $o = Bugzilla::Extension::Testopia::TestPlan->new($id); } elsif ($type eq 'run'){ - $o = Testopia::TestRun->new($id); + $o = Bugzilla::Extension::Testopia::TestRun->new($id); } elsif ($type eq 'case_run'){ - $o = Testopia::TestCaseRun->new($id); + $o = Bugzilla::Extension::Testopia::TestCaseRun->new($id); } elsif ($type eq 'environment'){ - $o = Testopia::Environment->new($id); + $o = Bugzilla::Extension::Testopia::Environment->new($id); } push (@ids, $id); push (@list, $o); @@ -160,34 +160,34 @@ sub init { # my @list; # foreach my $id (split(",", $self->get_saved_list())){ # if ($self->{'type'} eq 'case'){ -# my $o = Testopia::TestCase->new($id); +# my $o = Bugzilla::Extension::Testopia::TestCase->new($id); # push @list, $o; # $o->category; # $o->status; # $o->priority; # } # elsif ($self->{'type'} eq 'plan'){ -# my $o = Testopia::TestPlan->new($id); +# my $o = Bugzilla::Extension::Testopia::TestPlan->new($id); # push @list, $o; # $o->test_case_count; # $o->test_run_count; # } # elsif ($self->{'type'} eq 'run'){ -# my $o = Testopia::TestCase->new($id); +# my $o = Bugzilla::Extension::Testopia::TestCase->new($id); # push @list, $o; ## $o->category; ## $o->status; ## $o->priority; # } # elsif ($self->{'type'} eq 'caserun'){ -# my $o = Testopia::TestCase->new($id); +# my $o = Bugzilla::Extension::Testopia::TestCase->new($id); # push @list, $o; ## $o->category; ## $o->status; ## $o->priority; # } # elsif ($self->{'type'} eq 'attachment'){ -# my $o = Testopia::TestCase->new($id); +# my $o = Bugzilla::Extension::Testopia::TestCase->new($id); # push @list, $o; ## $o->category; ## $o->status; @@ -504,7 +504,7 @@ sub to_ext_json { =head1 SEE ALSO -Testopia::Search +Bugzilla::Extension::Testopia::Search =head1 AUTHOR diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/TestCase.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/TestCase.pm similarity index 94% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/TestCase.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/TestCase.pm index 50c8778843e..ce01a95952f 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/TestCase.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/TestCase.pm @@ -30,7 +30,7 @@ # Jeff Dayley # M-A Parent -package Testopia::TestCase; +package Bugzilla::Extension::Testopia::TestCase; use strict; @@ -41,19 +41,19 @@ use Bugzilla::Config; use Bugzilla::Error; use Bugzilla::Constants; -use Testopia::Constants; -use Testopia::Util; -use Testopia::TestPlan; -use Testopia::TestRun; -use Testopia::TestCaseRun; -use Testopia::Category; -use Testopia::Attachment; +use Bugzilla::Extension::Testopia::Constants; +use Bugzilla::Extension::Testopia::Util; +use Bugzilla::Extension::Testopia::TestPlan; +use Bugzilla::Extension::Testopia::TestRun; +use Bugzilla::Extension::Testopia::TestCaseRun; +use Bugzilla::Extension::Testopia::Category; +use Bugzilla::Extension::Testopia::Attachment; use JSON; use Text::Diff; use base qw(Exporter Bugzilla::Object); -@Testopia::TestCase::EXPORT = qw(lookup_status lookup_status_by_name +our @EXPORT = qw(lookup_status lookup_status_by_name lookup_category lookup_category_by_name lookup_priority lookup_priority_by_value lookup_default_tester); @@ -161,7 +161,7 @@ sub _check_status{ $status = trim($status); my $status_id; if ($status =~ /^\d+$/){ - $status_id = Testopia::Util::validate_selection($status, 'case_status_id', 'test_case_status'); + $status_id = Bugzilla::Extension::Testopia::Util::validate_selection($status, 'case_status_id', 'test_case_status'); } else { trick_taint($status); @@ -177,13 +177,13 @@ sub _check_category{ my $category_id; if (ref $category){ $product = Bugzilla::Product::check_product($category->{'product'}); - $category_id = Testopia::Category::check_case_category($category->{'category'}, $product); + $category_id = Bugzilla::Extension::Testopia::Category::check_case_category($category->{'category'}, $product); } elsif ($category =~ /^\d+$/){ - $category_id = Testopia::Util::validate_selection($category, 'category_id', 'test_case_categories'); + $category_id = Bugzilla::Extension::Testopia::Util::validate_selection($category, 'category_id', 'test_case_categories'); } else { - $category_id = Testopia::Category::check_case_category($category, $product); + $category_id = Bugzilla::Extension::Testopia::Category::check_case_category($category, $product); } return $category_id; @@ -195,7 +195,7 @@ sub _check_priority{ trick_taint($priority); my $priority_id; if ($priority =~ /^\d+$/){ - $priority_id = Testopia::Util::validate_selection($priority, 'id', 'priority'); + $priority_id = Bugzilla::Extension::Testopia::Util::validate_selection($priority, 'id', 'priority'); } else { $priority_id = lookup_priority_by_value($priority); @@ -317,7 +317,7 @@ sub _check_dependency{ my @validvalues; foreach my $id (split(/[\s,]+/, $value)) { next unless $id; - Testopia::Util::validate_test_id($id, 'case'); + Bugzilla::Extension::Testopia::Util::validate_test_id($id, 'case'); push(@validvalues, $id); } $value = join(",", @validvalues); @@ -328,7 +328,7 @@ sub _check_dependency{ sub _check_plans { my ($invocant, $plans) = @_; - # $plans is a reference to an array of Testopia::TestPlan objects. + # $plans is a reference to an array of Bugzilla::Extension::Testopia::TestPlan objects. ThrowUserError('plan_needed') unless scalar @$plans > 0; return $plans; } @@ -338,8 +338,8 @@ sub _check_cases { my @cases; foreach my $caseid (split(/[\s,]+/, $caseids)){ - Testopia::Util::validate_test_id($caseid, 'case'); - push @cases, Testopia::TestCase->new($caseid); + Bugzilla::Extension::Testopia::Util::validate_test_id($caseid, 'case'); + push @cases, Bugzilla::Extension::Testopia::TestCase->new($caseid); } return \@cases; @@ -352,8 +352,8 @@ sub _check_runs { $runids = join(',' ,@$runids); } foreach my $runid (split(/[\s,]+/, $runids)){ - Testopia::Util::validate_test_id($runid, 'run'); - push @runs, Testopia::TestRun->new($runid); + Bugzilla::Extension::Testopia::Util::validate_test_id($runid, 'run'); + push @runs, Bugzilla::Extension::Testopia::TestRun->new($runid); } return \@runs; } @@ -392,7 +392,7 @@ sub _check_components { @comp_ids = split(/[\s,]+/, $components); } foreach my $id (@comp_ids){ - Testopia::Util::validate_selection($id, 'id', 'components'); + Bugzilla::Extension::Testopia::Util::validate_selection($id, 'id', 'components'); trick_taint($id); if (ref $invocant){ @@ -507,7 +507,7 @@ sub create { $class->SUPER::check_required_create_fields($params); my $field_values = $class->run_create_validators($params); - $field_values->{creation_date} = Testopia::Util::get_time_stamp(); + $field_values->{creation_date} = Bugzilla::Extension::Testopia::Util::get_time_stamp(); # We have to handle these fields a bit differently since they have their own tables. my $action = $field_values->{action}; @@ -554,7 +554,7 @@ sub create { sub update { my $self = shift; my $dbh = Bugzilla->dbh; - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); $self->update_deps($self->{'dependson'}, $self->{'blocks'}); @@ -565,7 +565,7 @@ sub update { delete $changed->{'sortkey'}; foreach my $field (keys %$changed){ - Testopia::Util::log_activity('case', $self->id, $field, $timestamp, + Bugzilla::Extension::Testopia::Util::log_activity('case', $self->id, $field, $timestamp, $changed->{$field}->[0], $changed->{$field}->[1]); } @@ -700,7 +700,7 @@ sub get_category_list{ WHERE product_id IN (". join(",", @{$self->get_product_ids}) .")"); my @categories; foreach my $c (@$ids){ - push @categories, Testopia::Category->new($c); + push @categories, Bugzilla::Extension::Testopia::Category->new($c); } return \@categories; } @@ -829,7 +829,7 @@ sub add_tag { } foreach my $name (@tags){ - my $tag = Testopia::TestTag->create({'tag_name' => $name}); + my $tag = Bugzilla::Extension::Testopia::TestTag->create({'tag_name' => $name}); $tag->attach($self); } } @@ -843,7 +843,7 @@ Disassociates a tag from this test case sub remove_tag { my $self = shift; my ($tag_name) = @_; - my $tag = Testopia::TestTag->check_tag($tag_name); + my $tag = Bugzilla::Extension::Testopia::TestTag->check_tag($tag_name); ThrowUserError('testopia-unknown-tag', {'name' => $tag}) unless $tag; my $dbh = Bugzilla->dbh; $dbh->do("DELETE FROM test_case_tags @@ -1167,7 +1167,7 @@ sub store { my $dbh = Bugzilla->dbh; # Exclude the auto-incremented field from the column list. my $columns = join(", ", grep {$_ ne 'case_id'} DB_COLUMNS); - my ($timestamp) = Testopia::Util::get_time_stamp(); + my ($timestamp) = Bugzilla::Extension::Testopia::Util::get_time_stamp(); $dbh->do("INSERT INTO test_cases ($columns) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)", undef, ## Database Column ## @@ -1210,7 +1210,7 @@ sub store_text { my $dbh = Bugzilla->dbh; my ($key, $author, $action, $effect, $setup, $breakdown, $reset_version, $timestamp) = @_; if (!defined $timestamp){ - ($timestamp) = Testopia::Util::get_time_stamp(); + ($timestamp) = Bugzilla::Extension::Testopia::Util::get_time_stamp(); } trick_taint($action) if $action; trick_taint($effect) if $effect; @@ -1260,7 +1260,7 @@ sub link_plan { # Update the plans array to include new plan added. - push @{$self->{'plans'}}, Testopia::TestPlan->new($plan_id); + push @{$self->{'plans'}}, Bugzilla::Extension::Testopia::TestPlan->new($plan_id); } @@ -1275,7 +1275,7 @@ sub unlink_plan { my $self = shift; my $dbh = Bugzilla->dbh; my ($plan_id) = @_; - my $plan = Testopia::TestPlan->new($plan_id); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new($plan_id); if (scalar @{$self->plans} == 1){ $self->obliterate; @@ -1315,7 +1315,7 @@ sub copy { my ($author, $tester, $copydoc, $category_id) = @_; # Exclude the auto-incremented field from the column list. my $columns = join(", ", grep {$_ ne 'case_id'} DB_COLUMNS); - my ($timestamp) = Testopia::Util::get_time_stamp(); + my ($timestamp) = Bugzilla::Extension::Testopia::Util::get_time_stamp(); $category_id ||= $self->{'category_id'}; $dbh->do("INSERT INTO test_cases ($columns) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)", @@ -1492,7 +1492,7 @@ sub update_deps { my @validvalues; foreach my $id (split(/[\s,]+/, $fields->{$field})) { next unless $id; - Testopia::Util::validate_test_id($id, 'case'); + Bugzilla::Extension::Testopia::Util::validate_test_id($id, 'case'); push(@validvalues, $id); } $fields->{$field} = join(",", @validvalues); @@ -1808,7 +1808,7 @@ sub can_unlink_plan { my $self = shift; my ($plan_id) = @_; - my $plan = Testopia::TestPlan->new($plan_id); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new($plan_id); return 1 if Bugzilla->user->in_group('admin'); return 1 if Bugzilla->user->in_group('Testers') && Bugzilla->params->{"testopia-allow-group-member-deletes"}; return 1 if $plan->get_user_rights(Bugzilla->user->id) & TR_DELETE; @@ -1933,7 +1933,7 @@ sub attachments { my @attachments; foreach my $attach (@{$attachments}){ - push @attachments, Testopia::Attachment->new($attach); + push @attachments, Bugzilla::Extension::Testopia::Attachment->new($attach); } $self->{'attachments'} = \@attachments; return $self->{'attachments'}; @@ -2005,7 +2005,7 @@ Returns the category name based on the category_id of this case sub category { my $self = shift; return $self->{'category'} if exists $self->{'category'}; - $self->{'category'} = Testopia::Category->new($self->{'category_id'}); + $self->{'category'} = Bugzilla::Extension::Testopia::Category->new($self->{'category_id'}); return $self->{'category'}; } @@ -2041,7 +2041,7 @@ sub components { =head2 tags -Returns a reference to a list of Testopia::TestTag objects +Returns a reference to a list of Bugzilla::Extension::Testopia::TestTag objects associated with this case. =cut @@ -2058,7 +2058,7 @@ sub tags { undef, $self->{'case_id'}); my @tags; foreach my $id (@{$tagids}){ - push @tags, Testopia::TestTag->new($id); + push @tags, Bugzilla::Extension::Testopia::TestTag->new($id); } $self->{'tags'} = \@tags; return $self->{'tags'}; @@ -2066,7 +2066,7 @@ sub tags { =head2 plans -Returns a reference to a list of Testopia::TestPlan objects +Returns a reference to a list of Bugzilla::Extension::Testopia::TestPlan objects associated with this case. =cut @@ -2081,7 +2081,7 @@ sub plans { undef, $self->{'case_id'}); my @plans; foreach my $id (@{$ref}){ - push @plans, Testopia::TestPlan->new($id); + push @plans, Bugzilla::Extension::Testopia::TestPlan->new($id); } $self->{'plans'} = \@plans; return $self->{'plans'}; @@ -2120,7 +2120,7 @@ sub bugs { next unless Bugzilla->user->can_see_bug($row->{'bug_id'}); my $bug = Bugzilla::Bug->new($row->{'bug_id'}, Bugzilla->user->id); if ($row->{'case_run_id'}){ - my $cr = Testopia::TestCaseRun->new($row->{'case_run_id'}); + my $cr = Bugzilla::Extension::Testopia::TestCaseRun->new($row->{'case_run_id'}); next unless $cr; $bug->{'build'} = $cr->build->name; $bug->{'env'} = $cr->environment->name; @@ -2189,7 +2189,7 @@ sub text { =head2 runs -Returns a reference to a list of Testopia::TestRun objects +Returns a reference to a list of Bugzilla::Extension::Testopia::TestRun objects associated with this case. =cut @@ -2206,7 +2206,7 @@ sub runs { undef, $self->{'case_id'}); my @runs; foreach my $id (@{$ref}){ - push @runs, Testopia::TestRun->new($id); + push @runs, Bugzilla::Extension::Testopia::TestRun->new($id); } $self->{'runs'} = \@runs; return $self->{'runs'}; @@ -2225,7 +2225,7 @@ sub run_count { =head2 caseruns -Returns a reference to a list of Testopia::TestCaseRun objects +Returns a reference to a list of Bugzilla::Extension::Testopia::TestCaseRun objects associated with this case. =cut @@ -2240,7 +2240,7 @@ sub caseruns { undef, $self->{'case_id'}); my @runs; foreach my $id (@{$ref}){ - push @runs, Testopia::TestCaseRun->new($id); + push @runs, Bugzilla::Extension::Testopia::TestCaseRun->new($id); } $self->{'caseruns'} = \@runs; return $self->{'caseruns'}; @@ -2257,7 +2257,7 @@ sub sortkey { =head2 blocked -Returns a reference to a list of Testopia::TestCase objects +Returns a reference to a list of Bugzilla::Extension::Testopia::TestCase objects which are blocked by this test case. =cut @@ -2268,7 +2268,7 @@ sub blocked { my @deps; my $ref = _get_dep_lists("dependson", "blocked", $self->{'case_id'}); foreach my $id (@{$ref}){ - push @deps, Testopia::TestCase->new($id); + push @deps, Bugzilla::Extension::Testopia::TestCase->new($id); } $self->{'blocked'} = \@deps; return $self->{'blocked'}; @@ -2299,7 +2299,7 @@ sub blocked_list_uncached { =head2 dependson -Returns a reference to a list of Testopia::TestCase objects +Returns a reference to a list of Bugzilla::Extension::Testopia::TestCase objects which depend on this test case. =cut @@ -2310,7 +2310,7 @@ sub dependson { my @deps; my $ref = _get_dep_lists("blocked", "dependson", $self->{'case_id'}); foreach my $id (@{$ref}){ - push @deps, Testopia::TestCase->new($id); + push @deps, Bugzilla::Extension::Testopia::TestCase->new($id); } $self->{'dependson'} = \@deps; return $self->{'dependson'}; @@ -2382,7 +2382,7 @@ __END__ =head1 NAME -Testopia::TestCase - Testopia Test Case object +Bugzilla::Extension::Testopia::TestCase - Testopia Test Case object =head1 DESCRIPTION @@ -2391,10 +2391,10 @@ be linked to one or more test plans. =head1 SYNOPSIS -use Testopia::TestCase; +use Bugzilla::Extension::Testopia::TestCase; - $case = Testopia::TestCase->new($case_id); - $case = Testopia::TestCase->new(\%case_hash); + $case = Bugzilla::Extension::Testopia::TestCase->new($case_id); + $case = Bugzilla::Extension::Testopia::TestCase->new(\%case_hash); =cut diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/TestCaseRun.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/TestCaseRun.pm similarity index 93% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/TestCaseRun.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/TestCaseRun.pm index 579c9387ef5..d4817b23ffc 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/TestCaseRun.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/TestCaseRun.pm @@ -19,7 +19,7 @@ # Contributor(s): Greg Hendricks -package Testopia::TestCaseRun; +package Bugzilla::Extension::Testopia::TestCaseRun; use strict; @@ -30,11 +30,11 @@ use Bugzilla::Bug; use Bugzilla::Config; use Bugzilla::Constants; -use Testopia::Util; -use Testopia::Environment; -use Testopia::Build; -use Testopia::Constants; -use Testopia::Attachment; +use Bugzilla::Extension::Testopia::Util; +use Bugzilla::Extension::Testopia::Environment; +use Bugzilla::Extension::Testopia::Build; +use Bugzilla::Extension::Testopia::Constants; +use Bugzilla::Extension::Testopia::Attachment; use Date::Format; use Date::Parse; @@ -93,7 +93,7 @@ use constant VALIDATORS => { run_id => \&_check_run_id, case_text_version => \&_check_case_text_version, case_run_status_id => \&_check_case_run_status_id, - priority_id => \&Testopia::TestCase::_check_priority, + priority_id => \&Bugzilla::Extension::Testopia::TestCase::_check_priority, }; use constant UPDATE_VALIDATORS => { @@ -129,12 +129,12 @@ sub report_columns { ############################### sub _check_case_id { my ($invocant, $id) = @_; - return Testopia::Util::validate_test_id($id, 'case'); + return Bugzilla::Extension::Testopia::Util::validate_test_id($id, 'case'); } sub _check_run_id { my ($invocant, $id) = @_; - return Testopia::Util::validate_test_id($id, 'run'); + return Bugzilla::Extension::Testopia::Util::validate_test_id($id, 'run'); } sub _check_case_run_status_id { @@ -142,7 +142,7 @@ sub _check_case_run_status_id { $status = trim($status); my $status_id; if ($status =~ /^\d+$/){ - $status_id = Testopia::Util::validate_selection($status, 'case_run_status_id', 'test_case_run_status'); + $status_id = Bugzilla::Extension::Testopia::Util::validate_selection($status, 'case_run_status_id', 'test_case_run_status'); } else { $status_id = lookup_status_by_name($status); @@ -214,10 +214,10 @@ sub new { sub run_create_validators { my $class = shift; my $params = $class->SUPER::run_create_validators(@_); - my $run = Testopia::TestRun->new($params->{run_id}); + my $run = Bugzilla::Extension::Testopia::TestRun->new($params->{run_id}); - $params->{build_id} = Testopia::TestRun::->_check_build($params->{build_id}, $run->plan->product); - $params->{environment_id} = Testopia::TestRun::->_check_env($params->{environment_id}, $run->plan->product); + $params->{build_id} = Bugzilla::Extension::Testopia::TestRun::->_check_build($params->{build_id}, $run->plan->product); + $params->{environment_id} = Bugzilla::Extension::Testopia::TestRun::->_check_env($params->{environment_id}, $run->plan->product); $params->{assignee} = $class->_check_assignee($params->{assignee}); $params->{testedby} = $class->_check_assignee($params->{testedby}); @@ -235,7 +235,7 @@ sub create { my ($class, $params) = @_; $class->SUPER::check_required_create_fields($params); - my $case = Testopia::TestCase->new($params->{case_id}); + my $case = Bugzilla::Extension::Testopia::TestCase->new($params->{case_id}); unless ($params->{priority_id}){ $params->{priority_id} = $case->{priority_id}; @@ -289,7 +289,7 @@ sub switch { undef, ($run_id, $case_id, $build_id, $env_id)); if ($is){ - $self = Testopia::TestCaseRun->new($is); + $self = Bugzilla::Extension::Testopia::TestCaseRun->new($is); } else { my $oldbuild = $self->{'build_id'}; @@ -306,7 +306,7 @@ sub switch { }); if ($oldbuild != $build_id){ - my $build = Testopia::Build->new($oldbuild); + my $build = Bugzilla::Extension::Testopia::Build->new($oldbuild); my $note = "Build Changed by ". Bugzilla->user->login; $note .= ". Old build: '". $build->name; $note .= "' New build: '". $self->build->name; @@ -314,7 +314,7 @@ sub switch { $self->append_note($note); } if ($oldenv != $env_id){ - my $environment = Testopia::Environment->new($oldenv); + my $environment = Bugzilla::Extension::Testopia::Environment->new($oldenv); my $note = "Environment Changed by ". Bugzilla->user->login; $note .= ". Old environment: '". $environment->name; $note .= "' New environment: '". $self->environment->name; @@ -476,13 +476,13 @@ sub set_status { $self->{'testedby'} = undef; } elsif ($status_id == RUNNING || $status_id == PAUSED){ - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); $self->_update_fields({'running_date' => $timestamp}) if $status_id == RUNNING; $self->_update_fields({'close_date' => undef}); $self->{'close_date'} = undef; } else { - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); $self->_update_fields({'close_date' => $timestamp}); $self->_update_fields({'testedby' => Bugzilla->user->id}); $self->{'close_date'} = $timestamp; @@ -667,7 +667,7 @@ Attaches the specified bug to this test case-run sub attach_bug { my $self = shift; my ($bugs, $caserun_id) = @_; - $bugs = Testopia::TestCase->_check_bugs($bugs, "ATTACH"); + $bugs = Bugzilla::Extension::Testopia::TestCase->_check_bugs($bugs, "ATTACH"); $caserun_id ||= $self->{'case_run_id'}; my $dbh = Bugzilla->dbh; @@ -740,7 +740,7 @@ sub update_bugs { my ($status) = @_; my $resolution; my $dbh = Bugzilla->dbh; - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); foreach my $bug (@{$self->case->bugs}){ my $oldstatus = $bug->bug_status; my $oldresolution = $bug->resolution; @@ -792,7 +792,7 @@ sub obliterate { ($self->{'case_id'}, $self->{'run_id'})); if (scalar @{$ref}){ - my $cr = new Testopia::TestCaseRun(@{$ref}[0]); + my $cr = new Bugzilla::Extension::Testopia::TestCaseRun(@{$ref}[0]); $cr->set_as_current; } } @@ -930,8 +930,8 @@ Returns the TestRun object that this case-run is associated with sub run { my $self = shift; return $self->{'run'} if exists $self->{'run'}; - require Testopia::TestRun; - $self->{'run'} = Testopia::TestRun->new($self->{'run_id'}); + require Bugzilla::Extension::Testopia::TestRun; + $self->{'run'} = Bugzilla::Extension::Testopia::TestRun->new($self->{'run_id'}); return $self->{'run'}; } @@ -945,8 +945,8 @@ Returns the TestCase object that this case-run is associated with sub case { my $self = shift; return $self->{'case'} if exists $self->{'case'}; - require Testopia::TestCase; - $self->{'case'} = Testopia::TestCase->new($self->{'case_id'}); + require Bugzilla::Extension::Testopia::TestCase; + $self->{'case'} = Bugzilla::Extension::Testopia::TestCase->new($self->{'case_id'}); return $self->{'case'}; } @@ -959,7 +959,7 @@ Returns the Build object that this case-run is associated with sub build { my $self = shift; return $self->{'build'} if exists $self->{'build'}; - $self->{'build'} = Testopia::Build->new($self->{'build_id'}); + $self->{'build'} = Bugzilla::Extension::Testopia::Build->new($self->{'build_id'}); return $self->{'build'}; } @@ -972,7 +972,7 @@ Returns the Build object that this case-run is associated with sub environment { my $self = shift; return $self->{'environment'} if exists $self->{'environment'}; - $self->{'environment'} = Testopia::Environment->new($self->{'environment_id'}); + $self->{'environment'} = Bugzilla::Extension::Testopia::Environment->new($self->{'environment_id'}); return $self->{'environment'}; } @@ -1012,7 +1012,7 @@ sub attachments { my @attachments; foreach my $attach (@{$attachments}){ - my $att = Testopia::Attachment->new($attach->{attachment_id}); + my $att = Bugzilla::Extension::Testopia::Attachment->new($attach->{attachment_id}); $att->{'caserun_id'} = $self->id if $attach->{case_run_id}; push @attachments, $att; } @@ -1232,7 +1232,7 @@ sub lookup_status_by_name { __END__ =head1 NAME -Testopia::TestCaseRun - Testopia Test Case Run object +Bugzilla::Extension::Testopia::TestCaseRun - Testopia Test Case Run object =head1 DESCRIPTION @@ -1246,10 +1246,10 @@ case-run is made in the table for historical purposes. =head1 SYNOPSIS -use Testopia::TestCaseRun; +use Bugzilla::Extension::Testopia::TestCaseRun; - $caserun = Testopia::TestCaseRun->new($caserun_id); - $caserun = Testopia::TestCaseRun->new(\%caserun_hash); + $caserun = Bugzilla::Extension::Testopia::TestCaseRun->new($caserun_id); + $caserun = Bugzilla::Extension::Testopia::TestCaseRun->new(\%caserun_hash); =cut diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/TestPlan.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/TestPlan.pm similarity index 94% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/TestPlan.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/TestPlan.pm index 76542c2618f..31d8ee6c4c0 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/TestPlan.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/TestPlan.pm @@ -18,7 +18,7 @@ # # Contributor(s): Greg Hendricks -package Testopia::TestPlan; +package Bugzilla::Extension::Testopia::TestPlan; use strict; @@ -30,17 +30,17 @@ use Bugzilla::Constants; use Bugzilla::Version; use Bugzilla::Bug; -use Testopia::Constants; -use Testopia::Util; -use Testopia::TestTag; -use Testopia::Product; -use Testopia::Attachment; +use Bugzilla::Extension::Testopia::Constants; +use Bugzilla::Extension::Testopia::Util; +use Bugzilla::Extension::Testopia::TestTag; +use Bugzilla::Extension::Testopia::Product; +use Bugzilla::Extension::Testopia::Attachment; use Text::Diff; use JSON; use base qw(Exporter Bugzilla::Object); -@Testopia::TestPlan::EXPORT = qw(lookup_type_by_name lookup_type); +our @EXPORT = qw(lookup_type_by_name lookup_type); ############################### #### Initialization #### @@ -118,10 +118,10 @@ sub _check_product { my $product; if ($product_id !~ /^\d+$/ ){ $product = Bugzilla::Product::check_product($product_id); - $product = Testopia::Product->new($product->id); + $product = Bugzilla::Extension::Testopia::Product->new($product->id); } else { - $product = Testopia::Product->new($product_id); + $product = Bugzilla::Extension::Testopia::Product->new($product_id); } ThrowUserError("invalid-test-id-non-existent", {'id' => $product_id, 'type' => 'product'}) unless $product; @@ -153,7 +153,7 @@ sub _check_type { if ($type_id !~ /^\d+$/){ $type_id = lookup_type_by_name($type_id) || $type_id; } - Testopia::Util::validate_selection($type_id, 'type_id', 'test_plan_types'); + Bugzilla::Extension::Testopia::Util::validate_selection($type_id, 'type_id', 'test_plan_types'); return $type_id; } @@ -226,7 +226,7 @@ sub create { $class->SUPER::check_required_create_fields($params); my $field_values = $class->run_create_validators($params); - $field_values->{creation_date} = Testopia::Util::get_time_stamp(); + $field_values->{creation_date} = Bugzilla::Extension::Testopia::Util::get_time_stamp(); $field_values->{isactive} = 1; #We have to handle the plan document text a bit differently since it has its own table. @@ -250,8 +250,8 @@ sub create { # Create default category unless (scalar @{$self->product->categories}){ - require Testopia::Category; - my $category = Testopia::Category->create( + require Bugzilla::Extension::Testopia::Category; + my $category = Bugzilla::Extension::Testopia::Category->create( {'name' => '--default--', 'description' => 'Default product category for test cases', 'product_id' => $self->product->id }); @@ -263,13 +263,13 @@ sub create { sub update { my $self = shift; my $dbh = Bugzilla->dbh; - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); $dbh->bz_start_transaction(); my $changed = $self->SUPER::update(); foreach my $field (keys %$changed){ - Testopia::Util::log_activity('plan', $self->id, $field, $timestamp, $changed->{$field}->[0], $changed->{$field}->[1]); + Bugzilla::Extension::Testopia::Util::log_activity('plan', $self->id, $field, $timestamp, $changed->{$field}->[0], $changed->{$field}->[1]); } $dbh->bz_commit_transaction(); } @@ -291,7 +291,7 @@ sub store_text { my $dbh = Bugzilla->dbh; my ($key, $author, $text, $timestamp) = @_; if (!defined $timestamp){ - ($timestamp) = Testopia::Util::get_time_stamp(); + ($timestamp) = Bugzilla::Extension::Testopia::Util::get_time_stamp(); } $text ||= ''; trick_taint($text); @@ -320,7 +320,7 @@ sub clone { my $dbh = Bugzilla->dbh; # Exclude the auto-incremented field from the column list. my $columns = join(", ", grep {$_ ne 'plan_id'} DB_COLUMNS); - my ($timestamp) = Testopia::Util::get_time_stamp(); + my ($timestamp) = Bugzilla::Extension::Testopia::Util::get_time_stamp(); $dbh->do("INSERT INTO test_plans ($columns) VALUES (?,?,?,?,?,?,?)", undef, ($product_id, $author, @@ -370,7 +370,7 @@ sub add_tag { } foreach my $name (@tags){ - my $tag = Testopia::TestTag->create({'tag_name' => $name}); + my $tag = Bugzilla::Extension::Testopia::TestTag->create({'tag_name' => $name}); $tag->attach($self); } } @@ -384,7 +384,7 @@ Removes a tag from this plan. Takes the tag_id of the tag to remove. sub remove_tag { my $self = shift; my ($tag_name) = @_; - my $tag = Testopia::TestTag->check_tag($tag_name); + my $tag = Bugzilla::Extension::Testopia::TestTag->check_tag($tag_name); ThrowUserError('testopia-unknown-tag', {'name' => $tag}) unless $tag; my $dbh = Bugzilla->dbh; $dbh->do("DELETE FROM test_plan_tags @@ -974,7 +974,7 @@ sub get_case_tags { WHERE test_case_plans.plan_id = ?", undef, $self->id); my @tags; foreach my $id (@$tags){ - push @tags, Testopia::TestTag->new($id); + push @tags, Bugzilla::Extension::Testopia::TestTag->new($id); } return \@tags; } @@ -1157,7 +1157,7 @@ sub attachments { my @attachments; foreach my $attach (@{$attachments}){ - push @attachments, Testopia::Attachment->new($attach); + push @attachments, Bugzilla::Extension::Testopia::Attachment->new($attach); } $self->{'attachments'} = \@attachments; return $self->{'attachments'}; @@ -1202,7 +1202,7 @@ sub product { return $self->{'product'} if exists $self->{'product'}; - $self->{'product'} = Testopia::Product->new($self->product_id); + $self->{'product'} = Bugzilla::Extension::Testopia::Product->new($self->product_id); return $self->{'product'}; } @@ -1222,7 +1222,7 @@ sub case_ids { =head2 test_cases -Returns a reference to a list of Testopia::TestCase objects linked +Returns a reference to a list of Bugzilla::Extension::Testopia::TestCase objects linked to this plan =cut @@ -1232,7 +1232,7 @@ sub test_cases { my $dbh = Bugzilla->dbh; return $self->{'test_cases'} if exists $self->{'test_cases'}; - require Testopia::TestCase; + require Bugzilla::Extension::Testopia::TestCase; my $caseids = $dbh->selectcol_arrayref( "SELECT case_id FROM test_case_plans @@ -1240,7 +1240,7 @@ sub test_cases { undef, $self->{'plan_id'}); my @cases; foreach my $id (@{$caseids}){ - push @cases, Testopia::TestCase->new($id); + push @cases, Bugzilla::Extension::Testopia::TestCase->new($id); } $self->{'case_list'} = join(',', @{$caseids}); $self->{'test_cases'} = \@cases; @@ -1280,7 +1280,7 @@ sub test_runs { undef, $self->{'plan_id'}); my @runs; foreach my $id (@{$runids}){ - push @runs, Testopia::TestRun->new($id); + push @runs, Bugzilla::Extension::Testopia::TestRun->new($id); } $self->{'test_runs'} = \@runs; @@ -1330,7 +1330,7 @@ sub builds_seen { my ($status_id) = @_; my $dbh = Bugzilla->dbh; - require Testopia::Build; + require Bugzilla::Extension::Testopia::Build; my $ref = $dbh->selectcol_arrayref( "SELECT DISTINCT test_case_runs.build_id @@ -1341,7 +1341,7 @@ sub builds_seen { my @o; foreach my $id (@$ref){ - push @o, Testopia::Build->new($id); + push @o, Bugzilla::Extension::Testopia::Build->new($id); } return \@o; } @@ -1351,7 +1351,7 @@ sub environments_seen { my ($status_id) = @_; my $dbh = Bugzilla->dbh; - require Testopia::Environment; + require Bugzilla::Extension::Testopia::Environment; my $ref = $dbh->selectcol_arrayref( "SELECT DISTINCT test_case_runs.environment_id @@ -1362,14 +1362,14 @@ sub environments_seen { my @o; foreach my $id (@$ref){ - push @o, Testopia::Environment->new($id); + push @o, Bugzilla::Extension::Testopia::Environment->new($id); } return \@o; } =head2 tags -Returns a reference to a list of Testopia::TestTag objects +Returns a reference to a list of Bugzilla::Extension::Testopia::TestTag objects associated with this plan =cut @@ -1386,7 +1386,7 @@ sub tags { undef, $self->{'plan_id'}); my @plan_tags; foreach my $t (@{$tagids}){ - push @plan_tags, Testopia::TestTag->new($t); + push @plan_tags, Bugzilla::Extension::Testopia::TestTag->new($t); } $self->{'tags'} = \@plan_tags; return $self->{'tags'}; @@ -1484,7 +1484,7 @@ __END__ =head1 NAME -Testopia::TestPlan - Testopia Test Plan object +Bugzilla::Extension::Testopia::TestPlan - Testopia Test Plan object =head1 DESCRIPTION @@ -1494,10 +1494,10 @@ to a plan. =head1 SYNOPSIS -use Testopia::TestPlan; +use Bugzilla::Extension::Testopia::TestPlan; - $plan = Testopia::TestPlan->new($plan_id); - $plan = Testopia::TestPlan->new({}); + $plan = Bugzilla::Extension::Testopia::TestPlan->new($plan_id); + $plan = Bugzilla::Extension::Testopia::TestPlan->new({}); =cut diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/TestRun.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/TestRun.pm similarity index 91% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/TestRun.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/TestRun.pm index b41f8ab8ab3..547a05e4f20 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/TestRun.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/TestRun.pm @@ -20,7 +20,7 @@ # Ed Fuentetaja # Joel Smith -package Testopia::TestRun; +package Bugzilla::Extension::Testopia::TestRun; use strict; @@ -31,15 +31,15 @@ use Bugzilla::Constants; use Bugzilla::Bug; use Bugzilla::Config; -use Testopia::Constants; -use Testopia::Environment; -use Testopia::Build; +use Bugzilla::Extension::Testopia::Constants; +use Bugzilla::Extension::Testopia::Environment; +use Bugzilla::Extension::Testopia::Build; use JSON; use Date::Parse; use base qw(Exporter Bugzilla::Object); -@Testopia::TestRun::EXPORT = qw(calculate_percent); +our @EXPORT = qw(calculate_percent); ############################### #### Initialization #### @@ -108,7 +108,7 @@ sub _check_plan { my ($invocant, $plan_id) = @_; trick_taint($plan_id); ThrowUserError('testopia-missing-required-field', {'field' => 'plan'}) unless $plan_id; - Testopia::Util::validate_test_id($plan_id, 'plan'); + Bugzilla::Extension::Testopia::Util::validate_test_id($plan_id, 'plan'); return $plan_id; } @@ -118,13 +118,13 @@ sub _check_env{ my $environment_id; if (ref $environment){ $product = Bugzilla::Product::check_product($environment->{'product'}); - $environment_id = Testopia::Environment::check_environment($environment->{'environment'}, $product); + $environment_id = Bugzilla::Extension::Testopia::Environment::check_environment($environment->{'environment'}, $product); } elsif ($environment =~ /^\d+$/){ - $environment_id = Testopia::Util::validate_selection($environment, 'environment_id', 'test_environments'); + $environment_id = Bugzilla::Extension::Testopia::Util::validate_selection($environment, 'environment_id', 'test_environments'); } else { - $environment_id = Testopia::Environment::check_environment($environment, $product); + $environment_id = Bugzilla::Extension::Testopia::Environment::check_environment($environment, $product); } ThrowUserError('testopia-missing-required-field', {'field' => 'environment'}) unless $environment_id; return $environment_id; @@ -136,13 +136,13 @@ sub _check_build{ my $build_id; if (ref $build){ $product = Bugzilla::Product::check_product($build->{'product'}); - $build_id = Testopia::Build::check_build($build->{'build'}, $product); + $build_id = Bugzilla::Extension::Testopia::Build::check_build($build->{'build'}, $product); } elsif ($build =~ /^\d+$/){ - $build_id = Testopia::Util::validate_selection($build, 'build_id', 'test_builds'); + $build_id = Bugzilla::Extension::Testopia::Util::validate_selection($build, 'build_id', 'test_builds'); } else { - $build_id = Testopia::Build::check_build($build, $product); + $build_id = Bugzilla::Extension::Testopia::Build::check_build($build, $product); } ThrowUserError('testopia-missing-required-field', {'field' => 'build'}) unless $build_id; return $build_id; @@ -258,7 +258,7 @@ sub new { sub run_create_validators { my $class = shift; my $params = $class->SUPER::run_create_validators(@_); - my $plan = Testopia::TestPlan->new($params->{plan_id}); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new($params->{plan_id}); $params->{product_version} = $class->_check_product_version($params->{product_version}, $plan->product); $params->{build_id} = $class->_check_build($params->{build_id}, $plan->product); @@ -276,11 +276,11 @@ sub run_import_validators { sub create { my ($class, $params) = @_; - require Testopia::TestPlan; + require Bugzilla::Extension::Testopia::TestPlan; $class->SUPER::check_required_create_fields($params); my $field_values = $class->run_create_validators($params); - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); $field_values->{start_date} ||= $timestamp; unless ($field_values->{stop_date}){ $field_values->{stop_date} = $timestamp if $field_values->{status} == 0; @@ -296,14 +296,14 @@ sub create { sub update { my $self = shift; my $dbh = Bugzilla->dbh; - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); $dbh->bz_start_transaction(); my $changed = $self->SUPER::update(); foreach my $field (keys %$changed){ - Testopia::Util::log_activity('run', $self->id, $field, $timestamp, $changed->{$field}->[0], $changed->{$field}->[1]); + Bugzilla::Extension::Testopia::Util::log_activity('run', $self->id, $field, $timestamp, $changed->{$field}->[0], $changed->{$field}->[1]); } $dbh->bz_commit_transaction(); @@ -390,7 +390,7 @@ sub add_tag { } foreach my $name (@tags){ - my $tag = Testopia::TestTag->create({'tag_name' => $name}); + my $tag = Bugzilla::Extension::Testopia::TestTag->create({'tag_name' => $name}); $tag->attach($self); } } @@ -404,7 +404,7 @@ Disassociates a tag from this test run sub remove_tag { my $self = shift; my ($tag_name) = @_; - my $tag = Testopia::TestTag->check_tag($tag_name); + my $tag = Bugzilla::Extension::Testopia::TestTag->check_tag($tag_name); ThrowUserError('testopia-unknown-tag', {'name' => $tag}) unless $tag; my $dbh = Bugzilla->dbh; $dbh->do("DELETE FROM test_run_tags @@ -426,12 +426,12 @@ sub add_case_run { $status ||=IDLE; trick_taint($case_id); return 0 if $self->check_case($case_id); - my $case = Testopia::TestCase->new($case_id); + my $case = Bugzilla::Extension::Testopia::TestCase->new($case_id); $sortkey = $case->sortkey unless $sortkey; return 0 if $case->status ne 'CONFIRMED'; my $assignee = $case->default_tester ? $case->default_tester->id : undef; - my $caserun = Testopia::TestCaseRun->create({ + my $caserun = Bugzilla::Extension::Testopia::TestCaseRun->create({ 'run_id' => $self->{'run_id'}, 'case_id' => $case_id, 'assignee' => $assignee, @@ -456,7 +456,7 @@ sub store { my $dbh = Bugzilla->dbh; # Exclude the auto-incremented field from the column list. my $columns = join(", ", grep {$_ ne 'run_id'} DB_COLUMNS); - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); $dbh->do("INSERT INTO test_runs ($columns) VALUES (?,?,?,?,?,?,?,?,?,?)", undef, ($self->{'plan_id'}, $self->{'environment_id'}, @@ -495,7 +495,7 @@ sub clone { my $dbh = Bugzilla->dbh; # Exclude the auto-incremented field from the column list. my $columns = join(", ", grep {$_ ne 'run_id'} DB_COLUMNS); - my $timestamp = Testopia::Util::get_time_stamp(); + my $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp(); $dbh->do("INSERT INTO test_runs ($columns) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", undef, ($plan_id, $env_id, @@ -742,7 +742,7 @@ sub filter_case_categories { my @categories; foreach my $id (@$ids){ - push @categories, Testopia::Category->new($id); + push @categories, Bugzilla::Extension::Testopia::Category->new($id); } return \@categories; @@ -762,7 +762,7 @@ sub filter_environments { my @environments; foreach my $id (@$ids){ - push @environments, Testopia::Environment->new($id); + push @environments, Bugzilla::Extension::Testopia::Environment->new($id); } return \@environments; } @@ -781,7 +781,7 @@ sub filter_builds { my @builds; foreach my $id (@$ids){ - push @builds, Testopia::Build->new($id); + push @builds, Bugzilla::Extension::Testopia::Build->new($id); } return \@builds; } @@ -810,7 +810,7 @@ sub filter_components { =head2 environments -Returns a reference to a list of Testopia::Environment objects. +Returns a reference to a list of Bugzilla::Extension::Testopia::Environment objects. =cut @@ -825,7 +825,7 @@ sub environments { my @environments; foreach my $id (@{$environments}){ - push @environments, Testopia::Environment->new($id); + push @environments, Bugzilla::Extension::Testopia::Environment->new($id); } $self->{'environments'} = \@environments; return $self->{'environments'}; @@ -941,7 +941,7 @@ sub get_case_tags { WHERE test_case_runs.run_id = ?", undef, $self->id); my @tags; foreach my $id (@$tags){ - push @tags, Testopia::TestTag->new($id); + push @tags, Bugzilla::Extension::Testopia::TestTag->new($id); } return \@tags; } @@ -1187,7 +1187,7 @@ sub type { =head2 plan -Returns the Testopia::TestPlan object of the plan this run +Returns the Bugzilla::Extension::Testopia::TestPlan object of the plan this run is assoceated with =cut @@ -1195,14 +1195,14 @@ is assoceated with sub plan { my $self = shift; return $self->{'plan'} if exists $self->{'plan'}; - require Testopia::TestPlan; - $self->{'plan'} = Testopia::TestPlan->new($self->{'plan_id'}); + require Bugzilla::Extension::Testopia::TestPlan; + $self->{'plan'} = Bugzilla::Extension::Testopia::TestPlan->new($self->{'plan_id'}); return $self->{'plan'}; } =head2 tags -Returns a reference to a list of Testopia::TestTag objects +Returns a reference to a list of Bugzilla::Extension::Testopia::TestTag objects associated with this run =cut @@ -1219,7 +1219,7 @@ sub tags { undef, $self->{'run_id'}); my @tags; foreach my $t (@{$tagids}){ - push @tags, Testopia::TestTag->new($t); + push @tags, Bugzilla::Extension::Testopia::TestTag->new($t); } $self->{'tags'} = \@tags; return $self->{'tags'}; @@ -1227,7 +1227,7 @@ sub tags { =head2 environment -Returns the Testopia::Environment object of the environment +Returns the Bugzilla::Extension::Testopia::Environment object of the environment this run is assoceated with =cut @@ -1235,14 +1235,14 @@ this run is assoceated with sub environment { my $self = shift; return $self->{'environment'} if exists $self->{'environment'}; - $self->{'environment'} = Testopia::Environment->new($self->{'environment_id'}); + $self->{'environment'} = Bugzilla::Extension::Testopia::Environment->new($self->{'environment_id'}); return $self->{'environment'}; } =head2 build -Returns the Testopia::Build object of the plan this run +Returns the Bugzilla::Extension::Testopia::Build object of the plan this run is assoceated with =cut @@ -1250,7 +1250,7 @@ is assoceated with sub build { my $self = shift; return $self->{'build'} if exists $self->{'build'}; - $self->{'build'} = Testopia::Build->new($self->{'build_id'}); + $self->{'build'} = Bugzilla::Extension::Testopia::Build->new($self->{'build_id'}); return $self->{'build'}; } @@ -1315,7 +1315,7 @@ sub cc { =head2 cases -Returns a reference to a list of Testopia::TestCase objects +Returns a reference to a list of Bugzilla::Extension::Testopia::TestCase objects associated with this run =cut @@ -1325,7 +1325,7 @@ sub cases { return $self->{'cases'} if exists $self->{'cases'}; my @cases; foreach my $cr (@{$self->current_caseruns}){ - push @cases, Testopia::TestCase->new($cr->case_id); + push @cases, Bugzilla::Extension::Testopia::TestCase->new($cr->case_id); } $self->{'cases'} = \@cases; return $self->{'cases'}; @@ -1551,7 +1551,7 @@ sub current_caseruns { my $dbh = Bugzilla->dbh; return $self->{'current_caseruns'} if exists $self->{'current_caseruns'}; - require Testopia::TestCaseRun; + require Bugzilla::Extension::Testopia::TestCaseRun; my $ref = $dbh->selectcol_arrayref( "SELECT case_run_id FROM test_case_runs @@ -1560,7 +1560,7 @@ sub current_caseruns { my @caseruns; foreach my $id (@{$ref}){ - push @caseruns, Testopia::TestCaseRun->new($id); + push @caseruns, Bugzilla::Extension::Testopia::TestCaseRun->new($id); } $self->{'current_caseruns'} = \@caseruns; return $self->{'current_caseruns'}; @@ -1578,7 +1578,7 @@ sub caseruns { my $dbh = Bugzilla->dbh; return $self->{'caseruns'} if exists $self->{'caseruns'}; - require Testopia::TestCaseRun; + require Bugzilla::Extension::Testopia::TestCaseRun; my $ref = $dbh->selectcol_arrayref( "SELECT case_run_id FROM test_case_runs @@ -1586,7 +1586,7 @@ sub caseruns { my @caseruns; foreach my $id (@{$ref}){ - push @caseruns, Testopia::TestCaseRun->new($id); + push @caseruns, Bugzilla::Extension::Testopia::TestCaseRun->new($id); } $self->{'caseruns'} = \@caseruns; return $self->{'caseruns'}; @@ -1624,7 +1624,7 @@ __END__ =head1 NAME -Testopia::TestRun - Testopia Test Run object +Bugzilla::Extension::Testopia::TestRun - Testopia Test Run object =head1 DESCRIPTION @@ -1635,10 +1635,10 @@ case-runs. =head1 SYNOPSIS -use Testopia::TestRun; +use Bugzilla::Extension::Testopia::TestRun; - $run = Testopia::TestRun->new($run_id); - $run = Testopia::TestRun->new(\%run_hash); + $run = Bugzilla::Extension::Testopia::TestRun->new($run_id); + $run = Bugzilla::Extension::Testopia::TestRun->new(\%run_hash); =cut diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/TestTag.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/TestTag.pm similarity index 96% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/TestTag.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/TestTag.pm index 6d9a50f244e..f1afbadce15 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/TestTag.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/TestTag.pm @@ -20,7 +20,7 @@ =head1 NAME -Testopia::TestTag - A Testopia tag +Bugzilla::Extension::Testopia::TestTag - A Testopia tag =head1 DESCRIPTION @@ -31,14 +31,14 @@ not require administrator privileges to create. =head1 SYNOPSIS -use Testopia::TestTag; +use Bugzilla::Extension::Testopia::TestTag; - $tag = Testopia::TestTag->new($tag_id); - $tag = Testopia::TestTag->new($tag_hash); + $tag = Bugzilla::Extension::Testopia::TestTag->new($tag_id); + $tag = Bugzilla::Extension::Testopia::TestTag->new($tag_hash); =cut -package Testopia::TestTag; +package Bugzilla::Extension::Testopia::TestTag; use strict; @@ -141,7 +141,7 @@ sub check_tag { WHERE tag_name = ?", undef, lc($name)); if ($id){ - return Testopia::TestTag->new($id); + return Bugzilla::Extension::Testopia::TestTag->new($id); } else{ return undef; diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Util.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/Util.pm similarity index 93% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Util.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/Util.pm index a7265dbcf9a..302ca0bff66 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/Util.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/Util.pm @@ -22,7 +22,7 @@ =head1 NAME -Testopia::Util +Bugzilla::Extension::Testopia::Util =head1 DESCRIPTION @@ -31,12 +31,12 @@ It exports all of these functions using Exporter. =cut -package Testopia::Util; +package Bugzilla::Extension::Testopia::Util; use strict; use base qw(Exporter); -@Testopia::Util::EXPORT = qw(get_test_field_id get_time_stamp +our @EXPORT = qw(get_test_field_id get_time_stamp validate_test_id validate_selection support_server_push process_list percentage get_runs); @@ -46,7 +46,7 @@ use Bugzilla::Config; use Bugzilla::Error; use Bugzilla::Constants; use Bugzilla::Util; -#use Testopia::TestPlan; +#use Bugzilla::Extension::Testopia::TestPlan; ### Methods ### @@ -193,7 +193,7 @@ sub log_activity { $timestamp ||= get_time_stamp(); trick_taint($newvalue) if defined $newvalue; - my $field_id = Testopia::Util::get_test_field_id($field, "test_". $type ."s"); + my $field_id = Bugzilla::Extension::Testopia::Util::get_test_field_id($field, "test_". $type ."s"); $dbh->do("INSERT INTO test_". $type ."_activity (". $type . "_id, fieldid, who, changed, oldvalue, newvalue) VALUES(?,?,?,?,?,?)", @@ -224,13 +224,13 @@ sub get_runs { my @runs; foreach my $g (@$plan_ids){ foreach my $id (split(',', $g)){ - my $obj = Testopia::TestPlan->new($id); + my $obj = Bugzilla::Extension::Testopia::TestPlan->new($id); push @runs, @{$obj->test_runs} if $obj && $obj->canview; } } foreach my $g (@$run_ids){ foreach my $id (split(',', $g)){ - my $obj = Testopia::TestRun->new($id); + my $obj = Bugzilla::Extension::Testopia::TestRun->new($id); push @runs, $obj if $obj && $obj->canview; } } diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/Build.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/Build.pm similarity index 87% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/Build.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/WebService/Build.pm index c723c6da9b1..c78596c63fb 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/Build.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/Build.pm @@ -19,18 +19,18 @@ # Contributor(s): Dallas Harken # Greg Hendricks -package extensions::testopia::lib::Testopia::WebService::Build; +package Bugzilla::Extension::Testopia::WebService::Build; use strict; use base qw(Bugzilla::WebService); -use lib qw(./extensions/testopia/lib); +use lib qw(./extensions/Testopia/lib); use Bugzilla::Error; use Bugzilla::Constants; -use Testopia::Build; -use Testopia::Product; +use Bugzilla::Extension::Testopia::Build; +use Bugzilla::Extension::Testopia::Product; sub get { my $self = shift; @@ -39,7 +39,7 @@ sub get { Bugzilla->login(LOGIN_REQUIRED); # Result is a build object hash - my $build = new Testopia::Build($build_id); + my $build = new Bugzilla::Extension::Testopia::Build($build_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Build', id => $build_id}) unless $build; ThrowUserError('testopia-read-only', {'object' => $build->product}) unless $build->product->canedit; @@ -56,16 +56,16 @@ sub check_build { Bugzilla->login(LOGIN_REQUIRED); if ($product =~ /^\d+$/){ - $product = Testopia::Product->new($product); + $product = Bugzilla::Extension::Testopia::Product->new($product); } else { $product = Bugzilla::Product::check_product($product); - $product = Testopia::Product->new($product->id); + $product = Bugzilla::Extension::Testopia::Product->new($product->id); } ThrowUserError('testopia-read-only', {'object' => $product}) unless $product->canedit; - return Testopia::Build::check_build($name, $product, "THROWERROR"); + return Bugzilla::Extension::Testopia::Build::check_build($name, $product, "THROWERROR"); } sub create{ @@ -79,11 +79,11 @@ sub create{ my $product; if ($new_values->{'product_id'} =~ /^\d+$/){ - $product = Testopia::Product->new($new_values->{'product_id'}); + $product = Bugzilla::Extension::Testopia::Product->new($new_values->{'product_id'}); } else { $product = Bugzilla::Product::check_product($new_values->{'product_id'}); - $product = Testopia::Product->new($product->id); + $product = Bugzilla::Extension::Testopia::Product->new($product->id); } ThrowUserError('testopia-read-only', {'object' => $product}) unless $product->canedit; @@ -93,7 +93,7 @@ sub create{ $new_values->{'isactive'} = 1; } - my $build = Testopia::Build->create($new_values); + my $build = Bugzilla::Extension::Testopia::Build->create($new_values); # Result is new build return $build; @@ -105,7 +105,7 @@ sub update{ Bugzilla->login(LOGIN_REQUIRED); - my $build = new Testopia::Build($id); + my $build = new Bugzilla::Extension::Testopia::Build($id); ThrowUserError("invalid-test-id-non-existent", {'id' => $id, 'type' => 'Build'}) unless $build; ThrowUserError('testopia-read-only', {'object' => $build->product}) unless $build->product->canedit; @@ -129,7 +129,7 @@ sub lookup_name_by_id { die "Invalid Build ID" unless defined $build_id && length($build_id) > 0 && $build_id > 0; - my $build = new Testopia::Build($build_id); + my $build = new Bugzilla::Extension::Testopia::Build($build_id); ThrowUserError('testopia-read-only', {'object' => $build->product}) unless $build->product->canedit; my $result = defined $build ? $build->name : ''; @@ -149,7 +149,7 @@ sub get_runs { Bugzilla->login(LOGIN_REQUIRED); - my $build = new Testopia::Build($build_id); + my $build = new Bugzilla::Extension::Testopia::Build($build_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Build', id => $build_id}) unless $build; ThrowUserError('testopia-read-only', {'object' => $build}) unless $build->product->canview; @@ -164,7 +164,7 @@ sub get_caseruns { Bugzilla->login(LOGIN_REQUIRED); - my $build = new Testopia::Build($build_id); + my $build = new Bugzilla::Extension::Testopia::Build($build_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Build', id => $build_id}) unless $build; ThrowUserError('testopia-read-only', {'object' => $build}) unless $build->product->canview; @@ -228,7 +228,7 @@ Provides methods for automated scripts to manipulate Testopia Builds Params: $id - An integer representing the ID in the database - Returns: A blessed Testopia::Build object hash + Returns: A blessed Bugzilla::Extension::Testopia::Build object hash =item C @@ -273,7 +273,7 @@ Provides methods for automated scripts to manipulate Testopia Builds =head1 SEE ALSO -L +L L =head1 AUTHOR diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/Environment.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/Environment.pm similarity index 86% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/Environment.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/WebService/Environment.pm index c69b80f0643..079a5dac0f8 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/Environment.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/Environment.pm @@ -19,19 +19,19 @@ # Contributor(s): Dallas Harken # Greg Hendricks -package extensions::testopia::lib::Testopia::WebService::Environment; +package Bugzilla::Extension::Testopia::WebService::Environment; use strict; use base qw(Bugzilla::WebService); -use lib qw(./extensions/testopia/lib); +use lib qw(./extensions/Testopia/lib); use Bugzilla::Constants; use Bugzilla::Error; -use Testopia::Environment; -use Testopia::Search; -use Testopia::Table; +use Bugzilla::Extension::Testopia::Environment; +use Bugzilla::Extension::Testopia::Search; +use Bugzilla::Extension::Testopia::Table; sub get { my $self = shift; @@ -39,7 +39,7 @@ sub get { Bugzilla->login(LOGIN_REQUIRED); - my $environment = new Testopia::Environment($environment_id); + my $environment = new Bugzilla::Extension::Testopia::Environment($environment_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Environment', id => $environment_id}) unless $environment; ThrowUserError('testopia-read-only', {'object' => $environment}) unless $environment->canview; @@ -55,16 +55,16 @@ sub check_environment { Bugzilla->login(LOGIN_REQUIRED); if ($product =~ /^\d+$/){ - $product = Testopia::Product->new($product); + $product = Bugzilla::Extension::Testopia::Product->new($product); } else { $product = Bugzilla::Product::check_product($product); - $product = Testopia::Product->new($product->id); + $product = Bugzilla::Extension::Testopia::Product->new($product->id); } ThrowUserError('testopia-read-only', {'object' => $product}) unless $product->canedit; - return Testopia::Environment::check_environment($name, $product, 'THROWERROR'); + return Bugzilla::Extension::Testopia::Environment::check_environment($name, $product, 'THROWERROR'); } sub list { @@ -79,10 +79,10 @@ sub list { $cgi->param($_, $query->{$_}); } - my $search = Testopia::Search->new($cgi); + my $search = Bugzilla::Extension::Testopia::Search->new($cgi); # Result is an array of environment hash maps - return Testopia::Table->new('environment', 'tr_xmlrpc.cgi',$cgi,undef, $search->query())->list(); + return Bugzilla::Extension::Testopia::Table->new('environment', 'tr_xmlrpc.cgi',$cgi,undef, $search->query())->list(); } @@ -98,11 +98,11 @@ sub create { my $product; if ($new_values->{'product_id'} =~ /^\d+$/){ - $product = Testopia::Product->new($new_values->{'product_id'}); + $product = Bugzilla::Extension::Testopia::Product->new($new_values->{'product_id'}); } else { $product = Bugzilla::Product::check_product($new_values->{'product_id'}); - $product = Testopia::Product->new($product->id); + $product = Bugzilla::Extension::Testopia::Product->new($product->id); } ThrowUserError('testopia-read-only', {'object' => $product}) unless $product->canedit; @@ -111,7 +111,7 @@ sub create { $new_values->{'isactive'} = 1; } - my $environment = Testopia::Environment->create($new_values); + my $environment = Bugzilla::Extension::Testopia::Environment->create($new_values); # Result is new environment return $environment; @@ -124,16 +124,16 @@ sub create_full { Bugzilla->login(LOGIN_REQUIRED); if ($product =~ /^\d+$/){ - $product = Testopia::Product->new($product); + $product = Bugzilla::Extension::Testopia::Product->new($product); } else { $product = Bugzilla::Product::check_product($product); - $product = Testopia::Product->new($product->id); + $product = Bugzilla::Extension::Testopia::Product->new($product->id); } ThrowUserError('testopia-read-only', {'object' => $product}) unless $product->canedit; - my $env_id = Testopia::Environment->create_full($env_basename, $product->id, $environment); + my $env_id = Bugzilla::Extension::Testopia::Environment->create_full($env_basename, $product->id, $environment); return $env_id; } @@ -143,7 +143,7 @@ sub update { my ($environment_id, $new_values) = @_; Bugzilla->login(LOGIN_REQUIRED); - my $environment = new Testopia::Environment($environment_id); + my $environment = new Bugzilla::Extension::Testopia::Environment($environment_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Environment', id => $environment_id}) unless $environment; ThrowUserError('testopia-read-only', {'object' => $environment}) unless $environment->canedit; @@ -163,7 +163,7 @@ sub get_runs { Bugzilla->login(LOGIN_REQUIRED); - my $environment = new Testopia::Environment($environment_id); + my $environment = new Bugzilla::Extension::Testopia::Environment($environment_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Environment', id => $environment_id}) unless $environment; ThrowUserError('testopia-read-only', {'object' => $environment}) unless $environment->canview; @@ -178,7 +178,7 @@ sub get_caseruns { Bugzilla->login(LOGIN_REQUIRED); - my $environment = new Testopia::Environment($environment_id); + my $environment = new Bugzilla::Extension::Testopia::Environment($environment_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Environment', id => $environment_id}) unless $environment; ThrowUserError('testopia-read-only', {'object' => $environment}) unless $environment->canview; @@ -322,7 +322,7 @@ Harddrives => { Params: $id - An integer representing the ID in the database - Returns: A blessed Testopia::Environment object hash + Returns: A blessed Bugzilla::Extension::Testopia::Environment object hash =item C @@ -380,7 +380,7 @@ Harddrives => { =head1 SEE ALSO -L +L L =head1 AUTHOR diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/Product.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/Product.pm similarity index 92% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/Product.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/WebService/Product.pm index f6b266fd999..f70c18ef69f 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/Product.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/Product.pm @@ -19,28 +19,28 @@ # Contributor(s): Dallas Harken # Greg Hendricks -package extensions::testopia::lib::Testopia::WebService::Product; +package Bugzilla::Extension::Testopia::WebService::Product; use strict; use base qw(Bugzilla::WebService); -use lib qw(./extensions/testopia/lib); +use lib qw(./extensions/Testopia/lib); use Bugzilla::Error; use Bugzilla::Constants; -use Testopia::Product; +use Bugzilla::Extension::Testopia::Product; sub _validate { my ($product) = @_; Bugzilla->login(LOGIN_REQUIRED); if ($product =~ /^\d+$/){ - $product = Testopia::Product->new($product); + $product = Bugzilla::Extension::Testopia::Product->new($product); } else { $product = Bugzilla::Product::check_product($product); - $product = Testopia::Product->new($product->id); + $product = Bugzilla::Extension::Testopia::Product->new($product->id); } ThrowUserError('invalid-test-id-non-existent', {type => 'Product', id => $product}) unless $product; @@ -56,7 +56,7 @@ sub get { Bugzilla->login(LOGIN_REQUIRED); # Result is a product object hash - my $product = new Testopia::Product($id); + my $product = new Bugzilla::Extension::Testopia::Product($id); ThrowUserError('invalid-test-id-non-existent', {type => 'Product', id => $id}) unless $product; ThrowUserError('testopia-permission-denied', {'object' => $product}) unless $product->canedit; @@ -82,8 +82,8 @@ sub check_category { $product = _validate($product); ThrowUserError('testopia-read-only', {'object' => $product}) unless $product->canedit; - require Testopia::Category; - return Testopia::Category->new(Testopia::Category::check_case_category($name, $product)); + require Bugzilla::Extension::Testopia::Category; + return Bugzilla::Extension::Testopia::Category->new(Testopia::Category::check_case_category($name, $product)); } sub check_component { @@ -115,9 +115,9 @@ sub get_category { Bugzilla->login(LOGIN_REQUIRED); - require Testopia::Category; + require Bugzilla::Extension::Testopia::Category; - my $category = Testopia::Category->new($id); + my $category = Bugzilla::Extension::Testopia::Category->new($id); ThrowUserError('invalid-test-id-non-existent', {type => 'Category', id => $id}) unless $category; ThrowUserError('testopia-permission-denied', {'object' => $category->product}) unless $category->product->canedit; @@ -138,7 +138,7 @@ sub get_component { ThrowUserError('invalid-test-id-non-existent', {type => 'Component', id => $id}) unless $component; - my $product = Testopia::Product->new($component->product_id); + my $product = Bugzilla::Extension::Testopia::Product->new($component->product_id); ThrowUserError('testopia-permission-denied', {'object' => $product}) unless $product->canedit; @@ -290,7 +290,7 @@ Provides methods for automated scripts to expose Testopia Product data. Params: $id - An integer representing the ID in the database - Returns: A blessed Testopia::Product object hash + Returns: A blessed Bugzilla::Extension::Testopia::Product object hash =item C @@ -417,7 +417,7 @@ Provides methods for automated scripts to expose Testopia Product data. =head1 SEE ALSO -L +L L =head1 AUTHOR diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/TestCase.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/TestCase.pm similarity index 92% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/TestCase.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/WebService/TestCase.pm index ce9e96d87f0..8b3f6171eae 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/TestCase.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/TestCase.pm @@ -19,21 +19,21 @@ # Contributor(s): Dallas Harken # Greg Hendricks -package extensions::testopia::lib::Testopia::WebService::TestCase; +package Bugzilla::Extension::Testopia::WebService::TestCase; use strict; use base qw(Bugzilla::WebService); -use lib qw(./extensions/testopia/lib); +use lib qw(./extensions/Testopia/lib); use Bugzilla::User; use Bugzilla::Constants; use Bugzilla::Error; -use Testopia::TestCase; -use Testopia::Category; -use Testopia::Search; -use Testopia::Table; +use Bugzilla::Extension::Testopia::TestCase; +use Bugzilla::Extension::Testopia::Category; +use Bugzilla::Extension::Testopia::Search; +use Bugzilla::Extension::Testopia::Table; sub get { my $self = shift; @@ -41,7 +41,7 @@ sub get { Bugzilla->login(LOGIN_REQUIRED); - my $case = new Testopia::TestCase($case_id); + my $case = new Bugzilla::Extension::Testopia::TestCase($case_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case', id => $case_id}) unless $case; ThrowUserError('testopia-permission-denied', {'object' => $case}) unless $case->canview; @@ -70,8 +70,8 @@ sub list { } $cgi->param('distinct', 1); - my $search = Testopia::Search->new($cgi); - return Testopia::Table->new('case','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list(); + my $search = Bugzilla::Extension::Testopia::Search->new($cgi); + return Bugzilla::Extension::Testopia::Table->new('case','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list(); } sub list_count { @@ -89,8 +89,8 @@ sub list_count { } $cgi->param('distinct', 1); - my $search = Testopia::Search->new($cgi); - return Testopia::Table->new('case','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list_count(); + my $search = Bugzilla::Extension::Testopia::Search->new($cgi); + return Bugzilla::Extension::Testopia::Table->new('case','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list_count(); } sub create { @@ -124,7 +124,7 @@ sub create { my @plans; eval{ foreach my $id (@plan_ids){ - my $plan = Testopia::TestPlan->new($id); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new($id); ThrowUserError("invalid-test-id-non-existent", {'id' => $id, 'type' => 'Plan'}) unless $plan; ThrowUserError("testopia-create-denied", {'object' => 'Test Case', 'plan' => $plan}) unless $plan->canedit; push @plans, $plan; @@ -172,7 +172,7 @@ sub create { my $case; eval{ - $case = Testopia::TestCase->create($new_values); + $case = Bugzilla::Extension::Testopia::TestCase->create($new_values); }; if ($@){ push @results, {ERROR => $@}; @@ -191,7 +191,7 @@ sub update { Bugzilla->login(LOGIN_REQUIRED); - my @ids = Testopia::Util::process_list($ids); + my @ids = Bugzilla::Extension::Testopia::Util::process_list($ids); my @dependson; if (ref $new_values->{'dependson'} eq 'ARRAY'){ @@ -206,7 +206,7 @@ sub update { my @cases; foreach my $id (@ids){ - my $case = new Testopia::TestCase($id); + my $case = new Bugzilla::Extension::Testopia::TestCase($id); unless ($case){ ThrowUserError("invalid-test-id-non-existent", {'id' => $id, 'type' => 'Case'}) if scalar @ids == 1; push @cases, {ERROR => "TestCase $id does not exist"}; @@ -264,7 +264,7 @@ sub get_text { Bugzilla->login(LOGIN_REQUIRED); - my $case = new Testopia::TestCase($case_id); + my $case = new Bugzilla::Extension::Testopia::TestCase($case_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case', id => $case_id}) unless $case; ThrowUserError('testopia-permission-denied', {'object' => $case}) unless $case->canview; @@ -279,7 +279,7 @@ sub store_text { Bugzilla->login(LOGIN_REQUIRED); - my $case = new Testopia::TestCase($case_id); + my $case = new Bugzilla::Extension::Testopia::TestCase($case_id); $author_id ||= Bugzilla->user->id; if ($author_id !~ /^\d+$/){ @@ -301,7 +301,7 @@ sub get_plans { Bugzilla->login(LOGIN_REQUIRED); - my $case = new Testopia::TestCase($case_id); + my $case = new Bugzilla::Extension::Testopia::TestCase($case_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case', id => $case_id}) unless $case; ThrowUserError('testopia-permission-denied', {'object' => $case}) unless $case->canview; @@ -315,10 +315,10 @@ sub attach_bug { Bugzilla->login(LOGIN_REQUIRED); - my @ids = Testopia::Util::process_list($case_ids); + my @ids = Bugzilla::Extension::Testopia::Util::process_list($case_ids); my @results; foreach my $id (@ids){ - my $case = new Testopia::TestCase($id); + my $case = new Bugzilla::Extension::Testopia::TestCase($id); unless ($case){ push @results, {ERROR => "TestCase $id does not exist"}; next; @@ -344,7 +344,7 @@ sub detach_bug { Bugzilla->login(LOGIN_REQUIRED); - my $case = new Testopia::TestCase($case_id); + my $case = new Bugzilla::Extension::Testopia::TestCase($case_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case', id => $case_id}) unless $case; ThrowUserError('testopia-read-only', {'object' => $case}) unless $case->canedit; @@ -361,7 +361,7 @@ sub get_bugs { Bugzilla->login(LOGIN_REQUIRED); - my $case = new Testopia::TestCase($case_id); + my $case = new Bugzilla::Extension::Testopia::TestCase($case_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case', id => $case_id}) unless $case; ThrowUserError('testopia-permission-denied', {'object' => $case}) unless $case->canview; @@ -376,10 +376,10 @@ sub add_component { Bugzilla->login(LOGIN_REQUIRED); - my @ids = Testopia::Util::process_list($case_ids); + my @ids = Bugzilla::Extension::Testopia::Util::process_list($case_ids); my @results; foreach my $id (@ids){ - my $case = new Testopia::TestCase($id); + my $case = new Bugzilla::Extension::Testopia::TestCase($id); unless ($case){ push @results, {ERROR => "TestCase $id does not exist"}; next; @@ -405,10 +405,10 @@ sub remove_component { Bugzilla->login(LOGIN_REQUIRED); - my @ids = Testopia::Util::process_list($case_ids); + my @ids = Bugzilla::Extension::Testopia::Util::process_list($case_ids); my @results; foreach my $id (@ids){ - my $case = new Testopia::TestCase($id); + my $case = new Bugzilla::Extension::Testopia::TestCase($id); unless ($case){ push @results, {ERROR => "TestCase $id does not exist"}; next; @@ -434,7 +434,7 @@ sub get_components { Bugzilla->login(LOGIN_REQUIRED); - my $case = new Testopia::TestCase($case_id); + my $case = new Bugzilla::Extension::Testopia::TestCase($case_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case', id => $case_id}) unless $case; ThrowUserError('testopia-permission-denied', {'object' => $case}) unless $case->canview; @@ -449,10 +449,10 @@ sub add_tag { Bugzilla->login(LOGIN_REQUIRED); - my @ids = Testopia::Util::process_list($case_ids); + my @ids = Bugzilla::Extension::Testopia::Util::process_list($case_ids); my @results; foreach my $id (@ids){ - my $case = new Testopia::TestCase($id); + my $case = new Bugzilla::Extension::Testopia::TestCase($id); unless ($case){ push @results, {ERROR => "TestCase $id does not exist"}; next; @@ -478,10 +478,10 @@ sub remove_tag { Bugzilla->login(LOGIN_REQUIRED); - my @ids = Testopia::Util::process_list($case_ids); + my @ids = Bugzilla::Extension::Testopia::Util::process_list($case_ids); my @results; foreach my $id (@ids){ - my $case = new Testopia::TestCase($id); + my $case = new Bugzilla::Extension::Testopia::TestCase($id); unless ($case){ push @results, {ERROR => "TestCase $id does not exist"}; next; @@ -507,7 +507,7 @@ sub get_tags { Bugzilla->login(LOGIN_REQUIRED); - my $case = new Testopia::TestCase($case_id); + my $case = new Bugzilla::Extension::Testopia::TestCase($case_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case', id => $case_id}) unless $case; ThrowUserError('testopia-permission-denied', {'object' => $case}) unless $case->canview; @@ -529,16 +529,16 @@ sub link_plan { $plan_ids = join(',', @$plan_ids); } foreach my $id (split(',', $plan_ids)){ - my $plan = Testopia::TestPlan->new($id); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new($id); ThrowUserError("testopia-read-only", {'object' => $plan}) unless $plan->canedit; push @plans, $plan; } ThrowUserError('missing-plans-list') unless scalar @plans; - my @ids = Testopia::Util::process_list($case_ids); + my @ids = Bugzilla::Extension::Testopia::Util::process_list($case_ids); my @results; foreach my $id (@ids){ - my $case = new Testopia::TestCase($id); + my $case = new Bugzilla::Extension::Testopia::TestCase($id); foreach my $plan (@plans){ eval { $case->link_plan($plan->id); @@ -559,7 +559,7 @@ sub unlink_plan { Bugzilla->login(LOGIN_REQUIRED); - my $case = new Testopia::TestCase($case_id); + my $case = new Bugzilla::Extension::Testopia::TestCase($case_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case', id => $case_id}) unless $case; ThrowUserError("testopia-read-only", {'object' => 'case'}) unless ($case->can_unlink_plan($plan_id)); @@ -576,10 +576,10 @@ sub add_to_run { Bugzilla->login(LOGIN_REQUIRED); - my @ids = Testopia::Util::process_list($case_ids); + my @ids = Bugzilla::Extension::Testopia::Util::process_list($case_ids); my @results; foreach my $id (@ids){ - my $case = new Testopia::TestCase($id); + my $case = new Bugzilla::Extension::Testopia::TestCase($id); unless ($case){ push @results, {ERROR => "TestCase $id does not exist"}; next; @@ -609,7 +609,7 @@ sub get_case_run_history { Bugzilla->login(LOGIN_REQUIRED); - my $case = new Testopia::TestCase($case_id); + my $case = new Bugzilla::Extension::Testopia::TestCase($case_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case', id => $case_id}) unless $case; ThrowUserError('testopia-permission-denied', {'object' => $case}) unless $case->canview; @@ -624,7 +624,7 @@ sub get_change_history { Bugzilla->login(LOGIN_REQUIRED); - my $case = new Testopia::TestCase($case_id); + my $case = new Bugzilla::Extension::Testopia::TestCase($case_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case', id => $case_id}) unless $case; ThrowUserError('testopia-permission-denied', {'object' => $case}) unless $case->canview; @@ -639,7 +639,7 @@ sub calculate_average_time { Bugzilla->login(LOGIN_REQUIRED); - my $case = new Testopia::TestCase($case_id); + my $case = new Bugzilla::Extension::Testopia::TestCase($case_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case', id => $case_id}) unless $case; ThrowUserError('testopia-permission-denied', {'object' => $case}) unless $case->canview; @@ -648,11 +648,11 @@ sub calculate_average_time { } sub lookup_category_id_by_name { - return { ERROR => 'This method is considered harmful and has been deprecated. Please use Testopia::Product::check_catagory instead'}; + return { ERROR => 'This method is considered harmful and has been deprecated. Please use Bugzilla::Extension::Testopia::Product::check_catagory instead'}; } sub lookup_category_name_by_id { - return { ERROR => 'This method has been deprecated. Please use Testopia::Product::get_category instead'}; + return { ERROR => 'This method has been deprecated. Please use Bugzilla::Extension::Testopia::Product::get_category instead'}; } sub lookup_priority_id_by_name { @@ -835,7 +835,7 @@ Provides methods for automated scripts to manipulate Testopia TestCases Params: $id - Integer/String: An integer representing the ID in the database or a string representing the unique alias for this case. - Returns: A blessed Testopia::TestCase object hash + Returns: A blessed Bugzilla::Extension::Testopia::TestCase object hash =item C @@ -1026,9 +1026,9 @@ Provides methods for automated scripts to manipulate Testopia TestCases Returns: Integer - total matching cases. -=item C B Use Testopia::Product::get_category instead +=item C B Use Bugzilla::Extension::Testopia::Product::get_category instead -=item C B Use Testopia::Product::check_category instead +=item C B Use Bugzilla::Extension::Testopia::Product::check_category instead =item C @@ -1138,7 +1138,7 @@ Provides methods for automated scripts to manipulate Testopia TestCases =head1 SEE ALSO -L +L L =head1 AUTHOR diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/TestCaseRun.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/TestCaseRun.pm similarity index 90% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/TestCaseRun.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/WebService/TestCaseRun.pm index 76a78e14c13..acf1dc4a12a 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/TestCaseRun.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/TestCaseRun.pm @@ -19,23 +19,23 @@ # Contributor(s): Dallas Harken # Greg Hendricks -package extensions::testopia::lib::Testopia::WebService::TestCaseRun; +package Bugzilla::Extension::Testopia::WebService::TestCaseRun; use strict; use base qw(Bugzilla::WebService); -use lib qw(./extensions/testopia/lib); +use lib qw(./extensions/Testopia/lib); use Bugzilla::User; use Bugzilla::Constants; use Bugzilla::Error; use Bugzilla::Util; -use Testopia::Constants; -use Testopia::Search; -use Testopia::Table; -use Testopia::TestCaseRun; -use Testopia::Util; +use Bugzilla::Extension::Testopia::Constants; +use Bugzilla::Extension::Testopia::Search; +use Bugzilla::Extension::Testopia::Table; +use Bugzilla::Extension::Testopia::TestCaseRun; +use Bugzilla::Extension::Testopia::Util; sub get { my $self = shift; @@ -44,19 +44,19 @@ sub get { Bugzilla->login(LOGIN_REQUIRED); if ($build_id && $build_id !~ /^\d+$/){ - my $run = Testopia::TestRun->new($run_id); + my $run = Bugzilla::Extension::Testopia::TestRun->new($run_id); ThrowUserError('invalid-test-id-non-existent') unless $run; - my $build = Testopia::Build::check_build($build_id, $run->product, "THROW"); + my $build = Bugzilla::Extension::Testopia::Build::check_build($build_id, $run->product, "THROW"); $build_id = $build->id; } if ($env_id && $env_id !~ /^\d+$/){ - my $run = Testopia::TestRun->new($run_id); + my $run = Bugzilla::Extension::Testopia::TestRun->new($run_id); ThrowUserError('invalid-test-id-non-existent') unless $run; - my $environment = Testopia::Build::check_environment($env_id, $run->product, "THROW"); + my $environment = Bugzilla::Extension::Testopia::Build::check_environment($env_id, $run->product, "THROW"); $env_id = $environment->id; } #Result is a test case run hash map - my $caserun = new Testopia::TestCaseRun($run_id, $case_id, $build_id, $env_id); + my $caserun = new Bugzilla::Extension::Testopia::TestCaseRun($run_id, $case_id, $build_id, $env_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case Run', id => $run_id}) unless $caserun; ThrowUserError('testopia-permission-denied', {'object' => $caserun}) unless $caserun->canview; @@ -79,9 +79,9 @@ sub list { } $cgi->param('distinct', 1); - my $search = Testopia::Search->new($cgi); + my $search = Bugzilla::Extension::Testopia::Search->new($cgi); - return Testopia::Table->new('case_run','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list(); + return Bugzilla::Extension::Testopia::Table->new('case_run','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list(); } sub list_count { @@ -99,8 +99,8 @@ sub list_count { } $cgi->param('distinct', 1); - my $search = Testopia::Search->new($cgi); - return Testopia::Table->new('case_run','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list_count(); + my $search = Bugzilla::Extension::Testopia::Search->new($cgi); + return Bugzilla::Extension::Testopia::Table->new('case_run','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list_count(); } sub create { @@ -109,7 +109,7 @@ sub create { Bugzilla->login(LOGIN_REQUIRED); - my $run = Testopia::TestRun->new($new_values->{'run_id'}); + my $run = Bugzilla::Extension::Testopia::TestRun->new($new_values->{'run_id'}); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Run', id => $new_values->{'run_id'}}) unless $run; ThrowUserError('testopia-read-only', {'object' => $run}) unless $run->canedit; @@ -122,11 +122,11 @@ sub create { delete $new_values->{'priority'}; if (trim($new_values->{'build_id'}) !~ /^\d+$/ ){ - my $build = Testopia::Build::check_build($new_values->{'build_id'}, $run->plan->product, "THROWERROR"); + my $build = Bugzilla::Extension::Testopia::Build::check_build($new_values->{'build_id'}, $run->plan->product, "THROWERROR"); $new_values->{'build_id'} = $build->id; } if (trim($new_values->{'environment_id'}) !~ /^\d+$/ ){ - my $environment = Testopia::Environment::check_environment($new_values->{'environment_id'}, $run->plan->product, "THROWERROR"); + my $environment = Bugzilla::Extension::Testopia::Environment::check_environment($new_values->{'environment_id'}, $run->plan->product, "THROWERROR"); $new_values->{'environment_id'} = $environment->id; } @@ -135,7 +135,7 @@ sub create { delete $new_values->{'status'}; - my $caserun = Testopia::TestCaseRun->create($new_values); + my $caserun = Bugzilla::Extension::Testopia::TestCaseRun->create($new_values); # Result is new test case run object hash return $caserun; @@ -148,11 +148,11 @@ sub update { Bugzilla->login(LOGIN_REQUIRED); my @caseruns; - my @ids = Testopia::Util::process_list($run_id); + my @ids = Bugzilla::Extension::Testopia::Util::process_list($run_id); if (ref $case_id eq 'HASH' && !$build_id){ $new_values = $case_id; foreach my $id (@ids){ - my $caserun = new Testopia::TestCaseRun($id); + my $caserun = new Bugzilla::Extension::Testopia::TestCaseRun($id); if ($caserun){ push @caseruns, $caserun; } @@ -163,7 +163,7 @@ sub update { } else { foreach my $id (@ids){ - my $caserun = new Testopia::TestCaseRun($run_id,$case_id,$build_id,$env_id); + my $caserun = new Bugzilla::Extension::Testopia::TestCaseRun($run_id,$case_id,$build_id,$env_id); if ($caserun){ push @caseruns, $caserun; } @@ -251,7 +251,7 @@ sub lookup_status_id_by_name { Bugzilla->login(LOGIN_REQUIRED); # Result is test case run status id for the given test case run status name - return Testopia::TestCaseRun::lookup_status_by_name($name); + return Bugzilla::Extension::Testopia::TestCaseRun::lookup_status_by_name($name); } sub lookup_status_name_by_id { @@ -261,7 +261,7 @@ sub lookup_status_name_by_id { Bugzilla->login(LOGIN_REQUIRED); # Result is test case run status name for the given test case run status id - return Testopia::TestCaseRun::lookup_status($id); + return Bugzilla::Extension::Testopia::TestCaseRun::lookup_status($id); } sub get_history { @@ -271,7 +271,7 @@ sub get_history { Bugzilla->login(LOGIN_REQUIRED); #Result is a test case run hash map - my $caserun = new Testopia::TestCaseRun($run_id, $case_id, $build_id, $env_id); + my $caserun = new Bugzilla::Extension::Testopia::TestCaseRun($run_id, $case_id, $build_id, $env_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case Run', id => $run_id}) unless $caserun; ThrowUserError('testopia-permission-denied', {'object' => $caserun}) unless $caserun->canview; @@ -287,7 +287,7 @@ sub attach_bug { Bugzilla->login(LOGIN_REQUIRED); #Result is a test case run hash map - my $caserun = new Testopia::TestCaseRun($run_id, $case_id, $build_id, $env_id); + my $caserun = new Bugzilla::Extension::Testopia::TestCaseRun($run_id, $case_id, $build_id, $env_id); # If we have just the id, the third arg will not be set. $bug_ids = $case_id unless $build_id; @@ -307,7 +307,7 @@ sub detach_bug { Bugzilla->login(LOGIN_REQUIRED); #Result is a test case run hash map - my $caserun = new Testopia::TestCaseRun($run_id, $case_id, $build_id, $env_id); + my $caserun = new Bugzilla::Extension::Testopia::TestCaseRun($run_id, $case_id, $build_id, $env_id); # If we have just the id, the third arg will not be set. $bug_id = $case_id unless $build_id; @@ -328,7 +328,7 @@ sub get_bugs { Bugzilla->login(LOGIN_REQUIRED); #Result is a test case run hash map - my $caserun = new Testopia::TestCaseRun($run_id, $case_id, $build_id, $env_id); + my $caserun = new Bugzilla::Extension::Testopia::TestCaseRun($run_id, $case_id, $build_id, $env_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case Run', id => $run_id}) unless $caserun; ThrowUserError('testopia-permission-denied', {'object' => $caserun}) unless $caserun->canview; @@ -343,7 +343,7 @@ sub get_completion_time { Bugzilla->login(LOGIN_REQUIRED); #Result is a test case run hash map - my $caserun = new Testopia::TestCaseRun($run_id, $case_id, $build_id, $env_id); + my $caserun = new Bugzilla::Extension::Testopia::TestCaseRun($run_id, $case_id, $build_id, $env_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case Run', id => $run_id}) unless $caserun; ThrowUserError('testopia-permission-denied', {'object' => $caserun}) unless $caserun->canview; @@ -469,7 +469,7 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id) Params: $caserun_id - Integer: An integer representing the ID in the database for this case-run. - Returns: A blessed Testopia::TestCaseRun object hash + Returns: A blessed Bugzilla::Extension::Testopia::TestCaseRun object hash =item C @@ -480,7 +480,7 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id) $build_id - Integer: An integer representing the ID of the test build in the database. $environment_id - Integer: An integer representing the ID of the environment in the database. - Returns: A blessed Testopia::TestCaseRun object hash + Returns: A blessed Bugzilla::Extension::Testopia::TestCaseRun object hash =item C @@ -720,7 +720,7 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id) =head1 SEE ALSO -L +L L =head1 AUTHOR diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/TestPlan.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/TestPlan.pm similarity index 90% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/TestPlan.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/WebService/TestPlan.pm index 88dce510409..9e134568878 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/TestPlan.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/TestPlan.pm @@ -19,21 +19,21 @@ # Contributor(s): Dallas Harken # Greg Hendricks -package extensions::testopia::lib::Testopia::WebService::TestPlan; +package Bugzilla::Extension::Testopia::WebService::TestPlan; use strict; use base qw(Bugzilla::WebService); -use lib qw(./extensions/testopia/lib); +use lib qw(./extensions/Testopia/lib); use Bugzilla::Constants; use Bugzilla::User; use Bugzilla::Util; use Bugzilla::Error; -use Testopia::TestPlan; -use Testopia::Search; -use Testopia::Table; +use Bugzilla::Extension::Testopia::TestPlan; +use Bugzilla::Extension::Testopia::Search; +use Bugzilla::Extension::Testopia::Table; sub get { my $self = shift; @@ -42,7 +42,7 @@ sub get { Bugzilla->login(LOGIN_REQUIRED); # Result is a plan object hash - my $plan = new Testopia::TestPlan($plan_id); + my $plan = new Bugzilla::Extension::Testopia::TestPlan($plan_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Build', id => $plan_id}) unless $plan; ThrowUserError('testopia-permission-denied', {'object' => $plan}) unless $plan->canview; @@ -68,9 +68,9 @@ sub list { } $cgi->param('distinct', 1); - my $search = Testopia::Search->new($cgi); + my $search = Bugzilla::Extension::Testopia::Search->new($cgi); - return Testopia::Table->new('plan','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list(); + return Bugzilla::Extension::Testopia::Table->new('plan','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list(); } sub list_count { @@ -88,8 +88,8 @@ sub list_count { } $cgi->param('distinct', 1); - my $search = Testopia::Search->new($cgi); - return Testopia::Table->new('plan','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list_count(); + my $search = Bugzilla::Extension::Testopia::Search->new($cgi); + return Bugzilla::Extension::Testopia::Table->new('plan','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list_count(); } sub create { @@ -106,7 +106,7 @@ sub create { $new_values->{'author_id'} ||= Bugzilla->user->id; # Canedit check is performed in TestPlan::_check_product - my $plan = Testopia::TestPlan->create($new_values); + my $plan = Bugzilla::Extension::Testopia::TestPlan->create($new_values); return $plan; } @@ -117,7 +117,7 @@ sub update { Bugzilla->login(LOGIN_REQUIRED); - my $plan = new Testopia::TestPlan($plan_id); + my $plan = new Bugzilla::Extension::Testopia::TestPlan($plan_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Plan', id => $plan_id}) unless $plan; ThrowUserError('testopia-read-only', {'object' => $plan}) unless $plan->canedit; @@ -141,7 +141,7 @@ sub get_text { Bugzilla->login(LOGIN_REQUIRED); - my $plan = new Testopia::TestPlan($plan_id); + my $plan = new Bugzilla::Extension::Testopia::TestPlan($plan_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Plan', id => $plan_id}) unless $plan; ThrowUserError('testopia-permission-denied', {'object' => $plan}) unless $plan->canview; @@ -156,7 +156,7 @@ sub store_text { Bugzilla->login(LOGIN_REQUIRED); - my $plan = new Testopia::TestPlan($plan_id); + my $plan = new Bugzilla::Extension::Testopia::TestPlan($plan_id); $author_id ||= Bugzilla->user->id; if ($author_id !~ /^\d+$/){ @@ -179,7 +179,7 @@ sub get_test_cases { Bugzilla->login(LOGIN_REQUIRED); # Result is a plan object hash - my $plan = new Testopia::TestPlan($plan_id); + my $plan = new Bugzilla::Extension::Testopia::TestPlan($plan_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Build', id => $plan_id}) unless $plan; ThrowUserError('testopia-permission-denied', {'object' => $plan}) unless $plan->canview; @@ -195,7 +195,7 @@ sub get_case_tags { Bugzilla->login(LOGIN_REQUIRED); # Result is a plan object hash - my $plan = new Testopia::TestPlan($plan_id); + my $plan = new Bugzilla::Extension::Testopia::TestPlan($plan_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Build', id => $plan_id}) unless $plan; ThrowUserError('testopia-permission-denied', {'object' => $plan}) unless $plan->canview; @@ -211,7 +211,7 @@ sub get_test_runs { Bugzilla->login(LOGIN_REQUIRED); # Result is a plan object hash - my $plan = new Testopia::TestPlan($plan_id); + my $plan = new Bugzilla::Extension::Testopia::TestPlan($plan_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Plan', id => $plan_id}) unless $plan; ThrowUserError('testopia-permission-denied', {'object' => $plan}) unless $plan->canview; @@ -226,7 +226,7 @@ sub get_change_history { Bugzilla->login(LOGIN_REQUIRED); - my $plan = new Testopia::TestPlan($plan_id); + my $plan = new Bugzilla::Extension::Testopia::TestPlan($plan_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Plan', id => $plan_id}) unless $plan; ThrowUserError('testopia-permission-denied', {'object' => $plan}) unless $plan->canview; @@ -242,7 +242,7 @@ sub get_product { Bugzilla->login(LOGIN_REQUIRED); # Result is a plan object hash - my $plan = new Testopia::TestPlan($plan_id); + my $plan = new Bugzilla::Extension::Testopia::TestPlan($plan_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Product', id => $plan_id}) unless $plan; ThrowUserError('testopia-permission-denied', {'object' => $plan}) unless $plan->canview; @@ -268,7 +268,7 @@ sub lookup_type_id_by_name { Bugzilla->login(LOGIN_REQUIRED); # Result is test plan type id for the given test plan type name - return Testopia::TestPlan::lookup_type_by_name($name); + return Bugzilla::Extension::Testopia::TestPlan::lookup_type_by_name($name); } sub add_tag { @@ -277,10 +277,10 @@ sub add_tag { Bugzilla->login(LOGIN_REQUIRED); - my @ids = Testopia::Util::process_list($plan_ids); + my @ids = Bugzilla::Extension::Testopia::Util::process_list($plan_ids); my @results; foreach my $id (@ids){ - my $plan = new Testopia::TestPlan($id); + my $plan = new Bugzilla::Extension::Testopia::TestPlan($id); unless ($plan){ push @results, {ERROR => "TestPlan $id does not exist"}; next; @@ -306,7 +306,7 @@ sub remove_tag { Bugzilla->login(LOGIN_REQUIRED); - my $plan = new Testopia::TestPlan($plan_id); + my $plan = new Bugzilla::Extension::Testopia::TestPlan($plan_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Plan', id => $plan_id}) unless $plan; ThrowUserError('testopia-read-only', {'object' => $plan}) unless $plan->canedit; @@ -323,7 +323,7 @@ sub get_tags { Bugzilla->login(LOGIN_REQUIRED); - my $plan = new Testopia::TestPlan($plan_id); + my $plan = new Bugzilla::Extension::Testopia::TestPlan($plan_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Plan', id => $plan_id}) unless $plan; ThrowUserError('testopia-permission-denied', {'object' => $plan}) unless $plan->canview; @@ -393,7 +393,7 @@ Provides methods for automated scripts to manipulate Testopia TestPlans Params: $id - Integer/String: An integer representing the ID of this plan in the database - Returns: Hash: A blessed Testopia::TestPlan object hash + Returns: Hash: A blessed Bugzilla::Extension::Testopia::TestPlan object hash =item C @@ -409,7 +409,7 @@ Provides methods for automated scripts to manipulate Testopia TestPlans Params: $plan_id - Integer: An integer representing the ID of the plan in the database. - Returns: Hash: A blessed Testopia::Product hash. + Returns: Hash: A blessed Bugzilla::Extension::Testopia::Product hash. =item C @@ -601,7 +601,7 @@ Provides methods for automated scripts to manipulate Testopia TestPlans =head1 SEE ALSO -L +L L =head1 AUTHOR diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/TestRun.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/TestRun.pm similarity index 89% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/TestRun.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/WebService/TestRun.pm index fba362d61f6..4f295fe1922 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/TestRun.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/TestRun.pm @@ -19,12 +19,12 @@ # Contributor(s): Dallas Harken # Greg Hendricks -package extensions::testopia::lib::Testopia::WebService::TestRun; +package Bugzilla::Extension::Testopia::WebService::TestRun; use strict; use base qw(Bugzilla::WebService); -use lib qw(./extensions/testopia/lib); +use lib qw(./extensions/Testopia/lib); use Bugzilla::Constants; use Bugzilla::Product; @@ -32,10 +32,10 @@ use Bugzilla::User; use Bugzilla::Util; use Bugzilla::Error; -use Testopia::Constants; -use Testopia::TestRun; -use Testopia::Search; -use Testopia::Table; +use Bugzilla::Extension::Testopia::Constants; +use Bugzilla::Extension::Testopia::TestRun; +use Bugzilla::Extension::Testopia::Search; +use Bugzilla::Extension::Testopia::Table; # Utility method called by the list method sub get { @@ -45,7 +45,7 @@ sub get { Bugzilla->login(LOGIN_REQUIRED); # Result is a run object hash - my $run = new Testopia::TestRun($run_id); + my $run = new Bugzilla::Extension::Testopia::TestRun($run_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Build', id => $run_id}) unless $run; ThrowUserError('testopia-permission-denied', {'object' => $run}) unless $run->canview; @@ -70,9 +70,9 @@ sub list { } $cgi->param('distinct', 1); - my $search = Testopia::Search->new($cgi); + my $search = Bugzilla::Extension::Testopia::Search->new($cgi); - return Testopia::Table->new('run','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list(); + return Bugzilla::Extension::Testopia::Table->new('run','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list(); } sub list_count { @@ -90,8 +90,8 @@ sub list_count { } $cgi->param('distinct', 1); - my $search = Testopia::Search->new($cgi); - return Testopia::Table->new('run','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list_count(); + my $search = Bugzilla::Extension::Testopia::Search->new($cgi); + return Bugzilla::Extension::Testopia::Table->new('run','tr_xmlrpc.cgi',$cgi,undef,$search->query())->list_count(); } sub create { @@ -100,10 +100,10 @@ sub create { Bugzilla->login(LOGIN_REQUIRED); - my $plan = Testopia::TestPlan->new($new_values->{'plan_id'}); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new($new_values->{'plan_id'}); ThrowUserError("testopia-create-denied", {'object' => 'Test Run', 'plan' => $plan}) unless ($plan->canedit); - my @cases = Testopia::Util::process_list($new_values->{'cases'}); + my @cases = Bugzilla::Extension::Testopia::Util::process_list($new_values->{'cases'}); delete $new_values->{'cases'}; $new_values->{'manager_id'} ||= $new_values->{'manager'}; @@ -119,18 +119,18 @@ sub create { $new_values->{'status'} = 1 unless defined $new_values->{'status'} && $new_values->{'status'} == 0; if (trim($new_values->{'build_id'}) !~ /^\d+$/ ){ - my $build = Testopia::Build::check_build($new_values->{'build_id'}, $plan->product, "THROWERROR"); + my $build = Bugzilla::Extension::Testopia::Build::check_build($new_values->{'build_id'}, $plan->product, "THROWERROR"); $new_values->{'build_id'} = $build->id; } if (trim($new_values->{'environment_id'}) !~ /^\d+$/ ){ - my $environment = Testopia::Environment::check_environment($new_values->{'environment_id'}, $plan->product, "THROWERROR"); + my $environment = Bugzilla::Extension::Testopia::Environment::check_environment($new_values->{'environment_id'}, $plan->product, "THROWERROR"); $new_values->{'environment_id'} = $environment->id; } - my $run = Testopia::TestRun->create($new_values); + my $run = Bugzilla::Extension::Testopia::TestRun->create($new_values); foreach my $c (@cases){ - my $case = Testopia::TestCase->new($c); + my $case = Bugzilla::Extension::Testopia::TestCase->new($c); $run->add_case_run($case->id, $case->sortkey) if $case; } @@ -143,10 +143,10 @@ sub add_cases { Bugzilla->login(LOGIN_REQUIRED); - my @ids = Testopia::Util::process_list($case_ids); + my @ids = Bugzilla::Extension::Testopia::Util::process_list($case_ids); my @results; foreach my $id (@ids){ - my $case = new Testopia::TestCase($id); + my $case = new Bugzilla::Extension::Testopia::TestCase($id); unless ($case){ push @results, {ERROR => "TestCase $id does not exist"}; next; @@ -172,7 +172,7 @@ sub update { Bugzilla->login(LOGIN_REQUIRED); - my $run = new Testopia::TestRun($run_id); + my $run = new Bugzilla::Extension::Testopia::TestRun($run_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Run', id => $run_id}) unless $run; ThrowUserError('testopia-read-only', {'object' => $run}) unless $run->canedit; @@ -188,18 +188,18 @@ sub update { if ($new_values->{'build_id'} && trim($new_values->{'build_id'}) !~ /^\d+$/ ){ - my $build = Testopia::Build::check_build($new_values->{'build_id'}, $run->plan->product, "THROWERROR"); + my $build = Bugzilla::Extension::Testopia::Build::check_build($new_values->{'build_id'}, $run->plan->product, "THROWERROR"); $new_values->{'build_id'} = $build->id; } if ($new_values->{'environment_id'} && trim($new_values->{'environment_id'}) !~ /^\d+$/ ){ - my $environment = Testopia::Environment::check_environment($new_values->{'environment_id'}, $run->plan->product, "THROWERROR"); + my $environment = Bugzilla::Extension::Testopia::Environment::check_environment($new_values->{'environment_id'}, $run->plan->product, "THROWERROR"); $new_values->{'environment_id'} = $environment->id; } my $timestamp; $timestamp = $run->stop_date; $timestamp = undef if $new_values->{'status'} == 1; - $timestamp = Testopia::Util::get_time_stamp() if $new_values->{'status'} == 0 && !$run->stop_date; + $timestamp = Bugzilla::Extension::Testopia::Util::get_time_stamp() if $new_values->{'status'} == 0 && !$run->stop_date; $run->set_summary(trim($new_values->{'summary'})) if defined $new_values->{'summary'}; $run->set_product_version($new_values->{'product_version'}) if $new_values->{'product_version'}; @@ -224,7 +224,7 @@ sub get_change_history { Bugzilla->login(LOGIN_REQUIRED); - my $run = new Testopia::TestRun($run_id); + my $run = new Bugzilla::Extension::Testopia::TestRun($run_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Run', id => $run_id}) unless $run; ThrowUserError('testopia-permission-denied', {'object' => $run}) unless $run->canview; @@ -240,7 +240,7 @@ sub get_test_cases { Bugzilla->login(LOGIN_REQUIRED); # Result is a run object hash - my $run = new Testopia::TestRun($run_id); + my $run = new Bugzilla::Extension::Testopia::TestRun($run_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Build', id => $run_id}) unless $run; ThrowUserError('testopia-permission-denied', {'object' => $run}) unless $run->canview; @@ -256,7 +256,7 @@ sub get_case_tags { Bugzilla->login(LOGIN_REQUIRED); # Result is a run object hash - my $run = new Testopia::TestRun($run_id); + my $run = new Bugzilla::Extension::Testopia::TestRun($run_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Build', id => $run_id}) unless $run; ThrowUserError('testopia-permission-denied', {'object' => $run}) unless $run->canview; @@ -272,7 +272,7 @@ sub get_test_case_runs { Bugzilla->login(LOGIN_REQUIRED); # Result is a run object hash - my $run = new Testopia::TestRun($run_id); + my $run = new Bugzilla::Extension::Testopia::TestRun($run_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Build', id => $run_id}) unless $run; ThrowUserError('testopia-permission-denied', {'object' => $run}) unless $run->canview; @@ -289,7 +289,7 @@ sub get_test_plan { Bugzilla->login(LOGIN_REQUIRED); # Result is a run object hash - my $run = new Testopia::TestRun($run_id); + my $run = new Bugzilla::Extension::Testopia::TestRun($run_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Build', id => $run_id}) unless $run; ThrowUserError('testopia-permission-denied', {'object' => $run}) unless $run->canview; @@ -312,10 +312,10 @@ sub add_tag { Bugzilla->login(LOGIN_REQUIRED); - my @ids = Testopia::Util::process_list($run_ids); + my @ids = Bugzilla::Extension::Testopia::Util::process_list($run_ids); my @results; foreach my $id (@ids){ - my $run = new Testopia::TestRun($id); + my $run = new Bugzilla::Extension::Testopia::TestRun($id); unless ($run){ push @results, {ERROR => "TestRun $id does not exist"}; next; @@ -341,7 +341,7 @@ sub remove_tag { Bugzilla->login(LOGIN_REQUIRED); - my $run = new Testopia::TestRun($run_id); + my $run = new Bugzilla::Extension::Testopia::TestRun($run_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Run', id => $run_id}) unless $run; ThrowUserError('testopia-read-only', {'object' => $run}) unless $run->canedit; @@ -358,7 +358,7 @@ sub get_tags { Bugzilla->login(LOGIN_REQUIRED); - my $run = new Testopia::TestRun($run_id); + my $run = new Bugzilla::Extension::Testopia::TestRun($run_id); ThrowUserError('invalid-test-id-non-existent', {type => 'Test Run', id => $run_id}) unless $run; ThrowUserError('testopia-permission-denied', {'object' => $run}) unless $run->canview; @@ -391,7 +391,7 @@ sub get_completion_report { my @runs; foreach my $g (@run_ids){ - my $obj = Testopia::TestRun->new($g); + my $obj = Bugzilla::Extension::Testopia::TestRun->new($g); push @runs, $obj if $obj && $obj->canview; } @@ -433,7 +433,7 @@ sub get_bugs { my ($runs) = @_; my $dbh = Bugzilla->dbh; - my @run_ids = Testopia::Util::process_list($runs); + my @run_ids = Bugzilla::Extension::Testopia::Util::process_list($runs); my $bugs = $dbh->selectcol_arrayref(" SELECT DISTINCT tcb.bug_id @@ -527,7 +527,7 @@ Provides methods for automated scripts to manipulate Testopia TestRuns Params: $id - Integer: An integer representing the ID of the run in the database - Returns: Hash: A blessed Testopia::TestRun object hash + Returns: Hash: A blessed Bugzilla::Extension::Testopia::TestRun object hash =item C @@ -742,7 +742,7 @@ Provides methods for automated scripts to manipulate Testopia TestRuns =head1 SEE ALSO -L +L L =head1 AUTHOR diff --git a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/Testopia.pm b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/Testopia.pm similarity index 91% rename from mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/Testopia.pm rename to mozilla/webtools/testopia/extensions/Testopia/lib/WebService/Testopia.pm index 4403cdab7ae..0c8e14a3d81 100644 --- a/mozilla/webtools/testopia/extensions/testopia/lib/Testopia/WebService/Testopia.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/lib/WebService/Testopia.pm @@ -19,17 +19,17 @@ # Contributor(s): Dallas Harken # Greg Hendricks -package extensions::testopia::lib::Testopia::WebService::Testopia; +package Bugzilla::Extension::Testopia::WebService::Testopia; use strict; use base qw(Bugzilla::WebService); -use lib qw(./extensions/testopia/lib); +use lib qw(./extensions/Testopia/lib); use Bugzilla::Error; use Bugzilla::Constants; -use Testopia::Constants; +use Bugzilla::Extension::Testopia::Constants; sub api_version { my $self = shift; diff --git a/mozilla/webtools/testopia/extensions/testopia/patch-3.2.2 b/mozilla/webtools/testopia/extensions/Testopia/patch-3.2.2 similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/patch-3.2.2 rename to mozilla/webtools/testopia/extensions/Testopia/patch-3.2.2 diff --git a/mozilla/webtools/testopia/extensions/testopia/patch-3.4 b/mozilla/webtools/testopia/extensions/Testopia/patch-3.4 similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/patch-3.4 rename to mozilla/webtools/testopia/extensions/Testopia/patch-3.4 diff --git a/mozilla/webtools/testopia/extensions/testopia/patch-3.4.3 b/mozilla/webtools/testopia/extensions/Testopia/patch-3.4.3 similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/patch-3.4.3 rename to mozilla/webtools/testopia/extensions/Testopia/patch-3.4.3 diff --git a/mozilla/webtools/testopia/extensions/testopia/patch-3.4.4 b/mozilla/webtools/testopia/extensions/Testopia/patch-3.4.4 similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/patch-3.4.4 rename to mozilla/webtools/testopia/extensions/Testopia/patch-3.4.4 diff --git a/mozilla/webtools/testopia/extensions/testopia/patch-3.4.5 b/mozilla/webtools/testopia/extensions/Testopia/patch-3.4.5 similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/patch-3.4.5 rename to mozilla/webtools/testopia/extensions/Testopia/patch-3.4.5 diff --git a/mozilla/webtools/testopia/extensions/testopia/run_unit_tests.pl b/mozilla/webtools/testopia/extensions/Testopia/run_unit_tests.pl similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/run_unit_tests.pl rename to mozilla/webtools/testopia/extensions/Testopia/run_unit_tests.pl diff --git a/mozilla/webtools/testopia/extensions/testopia/t/API_Build.pm b/mozilla/webtools/testopia/extensions/Testopia/t/API_Build.pm similarity index 84% rename from mozilla/webtools/testopia/extensions/testopia/t/API_Build.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/API_Build.pm index 5c03b669344..15a30393965 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/API_Build.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/API_Build.pm @@ -30,9 +30,9 @@ use lib "../.."; use Testopia::Build; -use Testopia::Test::Constants; -use Testopia::Test::API::Util; -use Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::API::Util; +use Bugzilla::Extension::Testopia::Test::Util; use Test::More tests => 8; use Test::Deep; @@ -57,8 +57,8 @@ sub tear_down { sub test_check_build_by_product_id { my $self = shift; - my $rep = Testopia::Test::Util::get_rep('test_builds'); - my $obj = Testopia::Build->new($rep->{'build_id'}); + my $rep = Bugzilla::Extension::Testopia::Test::Util::get_rep('test_builds'); + my $obj = Bugzilla::Extension::Testopia::Build->new($rep->{'build_id'}); my $response = $proxy->call( "Build.check_build", $rep->{'name'}, $rep->{'product_id'} ); @@ -73,7 +73,7 @@ sub test_check_build_by_product_name { my $self = shift; my $rep = get_rep('test_builds'); - my $obj = Testopia::Build->new($rep->{'build_id'}); + my $obj = Bugzilla::Extension::Testopia::Build->new($rep->{'build_id'}); my $response = $proxy->call( "Build.check_build", $rep->{'name'}, $obj->product->name ); @@ -102,7 +102,7 @@ sub test_create_by_product_id { }); check_fault($response, $self); - my $obj = Testopia::Build->new($response->result->{'build_id'}); + my $obj = Bugzilla::Extension::Testopia::Build->new($response->result->{'build_id'}); convert_undef($obj); @@ -122,7 +122,7 @@ sub test_create_by_product_name { }); check_fault($response, $self); - my $obj = Testopia::Build->new($response->result->{'build_id'}); + my $obj = Bugzilla::Extension::Testopia::Build->new($response->result->{'build_id'}); convert_undef($obj); @@ -133,7 +133,7 @@ sub test_get { my $self = shift; my $rep = get_rep('test_builds'); - my $obj = Testopia::Build->new($rep->{'build_id'}); + my $obj = Bugzilla::Extension::Testopia::Build->new($rep->{'build_id'}); $obj->product; $obj->run_count; @@ -151,7 +151,7 @@ sub test_get_caseruns { my $self = shift; my $rep = get_rep('test_case_runs'); - my $obj = Testopia::Build->new($rep->{'build_id'}); + my $obj = Bugzilla::Extension::Testopia::Build->new($rep->{'build_id'}); $obj->product; my $response = $proxy->call( "Build.get_caseruns", $rep->{'build_id'} ); @@ -168,7 +168,7 @@ sub test_get_runs { my $self = shift; my $rep = get_rep('test_runs'); - my $obj = Testopia::Build->new($rep->{'build_id'}); + my $obj = Bugzilla::Extension::Testopia::Build->new($rep->{'build_id'}); $obj->product; my $response = $proxy->call( "Build.get_runs", $rep->{'build_id'} ); @@ -185,7 +185,7 @@ sub test_update { my $self = shift; my $rep = get_rep('test_builds'); - my $obj = Testopia::Build->new($rep->{'build_id'}); + my $obj = Bugzilla::Extension::Testopia::Build->new($rep->{'build_id'}); my $newname = 'API UPDATE TEST '. time(); my $newmilestone = $obj->product->milestones->[1]->{'name'}; @@ -205,7 +205,7 @@ sub test_update { } ); # Get the newly updated object to compare with - $obj = Testopia::Build->new($rep->{'build_id'}); + $obj = Bugzilla::Extension::Testopia::Build->new($rep->{'build_id'}); $obj->product; check_fault($response, $self); diff --git a/mozilla/webtools/testopia/extensions/testopia/t/API_Environment.pm b/mozilla/webtools/testopia/extensions/Testopia/t/API_Environment.pm similarity index 81% rename from mozilla/webtools/testopia/extensions/testopia/t/API_Environment.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/API_Environment.pm index 7fff282db33..bc0194a37d4 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/API_Environment.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/API_Environment.pm @@ -34,9 +34,9 @@ use Testopia::Search; use Testopia::Table; -use Testopia::Test::Constants; -use Testopia::Test::API::Util; -use Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::API::Util; +use Bugzilla::Extension::Testopia::Test::Util; use Test::More tests => 4; use Test::Deep; @@ -61,8 +61,8 @@ sub tear_down { sub test_check_environment_by_product_id { my $self = shift; - my $rep = Testopia::Test::Util::get_rep('test_environments'); - my $obj = Testopia::Environment->new($rep->{'environment_id'}); + my $rep = Bugzilla::Extension::Testopia::Test::Util::get_rep('test_environments'); + my $obj = Bugzilla::Extension::Testopia::Environment->new($rep->{'environment_id'}); my $response = $proxy->call( "Environment.check_environment", $rep->{'name'}, $rep->{'product_id'} ); @@ -77,7 +77,7 @@ sub test_check_environment_by_product_name { my $self = shift; my $rep = get_rep('test_environments'); - my $obj = Testopia::Environment->new($rep->{'environment_id'}); + my $obj = Bugzilla::Extension::Testopia::Environment->new($rep->{'environment_id'}); my $response = $proxy->call( "Environment.check_environment", $rep->{'name'}, $obj->product->name ); @@ -104,7 +104,7 @@ sub test_create_by_product_id { }); check_fault($response, $self); - my $obj = Testopia::Environment->new($response->result->{'environment_id'}); + my $obj = Bugzilla::Extension::Testopia::Environment->new($response->result->{'environment_id'}); convert_undef($obj); @@ -121,7 +121,7 @@ sub test_create_by_product_name { }); check_fault($response, $self); - my $obj = Testopia::Environment->new($response->result->{'environment_id'}); + my $obj = Bugzilla::Extension::Testopia::Environment->new($response->result->{'environment_id'}); convert_undef($obj); @@ -132,7 +132,7 @@ sub test_get { my $self = shift; my $rep = get_rep('test_environments'); - my $obj = Testopia::Environment->new($rep->{'environment_id'}); + my $obj = Bugzilla::Extension::Testopia::Environment->new($rep->{'environment_id'}); $obj->product; my $response = $proxy->call( "Environment.get", $rep->{'environment_id'} ); @@ -149,7 +149,7 @@ sub test_update { my $self = shift; my $rep = get_rep('test_environments'); - my $obj = Testopia::Environment->new($rep->{'environment_id'}); + my $obj = Bugzilla::Extension::Testopia::Environment->new($rep->{'environment_id'}); my $newname = 'API UPDATE TEST '. time(); my $newisactive = $obj->isactive ? 0 : 1; @@ -163,7 +163,7 @@ sub test_update { } ); # Get the newly updated object to compare with - $obj = Testopia::Environment->new($rep->{'environment_id'}); + $obj = Bugzilla::Extension::Testopia::Environment->new($rep->{'environment_id'}); $obj->product; check_fault($response, $self); @@ -178,7 +178,7 @@ sub test_get_caseruns { my $self = shift; my $rep = get_rep('test_case_runs'); - my $obj = Testopia::Environment->new($rep->{'environment_id'}); + my $obj = Bugzilla::Extension::Testopia::Environment->new($rep->{'environment_id'}); $obj->product; my $response = $proxy->call( "Environment.get_caseruns", $rep->{'environment_id'} ); @@ -195,7 +195,7 @@ sub test_get_runs { my $self = shift; my $rep = get_rep('test_runs'); - my $obj = Testopia::Environment->new($rep->{'environment_id'}); + my $obj = Bugzilla::Extension::Testopia::Environment->new($rep->{'environment_id'}); $obj->product; my $response = $proxy->call( "Environment.get_runs", $rep->{'environment_id'} ); @@ -215,8 +215,8 @@ sub test_list { $cgi->param("current_tab", "environment"); $cgi->param("pagesize", 25); - my $search = Testopia::Search->new($cgi); - my $table = Testopia::Table->new('environment', 'tr_xmlrpc.cgi',$cgi,undef, $search->query()); + my $search = Bugzilla::Extension::Testopia::Search->new($cgi); + my $table = Bugzilla::Extension::Testopia::Table->new('environment', 'tr_xmlrpc.cgi',$cgi,undef, $search->query()); my $response = $proxy->call( "Environment.list", { pagesize => 25, diff --git a/mozilla/webtools/testopia/extensions/testopia/t/API_Product.pm b/mozilla/webtools/testopia/extensions/Testopia/t/API_Product.pm similarity index 86% rename from mozilla/webtools/testopia/extensions/testopia/t/API_Product.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/API_Product.pm index ae2f273a62d..08ab78bdd68 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/API_Product.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/API_Product.pm @@ -34,9 +34,9 @@ use Testopia::Search; use Testopia::Table; -use Testopia::Test::Constants; -use Testopia::Test::API::Util; -use Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::API::Util; +use Bugzilla::Extension::Testopia::Test::Util; use Test::More; use Test::Deep; @@ -62,7 +62,7 @@ sub test_check_category { my $self = shift; my $rep = get_rep('test_case_categories'); - my $obj = Testopia::Category->new($rep->{'category_id'}); + my $obj = Bugzilla::Extension::Testopia::Category->new($rep->{'category_id'}); my $response = $proxy->call( "Product.check_category", $rep->{'name'}, $rep->{'product_id'} ); @@ -93,7 +93,7 @@ sub test_check_product { my $self = shift; my $rep = get_rep('products'); - my $obj = Testopia::Product->new($rep->{'id'}); + my $obj = Bugzilla::Extension::Testopia::Product->new($rep->{'id'}); my $response = $proxy->call( "Product.check_product", $rep->{'name'} ); @@ -108,7 +108,7 @@ sub test_get { my $self = shift; my $rep = get_rep('products'); - my $obj = Testopia::Product->new($rep->{'id'}); + my $obj = Bugzilla::Extension::Testopia::Product->new($rep->{'id'}); my $response = $proxy->call( "Product.get", $rep->{'id'} ); @@ -124,7 +124,7 @@ sub test_get_builds { my $self = shift; my $rep = get_rep('test_builds'); - my $obj = Testopia::Product->new($rep->{'product_id'}); + my $obj = Bugzilla::Extension::Testopia::Product->new($rep->{'product_id'}); my $response = $proxy->call( "Product.get_builds", $rep->{'product_id'} ); @@ -141,7 +141,7 @@ sub test_get_cases { my $self = shift; my $rep = get_rep('test_case_plans'); - my $plan = Testopia::TestPlan->new($rep->{'plan_id'}); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new($rep->{'plan_id'}); my $obj = $plan->product; my $response = $proxy->call( "Product.get_cases", $obj->id ); @@ -156,7 +156,7 @@ sub test_get_categories { my $self = shift; my $rep = get_rep('test_case_categories'); - my $obj = Testopia::Product->new($rep->{'product_id'}); + my $obj = Bugzilla::Extension::Testopia::Product->new($rep->{'product_id'}); my $response = $proxy->call( "Product.get_categories", $rep->{'product_id'} ); @@ -174,7 +174,7 @@ sub test_get_category { my $self = shift; my $rep = get_rep('test_case_categories'); - my $obj = Testopia::Category->new($rep->{'category_id'}); + my $obj = Bugzilla::Extension::Testopia::Category->new($rep->{'category_id'}); my $response = $proxy->call( "Product.get_category", $rep->{'category_id'} ); @@ -206,7 +206,7 @@ sub test_get_components { my $self = shift; my $rep = get_rep('products'); - my $obj = Testopia::Product->new($rep->{'id'}); + my $obj = Bugzilla::Extension::Testopia::Product->new($rep->{'id'}); my $response = $proxy->call( "Product.get_components", $rep->{'id'} ); @@ -224,7 +224,7 @@ sub test_get_enviroments { my $self = shift; my $rep = get_rep('test_environments'); - my $obj = Testopia::Product->new($rep->{'product_id'}); + my $obj = Bugzilla::Extension::Testopia::Product->new($rep->{'product_id'}); my $response = $proxy->call( "Product.get_environments", $rep->{'product_id'} ); @@ -242,7 +242,7 @@ sub test_get_milestones { my $self = shift; my $rep = get_rep('products'); - my $obj = Testopia::Product->new($rep->{'id'}); + my $obj = Bugzilla::Extension::Testopia::Product->new($rep->{'id'}); my $response = $proxy->call( "Product.get_milestones", $rep->{'id'} ); @@ -260,7 +260,7 @@ sub test_get_plans { my $self = shift; my $rep = get_rep('test_plans'); - my $obj = Testopia::Product->new($rep->{'product_id'}); + my $obj = Bugzilla::Extension::Testopia::Product->new($rep->{'product_id'}); my $response = $proxy->call( "Product.get_plans", $rep->{'product_id'} ); @@ -278,7 +278,7 @@ sub test_get_runs { my $self = shift; my $rep = get_rep('test_runs'); - my $run = Testopia::TestRun->new($rep->{'run_id'}); + my $run = Bugzilla::Extension::Testopia::TestRun->new($rep->{'run_id'}); my $obj = $run->plan->product; my $response = $proxy->call( "Product.get_runs", $obj->id ); @@ -297,7 +297,7 @@ sub test_get_tags { my $self = shift; my $rep = get_rep('test_run_tags'); - my $run = Testopia::TestRun->new($rep->{'run_id'}); + my $run = Bugzilla::Extension::Testopia::TestRun->new($rep->{'run_id'}); my $obj = $run->plan->product; my $response = $proxy->call( "Product.get_tags", $obj->id ); @@ -313,7 +313,7 @@ sub test_get_versions { my $self = shift; my $rep = get_rep('products'); - my $obj = Testopia::Product->new($rep->{'id'}); + my $obj = Bugzilla::Extension::Testopia::Product->new($rep->{'id'}); my $response = $proxy->call( "Product.get_versions", $rep->{'id'} ); diff --git a/mozilla/webtools/testopia/extensions/testopia/t/API_Suite.pm b/mozilla/webtools/testopia/extensions/Testopia/t/API_Suite.pm similarity index 87% rename from mozilla/webtools/testopia/extensions/testopia/t/API_Suite.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/API_Suite.pm index 25dd2e83e4f..369481901e0 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/API_Suite.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/API_Suite.pm @@ -10,7 +10,7 @@ use Test::Unit::TestRunner; use lib ".."; use lib "../.."; -use Testopia::Test::API::Util; +use Bugzilla::Extension::Testopia::Test::API::Util; sub name { 'Testopia API Test Suite' } diff --git a/mozilla/webtools/testopia/extensions/testopia/t/API_TestCase.pm b/mozilla/webtools/testopia/extensions/Testopia/t/API_TestCase.pm similarity index 84% rename from mozilla/webtools/testopia/extensions/testopia/t/API_TestCase.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/API_TestCase.pm index 985be0858ef..53161bb4940 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/API_TestCase.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/API_TestCase.pm @@ -33,9 +33,9 @@ use Testopia::TestCase; use Testopia::Search; use Testopia::Table; -use Testopia::Test::Constants; -use Testopia::Test::API::Util; -use Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::API::Util; +use Bugzilla::Extension::Testopia::Test::Util; use Test::More; use Test::Deep; @@ -60,10 +60,10 @@ sub tear_down { sub test_create_by_arrays { my $self = shift; - my $plan = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); - my $plan2 = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + my $plan2 = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); while ( $plan2->id == $plan->id ) { - $plan2 = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + $plan2 = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); } my @time = localtime(); @@ -104,7 +104,7 @@ sub test_create_by_arrays { ); check_fault( $response, $self ); - my $obj = Testopia::TestCase->new( $response->result->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $response->result->{'case_id'} ); $obj->type; $obj->version; @@ -116,10 +116,10 @@ sub test_create_by_arrays { sub test_create_by_strings { my $self = shift; - my $plan = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); - my $plan2 = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + my $plan2 = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); while ( $plan2->id == $plan->id ) { - $plan2 = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + $plan2 = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); } my @time = localtime(); my $category = get_rep('test_case_categories'); @@ -130,7 +130,7 @@ sub test_create_by_strings { { status => get_rep('test_case_status')->{'name'}, category => {category => $category->{'name'}, - product => Testopia::Product->new($category->{'product_id'})->name}, + product => Bugzilla::Extension::Testopia::Product->new($category->{'product_id'})->name}, priority => get_rep('priority')->{'value'}, summary => 'API TEST CREATE ' . time(), plans => "" . $plan->id .",". $plan2->id , @@ -159,13 +159,13 @@ sub test_create_by_strings { [ get_rep('bugs')->{'bug_id'}, get_rep('bugs')->{'bug_id'} ], components => [ {component => $component->{'name'}, - product => Testopia::Product->new($component->{'product_id'})->name}, + product => Bugzilla::Extension::Testopia::Product->new($component->{'product_id'})->name}, ], } ); check_fault( $response, $self ); - my $obj = Testopia::TestCase->new( $response->result->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $response->result->{'case_id'} ); $obj->type; $obj->version; @@ -178,7 +178,7 @@ sub test_get { my $self = shift; my $rep = get_rep('test_cases'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); $obj->text; $obj->version; $obj->dependson_list; @@ -199,7 +199,7 @@ sub test_update { my $self = shift; my $rep = get_rep('test_cases'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $category = get_rep('test_case_categories'); @@ -209,7 +209,7 @@ sub test_update { { status => get_rep('test_case_status')->{'name'}, category => {category => $category->{'name'}, - product => Testopia::Product->new($category->{'product_id'})->name}, + product => Bugzilla::Extension::Testopia::Product->new($category->{'product_id'})->name}, priority => get_rep('priority')->{'value'}, summary => 'API TEST UPDATE ' . time(), default_tester => get_rep('profiles')->{'login_name'}, @@ -232,7 +232,7 @@ sub test_update { ); # Get the newly updated object to compare with - $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); $obj->dependson_list; $obj->blocked_list; @@ -257,9 +257,9 @@ sub test_list { $cgi->param("Bugzilla_password", LOGIN_CREDENTIALS->{'admin'}->{'password'}); Bugzilla->login(); - my $search = Testopia::Search->new($cgi); + my $search = Bugzilla::Extension::Testopia::Search->new($cgi); my $table = - Testopia::Table->new( 'case', 'tr_xmlrpc.cgi', $cgi, undef, + Bugzilla::Extension::Testopia::Table->new( 'case', 'tr_xmlrpc.cgi', $cgi, undef, $search->query() ); my $response = $proxy->call( "TestCase.list", { pagesize => 25, } ); @@ -278,7 +278,7 @@ sub test_add_component { my $self = shift; my $rep = get_rep('test_cases'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $orig_size = scalar @{$obj->components}; delete $obj->{'components'}; @@ -286,7 +286,7 @@ sub test_add_component { my $response = $proxy->call( "TestCase.add_component", $rep->{'case_id'}, {component => $component->{'name'}, - product => Testopia::Product->new($component->{'product_id'})->name} ); + product => Bugzilla::Extension::Testopia::Product->new($component->{'product_id'})->name} ); check_fault( $response, $self ); @@ -298,7 +298,7 @@ sub test_add_tag { my $self = shift; my $rep = get_rep('test_cases'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $orig_size = scalar @{$obj->tags}; delete $obj->{'tags'}; @@ -325,7 +325,7 @@ sub test_add_to_run { $run = get_rep('test_runs'); } - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $orig_size = $obj->run_count; my $tag = get_rep('test_tags'); @@ -349,7 +349,7 @@ sub test_attach_bug { Bugzilla->login(); my $rep = get_rep('test_cases'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $orig_size = scalar @{$obj->bugs}; delete $obj->{'bugs'}; @@ -368,7 +368,7 @@ sub test_calculate_average_time { my $self = shift; my $rep = get_rep('test_cases'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $response = $proxy->call( "TestCase.calculate_average_time", $rep->{'case_id'} ); @@ -391,7 +391,7 @@ sub test_detach_bug { my $rep = get_rep('test_cases'); my $bug = get_rep('bugs'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); $obj->attach_bug($bug->{'bug_id'}); delete $obj->{'bugs'}; my $orig_size = scalar @{$obj->bugs}; @@ -417,7 +417,7 @@ sub test_get_bugs { my $rep = get_rep('test_case_bugs'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $response = $proxy->call( "TestCase.get_bugs", $rep->{'case_id'} ); @@ -435,7 +435,7 @@ sub test_get_case_run_history { my $self = shift; my $rep = get_rep('test_case_runs'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $response = $proxy->call( "TestCase.get_case_run_history", $rep->{'case_id'} ); @@ -453,7 +453,7 @@ sub test_get_change_history { my $self = shift; my $rep = get_rep('test_case_activity'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $response = $proxy->call( "TestCase.get_change_history", $rep->{'case_id'} ); @@ -471,7 +471,7 @@ sub test_get_components { my $self = shift; my $rep = get_rep('test_case_components'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $response = $proxy->call( "TestCase.get_components", $rep->{'case_id'} ); @@ -489,7 +489,7 @@ sub test_get_plans { my $self = shift; my $rep = get_rep('test_case_plans'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $response = $proxy->call( "TestCase.get_plans", $rep->{'case_id'} ); @@ -507,7 +507,7 @@ sub test_get_tags { my $self = shift; my $rep = get_rep('test_case_tags'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $response = $proxy->call( "TestCase.get_tags", $rep->{'case_id'} ); @@ -526,7 +526,7 @@ sub test_get_text { my $self = shift; my $rep = get_rep('test_case_texts'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $response = $proxy->call( "TestCase.get_text", $rep->{'case_id'} ); @@ -543,7 +543,7 @@ sub test_link_plan { my $self = shift; my $rep = get_rep('test_cases'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $orig_size = scalar @{$obj->plans}; delete $obj->{'plans'}; @@ -619,7 +619,7 @@ sub test_remove_component { my $rep = get_rep('test_case_components'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $orig_size = scalar @{$obj->components}; delete $obj->{'components'}; @@ -636,8 +636,8 @@ sub test_remove_tag { my $rep = get_rep('test_case_tags'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); - my $tag = Testopia::TestTag->new( $rep->{'tag_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); + my $tag = Bugzilla::Extension::Testopia::TestTag->new( $rep->{'tag_id'} ); my $orig_size = scalar @{$obj->tags}; delete $obj->{'tags'}; @@ -654,7 +654,7 @@ sub test_store_text { my $self = shift; my $rep = get_rep('test_cases'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); my $response = $proxy->call( "TestCase.store_text", $rep->{'case_id'}, "API ACTION UPDATE TEST", @@ -675,7 +675,7 @@ sub test_unlink_plan { my $plan = get_rep('test_plans'); my $rep = get_rep('test_cases'); - my $obj = Testopia::TestCase->new( $rep->{'case_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCase->new( $rep->{'case_id'} ); $obj->link_plan($plan->{'plan_id'}); delete $obj->{'plans'}; my $orig_size = scalar @{$obj->plans}; diff --git a/mozilla/webtools/testopia/extensions/testopia/t/API_TestCaseRun.pm b/mozilla/webtools/testopia/extensions/Testopia/t/API_TestCaseRun.pm similarity index 83% rename from mozilla/webtools/testopia/extensions/testopia/t/API_TestCaseRun.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/API_TestCaseRun.pm index fd143fefbdc..c8a33a147e5 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/API_TestCaseRun.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/API_TestCaseRun.pm @@ -33,9 +33,9 @@ use Testopia::TestCaseRun; use Testopia::Search; use Testopia::Table; -use Testopia::Test::Constants; -use Testopia::Test::API::Util; -use Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::API::Util; +use Bugzilla::Extension::Testopia::Test::Util; use Test::More; use Test::Deep; @@ -60,13 +60,13 @@ sub tear_down { sub test_create_by_integer { my $self = shift; - my $plan = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); while (scalar @{ $plan->test_runs } == 0 || scalar @{ $plan->test_cases } == 0 || scalar @{ $plan->product->environments } == 0 || scalar @{ $plan->product->builds } == 0 ) { - $plan = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + $plan = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); } my @runs = @{ $plan->test_runs }; @@ -96,7 +96,7 @@ sub test_create_by_integer { check_fault( $response, $self ); - my $obj = Testopia::TestCaseRun->new( $response->result->{'case_run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCaseRun->new( $response->result->{'case_run_id'} ); convert_undef($obj); @@ -106,13 +106,13 @@ sub test_create_by_integer { sub test_create_by_string { my $self = shift; - my $plan = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); while (scalar @{ $plan->test_runs } == 0 || scalar @{ $plan->test_cases } == 0 || scalar @{ $plan->product->environments } == 0 || scalar @{ $plan->product->builds } == 0 ) { - $plan = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + $plan = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); } my @runs = @{ $plan->test_runs }; my @cases = @{ $plan->test_cases }; @@ -137,7 +137,7 @@ sub test_create_by_string { check_fault( $response, $self ); - my $obj = Testopia::TestCaseRun->new( $response->result->{'case_run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCaseRun->new( $response->result->{'case_run_id'} ); convert_undef($obj); @@ -148,7 +148,7 @@ sub test_get_by_id { my $self = shift; my $rep = get_rep('test_case_runs'); - my $obj = Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); convert_undef($obj); @@ -165,7 +165,7 @@ sub test_get_by_values { my $self = shift; my $rep = get_rep('test_case_runs'); - my $obj = Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); my $response = $proxy->call( "TestCaseRun.get", $rep->{'run_id'}, $rep->{'case_id'}, $rep->{'build_id'}, @@ -184,7 +184,7 @@ sub test_update { my $self = shift; my $rep = get_rep('test_case_runs'); - my $obj = Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); my @builds = @{ $obj->run->plan->product->builds }; my @envs = @{ $obj->run->plan->product->environments }; @@ -207,7 +207,7 @@ sub test_update { check_fault( $response, $self ); # Get the newly updated object to compare with - $obj = Testopia::TestCaseRun->new( $response->result->{'case_run_id'} ); + $obj = Bugzilla::Extension::Testopia::TestCaseRun->new( $response->result->{'case_run_id'} ); $obj->build; $obj->environment; @@ -228,8 +228,8 @@ sub test_list { $cgi->param( "current_tab", "case_run" ); $cgi->param( "pagesize", 25 ); - my $search = Testopia::Search->new($cgi); - my $table = Testopia::Table->new( 'case_run', 'tr_xmlrpc.cgi', $cgi, undef, $search->query() ); + my $search = Bugzilla::Extension::Testopia::Search->new($cgi); + my $table = Bugzilla::Extension::Testopia::Table->new( 'case_run', 'tr_xmlrpc.cgi', $cgi, undef, $search->query() ); my $response = $proxy->call( "TestCaseRun.list", { pagesize => 25, } ); @@ -252,7 +252,7 @@ sub test_attach_bug { Bugzilla->login(); my $rep = get_rep('test_case_runs'); - my $obj = Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); my $orig_size = scalar @{ $obj->bugs }; my $bug = get_rep('bugs'); @@ -278,7 +278,7 @@ sub test_detach_bug { my $rep = get_rep('test_case_runs'); my $bug = get_rep('bugs'); - my $obj = Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); $obj->attach_bug( $bug->{'bug_id'} ); delete $obj->{'bugs'}; my $orig_size = scalar @{ $obj->bugs }; @@ -308,7 +308,7 @@ sub test_get_bugs { my $rep = $dbh->selectrow_hashref( "SELECT bug_id, case_run_id FROM test_case_bugs WHERE case_run_id IS NOT NULL LIMIT 1 OFFSET $offset"); - my $obj = Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); my $response = $proxy->call( "TestCaseRun.get_bugs", $rep->{'case_run_id'} ); @@ -326,7 +326,7 @@ sub test_get_completion_time { my $self = shift; my $rep = get_rep('test_case_runs'); - my $obj = Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); my $response = $proxy->call( "TestCaseRun.get_completion_time", $rep->{'case_run_id'} ); @@ -339,7 +339,7 @@ sub test_get_history { my $self = shift; my $rep = get_rep('test_case_runs'); - my $obj = Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); my $response = $proxy->call( "TestCaseRun.get_history", $rep->{'case_run_id'} ); @@ -362,7 +362,7 @@ sub test_lookup_status_id_by_name { check_fault( $response, $self ); # dump_all(lookup_status_by_name($rep->{'name'}), $response->result); - cmp_deeply( $response->result, Testopia::TestCaseRun::lookup_status_by_name( $rep->{'name'} ), + cmp_deeply( $response->result, Bugzilla::Extension::Testopia::TestCaseRun::lookup_status_by_name( $rep->{'name'} ), "TestCaseRun - lookup_status_id_by_name" ); } @@ -377,7 +377,7 @@ sub test_lookup_status_name_by_id { check_fault( $response, $self ); # dump_all($rep, $response->result); - cmp_deeply( $response->result, Testopia::TestCaseRun::lookup_status( $rep->{'case_run_status_id'} ), + cmp_deeply( $response->result, Bugzilla::Extension::Testopia::TestCaseRun::lookup_status( $rep->{'case_run_status_id'} ), "TestCaseRun - lookup_status_name_by_id" ); } diff --git a/mozilla/webtools/testopia/extensions/testopia/t/API_TestPlan.pm b/mozilla/webtools/testopia/extensions/Testopia/t/API_TestPlan.pm similarity index 84% rename from mozilla/webtools/testopia/extensions/testopia/t/API_TestPlan.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/API_TestPlan.pm index 4fdf47141a1..7e72d01380d 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/API_TestPlan.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/API_TestPlan.pm @@ -33,9 +33,9 @@ use Testopia::TestPlan; use Testopia::Search; use Testopia::Table; -use Testopia::Test::Constants; -use Testopia::Test::API::Util; -use Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::API::Util; +use Bugzilla::Extension::Testopia::Test::Util; use Test::More; use Test::Deep; @@ -60,7 +60,7 @@ sub tear_down { sub test_create_by_id { my $self = shift; - my $product = Testopia::Product->new( get_rep('products')->{'id'} ); + my $product = Bugzilla::Extension::Testopia::Product->new( get_rep('products')->{'id'} ); my @versions = @{ $product->versions }; my $version = $versions[ int( rand( scalar @versions ) ) ]; @@ -77,7 +77,7 @@ sub test_create_by_id { check_fault( $response, $self ); - my $obj = Testopia::TestPlan->new( $response->result->{'plan_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestPlan->new( $response->result->{'plan_id'} ); $obj->version; convert_undef($obj); @@ -89,7 +89,7 @@ sub test_create_by_id { sub test_create_by_string { my $self = shift; - my $product = Testopia::Product->new( get_rep('products')->{'id'} ); + my $product = Bugzilla::Extension::Testopia::Product->new( get_rep('products')->{'id'} ); my @versions = @{ $product->versions }; my $version = $versions[ int( rand( scalar @versions ) ) ]; @@ -105,7 +105,7 @@ sub test_create_by_string { check_fault( $response, $self ); - my $obj = Testopia::TestPlan->new( $response->result->{'plan_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestPlan->new( $response->result->{'plan_id'} ); $obj->version; convert_undef($obj); @@ -118,7 +118,7 @@ sub test_get { my $self = shift; my $rep = get_rep('test_plans'); - my $obj = Testopia::TestPlan->new( $rep->{'plan_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestPlan->new( $rep->{'plan_id'} ); $obj->product; my $response = $proxy->call( "TestPlan.get", $rep->{'plan_id'} ); @@ -140,7 +140,7 @@ sub test_update { my $self = shift; my $rep = get_rep('test_plans'); - my $obj = Testopia::TestPlan->new( $rep->{'plan_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestPlan->new( $rep->{'plan_id'} ); my @versions = @{ $obj->product->versions }; my $version = $versions[ int( rand( scalar @versions ) ) ]; @@ -157,7 +157,7 @@ sub test_update { ); # Get the newly updated object to compare with - $obj = Testopia::TestPlan->new( $rep->{'plan_id'} ); + $obj = Bugzilla::Extension::Testopia::TestPlan->new( $rep->{'plan_id'} ); $obj->product; check_fault( $response, $self ); @@ -173,7 +173,7 @@ sub test_get_test_cases { my $self = shift; my $rep = get_rep('test_case_plans'); - my $obj = Testopia::TestPlan->new( $rep->{'plan_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestPlan->new( $rep->{'plan_id'} ); $obj->product; my $response = $proxy->call( "TestPlan.get_test_cases", $rep->{'plan_id'} ); @@ -192,7 +192,7 @@ sub test_get_test_runs { my $self = shift; my $rep = get_rep('test_runs'); - my $obj = Testopia::TestPlan->new( $rep->{'plan_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestPlan->new( $rep->{'plan_id'} ); $obj->product; my $response = $proxy->call( "TestPlan.get_test_runs", $rep->{'plan_id'} ); @@ -219,8 +219,8 @@ sub test_list { Bugzilla->login(); - my $search = Testopia::Search->new($cgi); - my $table = Testopia::Table->new( 'plan', 'tr_xmlrpc.cgi', $cgi, undef, $search->query() ); + my $search = Bugzilla::Extension::Testopia::Search->new($cgi); + my $table = Bugzilla::Extension::Testopia::Table->new( 'plan', 'tr_xmlrpc.cgi', $cgi, undef, $search->query() ); my $response = $proxy->call( "TestPlan.list", { pagesize => 25, } ); @@ -239,7 +239,7 @@ sub test_add_tag { my $self = shift; my $rep = get_rep('test_plans'); - my $obj = Testopia::TestPlan->new( $rep->{'plan_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestPlan->new( $rep->{'plan_id'} ); my $orig_size = scalar @{ $obj->tags }; delete $obj->{'tags'}; @@ -258,7 +258,7 @@ sub test_get_change_history { my $self = shift; my $rep = get_rep('test_plan_activity'); - my $obj = Testopia::TestPlan->new( $rep->{'plan_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestPlan->new( $rep->{'plan_id'} ); my $response = $proxy->call( "TestPlan.get_change_history", $rep->{'plan_id'} ); @@ -276,7 +276,7 @@ sub test_get_product { my $self = shift; my $rep = get_rep('test_plans'); - my $obj = Testopia::TestPlan->new( $rep->{'plan_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestPlan->new( $rep->{'plan_id'} ); my $response = $proxy->call( "TestPlan.get_product", $rep->{'plan_id'} ); @@ -294,7 +294,7 @@ sub test_get_tags { my $self = shift; my $rep = get_rep('test_plan_tags'); - my $obj = Testopia::TestPlan->new( $rep->{'plan_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestPlan->new( $rep->{'plan_id'} ); my $response = $proxy->call( "TestPlan.get_tags", $rep->{'plan_id'} ); @@ -314,7 +314,7 @@ sub test_get_text { my $self = shift; my $rep = get_rep('test_plan_texts'); - my $obj = Testopia::TestPlan->new( $rep->{'plan_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestPlan->new( $rep->{'plan_id'} ); my $response = $proxy->call( "TestPlan.get_text", $rep->{'plan_id'} ); @@ -360,8 +360,8 @@ sub test_remove_tag { my $rep = get_rep('test_plan_tags'); - my $obj = Testopia::TestPlan->new( $rep->{'plan_id'} ); - my $tag = Testopia::TestTag->new( $rep->{'tag_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestPlan->new( $rep->{'plan_id'} ); + my $tag = Bugzilla::Extension::Testopia::TestTag->new( $rep->{'tag_id'} ); delete $obj->{'tags'}; my $orig_size = scalar @{ $obj->tags }; @@ -379,7 +379,7 @@ sub test_store_text { my $self = shift; my $rep = get_rep('test_plans'); - my $obj = Testopia::TestPlan->new( $rep->{'plan_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestPlan->new( $rep->{'plan_id'} ); my $response = $proxy->call( "TestPlan.store_text", $rep->{'plan_id'}, "API DOCUMENT UPDATE TEST" ); diff --git a/mozilla/webtools/testopia/extensions/testopia/t/API_TestRun.pm b/mozilla/webtools/testopia/extensions/Testopia/t/API_TestRun.pm similarity index 82% rename from mozilla/webtools/testopia/extensions/testopia/t/API_TestRun.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/API_TestRun.pm index 9cd49b4676f..f92d76e3b40 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/API_TestRun.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/API_TestRun.pm @@ -33,9 +33,9 @@ use Testopia::TestRun; use Testopia::Search; use Testopia::Table; -use Testopia::Test::Constants; -use Testopia::Test::API::Util; -use Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::API::Util; +use Bugzilla::Extension::Testopia::Test::Util; use Test::More; use Test::Deep; @@ -60,12 +60,12 @@ sub tear_down { sub test_create_by_id { my $self = shift; - my $plan = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); while (scalar @{ $plan->test_cases } == 0 || scalar @{ $plan->product->environments } == 0 || scalar @{ $plan->product->builds } == 0 ) { - $plan = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + $plan = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); } my @cases = @{ $plan->test_cases }; @@ -96,7 +96,7 @@ sub test_create_by_id { check_fault( $response, $self ); - my $obj = Testopia::TestRun->new( $response->result->{'run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestRun->new( $response->result->{'run_id'} ); $obj->build; convert_undef($obj); @@ -108,12 +108,12 @@ sub test_create_by_id { sub test_create_by_string { my $self = shift; - my $plan = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); while (scalar @{ $plan->test_cases } == 0 || scalar @{ $plan->product->environments } == 0 || scalar @{ $plan->product->builds } == 0 ) { - $plan = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + $plan = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); } my @cases = @{ $plan->test_cases }; @@ -137,7 +137,7 @@ sub test_create_by_string { check_fault( $response, $self ); - my $obj = Testopia::TestRun->new( $response->result->{'run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestRun->new( $response->result->{'run_id'} ); convert_undef($obj); @@ -149,7 +149,7 @@ sub test_get { my $self = shift; my $rep = get_rep('test_runs'); - my $obj = Testopia::TestRun->new( $rep->{'run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestRun->new( $rep->{'run_id'} ); $obj->{'case_count'} = $obj->case_count(); convert_undef($obj); @@ -181,12 +181,12 @@ sub test_add_cases { sub test_update { my $self = shift; - my $plan = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); while (scalar @{ $plan->test_cases } == 0 || scalar @{ $plan->product->environments } == 0 || scalar @{ $plan->product->builds } == 0 ) { - $plan = Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); + $plan = Bugzilla::Extension::Testopia::TestPlan->new( get_rep('test_plans')->{'plan_id'} ); } my @cases = @{ $plan->test_cases }; @@ -200,7 +200,7 @@ sub test_update { my $version = $versions[ int( rand( scalar @versions ) ) ]; my $rep = get_rep('test_runs'); - my $obj = Testopia::TestRun->new( $rep->{'run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestRun->new( $rep->{'run_id'} ); my $response = $proxy->call( "TestRun.update", @@ -221,7 +221,7 @@ sub test_update { ); # Get the newly updated object to compare with - $obj = Testopia::TestRun->new( $rep->{'run_id'} ); + $obj = Bugzilla::Extension::Testopia::TestRun->new( $rep->{'run_id'} ); convert_undef($obj); @@ -242,9 +242,9 @@ sub test_list { Bugzilla->login(); - my $search = Testopia::Search->new($cgi); + my $search = Bugzilla::Extension::Testopia::Search->new($cgi); my $table = - Testopia::Table->new( 'run', 'tr_xmlrpc.cgi', $cgi, undef, $search->query() ); + Bugzilla::Extension::Testopia::Table->new( 'run', 'tr_xmlrpc.cgi', $cgi, undef, $search->query() ); convert_undef( $table->list ); @@ -261,7 +261,7 @@ sub test_add_tag { my $self = shift; my $rep = get_rep('test_runs'); - my $obj = Testopia::TestRun->new( $rep->{'run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestRun->new( $rep->{'run_id'} ); my $orig_size = scalar @{ $obj->tags }; delete $obj->{'tags'}; @@ -283,8 +283,8 @@ sub test_get_bugs { while ( !$rep->{'case_run_id'} ) { $rep = get_rep('test_case_bugs'); } - my $cr = Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); - my $obj = Testopia::TestRun->new( $cr->run_id ); + my $cr = Bugzilla::Extension::Testopia::TestCaseRun->new( $rep->{'case_run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestRun->new( $cr->run_id ); my $response = $proxy->call( "TestRun.get_bugs", $cr->run_id ); @@ -301,7 +301,7 @@ sub test_get_change_history { my $self = shift; my $rep = get_rep('test_run_activity'); - my $obj = Testopia::TestRun->new( $rep->{'run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestRun->new( $rep->{'run_id'} ); my $response = $proxy->call( "TestRun.get_change_history", $rep->{'run_id'} ); @@ -318,7 +318,7 @@ sub test_get_completion_report { my $self = shift; my $rep = get_rep('test_case_runs'); - my $obj = Testopia::TestRun->new( $rep->{'run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestRun->new( $rep->{'run_id'} ); my $response = $proxy->call( "TestRun.get_completion_report", $rep->{'run_id'} ); @@ -332,7 +332,7 @@ sub test_get_tags { my $self = shift; my $rep = get_rep('test_run_tags'); - my $obj = Testopia::TestRun->new( $rep->{'run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestRun->new( $rep->{'run_id'} ); my $response = $proxy->call( "TestRun.get_tags", $rep->{'run_id'} ); @@ -352,7 +352,7 @@ sub test_get_test_case_runs { my $self = shift; my $rep = get_rep('test_case_runs'); - my $obj = Testopia::TestRun->new( $rep->{'run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestRun->new( $rep->{'run_id'} ); my $response = $proxy->call( "TestRun.get_test_case_runs", $rep->{'run_id'} ); @@ -370,7 +370,7 @@ sub test_get_test_cases { my $self = shift; my $rep = get_rep('test_case_runs'); - my $obj = Testopia::TestRun->new( $rep->{'run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestRun->new( $rep->{'run_id'} ); my $response = $proxy->call( "TestRun.get_test_cases", $rep->{'run_id'} ); @@ -388,7 +388,7 @@ sub test_get_test_plan { my $self = shift; my $rep = get_rep('test_runs'); - my $obj = Testopia::TestRun->new( $rep->{'run_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestRun->new( $rep->{'run_id'} ); my $response = $proxy->call( "TestRun.get_test_plan", $rep->{'run_id'} ); @@ -404,8 +404,8 @@ sub test_remove_tag { my $rep = get_rep('test_run_tags'); - my $obj = Testopia::TestRun->new( $rep->{'run_id'} ); - my $tag = Testopia::TestTag->new( $rep->{'tag_id'} ); + my $obj = Bugzilla::Extension::Testopia::TestRun->new( $rep->{'run_id'} ); + my $tag = Bugzilla::Extension::Testopia::TestTag->new( $rep->{'tag_id'} ); delete $obj->{'tags'}; my $orig_size = scalar @{ $obj->tags }; diff --git a/mozilla/webtools/testopia/extensions/testopia/t/Instantiate.t b/mozilla/webtools/testopia/extensions/Testopia/t/Instantiate.t similarity index 76% rename from mozilla/webtools/testopia/extensions/testopia/t/Instantiate.t rename to mozilla/webtools/testopia/extensions/Testopia/t/Instantiate.t index f699c5b5e59..1ca6f0e0584 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/Instantiate.t +++ b/mozilla/webtools/testopia/extensions/Testopia/t/Instantiate.t @@ -14,9 +14,9 @@ use Testopia::Build; use Testopia::Category; use Testopia::Classification; use Testopia::Environment; -use Testopia::Environment::Category; -use Testopia::Environment::Element; -use Testopia::Environment::Property; +use Bugzilla::Extension::Testopia::Environment::Category; +use Bugzilla::Extension::Testopia::Environment::Element; +use Bugzilla::Extension::Testopia::Environment::Property; use Testopia::Product; use Testopia::TestCase; use Testopia::TestCaseRun; @@ -24,7 +24,7 @@ use Testopia::TestPlan; use Testopia::TestRun; use Testopia::TestTag; -use Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Util; Bugzilla->error_mode(ERROR_MODE_DIE); @@ -47,7 +47,7 @@ foreach my $table (@tables) { if (defined $db_obj){ SWITCH: for ($table) { /attachments/ && do { - my $obj = new Testopia::Attachment( $db_obj->{'attachment_id'} ); + my $obj = new Bugzilla::Extension::Testopia::Attachment( $db_obj->{'attachment_id'} ); ok( defined $obj, "Testing Attachment Instantiation" ); isa_ok( $obj, 'BugzillaTestopia::Attachment' ); @@ -55,7 +55,7 @@ if (defined $db_obj){ last SWITCH; }; /builds/ && do { - my $obj = new Testopia::Build( $db_obj->{'build_id'} ); + my $obj = new Bugzilla::Extension::Testopia::Build( $db_obj->{'build_id'} ); ok( defined $obj, "Testing Build Instantiation" ); isa_ok( $obj, 'Testopia::Build' ); @@ -63,7 +63,7 @@ if (defined $db_obj){ last SWITCH; }; /case_categories/ && do{ - my $obj = new Testopia::Category( $db_obj->{'category_id'} ); + my $obj = new Bugzilla::Extension::Testopia::Category( $db_obj->{'category_id'} ); ok( defined $obj, "Testing Build Instantiation" ); isa_ok( $obj, 'Testopia::Category' ); @@ -71,7 +71,7 @@ if (defined $db_obj){ last SWITCH; }; /environments/ && do{ - my $obj = new Testopia::Environment( $db_obj->{'environment_id'} ); + my $obj = new Bugzilla::Extension::Testopia::Environment( $db_obj->{'environment_id'} ); ok( defined $obj, "Testing Build Instantiation" ); isa_ok( $obj, 'Testopia::Environment' ); @@ -79,7 +79,7 @@ if (defined $db_obj){ last SWITCH; }; /environment_category/ && do{ - my $obj = new Testopia::Environment::Category( $db_obj->{'env_category_id'} ); + my $obj = new Bugzilla::Extension::Testopia::Environment::Category( $db_obj->{'env_category_id'} ); ok( defined $obj, "Testing Build Instantiation" ); isa_ok( $obj, 'Testopia::Environment::Category' ); @@ -87,7 +87,7 @@ if (defined $db_obj){ last SWITCH; }; /environment_element/ && do{ - my $obj = new Testopia::Environment::Element( $db_obj->{'element_id'} ); + my $obj = new Bugzilla::Extension::Testopia::Environment::Element( $db_obj->{'element_id'} ); ok( defined $obj, "Testing Build Instantiation" ); isa_ok( $obj, 'Testopia::Environment::Element' ); @@ -99,7 +99,7 @@ if (defined $db_obj){ last SWITCH; }; /environment_property/ && do{ - my $obj = new Testopia::Environment::Property( $db_obj->{'property_id'} ); + my $obj = new Bugzilla::Extension::Testopia::Environment::Property( $db_obj->{'property_id'} ); ok( defined $obj, "Testing Build Instantiation" ); isa_ok( $obj, 'Testopia::Environment::Property' ); @@ -107,7 +107,7 @@ if (defined $db_obj){ last SWITCH; }; /cases/ && do{ - my $obj = new Testopia::TestCase( $db_obj->{'case_id'} ); + my $obj = new Bugzilla::Extension::Testopia::TestCase( $db_obj->{'case_id'} ); ok( defined $obj, "Testing Build Instantiation" ); isa_ok( $obj, 'Testopia::TestCase' ); @@ -115,7 +115,7 @@ if (defined $db_obj){ last SWITCH; }; /case_runs/ && do{ - my $obj = new Testopia::TestCaseRun( $db_obj->{'case_run_id'} ); + my $obj = new Bugzilla::Extension::Testopia::TestCaseRun( $db_obj->{'case_run_id'} ); ok( defined $obj, "Testing Build Instantiation" ); isa_ok( $obj, 'Testopia::TestCaseRun' ); @@ -123,7 +123,7 @@ if (defined $db_obj){ last SWITCH; }; /plans/ && do{ - my $obj = new Testopia::TestPlan( $db_obj->{'plan_id'} ); + my $obj = new Bugzilla::Extension::Testopia::TestPlan( $db_obj->{'plan_id'} ); ok( defined $obj, "Testing Build Instantiation" ); isa_ok( $obj, 'Testopia::TestPlan' ); @@ -131,7 +131,7 @@ if (defined $db_obj){ last SWITCH; }; /runs/ && do{ - my $obj = new Testopia::TestRun( $db_obj->{'run_id'} ); + my $obj = new Bugzilla::Extension::Testopia::TestRun( $db_obj->{'run_id'} ); ok( defined $obj, "Testing Build Instantiation" ); isa_ok( $obj, 'Testopia::TestRun' ); @@ -140,7 +140,7 @@ if (defined $db_obj){ last SWITCH; }; /tags/ && do{ - my $obj = new Testopia::TestTag( $db_obj->{'tag_id'} ); + my $obj = new Bugzilla::Extension::Testopia::TestTag( $db_obj->{'tag_id'} ); ok( defined $obj, "Testing Build Instantiation" ); isa_ok( $obj, 'Testopia::TestTag' ); @@ -148,7 +148,7 @@ if (defined $db_obj){ last SWITCH; }; /products/ && do{ - my $obj = new Testopia::Product( $db_obj->{'id'} ); + my $obj = new Bugzilla::Extension::Testopia::Product( $db_obj->{'id'} ); ok( defined $obj, "Testing Build Instantiation" ); isa_ok( $obj, 'Testopia::Product' ); @@ -157,7 +157,7 @@ if (defined $db_obj){ last SWITCH; }; /classifications/ && do{ - my $obj = new Testopia::Classification( $db_obj->{'id'} ); + my $obj = new Bugzilla::Extension::Testopia::Classification( $db_obj->{'id'} ); ok( defined $obj, "Testing Build Instantiation" ); isa_ok( $obj, 'Testopia::Classification' ); diff --git a/mozilla/webtools/testopia/extensions/testopia/t/OBJ_Attachment.pm b/mozilla/webtools/testopia/extensions/Testopia/t/OBJ_Attachment.pm similarity index 89% rename from mozilla/webtools/testopia/extensions/testopia/t/OBJ_Attachment.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/OBJ_Attachment.pm index ac85458de75..4de1e74851e 100755 --- a/mozilla/webtools/testopia/extensions/testopia/t/OBJ_Attachment.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/OBJ_Attachment.pm @@ -35,8 +35,8 @@ use Testopia::Attachment; use Testopia::TestPlan; use Test; -use Testopia::Test::Constants; -use Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::Util; use Test::More; use Test::Exception; @@ -67,7 +67,7 @@ sub test_create{ sub case_id_create{ my $obj_hash = shift; - my $created_obj = Testopia::Attachment->create($obj_hash); + my $created_obj = Bugzilla::Extension::Testopia::Attachment->create($obj_hash); #Compare data against 3 database tables delete $obj_hash->{'case_id'}; delete $obj_hash->{'contents'}; @@ -82,10 +82,10 @@ sub case_id_create{ $created_obj->{'creation_ts'} = $ts; - my $db_obj = Testopia::Test::Util::get_rep_by_field('test_attachment_data', + my $db_obj = Bugzilla::Extension::Testopia::Test::Util::get_rep_by_field('test_attachment_data', 'attachment_id', $created_obj->{'attachment_id'} ); - $db_obj = Testopia::Test::Util::get_rep_by_field('test_case_attachments', + $db_obj = Bugzilla::Extension::Testopia::Test::Util::get_rep_by_field('test_case_attachments', 'attachment_id', $created_obj->{'attachment_id'}); like($db_obj->{'case_id'}, '/1/', 'Case ID Match'); ok(!defined($db_obj->{'case_run_id'}), 'Case Run ID Not Defind'); @@ -103,7 +103,7 @@ sub plan_id_create{ $obj_hash->{'plan_id'} = 1; delete $obj_hash->{'case_id'}; - my $created_obj = Testopia::Attachment->create($obj_hash); + my $created_obj = Bugzilla::Extension::Testopia::Attachment->create($obj_hash); delete $obj_hash->{'plan_id'}; delete $obj_hash->{'contents'}; my $id = $created_obj->{'attachment_id'}; @@ -116,7 +116,7 @@ sub plan_id_create{ $created_obj->{'attachment_id'} = $id; $created_obj->{'creation_ts'} = $ts; - my $db_obj = Testopia::Test::Util::get_rep('test_attachment_data', + my $db_obj = Bugzilla::Extension::Testopia::Test::Util::get_rep('test_attachment_data', 'attachment_id', $created_obj->{'attachment_id'} ); $db_obj = Test::get_rep('test_plan_attachments', @@ -187,11 +187,11 @@ sub _link_case{ my $id = $dbh->selectrow_array("SELECT MAX(id) FROM products WHERE id <> ?", undef, $obj->id); for(my $i=0; $i < 2; $i++){ - my $plan = Testopia::TestPlan->new($id); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new($id); $id--; push @plans, $plan; } - my $case = Testopia::TestCase->create({'case_status_id' => 1, + my $case = Bugzilla::Extension::Testopia::TestCase->create({'case_status_id' => 1, 'category_id' => 1, 'priority_id' => 1, 'author_id' => $obj->id, @@ -222,7 +222,7 @@ sub _unlink_case{ } sub test_can_view{ - my $creds = Testopia::Test::Constants->LOGIN_CREDENTIALS; + my $creds = Bugzilla::Extension::Testopia::Test::Constants->LOGIN_CREDENTIALS; foreach (Testopia::Test::Constants->LOGIN_TYPES){ my $login = $creds->{$_}; Test::set_user($login->{'id'}, $login->{'login_name'}, $login->{'password'}); @@ -231,7 +231,7 @@ sub test_can_view{ } sub test_can_edit{ - my $creds = Testopia::Test::Constants->LOGIN_CREDENTIALS; + my $creds = Bugzilla::Extension::Testopia::Test::Constants->LOGIN_CREDENTIALS; foreach (Testopia::Test::Constants->LOGIN_TYPES){ my $login = $creds->{$_}; Test::set_user($login->{'id'}, $login->{'login_name'}, $login->{'password'}); @@ -240,7 +240,7 @@ sub test_can_edit{ } sub test_can_delete{ - my $creds = Testopia::Test::Constants->LOGIN_CREDENTIALS; + my $creds = Bugzilla::Extension::Testopia::Test::Constants->LOGIN_CREDENTIALS; foreach (Testopia::Test::Constants->LOGIN_TYPES){ my $login = $creds->{$_}; Test::set_user($login->{'id'}, $login->{'login_name'}, $login->{'password'}); @@ -278,11 +278,11 @@ sub test_cases{ my @plans; for(my $i=0; $i < 2; $i++){ - my $plan = Testopia::TestPlan->new($id); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new($id); $id--; push @plans, $plan; } - my $case = Testopia::TestCase->create({'case_status_id' => 1, + my $case = Bugzilla::Extension::Testopia::TestCase->create({'case_status_id' => 1, 'category_id' => 1, 'priority_id' => 1, 'author_id' => 1, @@ -296,7 +296,7 @@ sub test_cases{ sub test_plans{ Test::set_user(1, 'admin@testopia.com', 'admin@testopia.com'); my $id = $dbh->selectrow_array("SELECT MAX(id) FROM products WHERE id <> ?", undef, $obj->id); - my $plan = Testopia::TestPlan->new($id); + my $plan = Bugzilla::Extension::Testopia::TestPlan->new($id); $obj->link_plan($plan->id); delete $plan->{'version'}; ok( defined $obj->plans, 'TestPlans Linked' ); @@ -304,7 +304,7 @@ sub test_plans{ } sub test_obliterate{ - my $creds = Testopia::Test::Constants->LOGIN_CREDENTIALS; + my $creds = Bugzilla::Extension::Testopia::Test::Constants->LOGIN_CREDENTIALS; foreach (Testopia::Test::Constants->LOGIN_TYPES){ my $login = $creds->{$_}; Test::set_user($login->{'id'}, $login->{'login_name'}, $login->{'password'}); diff --git a/mozilla/webtools/testopia/extensions/testopia/t/OBJ_Builds.pm b/mozilla/webtools/testopia/extensions/Testopia/t/OBJ_Builds.pm similarity index 87% rename from mozilla/webtools/testopia/extensions/testopia/t/OBJ_Builds.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/OBJ_Builds.pm index b5dab5a7a76..c30475aaef7 100755 --- a/mozilla/webtools/testopia/extensions/testopia/t/OBJ_Builds.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/OBJ_Builds.pm @@ -33,8 +33,8 @@ use Bugzilla::Constants; use Testopia::Build; use Test; -use Testopia::Test::Constants; -use Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::Util; use Test::More; use Test::Exception; @@ -49,7 +49,7 @@ our $obj = Test::test_init(DB_TABLE, ID_FIELD, 'Testopia::Build'); our $dbh = Bugzilla->dbh; sub test_check_product{ - my $creds = Testopia::Test::Constants->LOGIN_CREDENTIALS; + my $creds = Bugzilla::Extension::Testopia::Test::Constants->LOGIN_CREDENTIALS; foreach (Testopia::Test::Constants->LOGIN_TYPES){ my $login = $creds->{$_}; Test::set_user($login->{'id'}, $login->{'login_name'}, $login->{'password'}); @@ -59,7 +59,7 @@ sub test_check_product{ dies_ok( sub {$obj->_check_product($obj->product_id)}, "User " . Bugzilla->user->{'login_name'} ." does not have sufficient rights to check Product"); } else{ - my $db_obj = Testopia::Test::Util::get_rep_by_field('products', 'id', $obj->product_id); + my $db_obj = Bugzilla::Extension::Testopia::Test::Util::get_rep_by_field('products', 'id', $obj->product_id); # Check product by ID my $id = $obj->_check_product($obj->product_id); # Check product by Name @@ -72,14 +72,14 @@ sub test_check_product{ sub test_set_description(){ - my $db_obj = Testopia::Test::Util::get_rep_by_field(DB_TABLE, ID_FIELD, $obj->id); + my $db_obj = Bugzilla::Extension::Testopia::Test::Util::get_rep_by_field(DB_TABLE, ID_FIELD, $obj->id); $obj->set_description('Some Description'); #Defauls set to '' cmp_ok( $db_obj->{'description'}, '!~', $obj->description, 'Build Description Has Been Changed'); } sub test_set_isactive(){ - my $db_obj = Testopia::Test::Util::get_rep_by_field(DB_TABLE, ID_FIELD, $obj->id); + my $db_obj = Bugzilla::Extension::Testopia::Test::Util::get_rep_by_field(DB_TABLE, ID_FIELD, $obj->id); # Default set to 1 $obj->set_isactive(0); cmp_ok($db_obj->{'isactive'}, '!=', $obj->isactive, "Build IsActive has Changed"); @@ -106,7 +106,7 @@ sub test_create{ 'isactive' => '1'}; _bad_creates($obj_hash); - my $creds = Testopia::Test::Constants->LOGIN_CREDENTIALS; + my $creds = Bugzilla::Extension::Testopia::Test::Constants->LOGIN_CREDENTIALS; foreach (Testopia::Test::Constants->LOGIN_TYPES){ my $login = $creds->{$_}; Test::set_user($login->{'id'}, $login->{'login_name'}, $login->{'password'}); @@ -116,7 +116,7 @@ sub test_create{ } else{ - my $created_obj = Testopia::Build->create($obj_hash); + my $created_obj = Bugzilla::Extension::Testopia::Build->create($obj_hash); # Must remove this entry now because we add it multiple times, # and the DB does not like that $dbh->do("DELETE FROM test_builds WHERE build_id = ?", undef, $created_obj->id); diff --git a/mozilla/webtools/testopia/extensions/testopia/t/OBJ_Builds_GREGG.pm b/mozilla/webtools/testopia/extensions/Testopia/t/OBJ_Builds_GREGG.pm similarity index 98% rename from mozilla/webtools/testopia/extensions/testopia/t/OBJ_Builds_GREGG.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/OBJ_Builds_GREGG.pm index 6a9bb848242..cccdceef98a 100755 --- a/mozilla/webtools/testopia/extensions/testopia/t/OBJ_Builds_GREGG.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/OBJ_Builds_GREGG.pm @@ -136,7 +136,7 @@ sub test_create{ } else{ - my $created_obj = Testopia::Build->create($obj_hash); + my $created_obj = Bugzilla::Extension::Testopia::Build->create($obj_hash); # Must remove this entry now because we add it multiple times, # and the DB does not like that $dbh->do("DELETE FROM test_builds WHERE build_id = ?", undef, $created_obj->id); diff --git a/mozilla/webtools/testopia/extensions/testopia/t/OBJ_Category.pm b/mozilla/webtools/testopia/extensions/Testopia/t/OBJ_Category.pm similarity index 93% rename from mozilla/webtools/testopia/extensions/testopia/t/OBJ_Category.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/OBJ_Category.pm index e1a6c4f4202..b1d0f9c3dc3 100755 --- a/mozilla/webtools/testopia/extensions/testopia/t/OBJ_Category.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/OBJ_Category.pm @@ -36,8 +36,8 @@ use Testopia::TestCase; use Testopia::TestPlan; use Test; -use Testopia::Test::Constants; -use Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::Util; use Test::More; use Test::Exception; @@ -66,7 +66,7 @@ sub test_set_name{ } sub test_create{ - my $creds = Testopia::Test::Constants->LOGIN_CREDENTIALS; + my $creds = Bugzilla::Extension::Testopia::Test::Constants->LOGIN_CREDENTIALS; my $hash_obj = {product_id => 1, name => 'Unique Name'}; foreach (Testopia::Test::Constants->LOGIN_TYPES){ my $login = $creds->{$_}; @@ -76,7 +76,7 @@ sub test_create{ dies_ok( sub {Testopia::Category->create($hash_obj)}, "User " . Bugzilla->user->{'login_name'} ." does not have rights to create new builds"); } else{ - my $created_obj = Testopia::Category->create($hash_obj); + my $created_obj = Bugzilla::Extension::Testopia::Category->create($hash_obj); ok($created_obj->{'product_id'} eq $hash_obj->{'product_id'}, "Object Created with ProductId"); ok($created_obj->{'name'} eq $hash_obj->{'name'}, "Object Created with a Name"); Bugzilla->dbh->do('DELETE FROM test_case_categories WHERE category_id = ?', undef, $created_obj->id); @@ -97,7 +97,7 @@ sub test_remove{ sub test_candelete{ my $id = $obj->id + 1; - my $creds = Testopia::Test::Constants->LOGIN_CREDENTIALS; + my $creds = Bugzilla::Extension::Testopia::Test::Constants->LOGIN_CREDENTIALS; my $plan = new Testopia::TestPlan(1); my $case_hash = { 'case_status_id' => 1, diff --git a/mozilla/webtools/testopia/extensions/testopia/t/OBJ_Environment.pm b/mozilla/webtools/testopia/extensions/Testopia/t/OBJ_Environment.pm similarity index 93% rename from mozilla/webtools/testopia/extensions/testopia/t/OBJ_Environment.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/OBJ_Environment.pm index 9af0ef89f25..937f0436d22 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/OBJ_Environment.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/OBJ_Environment.pm @@ -30,10 +30,10 @@ use base qw(Exporter Test::Unit::TestCase); use Bugzilla; use Bugzilla::Constants; use Testopia::Environment; -use Testopia::Environment::Element; +use Bugzilla::Extension::Testopia::Environment::Element; use Test; -use Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::Constants; use Test::More tests => 100; use Test::Exception; @@ -76,7 +76,7 @@ sub test_create{ # _check_product validator # error if user can't edit - my $creds = Testopia::Test::Constants->LOGIN_CREDENTIALS; + my $creds = Bugzilla::Extension::Testopia::Test::Constants->LOGIN_CREDENTIALS; foreach (Testopia::Test::Constants->LOGIN_TYPES){ my $login = $creds->{$_}; Test::set_user($login->{'id'}, $login->{'login_name'}, $login->{'password'}); @@ -86,7 +86,7 @@ sub test_create{ dies_ok( sub {Testopia::Environment->create({name => 'NAME', product_id => 999})}, "User " . Bugzilla->user->{'login_name'} ." does not have rights to create a Category"); } else{ - $created_obj = Testopia::Environment->create({name => 'NAME', product_id => 999}); + $created_obj = Bugzilla::Extension::Testopia::Environment->create({name => 'NAME', product_id => 999}); my $obj_hash = ({product_id => '999', name => 'NAME', isactive =>1, environment_id => $created_obj->id}); cmp_deeply($obj_hash, noclass($created_obj), "Created Object Match"); # We must delete this here because we add it more than once and the diff --git a/mozilla/webtools/testopia/extensions/testopia/t/OBJ_TestCase.pm b/mozilla/webtools/testopia/extensions/Testopia/t/OBJ_TestCase.pm similarity index 95% rename from mozilla/webtools/testopia/extensions/testopia/t/OBJ_TestCase.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/OBJ_TestCase.pm index 078fd55b492..90dacdae3ce 100755 --- a/mozilla/webtools/testopia/extensions/testopia/t/OBJ_TestCase.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/OBJ_TestCase.pm @@ -36,8 +36,8 @@ use Testopia::TestTag; use Testopia::TestCaseRun; use Test; -use Testopia::Test::Util; -use Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; use Test::Exception; use Test::Deep; @@ -75,7 +75,7 @@ sub check_dependency{ } sub check_bugs{ - my $creds = Testopia::Test::Constants->LOGIN_CREDENTIALS; + my $creds = Bugzilla::Extension::Testopia::Test::Constants->LOGIN_CREDENTIALS; foreach (Testopia::Test::Constants->LOGIN_TYPES){ my $login = $creds->{$_}; Test::set_user($login->{'id'}, $login->{'login_name'}, $login->{'password'}); @@ -102,7 +102,7 @@ sub check_components{ } sub check_tester{ - my $creds = Testopia::Test::Constants->LOGIN_CREDENTIALS; + my $creds = Bugzilla::Extension::Testopia::Test::Constants->LOGIN_CREDENTIALS; foreach (Testopia::Test::Constants->LOGIN_TYPES){ my $login = $creds->{$_}; ok($obj->_check_tester($login->{'login_name'}), 'User '. $login->{'login_name'} .' has a valid Login'); @@ -203,7 +203,7 @@ sub test_create{ 'category_id' => 999, 'author_id' => 999}; - my $creds = Testopia::Test::Constants->LOGIN_CREDENTIALS; + my $creds = Bugzilla::Extension::Testopia::Test::Constants->LOGIN_CREDENTIALS; foreach (Testopia::Test::Constants->LOGIN_TYPES){ my $login = $creds->{$_}; Test::set_user($login->{'id'}, $login->{'login_name'}, $login->{'password'}); @@ -217,7 +217,7 @@ sub test_create{ foreach my $field ($created_obj){ delete $created_obj->{$field} unless( defined $hash->{$field}); } - my $db_obj = new Testopia::TestCase($created_obj->id); + my $db_obj = new Bugzilla::Extension::Testopia::TestCase($created_obj->id); $db_obj->{'plans'} = $db_obj->plans; $db_obj->{'version'} = 1; cmp_deeply($created_obj, $db_obj, 'Created Object Matched in DB'); @@ -233,7 +233,7 @@ sub test_update{ delete $obj->{'version'}; delete $obj->{'type'}; $obj->update; - my $db_obj = new Testopia::TestCase($obj->id); + my $db_obj = new Bugzilla::Extension::Testopia::TestCase($obj->id); cmp_deeply($obj, $db_obj, 'Update TestCase'); } @@ -256,7 +256,7 @@ sub test_get_category_list{ my @categories; my $cat_ids = $dbh->selectrow_arrayref("SELECT category_id FROM test_case_categories WHERE product_id IN (?)", undef, join(",", @{$obj->get_product_ids})); foreach my $id (@$cat_ids){ - push @categories, Testopia::Category->new($id); + push @categories, Bugzilla::Extension::Testopia::Category->new($id); } ok($obj->get_category_list, 'Category List Match'); } @@ -304,7 +304,7 @@ sub test_remove_tag{ } sub test_attach_bug{ - my $creds = Testopia::Test::Constants->LOGIN_CREDENTIALS; + my $creds = Bugzilla::Extension::Testopia::Test::Constants->LOGIN_CREDENTIALS; foreach (Testopia::Test::Constants->LOGIN_TYPES){ my $login = $creds->{$_}; Test::set_user($login->{'id'}, $login->{'login_name'}, $login->{'password'}); @@ -364,7 +364,7 @@ sub test_add_to_run{ my $before_adding = $dbh->selectrow_hashref("SELECT case_run_id, run_id, case_id, case_run_status_id, case_text_version, build_id, iscurrent, environment_id FROM test_case_runs WHERE run_id = $run"); $obj->add_to_run($run); my $db_obj = $dbh->selectrow_hashref("SELECT * FROM test_case_runs WHERE run_id = $run"); - my $object = new Testopia::TestCaseRun($db_obj->{'case_run_id'}); + my $object = new Bugzilla::Extension::Testopia::TestCaseRun($db_obj->{'case_run_id'}); cmp_deeply($db_obj, noclass($object), 'Test Case Added to Run'); } diff --git a/mozilla/webtools/testopia/extensions/testopia/t/SE_attachments.t b/mozilla/webtools/testopia/extensions/Testopia/t/SE_attachments.t similarity index 91% rename from mozilla/webtools/testopia/extensions/testopia/t/SE_attachments.t rename to mozilla/webtools/testopia/extensions/Testopia/t/SE_attachments.t index 516b46774df..e830020b1a6 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/SE_attachments.t +++ b/mozilla/webtools/testopia/extensions/Testopia/t/SE_attachments.t @@ -35,10 +35,10 @@ use Bugzilla::Constants; use Testopia::Product; use Testopia::Environment; -use Testopia::Test::Util; -use Testopia::Test::Constants; -use Testopia::Test::Selenium::Util; -use Testopia::Test::Selenium::Constants; +use Bugzilla::Extension::Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::Selenium::Util; +use Bugzilla::Extension::Testopia::Test::Selenium::Constants; my ($user_type, $login, $passwd) = @ARGV; @@ -51,7 +51,7 @@ my $isanon = 0; $se->start(); if ($login && $passwd){ - unless ( Testopia::Test::Selenium::Util->login( $login, $passwd) ) { + unless ( Bugzilla::Extension::Testopia::Test::Selenium::Util->login( $login, $passwd) ) { $se->stop(); fail('login'); exit; @@ -109,7 +109,7 @@ sub test_add { my $rep = get_rep('products'); #Add new build - suppose to error because missing name - my $product = new Testopia::Product($rep->{'id'}); + my $product = new Bugzilla::Extension::Testopia::Product($rep->{'id'}); my $test = { url => "tr_builds.cgi", action => "add", @@ -183,7 +183,7 @@ sub test_edit { ok( $se->is_text_present("success: true"), "'action=edit' failed for tr_builds.cgi" ); #check edit succeded and values updated - my $build = new Testopia::Build($rep->{'build_id'}); + my $build = new Bugzilla::Extension::Testopia::Build($rep->{'build_id'}); cmp_deeply( $test->{params}, noclass($build), "Build Hashes match" ); } diff --git a/mozilla/webtools/testopia/extensions/testopia/t/SE_builds.t b/mozilla/webtools/testopia/extensions/Testopia/t/SE_builds.t similarity index 91% rename from mozilla/webtools/testopia/extensions/testopia/t/SE_builds.t rename to mozilla/webtools/testopia/extensions/Testopia/t/SE_builds.t index aeb78d11d09..ceae99f9393 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/SE_builds.t +++ b/mozilla/webtools/testopia/extensions/Testopia/t/SE_builds.t @@ -35,10 +35,10 @@ use Bugzilla::Constants; use Testopia::Product; use Testopia::Build; -use Testopia::Test::Util; -use Testopia::Test::Constants; -use Testopia::Test::Selenium::Util; -use Testopia::Test::Selenium::Constants; +use Bugzilla::Extension::Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::Selenium::Util; +use Bugzilla::Extension::Testopia::Test::Selenium::Constants; my ($user_type, $login, $passwd) = @ARGV; @@ -51,7 +51,7 @@ my $isanon = 0; $se->start(); if ($login && $passwd){ - unless ( Testopia::Test::Selenium::Util->login( $login, $passwd) ) { + unless ( Bugzilla::Extension::Testopia::Test::Selenium::Util->login( $login, $passwd) ) { $se->stop(); fail('login'); exit; @@ -108,7 +108,7 @@ sub test_add { my $rep = get_rep('products'); #Add new build - suppose to error because missing name - my $product = new Testopia::Product($rep->{'id'}); + my $product = new Bugzilla::Extension::Testopia::Product($rep->{'id'}); my $test = { url => "tr_builds.cgi", action => "add", @@ -182,7 +182,7 @@ sub test_edit { ok( $se->is_text_present("success: true"), "'action=edit' failed for tr_builds.cgi" ); #check edit succeded and values updated - my $build = new Testopia::Build($rep->{'build_id'}); + my $build = new Bugzilla::Extension::Testopia::Build($rep->{'build_id'}); cmp_deeply( $test->{params}, noclass($build), "Build Hashes match" ); } diff --git a/mozilla/webtools/testopia/extensions/testopia/t/SE_caseruns.t b/mozilla/webtools/testopia/extensions/Testopia/t/SE_caseruns.t similarity index 93% rename from mozilla/webtools/testopia/extensions/testopia/t/SE_caseruns.t rename to mozilla/webtools/testopia/extensions/Testopia/t/SE_caseruns.t index 1cdda0be179..aaa9e9c01a1 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/SE_caseruns.t +++ b/mozilla/webtools/testopia/extensions/Testopia/t/SE_caseruns.t @@ -35,10 +35,10 @@ use Bugzilla::Constants; use Testopia::Product; use Testopia::Environment; -use Testopia::Test::Util; -use Testopia::Test::Constants; -use Testopia::Test::Selenium::Util; -use Testopia::Test::Selenium::Constants; +use Bugzilla::Extension::Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::Selenium::Util; +use Bugzilla::Extension::Testopia::Test::Selenium::Constants; my ($user_type, $login, $passwd) = @ARGV; @@ -51,7 +51,7 @@ my $isanon = 0; $se->start(); if ($login && $passwd){ - unless ( Testopia::Test::Selenium::Util->login( $login, $passwd) ) { + unless ( Bugzilla::Extension::Testopia::Test::Selenium::Util->login( $login, $passwd) ) { $se->stop(); fail('login'); exit; @@ -117,7 +117,7 @@ Test updating status id of caserun sub test_update_status_id { my $self = shift; - my $dbh = Testopia::Test::Selenium::Util->dbh; + my $dbh = Bugzilla::Extension::Testopia::Test::Selenium::Util->dbh; #get current status id my $ref = $dbh->selectrow_hashref( @@ -179,7 +179,7 @@ Test updating assignee of caserun sub test_update_assignee { my $self = shift; - my $dbh = Testopia::Test::Selenium::Util->dbh; + my $dbh = Bugzilla::Extension::Testopia::Test::Selenium::Util->dbh; #get current assignee id my $ref = $dbh->selectrow_hashref( @@ -250,7 +250,7 @@ sub test_delete { my $self = shift; - my $dbh = Testopia::Test::Selenium::Util->dbh; + my $dbh = Bugzilla::Extension::Testopia::Test::Selenium::Util->dbh; my $del_cr; # Caserun we want to delete $dbh->prepare("INSERT INTO test_case_runs (run_id, case_id, assignee, diff --git a/mozilla/webtools/testopia/extensions/testopia/t/SE_cases.t b/mozilla/webtools/testopia/extensions/Testopia/t/SE_cases.t similarity index 98% rename from mozilla/webtools/testopia/extensions/testopia/t/SE_cases.t rename to mozilla/webtools/testopia/extensions/Testopia/t/SE_cases.t index 1722add50a2..ebc882236d7 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/SE_cases.t +++ b/mozilla/webtools/testopia/extensions/Testopia/t/SE_cases.t @@ -35,10 +35,10 @@ use Bugzilla::Constants; use Testopia::Product; use Testopia::Environment; -use Testopia::Test::Util; -use Testopia::Test::Constants; -use Testopia::Test::Selenium::Util; -use Testopia::Test::Selenium::Constants; +use Bugzilla::Extension::Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::Selenium::Util; +use Bugzilla::Extension::Testopia::Test::Selenium::Constants; my ($user_type, $login, $passwd) = @ARGV; @@ -51,7 +51,7 @@ my $isanon = 0; $se->start(); if ($login && $passwd){ - unless ( Testopia::Test::Selenium::Util->login( $login, $passwd) ) { + unless ( Bugzilla::Extension::Testopia::Test::Selenium::Util->login( $login, $passwd) ) { $se->stop(); fail('login'); exit; diff --git a/mozilla/webtools/testopia/extensions/testopia/t/SE_categories.t b/mozilla/webtools/testopia/extensions/Testopia/t/SE_categories.t similarity index 91% rename from mozilla/webtools/testopia/extensions/testopia/t/SE_categories.t rename to mozilla/webtools/testopia/extensions/Testopia/t/SE_categories.t index 8c0f61a9785..7d0d3ff87f9 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/SE_categories.t +++ b/mozilla/webtools/testopia/extensions/Testopia/t/SE_categories.t @@ -35,10 +35,10 @@ use Bugzilla::Constants; use Testopia::Product; use Testopia::Category; -use Testopia::Test::Util; -use Testopia::Test::Constants; -use Testopia::Test::Selenium::Util; -use Testopia::Test::Selenium::Constants; +use Bugzilla::Extension::Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::Selenium::Util; +use Bugzilla::Extension::Testopia::Test::Selenium::Constants; my ($user_type, $login, $passwd) = @ARGV; @@ -51,7 +51,7 @@ my $isanon = 0; $se->start(); if ($login && $passwd){ - unless ( Testopia::Test::Selenium::Util->login( $login, $passwd) ) { + unless ( Bugzilla::Extension::Testopia::Test::Selenium::Util->login( $login, $passwd) ) { $se->stop(); fail('login'); exit; @@ -109,7 +109,7 @@ sub test_add { my $rep = get_rep('products'); #Add new build - suppose to error because missing name - my $product = new Testopia::Product($rep->{'id'}); + my $product = new Bugzilla::Extension::Testopia::Product($rep->{'id'}); my $test = { url => "tr_categories.cgi", action => "add", @@ -188,7 +188,7 @@ sub test_edit { ok( $se->is_text_present("success: true"), "'action=edit' failed for tr_categories.cgi" ); #check edit succeded and values updated - my $build = new Testopia::Build($rep->{'build_id'}); + my $build = new Bugzilla::Extension::Testopia::Build($rep->{'build_id'}); cmp_deeply( $test->{params}, noclass($build), "Build Hashes match" ); } diff --git a/mozilla/webtools/testopia/extensions/testopia/t/SE_environments.t b/mozilla/webtools/testopia/extensions/Testopia/t/SE_environments.t similarity index 90% rename from mozilla/webtools/testopia/extensions/testopia/t/SE_environments.t rename to mozilla/webtools/testopia/extensions/Testopia/t/SE_environments.t index ced4b34d103..4695d97a708 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/SE_environments.t +++ b/mozilla/webtools/testopia/extensions/Testopia/t/SE_environments.t @@ -35,10 +35,10 @@ use Bugzilla::Constants; use Testopia::Product; use Testopia::Environment; -use Testopia::Test::Util; -use Testopia::Test::Constants; -use Testopia::Test::Selenium::Util; -use Testopia::Test::Selenium::Constants; +use Bugzilla::Extension::Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::Selenium::Util; +use Bugzilla::Extension::Testopia::Test::Selenium::Constants; my ($user_type, $login, $passwd) = @ARGV; @@ -51,7 +51,7 @@ my $isanon = 0; $se->start(); if ($login && $passwd){ - unless ( Testopia::Test::Selenium::Util->login( $login, $passwd) ) { + unless ( Bugzilla::Extension::Testopia::Test::Selenium::Util->login( $login, $passwd) ) { $se->stop(); fail('login'); exit; @@ -89,7 +89,7 @@ sub test_add { my $rep = get_rep('products'); # Add new environment - supposed to error because missing name - my $product = new Testopia::Product($rep->{'id'}); + my $product = new Bugzilla::Extension::Testopia::Product($rep->{'id'}); my $test = { url => "tr_environments.cgi", action => "add", @@ -165,7 +165,7 @@ sub test_edit { ok( $se->is_text_present("'success': true"), "action=toggle" ); #check edit succeded and values updated - my $environment = new Testopia::Environment($rep->{'environment_id'}); + my $environment = new Bugzilla::Extension::Testopia::Environment($rep->{'environment_id'}); diag(dump_all($environment, $test)) if DEBUG; ok ($environment->name eq $test->{params}->{name}, "Names match"); diff --git a/mozilla/webtools/testopia/extensions/testopia/t/SE_plans.t b/mozilla/webtools/testopia/extensions/Testopia/t/SE_plans.t similarity index 98% rename from mozilla/webtools/testopia/extensions/testopia/t/SE_plans.t rename to mozilla/webtools/testopia/extensions/Testopia/t/SE_plans.t index c06ae669850..062ed43f95a 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/SE_plans.t +++ b/mozilla/webtools/testopia/extensions/Testopia/t/SE_plans.t @@ -35,10 +35,10 @@ use Bugzilla::Constants; use Testopia::Product; use Testopia::Environment; -use Testopia::Test::Util; -use Testopia::Test::Constants; -use Testopia::Test::Selenium::Util; -use Testopia::Test::Selenium::Constants; +use Bugzilla::Extension::Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::Selenium::Util; +use Bugzilla::Extension::Testopia::Test::Selenium::Constants; my ($user_type, $login, $passwd) = @ARGV; @@ -51,7 +51,7 @@ my $isanon = 0; $se->start(); if ($login && $passwd){ - unless ( Testopia::Test::Selenium::Util->login( $login, $passwd) ) { + unless ( Bugzilla::Extension::Testopia::Test::Selenium::Util->login( $login, $passwd) ) { $se->stop(); fail('login'); exit; diff --git a/mozilla/webtools/testopia/extensions/testopia/t/SE_query.t b/mozilla/webtools/testopia/extensions/Testopia/t/SE_query.t similarity index 84% rename from mozilla/webtools/testopia/extensions/testopia/t/SE_query.t rename to mozilla/webtools/testopia/extensions/Testopia/t/SE_query.t index 5c2cfad7c6b..05d5b7e5cb2 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/SE_query.t +++ b/mozilla/webtools/testopia/extensions/Testopia/t/SE_query.t @@ -35,10 +35,10 @@ use Bugzilla::Constants; use Testopia::Product; use Testopia::Environment; -use Testopia::Test::Util; -use Testopia::Test::Constants; -use Testopia::Test::Selenium::Util; -use Testopia::Test::Selenium::Constants; +use Bugzilla::Extension::Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::Selenium::Util; +use Bugzilla::Extension::Testopia::Test::Selenium::Constants; my ($user_type, $login, $passwd) = @ARGV; @@ -51,7 +51,7 @@ my $isanon = 0; $se->start(); if ($login && $passwd){ - unless ( Testopia::Test::Selenium::Util->login( $login, $passwd) ) { + unless ( Bugzilla::Extension::Testopia::Test::Selenium::Util->login( $login, $passwd) ) { $se->stop(); fail('login'); exit; diff --git a/mozilla/webtools/testopia/extensions/testopia/t/SE_runs.t b/mozilla/webtools/testopia/extensions/Testopia/t/SE_runs.t similarity index 98% rename from mozilla/webtools/testopia/extensions/testopia/t/SE_runs.t rename to mozilla/webtools/testopia/extensions/Testopia/t/SE_runs.t index f6cb2891831..7696c9b5d11 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/SE_runs.t +++ b/mozilla/webtools/testopia/extensions/Testopia/t/SE_runs.t @@ -35,10 +35,10 @@ use Bugzilla::Constants; use Testopia::Product; use Testopia::Environment; -use Testopia::Test::Util; -use Testopia::Test::Constants; -use Testopia::Test::Selenium::Util; -use Testopia::Test::Selenium::Constants; +use Bugzilla::Extension::Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Constants; +use Bugzilla::Extension::Testopia::Test::Selenium::Util; +use Bugzilla::Extension::Testopia::Test::Selenium::Constants; my ($user_type, $login, $passwd) = @ARGV; @@ -51,7 +51,7 @@ my $isanon = 0; $se->start(); if ($login && $passwd){ - unless ( Testopia::Test::Selenium::Util->login( $login, $passwd) ) { + unless ( Bugzilla::Extension::Testopia::Test::Selenium::Util->login( $login, $passwd) ) { $se->stop(); fail('login'); exit; diff --git a/mozilla/webtools/testopia/extensions/testopia/t/SE_tags.t b/mozilla/webtools/testopia/extensions/Testopia/t/SE_tags.t similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/t/SE_tags.t rename to mozilla/webtools/testopia/extensions/Testopia/t/SE_tags.t diff --git a/mozilla/webtools/testopia/extensions/testopia/t/Test.pm b/mozilla/webtools/testopia/extensions/Testopia/t/Test.pm similarity index 98% rename from mozilla/webtools/testopia/extensions/testopia/t/Test.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/Test.pm index 0eccab33fb7..aec0c2f91d0 100755 --- a/mozilla/webtools/testopia/extensions/testopia/t/Test.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/Test.pm @@ -31,7 +31,7 @@ use Test::Deep; use Bugzilla::Constants; use Bugzilla::User; -use Testopia::Test::Util; +use Bugzilla::Extension::Testopia::Test::Util; use base qw(Testopia::Test::Util Exporter); @testopia::t::Test::EXPORT = qw(test_init set_user); diff --git a/mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/API/Constants.pm b/mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/API/Constants.pm similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/API/Constants.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/API/Constants.pm diff --git a/mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/API/Util.pm b/mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/API/Util.pm similarity index 97% rename from mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/API/Util.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/API/Util.pm index c049315f4ef..9874a4a822f 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/API/Util.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/API/Util.pm @@ -18,7 +18,7 @@ # # Contributor(s): Greg Hendricks -package Testopia::Test::API::Util; +package Bugzilla::Extension::Testopia::Test::API::Util; use strict; diff --git a/mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/Constants.pm b/mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/Constants.pm similarity index 96% rename from mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/Constants.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/Constants.pm index 1c422a74953..78eb0a47f7e 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/Constants.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/Constants.pm @@ -18,7 +18,7 @@ # # Contributor(s): Greg Hendricks -package Testopia::Test::Constants; +package Bugzilla::Extension::Testopia::Test::Constants; use base qw(Exporter); diff --git a/mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/Selenium/Constants.pm b/mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/Selenium/Constants.pm similarity index 98% rename from mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/Selenium/Constants.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/Selenium/Constants.pm index e0be897143c..cb1cb9fa751 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/Selenium/Constants.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/Selenium/Constants.pm @@ -12,7 +12,7 @@ Exporter =cut -package Testopia::Test::Selenium::Constants; +package Bugzilla::Extension::Testopia::Test::Selenium::Constants; use strict; diff --git a/mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/Selenium/Util.pm b/mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/Selenium/Util.pm similarity index 97% rename from mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/Selenium/Util.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/Selenium/Util.pm index cd649a164a3..07ed6f64b27 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/Selenium/Util.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/Selenium/Util.pm @@ -20,7 +20,7 @@ # Jeff Dayley # Ben Warby -package Testopia::Test::Selenium::Util; +package Bugzilla::Extension::Testopia::Test::Selenium::Util; use base qw(Exporter); @@ -38,7 +38,7 @@ use lib "../.."; use lib ".."; use Bugzilla; -use Testopia::Test::Selenium::Constants; +use Bugzilla::Extension::Testopia::Test::Selenium::Constants; use Bugzilla::Util; use WWW::Selenium; diff --git a/mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/Util.pm b/mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/Util.pm similarity index 96% rename from mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/Util.pm rename to mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/Util.pm index a7bd5167dbf..3989b011d46 100644 --- a/mozilla/webtools/testopia/extensions/testopia/t/Testopia/Test/Util.pm +++ b/mozilla/webtools/testopia/extensions/Testopia/t/Testopia/Test/Util.pm @@ -1,5 +1,5 @@ -package Testopia::Test::Util; +package Bugzilla::Extension::Testopia::Test::Util; use base qw(Exporter); diff --git a/mozilla/webtools/testopia/extensions/testopia/t/data/dummy_load.sql b/mozilla/webtools/testopia/extensions/Testopia/t/data/dummy_load.sql similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/t/data/dummy_load.sql rename to mozilla/webtools/testopia/extensions/Testopia/t/data/dummy_load.sql diff --git a/mozilla/webtools/testopia/extensions/testopia/t/data/dummy_pgsql.sql b/mozilla/webtools/testopia/extensions/Testopia/t/data/dummy_pgsql.sql similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/t/data/dummy_pgsql.sql rename to mozilla/webtools/testopia/extensions/Testopia/t/data/dummy_pgsql.sql diff --git a/mozilla/webtools/testopia/extensions/testopia/template/en/default/admin/params/testopia.html.tmpl b/mozilla/webtools/testopia/extensions/Testopia/template/en/default/admin/params/testopia.html.tmpl similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/template/en/default/admin/params/testopia.html.tmpl rename to mozilla/webtools/testopia/extensions/Testopia/template/en/default/admin/params/testopia.html.tmpl diff --git a/mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/admin/products/confirm-delete.html.tmpl/confirmation/testopia.html.tmpl b/mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/admin/products/confirm-delete-confirmation.html.tmpl similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/admin/products/confirm-delete.html.tmpl/confirmation/testopia.html.tmpl rename to mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/admin/products/confirm-delete-confirmation.html.tmpl diff --git a/mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/bug/create/create.html.tmpl/end/tr.html.tmpl b/mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/bug/create/create-end.html.tmpl similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/bug/create/create.html.tmpl/end/tr.html.tmpl rename to mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/bug/create/create-end.html.tmpl diff --git a/mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/bug/create/create.html.tmpl/form/tr.html.tmpl b/mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/bug/create/create-form.html.tmpl similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/bug/create/create.html.tmpl/form/tr.html.tmpl rename to mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/bug/create/create-form.html.tmpl diff --git a/mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/bug/create/created.html.tmpl/message/tr.html.tmpl b/mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/bug/create/created-message.html.tmpl similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/bug/create/created.html.tmpl/message/tr.html.tmpl rename to mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/bug/create/created-message.html.tmpl diff --git a/mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/bug/edit.html.tmpl/after_custom_fields/tr.html.tmpl b/mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/bug/edit-after_custom_fields.html.tmpl similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/bug/edit.html.tmpl/after_custom_fields/tr.html.tmpl rename to mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/bug/edit-after_custom_fields.html.tmpl diff --git a/mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/bug/process/results.html.tmpl/links/tr.html.tmpl b/mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/bug/process/results-links.html.tmpl similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/bug/process/results.html.tmpl/links/tr.html.tmpl rename to mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/bug/process/results-links.html.tmpl diff --git a/mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/global/banner.html.tmpl/version/testopia.html.tmpl b/mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/global/banner-version.html.tmpl similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/global/banner.html.tmpl/version/testopia.html.tmpl rename to mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/global/banner-version.html.tmpl diff --git a/mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/global/code-error.html.tmpl/errors/testopia_errors.html.tmpl b/mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/global/code-error-errors.html.tmpl similarity index 100% rename from mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/global/code-error.html.tmpl/errors/testopia_errors.html.tmpl rename to mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/global/code-error-errors.html.tmpl diff --git a/mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/global/common-links.html.tmpl/link-row/testopia.html.tmpl b/mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/global/common-links-link-row.html.tmpl similarity index 96% rename from mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/global/common-links.html.tmpl/link-row/testopia.html.tmpl rename to mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/global/common-links-link-row.html.tmpl index 9ef0752e9e6..ae3d44aba22 100644 --- a/mozilla/webtools/testopia/extensions/testopia/template/en/default/hook/global/common-links.html.tmpl/link-row/testopia.html.tmpl +++ b/mozilla/webtools/testopia/extensions/Testopia/template/en/default/hook/global/common-links-link-row.html.tmpl @@ -20,7 +20,6 @@ [% IF user.login AND user.settings.view_testopia.value == 'on' %] -
Testopia: