Removed tabs
git-svn-id: svn://10.0.0.236/trunk@228049 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -169,17 +169,17 @@ sub get_environment_elements{
|
||||
my $id = $self->{'environment_id'};
|
||||
|
||||
my $ref = $dbh->selectcol_arrayref(qq{
|
||||
SELECT DISTINCT tee.element_id
|
||||
FROM test_environment_map as tem
|
||||
JOIN test_environment_element as tee
|
||||
ON tem.element_id = tee.element_id
|
||||
WHERE tem.environment_id = ?},undef,$id);
|
||||
SELECT DISTINCT tee.element_id
|
||||
FROM test_environment_map as tem
|
||||
JOIN test_environment_element as tee
|
||||
ON tem.element_id = tee.element_id
|
||||
WHERE tem.environment_id = ?},undef,$id);
|
||||
|
||||
my @elements;
|
||||
|
||||
foreach my $val (@$ref){
|
||||
push @elements, Bugzilla::Testopia::Environment::Element->new($val);
|
||||
}
|
||||
foreach my $val (@$ref){
|
||||
push @elements, Bugzilla::Testopia::Environment::Element->new($val);
|
||||
}
|
||||
$self->{'elements'} = \@elements;
|
||||
|
||||
return \@elements;
|
||||
@@ -222,18 +222,18 @@ Returns a selected value for the specified environment element property instance
|
||||
=cut
|
||||
|
||||
sub get_value_selected{
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $self = shift;
|
||||
|
||||
my ($environment,$element,$property) = (@_);
|
||||
|
||||
my ($var) = $dbh->selectrow_array(
|
||||
"SELECT value_selected
|
||||
FROM test_environment_map
|
||||
WHERE environment_id = ?
|
||||
AND element_id = ?
|
||||
AND property_id = ?",
|
||||
undef,($environment,$element,$property));
|
||||
"SELECT value_selected
|
||||
FROM test_environment_map
|
||||
WHERE environment_id = ?
|
||||
AND element_id = ?
|
||||
AND property_id = ?",
|
||||
undef,($environment,$element,$property));
|
||||
|
||||
return $var;
|
||||
}
|
||||
@@ -249,8 +249,8 @@ sub get_environments{
|
||||
my $self = shift;
|
||||
|
||||
my $ref = $dbh->selectall_arrayref(
|
||||
"SELECT environment_id, name
|
||||
FROM test_environments");
|
||||
"SELECT environment_id, name
|
||||
FROM test_environments");
|
||||
|
||||
return $ref;
|
||||
}
|
||||
@@ -325,20 +325,20 @@ sub get_all_elements{
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $self = shift;
|
||||
|
||||
my $ref = $dbh->selectcol_arrayref(
|
||||
"SELECT tee.element_id
|
||||
FROM test_environment_map as tem
|
||||
JOIN test_environment_element as tee
|
||||
ON tem.element_id = tee.element_id",
|
||||
undef);
|
||||
my $ref = $dbh->selectcol_arrayref(
|
||||
"SELECT tee.element_id
|
||||
FROM test_environment_map as tem
|
||||
JOIN test_environment_element as tee
|
||||
ON tem.element_id = tee.element_id",
|
||||
undef);
|
||||
|
||||
my @elements;
|
||||
|
||||
foreach my $val (@$ref){
|
||||
push @elements, Bugzilla::Testopia::Environment::Element->new($val);
|
||||
}
|
||||
foreach my $val (@$ref){
|
||||
push @elements, Bugzilla::Testopia::Environment::Element->new($val);
|
||||
}
|
||||
|
||||
return \@elements;
|
||||
return \@elements;
|
||||
}
|
||||
|
||||
=head2 check environment name
|
||||
@@ -354,10 +354,10 @@ sub check_environment{
|
||||
my $dbh = Bugzilla->dbh;
|
||||
|
||||
my ($used) = $dbh->selectrow_array(
|
||||
"SELECT environment_id
|
||||
FROM test_environments
|
||||
WHERE name = ? AND product_id = ?",
|
||||
undef, ($name, $product_id));
|
||||
"SELECT environment_id
|
||||
FROM test_environments
|
||||
WHERE name = ? AND product_id = ?",
|
||||
undef, ($name, $product_id));
|
||||
|
||||
return $used;
|
||||
}
|
||||
@@ -412,7 +412,7 @@ sub store {
|
||||
$self->persist_environment_element_and_children(1, $element, "store");
|
||||
}
|
||||
|
||||
return $key;
|
||||
return $key;
|
||||
}
|
||||
|
||||
|
||||
@@ -423,7 +423,7 @@ Serializes the property values to the database
|
||||
=cut
|
||||
|
||||
sub store_property_value {
|
||||
my $self = shift;
|
||||
my $self = shift;
|
||||
|
||||
my ($prop_id,$elem_id,$value_selected) = @_;
|
||||
|
||||
@@ -448,8 +448,8 @@ sub store_environment_name {
|
||||
# Exclude the auto-incremented field from the column list.
|
||||
my $columns = join(", ", grep {$_ ne 'environment_id'} DB_COLUMNS);
|
||||
|
||||
return undef if $self->check_environment($name, $product_id);
|
||||
|
||||
return undef if $self->check_environment($name, $product_id);
|
||||
|
||||
my $dbh = Bugzilla->dbh;
|
||||
$dbh->do("INSERT INTO test_environments ($columns) VALUES (?,?,?)",
|
||||
undef, ($product_id, $name, 1));
|
||||
@@ -545,7 +545,7 @@ Updates the property of the element in the database
|
||||
|
||||
sub update_property_value {
|
||||
|
||||
my $timestamp = Bugzilla::Testopia::Util::get_time_stamp();
|
||||
my $timestamp = Bugzilla::Testopia::Util::get_time_stamp();
|
||||
my $self = shift;
|
||||
my ($propID, $elemID, $valueSelected) = (@_);
|
||||
|
||||
@@ -688,7 +688,7 @@ Returns the name of this object
|
||||
|
||||
sub id { return $_[0]->{'environment_id'}; }
|
||||
sub product_id { return $_[0]->{'product_id'}; }
|
||||
sub isactive { return $_[0]->{'isactive'}; }
|
||||
sub isactive { return $_[0]->{'isactive'}; }
|
||||
sub name { return $_[0]->{'name'}; }
|
||||
|
||||
=head2 product
|
||||
|
||||
@@ -126,21 +126,21 @@ Returns an array of element objects for a category
|
||||
=cut
|
||||
|
||||
sub get_elements_by_category{
|
||||
my $self = shift;
|
||||
|
||||
my $self = shift;
|
||||
|
||||
my $dbh = Bugzilla->dbh;
|
||||
|
||||
my $ref = $dbh->selectcol_arrayref(qq{
|
||||
SELECT element_id
|
||||
SELECT element_id
|
||||
FROM test_environment_element
|
||||
WHERE env_category_id = ?}, undef, $self->{'env_category_id'});
|
||||
|
||||
my @elements;
|
||||
WHERE env_category_id = ?}, undef, $self->{'env_category_id'});
|
||||
|
||||
my @elements;
|
||||
|
||||
foreach my $val (@$ref){
|
||||
push @elements, Bugzilla::Testopia::Environment::Element->new($val);
|
||||
};
|
||||
|
||||
foreach my $val (@$ref){
|
||||
push @elements, Bugzilla::Testopia::Environment::Element->new($val);
|
||||
};
|
||||
|
||||
return \@elements;
|
||||
}
|
||||
|
||||
@@ -151,15 +151,15 @@ Returns an array of parent elements by category
|
||||
=cut
|
||||
|
||||
sub get_parent_elements{
|
||||
my $self = shift;
|
||||
|
||||
my $self = shift;
|
||||
|
||||
my $dbh = Bugzilla->dbh;
|
||||
|
||||
################## original
|
||||
# Matches null for parent id
|
||||
#
|
||||
# my $ref = $dbh->selectcol_arrayref(qq{
|
||||
# SELECT element_id
|
||||
# SELECT element_id
|
||||
# FROM test_environment_element
|
||||
# WHERE env_category_id = ? AND parent_id is null }, undef, $self->{'env_category_id'});
|
||||
#
|
||||
@@ -170,7 +170,7 @@ sub get_parent_elements{
|
||||
# Matches 0 for parent id
|
||||
#
|
||||
# my $ref = $dbh->selectcol_arrayref(qq{
|
||||
# SELECT element_id
|
||||
# SELECT element_id
|
||||
# FROM test_environment_element
|
||||
# WHERE env_category_id = ? AND parent_id = 0 }, undef, $self->{'env_category_id'});
|
||||
#
|
||||
@@ -178,19 +178,19 @@ sub get_parent_elements{
|
||||
|
||||
|
||||
########### temp fix to address issues with 0 or null in test_envrionment_element parent_id column
|
||||
##### matching null OR 0
|
||||
my $ref = $dbh->selectcol_arrayref(qq{
|
||||
SELECT element_id
|
||||
##### matching null OR 0
|
||||
my $ref = $dbh->selectcol_arrayref(qq{
|
||||
SELECT element_id
|
||||
FROM test_environment_element
|
||||
WHERE env_category_id = ? AND (parent_id is null or parent_id = 0) }, undef, $self->{'env_category_id'});
|
||||
########### end temp fix.... delete when ready
|
||||
########### end temp fix.... delete when ready
|
||||
|
||||
my @elements;
|
||||
my @elements;
|
||||
|
||||
foreach my $val (@$ref){
|
||||
push @elements, Bugzilla::Testopia::Environment::Element->new($val);
|
||||
};
|
||||
|
||||
foreach my $val (@$ref){
|
||||
push @elements, Bugzilla::Testopia::Environment::Element->new($val);
|
||||
};
|
||||
|
||||
return \@elements;
|
||||
}
|
||||
|
||||
@@ -201,14 +201,14 @@ Returns 1 if a category has any elements
|
||||
=cut
|
||||
|
||||
sub check_for_elements{
|
||||
my $self = shift;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $self = shift;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
|
||||
my $ref = $dbh->selectrow_array(qq{
|
||||
SELECT 1
|
||||
SELECT 1
|
||||
FROM test_environment_element
|
||||
WHERE env_category_id = ?}, undef, $self->{'env_category_id'});
|
||||
|
||||
WHERE env_category_id = ?}, undef, $self->{'env_category_id'});
|
||||
|
||||
return $ref;
|
||||
}
|
||||
|
||||
@@ -219,14 +219,14 @@ Returns the product_id, product name, and count of categories
|
||||
=cut
|
||||
|
||||
sub get_env_product_list{
|
||||
my $self = shift;
|
||||
my ($class_id) = @_;
|
||||
my $self = shift;
|
||||
my ($class_id) = @_;
|
||||
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $query = "SELECT p.id, p.name, COUNT(tec.env_category_id) AS cat_count
|
||||
FROM products p
|
||||
LEFT JOIN group_control_map
|
||||
ON group_control_map.product_id = p.id ";
|
||||
FROM products p
|
||||
LEFT JOIN group_control_map
|
||||
ON group_control_map.product_id = p.id ";
|
||||
|
||||
if (Bugzilla->params->{'useentrygroupdefault'}) {
|
||||
$query .= "AND group_control_map.entry != 0 ";
|
||||
@@ -238,7 +238,7 @@ sub get_env_product_list{
|
||||
$query .= "AND group_id NOT IN(" .
|
||||
join(',', values(%{Bugzilla->user->groups})) . ") ";
|
||||
}
|
||||
|
||||
|
||||
$query .= "LEFT OUTER JOIN test_environment_category AS tec
|
||||
ON p.id = tec.product_id ";
|
||||
$query .= "WHERE group_id IS NULL ";
|
||||
@@ -267,7 +267,7 @@ sub get_all_child_count {
|
||||
FROM test_environment_category
|
||||
WHERE product_id = 0");
|
||||
|
||||
return $all_count;
|
||||
return $all_count;
|
||||
}
|
||||
|
||||
sub product_categories_to_json {
|
||||
@@ -373,15 +373,15 @@ Returns category id if a category exists
|
||||
sub check_category{
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $self = shift;
|
||||
my ($name, $prodID) = (@_);
|
||||
|
||||
$prodID ||= $self->product_id;
|
||||
|
||||
my ($name, $prodID) = (@_);
|
||||
|
||||
$prodID ||= $self->product_id;
|
||||
|
||||
my ($used) = $dbh->selectrow_array(
|
||||
"SELECT env_category_id
|
||||
FROM test_environment_category
|
||||
WHERE name = ? AND product_id = ?",
|
||||
undef,($name,$prodID));
|
||||
FROM test_environment_category
|
||||
WHERE name = ? AND product_id = ?",
|
||||
undef,($name,$prodID));
|
||||
|
||||
return $used;
|
||||
}
|
||||
@@ -394,13 +394,13 @@ Returns category name if a category id exists
|
||||
|
||||
sub check_category_by_id{
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $self = shift;
|
||||
my $self = shift;
|
||||
my ($id) = (@_);
|
||||
|
||||
my ($used) = $dbh->selectrow_arrayref(qq{
|
||||
SELECT name
|
||||
FROM test_environment_category
|
||||
WHERE env_category_id = ?},undef,$id);
|
||||
my ($used) = $dbh->selectrow_arrayref(qq{
|
||||
SELECT name
|
||||
FROM test_environment_category
|
||||
WHERE env_category_id = ?},undef,$id);
|
||||
|
||||
return $used;
|
||||
}
|
||||
@@ -419,7 +419,7 @@ sub store {
|
||||
my $timestamp = Bugzilla::Testopia::Util::get_time_stamp();
|
||||
|
||||
return 0 if $self->check_category($self->{'name'},$self->{'product_id'});
|
||||
|
||||
|
||||
my $dbh = Bugzilla->dbh;
|
||||
$dbh->do("INSERT INTO test_environment_category ($columns) VALUES (?, ?)",
|
||||
undef, ($self->{'product_id'}, $self->{'name'}));
|
||||
@@ -474,11 +474,11 @@ Completely removes the element category entry from the database.
|
||||
|
||||
sub obliterate {
|
||||
my $self = shift;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $children = $dbh->selectcol_arrayref(
|
||||
"SELECT element_id FROM test_environment_element
|
||||
WHERE env_category_id = ?", undef, $self->id);
|
||||
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $children = $dbh->selectcol_arrayref(
|
||||
"SELECT element_id FROM test_environment_element
|
||||
WHERE env_category_id = ?", undef, $self->id);
|
||||
|
||||
foreach my $id (@$children){
|
||||
my $element = Bugzilla::Testopia::Environment::Element->new($id);
|
||||
$element->obliterate;
|
||||
|
||||
@@ -111,8 +111,8 @@ sub _init {
|
||||
|
||||
$obj = $dbh->selectrow_hashref(
|
||||
"SELECT $columns
|
||||
FROM test_environment_element
|
||||
WHERE element_id = ?", undef, $id);
|
||||
FROM test_environment_element
|
||||
WHERE element_id = ?", undef, $id);
|
||||
} elsif (ref $param eq 'HASH'){
|
||||
$obj = $param;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ gets all of their children until exhausted.
|
||||
=cut
|
||||
|
||||
sub get_children{
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $self = shift;
|
||||
|
||||
return $self->{'children'} if exists $self->{'children'};
|
||||
@@ -146,7 +146,7 @@ sub get_children{
|
||||
|
||||
if(%newvalues)
|
||||
{
|
||||
$depth = $newvalues{'depth'};
|
||||
$depth = $newvalues{'depth'};
|
||||
}
|
||||
|
||||
$depth--;
|
||||
@@ -157,20 +157,20 @@ sub get_children{
|
||||
my $id = $self->{'element_id'};
|
||||
|
||||
my $ref = $dbh->selectcol_arrayref(qq{
|
||||
SELECT tee.element_id
|
||||
FROM test_environment_element as tee
|
||||
WHERE tee.parent_id = ?},undef,$id);
|
||||
SELECT tee.element_id
|
||||
FROM test_environment_element as tee
|
||||
WHERE tee.parent_id = ?},undef,$id);
|
||||
|
||||
my @children;
|
||||
|
||||
foreach my $val (@$ref){
|
||||
my $child = Bugzilla::Testopia::Environment::Element->new($val);
|
||||
$child->get_children('depth'=>$depth);
|
||||
push(@children,$child);
|
||||
}
|
||||
|
||||
$self->{'children'} = \@children;
|
||||
|
||||
foreach my $val (@$ref){
|
||||
my $child = Bugzilla::Testopia::Environment::Element->new($val);
|
||||
$child->get_children('depth'=>$depth);
|
||||
push(@children,$child);
|
||||
}
|
||||
|
||||
$self->{'children'} = \@children;
|
||||
|
||||
}
|
||||
|
||||
=head2 get_properties
|
||||
@@ -180,24 +180,24 @@ Returns an array of the property objects for an element.
|
||||
=cut
|
||||
|
||||
sub get_properties{
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $self = shift;
|
||||
|
||||
my $ref = $dbh->selectcol_arrayref(qq{
|
||||
SELECT tep.property_id
|
||||
FROM test_environment_property as tep
|
||||
WHERE tep.element_id = ?},undef,($self->{'element_id'}));
|
||||
SELECT tep.property_id
|
||||
FROM test_environment_property as tep
|
||||
WHERE tep.element_id = ?},undef,($self->{'element_id'}));
|
||||
|
||||
my @properties;
|
||||
|
||||
foreach my $val (@$ref){
|
||||
my $property = Bugzilla::Testopia::Environment::Property->new($val);
|
||||
push(@properties,$property);
|
||||
}
|
||||
|
||||
$self->{'properties'} = \@properties;
|
||||
return $self->{'properties'};
|
||||
|
||||
foreach my $val (@$ref){
|
||||
my $property = Bugzilla::Testopia::Environment::Property->new($val);
|
||||
push(@properties,$property);
|
||||
}
|
||||
|
||||
$self->{'properties'} = \@properties;
|
||||
return $self->{'properties'};
|
||||
|
||||
}
|
||||
|
||||
=head2 check_element
|
||||
@@ -210,8 +210,8 @@ sub check_element{
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $self = shift;
|
||||
my ($name, $cat_id) = @_;
|
||||
|
||||
# Since categories are uniquely identified by product_id we don't have to check by join on the product_id.
|
||||
|
||||
# Since categories are uniquely identified by product_id we don't have to check by join on the product_id.
|
||||
my ($used) = $dbh->selectrow_array(
|
||||
"SELECT element_id
|
||||
FROM test_environment_element
|
||||
@@ -233,13 +233,13 @@ sub check_for_children{
|
||||
my $self = shift;
|
||||
|
||||
my ($has_element) = $dbh->selectrow_array(
|
||||
"SELECT 1
|
||||
"SELECT 1
|
||||
FROM test_environment_element
|
||||
WHERE parent_id = ?",
|
||||
undef, $self->{'element_id'});
|
||||
|
||||
my ($has_property) = $dbh->selectrow_array(
|
||||
"SELECT 1
|
||||
"SELECT 1
|
||||
FROM test_environment_property
|
||||
WHERE element_id = ?",
|
||||
undef, $self->{'element_id'});
|
||||
@@ -320,7 +320,7 @@ sub check_for_properties{
|
||||
my $self = shift;
|
||||
|
||||
my ($used) = $dbh->selectrow_array(qq{
|
||||
SELECT 1
|
||||
SELECT 1
|
||||
FROM test_environment_property
|
||||
WHERE element_id = ? },undef,$self->{'element_id'});
|
||||
|
||||
@@ -361,7 +361,7 @@ Updates the element in the database
|
||||
|
||||
sub update_element_name {
|
||||
my $self = shift;
|
||||
my $timestamp = Bugzilla::Testopia::Util::get_time_stamp();
|
||||
my $timestamp = Bugzilla::Testopia::Util::get_time_stamp();
|
||||
|
||||
my ($name) = (@_);
|
||||
|
||||
@@ -381,7 +381,7 @@ Updates the category of the element in the database
|
||||
|
||||
sub update_element_category {
|
||||
my $self = shift;
|
||||
my $timestamp = Bugzilla::Testopia::Util::get_time_stamp();
|
||||
my $timestamp = Bugzilla::Testopia::Util::get_time_stamp();
|
||||
|
||||
my ($catid) = (@_);
|
||||
|
||||
@@ -400,7 +400,7 @@ Updates the parent_id of the element in the database
|
||||
|
||||
sub update_element_parent {
|
||||
my $self = shift;
|
||||
my $timestamp = Bugzilla::Testopia::Util::get_time_stamp();
|
||||
my $timestamp = Bugzilla::Testopia::Util::get_time_stamp();
|
||||
|
||||
my ($parent_id) = (@_);
|
||||
|
||||
@@ -419,12 +419,12 @@ Completely removes the element entry from the database.
|
||||
sub obliterate {
|
||||
my $self = shift;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
|
||||
foreach my $p (@{$self->get_properties}){
|
||||
$p->obliterate;
|
||||
}
|
||||
|
||||
$dbh->do("DELETE FROM test_environment_map
|
||||
|
||||
foreach my $p (@{$self->get_properties}){
|
||||
$p->obliterate;
|
||||
}
|
||||
|
||||
$dbh->do("DELETE FROM test_environment_map
|
||||
WHERE element_id = ?", undef, $self->id);
|
||||
$dbh->do("DELETE FROM test_environment_element
|
||||
WHERE element_id = ?", undef, $self->{'element_id'});
|
||||
|
||||
@@ -137,9 +137,9 @@ sub check_property{
|
||||
}
|
||||
|
||||
my ($used) = $dbh->selectrow_array(qq{
|
||||
SELECT property_id
|
||||
FROM test_environment_property
|
||||
WHERE name = ? AND element_id = ?},undef,$name,$element_id);
|
||||
SELECT property_id
|
||||
FROM test_environment_property
|
||||
WHERE name = ? AND element_id = ?},undef,$name,$element_id);
|
||||
|
||||
return $used;
|
||||
}
|
||||
@@ -156,9 +156,9 @@ sub check_for_validexp{
|
||||
my $dbh = Bugzilla->dbh;
|
||||
|
||||
my ($used) = $dbh->selectrow_array(qq{
|
||||
SELECT 1
|
||||
FROM test_environment_property
|
||||
WHERE property_id = ? AND (validexp IS NOT NULL AND validexp <> '')},undef,$self->{'property_id'});
|
||||
SELECT 1
|
||||
FROM test_environment_property
|
||||
WHERE property_id = ? AND (validexp IS NOT NULL AND validexp <> '')},undef,$self->{'property_id'});
|
||||
|
||||
return $used;
|
||||
}
|
||||
@@ -197,9 +197,9 @@ sub get_validexp{
|
||||
my $dbh = Bugzilla->dbh;
|
||||
|
||||
my $validexp = $dbh->selectrow_arrayref(qq{
|
||||
SELECT validexp
|
||||
FROM test_environment_property
|
||||
WHERE property_id = ? },undef,$self->{'property_id'});
|
||||
SELECT validexp
|
||||
FROM test_environment_property
|
||||
WHERE property_id = ? },undef,$self->{'property_id'});
|
||||
|
||||
return $validexp;
|
||||
}
|
||||
@@ -219,7 +219,7 @@ sub store {
|
||||
|
||||
# Verify name is available
|
||||
return undef if $self->check_property($self->{'name'}, $self->{'element_id'});
|
||||
|
||||
|
||||
my $dbh = Bugzilla->dbh;
|
||||
$dbh->do("INSERT INTO test_environment_property ($columns) VALUES (?,?,?)",
|
||||
undef, ($self->{'element_id'}, $self->{'name'}, $self->{'validexp'}));
|
||||
@@ -234,7 +234,7 @@ Updates the property name in the database
|
||||
=cut
|
||||
|
||||
sub set_name {
|
||||
my $self = shift;
|
||||
my $self = shift;
|
||||
my $timestamp = Bugzilla::Testopia::Util::get_time_stamp();
|
||||
|
||||
my ($name) = (@_);
|
||||
@@ -253,7 +253,7 @@ Updates the elmnt_id in the database
|
||||
=cut
|
||||
|
||||
sub set_element {
|
||||
my $self = shift;
|
||||
my $self = shift;
|
||||
my $timestamp = Bugzilla::Testopia::Util::get_time_stamp();
|
||||
|
||||
my ($id) = (@_);
|
||||
@@ -321,7 +321,7 @@ Completely removes the element property entry from the database.
|
||||
sub obliterate {
|
||||
my $self = shift;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
|
||||
|
||||
$dbh->do("DELETE FROM test_environment_map
|
||||
WHERE property_id = ?", undef, $self->id);
|
||||
$dbh->do("DELETE FROM test_environment_property
|
||||
|
||||
@@ -120,9 +120,9 @@ sub check_product_by_name {
|
||||
my ($name) = @_;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my ($used) = $dbh->selectrow_array(qq{
|
||||
SELECT id
|
||||
FROM products
|
||||
WHERE name = ?},undef,$name);
|
||||
SELECT id
|
||||
FROM products
|
||||
WHERE name = ?},undef,$name);
|
||||
return $used;
|
||||
}
|
||||
|
||||
|
||||
@@ -647,7 +647,7 @@ sub link_plan {
|
||||
|
||||
# Update the plans array to include new plan added.
|
||||
|
||||
push @{$self->{'plans'}}, Bugzilla::Testopia::TestPlan->new($plan_id);
|
||||
push @{$self->{'plans'}}, Bugzilla::Testopia::TestPlan->new($plan_id);
|
||||
|
||||
}
|
||||
|
||||
@@ -688,7 +688,7 @@ sub unlink_plan {
|
||||
# Update the plans array.
|
||||
delete $self->{'plans'};
|
||||
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
=head2 copy
|
||||
@@ -1504,9 +1504,9 @@ sub components {
|
||||
|
||||
my @comps;
|
||||
foreach my $id (@$comps){
|
||||
my $comp = Bugzilla::Component->new($id);
|
||||
my $prod = Bugzilla::Product->new($comp->product_id);
|
||||
$comp->{'product_name'} = $prod->name;
|
||||
my $comp = Bugzilla::Component->new($id);
|
||||
my $prod = Bugzilla::Product->new($comp->product_id);
|
||||
$comp->{'product_name'} = $prod->name;
|
||||
push @comps, $comp;
|
||||
}
|
||||
$self->{'components'} = \@comps;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -40,7 +40,7 @@ package Bugzilla::Testopia::XmlReferences;
|
||||
|
||||
use constant IGNORECASE => "ignorecase";
|
||||
|
||||
#use strict;
|
||||
use strict;
|
||||
|
||||
sub new
|
||||
{
|
||||
@@ -49,10 +49,10 @@ sub new
|
||||
my $class = ref($invocant) || $invocant;
|
||||
my $self = {};
|
||||
bless($self, $class);
|
||||
$self{IGNORECASE} = $ignorecase;
|
||||
$self->{IGNORECASE} = $ignorecase;
|
||||
for my $field ( split(/ /, $fields) )
|
||||
{
|
||||
$field = uc $field if ( $self{IGNORECASE} );
|
||||
$field = uc $field if ( $self->{IGNORECASE} );
|
||||
$self->{$field} = [];
|
||||
}
|
||||
return $self;
|
||||
@@ -62,7 +62,7 @@ sub add
|
||||
{
|
||||
my ($self, $type, $object) = @_;
|
||||
|
||||
$type = uc $type if ( $self{IGNORECASE} );
|
||||
$type = uc $type if ( $self->{IGNORECASE} );
|
||||
|
||||
return 0 if ( ! exists $self->{$type} );
|
||||
|
||||
@@ -74,7 +74,7 @@ sub display
|
||||
my ($self) = @_;
|
||||
|
||||
print "display() self=" . $self . "\n";
|
||||
foreach $key (keys %$self)
|
||||
foreach my $key (keys %$self)
|
||||
{
|
||||
if ( defined $self->{$key} )
|
||||
{
|
||||
@@ -91,7 +91,7 @@ sub get
|
||||
{
|
||||
my ($self, $type) = @_;
|
||||
|
||||
$type = uc $type if ( $self{IGNORECASE} );
|
||||
$type = uc $type if ( $self->{IGNORECASE} );
|
||||
|
||||
return 0 if ( ! exists $self->{$type} );
|
||||
|
||||
|
||||
@@ -62,31 +62,31 @@ use Class::Struct;
|
||||
#
|
||||
struct
|
||||
(
|
||||
'Bugzilla::Testopia::XmlTestCase',
|
||||
{
|
||||
attachments => '@',
|
||||
blocks => 'Bugzilla::Testopia::XmlReferences',
|
||||
category => '$',
|
||||
component_ids => '@',
|
||||
dependson => 'Bugzilla::Testopia::XmlReferences',
|
||||
tags => '@',
|
||||
testcase => 'Bugzilla::Testopia::TestCase',
|
||||
testplan => 'Bugzilla::Testopia::XmlReferences',
|
||||
}
|
||||
'Bugzilla::Testopia::XmlTestCase',
|
||||
{
|
||||
attachments => '@',
|
||||
blocks => 'Bugzilla::Testopia::XmlReferences',
|
||||
category => '$',
|
||||
component_ids => '@',
|
||||
dependson => 'Bugzilla::Testopia::XmlReferences',
|
||||
tags => '@',
|
||||
testcase => 'Bugzilla::Testopia::TestCase',
|
||||
testplan => 'Bugzilla::Testopia::XmlReferences',
|
||||
}
|
||||
);
|
||||
|
||||
sub add_attachment()
|
||||
{
|
||||
my ($self,$tag) = @_;
|
||||
|
||||
push @{$self->attachments}, $tag;
|
||||
my ($self,$tag) = @_;
|
||||
|
||||
push @{$self->attachments}, $tag;
|
||||
}
|
||||
|
||||
sub add_tag()
|
||||
{
|
||||
my ($self,$tag) = @_;
|
||||
|
||||
push @{$self->tags}, $tag;
|
||||
my ($self,$tag) = @_;
|
||||
|
||||
push @{$self->tags}, $tag;
|
||||
}
|
||||
|
||||
=head2 get_available_products
|
||||
@@ -109,155 +109,155 @@ sub get_available_products {
|
||||
|
||||
sub add_component()
|
||||
{
|
||||
my ($self,$component,$component_product) = @_;
|
||||
my $component_id = "";
|
||||
my $product_id = "";
|
||||
|
||||
return "Component $component needs to provide a product." if ( $component_product eq "" );
|
||||
|
||||
# Find the product identifier.
|
||||
my $products_ref = get_available_products();
|
||||
foreach my $product (@$products_ref)
|
||||
{
|
||||
if ( $component_product eq $product->{name} )
|
||||
{
|
||||
$product_id = $product->{id};
|
||||
last;
|
||||
}
|
||||
}
|
||||
return "Cannot find product $component_product for component $component." if ( $product_id eq "" );
|
||||
|
||||
# Find the component identifier for the product's componet
|
||||
my $product = Bugzilla::Testopia::Product->new($product_id);
|
||||
my $components_ref = $product->components;
|
||||
foreach my $product_component ( @$components_ref )
|
||||
{
|
||||
if ( $component eq $product_component->name )
|
||||
{
|
||||
$component_id = $product_component->id;
|
||||
last;
|
||||
}
|
||||
}
|
||||
return "Product $component_product does not have a component named $component." if ( $component_id eq "" );
|
||||
|
||||
# Save the component identifier for this Test Case.
|
||||
push @{$self->component_ids}, $component_id;
|
||||
|
||||
return "";
|
||||
my ($self,$component,$component_product) = @_;
|
||||
my $component_id = "";
|
||||
my $product_id = "";
|
||||
|
||||
return "Component $component needs to provide a product." if ( $component_product eq "" );
|
||||
|
||||
# Find the product identifier.
|
||||
my $products_ref = get_available_products();
|
||||
foreach my $product (@$products_ref)
|
||||
{
|
||||
if ( $component_product eq $product->{name} )
|
||||
{
|
||||
$product_id = $product->{id};
|
||||
last;
|
||||
}
|
||||
}
|
||||
return "Cannot find product $component_product for component $component." if ( $product_id eq "" );
|
||||
|
||||
# Find the component identifier for the product's componet
|
||||
my $product = Bugzilla::Testopia::Product->new($product_id);
|
||||
my $components_ref = $product->components;
|
||||
foreach my $product_component ( @$components_ref )
|
||||
{
|
||||
if ( $component eq $product_component->name )
|
||||
{
|
||||
$component_id = $product_component->id;
|
||||
last;
|
||||
}
|
||||
}
|
||||
return "Product $component_product does not have a component named $component." if ( $component_id eq "" );
|
||||
|
||||
# Save the component identifier for this Test Case.
|
||||
push @{$self->component_ids}, $component_id;
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
sub debug_display()
|
||||
{
|
||||
my ($self) = @_;
|
||||
my $display_variable = "";
|
||||
{
|
||||
my ($self) = @_;
|
||||
my $display_variable = "";
|
||||
|
||||
my %text = %{$self->testcase->text()} if ( defined $self->testcase->text() );
|
||||
print STDERR "Testcase: " . $self->testcase->summary() . "\n";
|
||||
my $testcase_id = "null";
|
||||
$testcase_id = $self->testcase->id() if ( $self->testcase->id() );
|
||||
print STDERR " ID " . $testcase_id . "\n";
|
||||
print STDERR " Action\n";
|
||||
if ( defined $text{'action'} )
|
||||
{
|
||||
my @results = split(/\n/,$text{'action'});
|
||||
foreach my $result (@results)
|
||||
{
|
||||
print STDERR " $result\n";
|
||||
}
|
||||
}
|
||||
my $alias = "null";
|
||||
$alias = $self->testcase-alias() if ( $self->testcase->alias() );
|
||||
print STDERR " Alias " . $alias . "\n";
|
||||
my %author = %{$self->testcase->author()};
|
||||
my $author_id = $author{"id"};
|
||||
my $author_login = $author{"login"};
|
||||
print STDERR " Author " . $author_login . " (id=" . $author_id . ", hash=" . $self->testcase->author() . ")\n";
|
||||
print STDERR " Blocks " . $self->blocks->display() . "\n";
|
||||
print STDERR " Category " . $self->category . "\n";
|
||||
print STDERR " Depends On " . $self->dependson->display() . "\n";
|
||||
print STDERR " Expected Results\n";
|
||||
if ( defined $text{'effect'} )
|
||||
{
|
||||
my @results = split(/\n/,$text{'effect'});
|
||||
foreach my $result (@results)
|
||||
{
|
||||
print STDERR " $result\n";
|
||||
}
|
||||
}
|
||||
print STDERR " Summary " . $self->testcase->summary() . "\n";
|
||||
#TODO:print STDERR " Default Product Version " . $self->testcase->product_version() . "\n";
|
||||
#TODO:print STDERR " Document " . $self->testcase->text() . "\n";
|
||||
my %tester = %{$self->testcase->default_tester()};
|
||||
my $tester_id = $tester{"id"};
|
||||
my $tester_login = $tester{"login"};
|
||||
print STDERR " Tester " . $tester_login . " (id=" . $tester_id . ", hash=" . $self->testcase->default_tester() . ")\n";
|
||||
print STDERR " Is Automated " . $self->testcase->isautomated() . "\n";
|
||||
#TODO:print STDERR " Plans " . $self->testcase->plans() . "\n";
|
||||
#TODO:print STDERR " Priority " . $self->testcase->priority_id() . "\n";
|
||||
#TODO:print STDERR " Product " . $self->testcase->product_id() . "\n";
|
||||
print STDERR " Requirement " . $self->testcase->requirement() . "\n";
|
||||
print STDERR "Testcase: " . $self->testcase->summary() . "\n";
|
||||
my $testcase_id = "null";
|
||||
$testcase_id = $self->testcase->id() if ( $self->testcase->id() );
|
||||
print STDERR " ID " . $testcase_id . "\n";
|
||||
print STDERR " Action\n";
|
||||
if ( defined $text{'action'} )
|
||||
{
|
||||
my @results = split(/\n/,$text{'action'});
|
||||
foreach my $result (@results)
|
||||
{
|
||||
print STDERR " $result\n";
|
||||
}
|
||||
}
|
||||
my $alias = "null";
|
||||
$alias = $self->testcase-alias() if ( $self->testcase->alias() );
|
||||
print STDERR " Alias " . $alias . "\n";
|
||||
my %author = %{$self->testcase->author()};
|
||||
my $author_id = $author{"id"};
|
||||
my $author_login = $author{"login"};
|
||||
print STDERR " Author " . $author_login . " (id=" . $author_id . ", hash=" . $self->testcase->author() . ")\n";
|
||||
print STDERR " Blocks " . $self->blocks->display() . "\n";
|
||||
print STDERR " Category " . $self->category . "\n";
|
||||
print STDERR " Depends On " . $self->dependson->display() . "\n";
|
||||
print STDERR " Expected Results\n";
|
||||
if ( defined $text{'effect'} )
|
||||
{
|
||||
my @results = split(/\n/,$text{'effect'});
|
||||
foreach my $result (@results)
|
||||
{
|
||||
print STDERR " $result\n";
|
||||
}
|
||||
}
|
||||
print STDERR " Summary " . $self->testcase->summary() . "\n";
|
||||
#TODO:print STDERR " Default Product Version " . $self->testcase->product_version() . "\n";
|
||||
#TODO:print STDERR " Document " . $self->testcase->text() . "\n";
|
||||
my %tester = %{$self->testcase->default_tester()};
|
||||
my $tester_id = $tester{"id"};
|
||||
my $tester_login = $tester{"login"};
|
||||
print STDERR " Tester " . $tester_login . " (id=" . $tester_id . ", hash=" . $self->testcase->default_tester() . ")\n";
|
||||
print STDERR " Is Automated " . $self->testcase->isautomated() . "\n";
|
||||
#TODO:print STDERR " Plans " . $self->testcase->plans() . "\n";
|
||||
#TODO:print STDERR " Priority " . $self->testcase->priority_id() . "\n";
|
||||
#TODO:print STDERR " Product " . $self->testcase->product_id() . "\n";
|
||||
print STDERR " Requirement " . $self->testcase->requirement() . "\n";
|
||||
|
||||
print STDERR " Script " . $self->testcase->script() . "\n";
|
||||
print STDERR " Script Arguments " . $self->testcase->arguments() . "\n";
|
||||
print STDERR " Status " . $self->testcase->status() . "\n";
|
||||
|
||||
foreach my $tag (@{$self->tags})
|
||||
{
|
||||
print STDERR " Tag " . $tag . "\n";
|
||||
}
|
||||
|
||||
my @attachments = @{$self->testcase->attachments()};
|
||||
foreach my $attachment (@attachments)
|
||||
{
|
||||
my %submitter = %{$self->testcase->submitter()};
|
||||
$author_login = $author{"login"};
|
||||
print STDERR " Attachment " . $attachment->description() . "\n";
|
||||
print STDERR " Filename " . $attachment->filename() . "\n";
|
||||
print STDERR " Mime Type " . $attachment->mime_type(). "\n";
|
||||
print STDERR " Submitter " . $author_login . "\n";
|
||||
}
|
||||
print STDERR " Script " . $self->testcase->script() . "\n";
|
||||
print STDERR " Script Arguments " . $self->testcase->arguments() . "\n";
|
||||
print STDERR " Status " . $self->testcase->status() . "\n";
|
||||
|
||||
foreach my $tag (@{$self->tags})
|
||||
{
|
||||
print STDERR " Tag " . $tag . "\n";
|
||||
}
|
||||
|
||||
my @attachments = @{$self->testcase->attachments()};
|
||||
foreach my $attachment (@attachments)
|
||||
{
|
||||
my %submitter = %{$self->testcase->submitter()};
|
||||
$author_login = $author{"login"};
|
||||
print STDERR " Attachment " . $attachment->description() . "\n";
|
||||
print STDERR " Filename " . $attachment->filename() . "\n";
|
||||
print STDERR " Mime Type " . $attachment->mime_type(). "\n";
|
||||
print STDERR " Submitter " . $author_login . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub get_testcase_ids()
|
||||
{
|
||||
my ($self, $field, @new_testcases) = @_;
|
||||
my $error_message = "";
|
||||
|
||||
my @testcase_id = @{$self->$field->get(uc $Bugzilla::Testopia::Xml::DATABASE_ID)};
|
||||
|
||||
foreach my $testcase_summary ( @{$self->$field->get(uc $Bugzilla::Testopia::Xml::XML_DESCRIPTION)} )
|
||||
{
|
||||
foreach my $testcase (@new_testcases)
|
||||
{
|
||||
push @testcase_id, $testcase->testcase->id() if ( $testcase->testcase->summary() eq $testcase_summary );
|
||||
}
|
||||
}
|
||||
|
||||
#TODO Testplans using Database_Description
|
||||
foreach my $testcase_summary ( @{$self->$field->get(uc $Bugzilla::Testopia::Xml::DATABASE_DESCRIPTION)} )
|
||||
{
|
||||
$error_message .= "\n" if ( $error_message ne "" );
|
||||
$error_message .= "Have not implemented code for $Bugzilla::Testopia::Xml::DATABASE_DESCRIPTION lookup for blocking test case " . $testcase_summary . "' for Test Case '". $self->testcase->summary . "'.";
|
||||
}
|
||||
return $error_message if ( $error_message ne "" );
|
||||
|
||||
my @return_testcase_id;
|
||||
foreach my $testcase_id (@testcase_id)
|
||||
{
|
||||
my $testcase = Bugzilla::Testopia::TestCase->new($testcase_id);
|
||||
if ( ! defined($testcase) )
|
||||
{
|
||||
$error_message .= "\n" if ( $error_message ne "" );
|
||||
$error_message .= "Could not find blocking Test Case '" . $testcase_id . "' for Test Case '". $self->testcase->summary . "'.";
|
||||
}
|
||||
else
|
||||
{
|
||||
push @return_testcase_id, $testcase->id();
|
||||
}
|
||||
}
|
||||
return $error_message if ( $error_message ne "" );
|
||||
|
||||
return @return_testcase_id;
|
||||
my ($self, $field, @new_testcases) = @_;
|
||||
my $error_message = "";
|
||||
|
||||
my @testcase_id = @{$self->$field->get(uc $Bugzilla::Testopia::Xml::DATABASE_ID)};
|
||||
|
||||
foreach my $testcase_summary ( @{$self->$field->get(uc $Bugzilla::Testopia::Xml::XML_DESCRIPTION)} )
|
||||
{
|
||||
foreach my $testcase (@new_testcases)
|
||||
{
|
||||
push @testcase_id, $testcase->testcase->id() if ( $testcase->testcase->summary() eq $testcase_summary );
|
||||
}
|
||||
}
|
||||
|
||||
#TODO Testplans using Database_Description
|
||||
foreach my $testcase_summary ( @{$self->$field->get(uc $Bugzilla::Testopia::Xml::DATABASE_DESCRIPTION)} )
|
||||
{
|
||||
$error_message .= "\n" if ( $error_message ne "" );
|
||||
$error_message .= "Have not implemented code for $Bugzilla::Testopia::Xml::DATABASE_DESCRIPTION lookup for blocking test case " . $testcase_summary . "' for Test Case '". $self->testcase->summary . "'.";
|
||||
}
|
||||
return $error_message if ( $error_message ne "" );
|
||||
|
||||
my @return_testcase_id;
|
||||
foreach my $testcase_id (@testcase_id)
|
||||
{
|
||||
my $testcase = Bugzilla::Testopia::TestCase->new($testcase_id);
|
||||
if ( ! defined($testcase) )
|
||||
{
|
||||
$error_message .= "\n" if ( $error_message ne "" );
|
||||
$error_message .= "Could not find blocking Test Case '" . $testcase_id . "' for Test Case '". $self->testcase->summary . "'.";
|
||||
}
|
||||
else
|
||||
{
|
||||
push @return_testcase_id, $testcase->id();
|
||||
}
|
||||
}
|
||||
return $error_message if ( $error_message ne "" );
|
||||
|
||||
return @return_testcase_id;
|
||||
}
|
||||
|
||||
=head2 store
|
||||
@@ -270,94 +270,94 @@ attachments and categories.
|
||||
|
||||
sub store()
|
||||
{
|
||||
my ($self, @new_testplans) = @_;
|
||||
my $error_message = "";
|
||||
my @testplan_id = @{$self->testplan->get(uc $Bugzilla::Testopia::Xml::DATABASE_ID)};
|
||||
|
||||
# If we have any references to test plans from the XML data we need to search the @new_testplans
|
||||
# array to find the actual test plan id. The new_testplans array contains all test plans created
|
||||
# from the XML.
|
||||
# Order of looping does not matter, number of test plans associated to each test case should be small.
|
||||
foreach my $testplan_name ( @{$self->testplan->get(uc $Bugzilla::Testopia::Xml::XML_DESCRIPTION)} )
|
||||
{
|
||||
foreach my $testplan (@new_testplans)
|
||||
{
|
||||
push @testplan_id, $testplan->id() if ( $testplan->name() eq $testplan_name );
|
||||
}
|
||||
}
|
||||
|
||||
#TODO Testplans using Database_Description
|
||||
foreach my $testplan_name ( @{$self->testplan->get(uc $Bugzilla::Testopia::Xml::DATABASE_DESCRIPTION)} )
|
||||
{
|
||||
$error_message .= "\n" if ( $error_message ne "" );
|
||||
$error_message .= "Have not implemented code for $Bugzilla::Testopia::Xml::DATABASE_DESCRIPTION lookup of test plan " . $testplan_name . "' for Test Case '". $self->testcase->summary . "'.";
|
||||
}
|
||||
return $error_message if ( $error_message ne "" );
|
||||
|
||||
# Have to have a testplan to determine valid categories for testcase.
|
||||
return "Test Case '" . $self->testcase->summary . "' needs a Test Plan." if ( $#testplan_id == -1 );
|
||||
|
||||
# Verify that each testplan exists.
|
||||
my @testplan;
|
||||
foreach my $testplan_id (@testplan_id)
|
||||
{
|
||||
my $testplan = Bugzilla::Testopia::TestPlan->new($testplan_id);
|
||||
if ( ! defined($testplan) )
|
||||
{
|
||||
$error_message .= "\n" if ( $error_message ne "" );
|
||||
$error_message .= "Could not find Test Plan '" . $testplan_id . "' for Test Case '". $self->testcase->summary . "'.";
|
||||
}
|
||||
else
|
||||
{
|
||||
push @testplan, $testplan;
|
||||
}
|
||||
}
|
||||
return $error_message if ( $error_message ne "" );
|
||||
|
||||
# Verify that each testplan has the testcase's category associated to it. If the category does not
|
||||
# exist it will be created.
|
||||
foreach my $testplan (@testplan)
|
||||
{
|
||||
my $category = $testplan->product->categories->[0];
|
||||
my $categoryid = $category->check_name($self->category) if ( defined($category) );
|
||||
if ( ! defined($categoryid) )
|
||||
{
|
||||
my $new_category = Bugzilla::Testopia::Category->new({
|
||||
product_id => $testplan->product_id,
|
||||
name => $self->category,
|
||||
description => "FIX ME. Created during Test Plan import."
|
||||
});
|
||||
$categoryid = $new_category->store();
|
||||
}
|
||||
$self->testcase->{'category_id'} = $categoryid if ( ! defined($self->testcase->{'category_id'}) );
|
||||
my ($self, @new_testplans) = @_;
|
||||
my $error_message = "";
|
||||
my @testplan_id = @{$self->testplan->get(uc $Bugzilla::Testopia::Xml::DATABASE_ID)};
|
||||
|
||||
# If we have any references to test plans from the XML data we need to search the @new_testplans
|
||||
# array to find the actual test plan id. The new_testplans array contains all test plans created
|
||||
# from the XML.
|
||||
# Order of looping does not matter, number of test plans associated to each test case should be small.
|
||||
foreach my $testplan_name ( @{$self->testplan->get(uc $Bugzilla::Testopia::Xml::XML_DESCRIPTION)} )
|
||||
{
|
||||
foreach my $testplan (@new_testplans)
|
||||
{
|
||||
push @testplan_id, $testplan->id() if ( $testplan->name() eq $testplan_name );
|
||||
}
|
||||
}
|
||||
my $case_id = $self->testcase->store();
|
||||
$self->testcase->{'case_id'} = $case_id;
|
||||
foreach my $attachment ( @{$self->attachments} )
|
||||
{
|
||||
$attachment->{'case_id'} = $case_id;
|
||||
$attachment->store();
|
||||
}
|
||||
foreach my $asciitag ( @{$self->tags} )
|
||||
{
|
||||
my $classtag = Bugzilla::Testopia::TestTag->new({'tag_name' => $asciitag});
|
||||
my $tagid = $classtag->store;
|
||||
$self->testcase->add_tag($tagid);
|
||||
}
|
||||
|
||||
# Link the testcase to each of it's testplans.
|
||||
foreach my $testplan ( @testplan )
|
||||
{
|
||||
$self->testcase->link_plan($testplan->id(),$case_id)
|
||||
}
|
||||
|
||||
# Code below requires the testplans to be linked into testcases before being run.
|
||||
foreach my $component_id ( @{$self->component_ids} )
|
||||
{
|
||||
$self->testcase->add_component($component_id);
|
||||
}
|
||||
|
||||
return $error_message;
|
||||
|
||||
#TODO Testplans using Database_Description
|
||||
foreach my $testplan_name ( @{$self->testplan->get(uc $Bugzilla::Testopia::Xml::DATABASE_DESCRIPTION)} )
|
||||
{
|
||||
$error_message .= "\n" if ( $error_message ne "" );
|
||||
$error_message .= "Have not implemented code for $Bugzilla::Testopia::Xml::DATABASE_DESCRIPTION lookup of test plan " . $testplan_name . "' for Test Case '". $self->testcase->summary . "'.";
|
||||
}
|
||||
return $error_message if ( $error_message ne "" );
|
||||
|
||||
# Have to have a testplan to determine valid categories for testcase.
|
||||
return "Test Case '" . $self->testcase->summary . "' needs a Test Plan." if ( $#testplan_id == -1 );
|
||||
|
||||
# Verify that each testplan exists.
|
||||
my @testplan;
|
||||
foreach my $testplan_id (@testplan_id)
|
||||
{
|
||||
my $testplan = Bugzilla::Testopia::TestPlan->new($testplan_id);
|
||||
if ( ! defined($testplan) )
|
||||
{
|
||||
$error_message .= "\n" if ( $error_message ne "" );
|
||||
$error_message .= "Could not find Test Plan '" . $testplan_id . "' for Test Case '". $self->testcase->summary . "'.";
|
||||
}
|
||||
else
|
||||
{
|
||||
push @testplan, $testplan;
|
||||
}
|
||||
}
|
||||
return $error_message if ( $error_message ne "" );
|
||||
|
||||
# Verify that each testplan has the testcase's category associated to it. If the category does not
|
||||
# exist it will be created.
|
||||
foreach my $testplan (@testplan)
|
||||
{
|
||||
my $category = $testplan->product->categories->[0];
|
||||
my $categoryid = $category->check_name($self->category) if ( defined($category) );
|
||||
if ( ! defined($categoryid) )
|
||||
{
|
||||
my $new_category = Bugzilla::Testopia::Category->new({
|
||||
product_id => $testplan->product_id,
|
||||
name => $self->category,
|
||||
description => "FIX ME. Created during Test Plan import."
|
||||
});
|
||||
$categoryid = $new_category->store();
|
||||
}
|
||||
$self->testcase->{'category_id'} = $categoryid if ( ! defined($self->testcase->{'category_id'}) );
|
||||
}
|
||||
my $case_id = $self->testcase->store();
|
||||
$self->testcase->{'case_id'} = $case_id;
|
||||
foreach my $attachment ( @{$self->attachments} )
|
||||
{
|
||||
$attachment->{'case_id'} = $case_id;
|
||||
$attachment->store();
|
||||
}
|
||||
foreach my $asciitag ( @{$self->tags} )
|
||||
{
|
||||
my $classtag = Bugzilla::Testopia::TestTag->new({'tag_name' => $asciitag});
|
||||
my $tagid = $classtag->store;
|
||||
$self->testcase->add_tag($tagid);
|
||||
}
|
||||
|
||||
# Link the testcase to each of it's testplans.
|
||||
foreach my $testplan ( @testplan )
|
||||
{
|
||||
$self->testcase->link_plan($testplan->id(),$case_id)
|
||||
}
|
||||
|
||||
# Code below requires the testplans to be linked into testcases before being run.
|
||||
foreach my $component_id ( @{$self->component_ids} )
|
||||
{
|
||||
$self->testcase->add_component($component_id);
|
||||
}
|
||||
|
||||
return $error_message;
|
||||
}
|
||||
|
||||
=head2 store_relationships
|
||||
@@ -371,39 +371,39 @@ been stored.
|
||||
|
||||
sub store_relationships()
|
||||
{
|
||||
my ($self, @new_testcases) = @_;
|
||||
my ($self, @new_testcases) = @_;
|
||||
|
||||
# Hashes are used because the entires in blocks and dependson must be unique.
|
||||
my %blocks = ();
|
||||
foreach my $block ( $self->get_testcase_ids("blocks",@new_testcases) )
|
||||
{
|
||||
$blocks{$block}++;
|
||||
}
|
||||
my $blocks_size = keys( %blocks );
|
||||
my %dependson = ();
|
||||
foreach my $dependson ( $self->get_testcase_ids("dependson",@new_testcases) )
|
||||
{
|
||||
$dependson{$dependson}++;
|
||||
}
|
||||
my $dependson_size = keys( %dependson );
|
||||
|
||||
# Hashes are used because the entires in blocks and dependson must be unique.
|
||||
my %blocks = ();
|
||||
foreach my $block ( $self->get_testcase_ids("blocks",@new_testcases) )
|
||||
{
|
||||
$blocks{$block}++;
|
||||
}
|
||||
my $blocks_size = keys( %blocks );
|
||||
my %dependson = ();
|
||||
foreach my $dependson ( $self->get_testcase_ids("dependson",@new_testcases) )
|
||||
{
|
||||
$dependson{$dependson}++;
|
||||
}
|
||||
my $dependson_size = keys( %dependson );
|
||||
|
||||
|
||||
if ( ( $blocks_size > 0 ) || ( $dependson_size > 0 ) )
|
||||
{
|
||||
# Need to add the current blocks and dependson from the Test Case; otherwise, they will
|
||||
# be removed.
|
||||
foreach my $block ( split(/ /,$self->testcase->blocked_list_uncached()) )
|
||||
{
|
||||
$blocks{$block}++;
|
||||
}
|
||||
foreach my $dependson ( split(/ /,$self->testcase->dependson_list_uncached()) )
|
||||
{
|
||||
$dependson{$dependson}++;
|
||||
}
|
||||
my @blocks = keys(%blocks);
|
||||
my @dependson = keys(%dependson);
|
||||
$self->testcase->update_deps( join(' ',@dependson ),join(' ',@blocks) );
|
||||
}
|
||||
if ( ( $blocks_size > 0 ) || ( $dependson_size > 0 ) )
|
||||
{
|
||||
# Need to add the current blocks and dependson from the Test Case; otherwise, they will
|
||||
# be removed.
|
||||
foreach my $block ( split(/ /,$self->testcase->blocked_list_uncached()) )
|
||||
{
|
||||
$blocks{$block}++;
|
||||
}
|
||||
foreach my $dependson ( split(/ /,$self->testcase->dependson_list_uncached()) )
|
||||
{
|
||||
$dependson{$dependson}++;
|
||||
}
|
||||
my @blocks = keys(%blocks);
|
||||
my @dependson = keys(%dependson);
|
||||
$self->testcase->update_deps( join(' ',@dependson ),join(' ',@blocks) );
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
@@ -100,7 +100,7 @@ sub make_fault
|
||||
{
|
||||
my $self = shift;
|
||||
|
||||
# RPC Fault Code must be an integer
|
||||
# RPC Fault Code must be an integer
|
||||
$self->SUPER::make_fault(ERROR_FAULT_SERVER, $_[1]);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,15 +30,15 @@ sub get
|
||||
|
||||
$self->login;
|
||||
|
||||
#Result is a test plan hash map
|
||||
#Result is a test plan hash map
|
||||
my $build = new Bugzilla::Testopia::Build($build_id);
|
||||
|
||||
if (not defined $build)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $build)
|
||||
{
|
||||
$self->logout;
|
||||
die "Build, " . $build_id . ", not found";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$self->logout;
|
||||
|
||||
return $build;
|
||||
@@ -46,45 +46,45 @@ sub get
|
||||
|
||||
sub create
|
||||
{
|
||||
my $self = shift;
|
||||
my ($new_values) = @_; # Required: name, product_id
|
||||
my $self = shift;
|
||||
my ($new_values) = @_; # Required: name, product_id
|
||||
|
||||
$self->login;
|
||||
|
||||
my $build = new Bugzilla::Testopia::Build($new_values);
|
||||
|
||||
my $name = $$new_values{name};
|
||||
|
||||
my $build = new Bugzilla::Testopia::Build($new_values);
|
||||
|
||||
my $name = $$new_values{name};
|
||||
|
||||
if (defined($name) && $build->check_name($name))
|
||||
{
|
||||
die "Build name, " . $name . ", already exists";
|
||||
}
|
||||
|
||||
my $result = $build->store();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is new build id
|
||||
return $result;
|
||||
my $result = $build->store();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is new build id
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub update
|
||||
{
|
||||
my $self =shift;
|
||||
my ($build_id, $new_values) = @_; # Modifiable: name, description, milestone
|
||||
my $self =shift;
|
||||
my ($build_id, $new_values) = @_; # Modifiable: name, description, milestone
|
||||
|
||||
$self->login;
|
||||
|
||||
my $build = new Bugzilla::Testopia::Build($build_id);
|
||||
|
||||
if (not defined $build)
|
||||
{
|
||||
$self->logout;
|
||||
my $build = new Bugzilla::Testopia::Build($build_id);
|
||||
|
||||
if (not defined $build)
|
||||
{
|
||||
$self->logout;
|
||||
die "Build, " . $build_id . ", not found";
|
||||
}
|
||||
|
||||
my $name = $$new_values{name};
|
||||
|
||||
}
|
||||
|
||||
my $name = $$new_values{name};
|
||||
|
||||
if (defined($name) && $build->check_name($name))
|
||||
{
|
||||
die "Build name, " . $name . ", already exists";
|
||||
@@ -103,12 +103,12 @@ sub update
|
||||
$description,
|
||||
$milestone);
|
||||
|
||||
$build = new Bugzilla::Testopia::Build($build_id);
|
||||
|
||||
$self->logout;
|
||||
$build = new Bugzilla::Testopia::Build($build_id);
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is modified build, otherwise an exception will be thrown
|
||||
return $build;
|
||||
# Result is modified build, otherwise an exception will be thrown
|
||||
return $build;
|
||||
}
|
||||
|
||||
sub lookup_name_by_id
|
||||
|
||||
@@ -72,24 +72,24 @@ sub get_milestones
|
||||
|
||||
my $product = new Bugzilla::Testopia::Product($product_id);
|
||||
|
||||
if (not defined $product)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $product)
|
||||
{
|
||||
$self->logout;
|
||||
die "Product, " . $product_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $product->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $product->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $product->milestones;
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is list of milestones for the given product
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result is list of milestones for the given product
|
||||
return $result;
|
||||
}
|
||||
|
||||
#sub get_product
|
||||
|
||||
@@ -35,18 +35,18 @@ sub _list
|
||||
|
||||
foreach (keys(%$query))
|
||||
{
|
||||
$cgi->param($_, $$query{$_});
|
||||
$cgi->param($_, $$query{$_});
|
||||
}
|
||||
|
||||
|
||||
my $search = Bugzilla::Testopia::Search->new($cgi);
|
||||
|
||||
# Result is an array of test plan hash maps
|
||||
return Bugzilla::Testopia::Table->new('case',
|
||||
'tr_xmlrpc.cgi',
|
||||
$cgi,
|
||||
undef,
|
||||
$search->query()
|
||||
)->list();
|
||||
# Result is an array of test plan hash maps
|
||||
return Bugzilla::Testopia::Table->new('case',
|
||||
'tr_xmlrpc.cgi',
|
||||
$cgi,
|
||||
undef,
|
||||
$search->query()
|
||||
)->list();
|
||||
}
|
||||
|
||||
sub get
|
||||
@@ -58,21 +58,21 @@ sub get
|
||||
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testcase, " . $test_case_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_case->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_case->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
$self->logout;
|
||||
|
||||
#Result is a test case hash map
|
||||
#Result is a test case hash map
|
||||
return $test_case;
|
||||
}
|
||||
|
||||
@@ -83,135 +83,135 @@ sub list
|
||||
|
||||
$self->login;
|
||||
|
||||
my $list = _list($query);
|
||||
|
||||
my $list = _list($query);
|
||||
|
||||
$self->logout;
|
||||
|
||||
return $list;
|
||||
return $list;
|
||||
}
|
||||
|
||||
sub create
|
||||
{
|
||||
my $self =shift;
|
||||
my ($new_values) = @_;
|
||||
|
||||
if (not defined $$new_values{plan_id})
|
||||
{
|
||||
die "Plan ID Number (plan_id) Required When Creating A TestCase"
|
||||
}
|
||||
my $self =shift;
|
||||
my ($new_values) = @_;
|
||||
|
||||
if (not defined $$new_values{plan_id})
|
||||
{
|
||||
die "Plan ID Number (plan_id) Required When Creating A TestCase"
|
||||
}
|
||||
|
||||
# Plan id linked to new test case after store method is called
|
||||
my $plan_id = $$new_values{plan_id};
|
||||
my $plan_id = $$new_values{plan_id};
|
||||
|
||||
# Remove plan id from new_values hash
|
||||
delete $$new_values{plan_id};
|
||||
# Remove plan id from new_values hash
|
||||
delete $$new_values{plan_id};
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($new_values);
|
||||
|
||||
# Result is test plan id
|
||||
my $result = $test_case->store();
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($new_values);
|
||||
|
||||
# Result is test plan id
|
||||
my $result = $test_case->store();
|
||||
|
||||
$test_case->link_plan($plan_id, $result);
|
||||
|
||||
$self->logout;
|
||||
$test_case->link_plan($plan_id, $result);
|
||||
|
||||
$self->logout;
|
||||
|
||||
return $result
|
||||
return $result
|
||||
}
|
||||
|
||||
sub update
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_case_id, $new_values) = @_;
|
||||
my $self =shift;
|
||||
my ($test_case_id, $new_values) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testcase, " . $test_case_id . ", not found";
|
||||
}
|
||||
}
|
||||
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
if (defined $$new_values{author_id})
|
||||
{
|
||||
die "Update of TestCase's author_id is not allowed";
|
||||
}
|
||||
if (defined $$new_values{author_id})
|
||||
{
|
||||
die "Update of TestCase's author_id is not allowed";
|
||||
}
|
||||
|
||||
my $result = $test_case->update($new_values);
|
||||
|
||||
$test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
$test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is modified test case on success, otherwise an exception will be thrown
|
||||
return $test_case;
|
||||
$self->logout;
|
||||
|
||||
# Result is modified test case on success, otherwise an exception will be thrown
|
||||
return $test_case;
|
||||
}
|
||||
|
||||
sub get_text
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_case_id) = @_;
|
||||
my $self =shift;
|
||||
my ($test_case_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testcase, " . $test_case_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_case->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_case->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $doc = $test_case->text();
|
||||
my $doc = $test_case->text();
|
||||
|
||||
$self->logout;
|
||||
|
||||
#Result is the latest test case doc hash map
|
||||
return $doc;
|
||||
$self->logout;
|
||||
|
||||
#Result is the latest test case doc hash map
|
||||
return $doc;
|
||||
}
|
||||
|
||||
sub store_text
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_case_id, $author_id, $action, $effect, $setup, $breakdown) = @_;
|
||||
my $self =shift;
|
||||
my ($test_case_id, $author_id, $action, $effect, $setup, $breakdown) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testcase, " . $test_case_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $version = $test_case->store_text($test_case_id, $author_id, $action, $effect, $setup, $breakdown);
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is new test case doc version on success, otherwise an exception will be thrown
|
||||
return $version;
|
||||
my $version = $test_case->store_text($test_case_id, $author_id, $action, $effect, $setup, $breakdown);
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is new test case doc version on success, otherwise an exception will be thrown
|
||||
return $version;
|
||||
}
|
||||
|
||||
sub get_plans
|
||||
@@ -223,24 +223,24 @@ sub get_plans
|
||||
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testcase, " . $test_case_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_case->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_case->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_case->plans();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is list of test plans for the given test case
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result is list of test plans for the given test case
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub get_bugs
|
||||
@@ -252,137 +252,137 @@ sub get_bugs
|
||||
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testcase, " . $test_case_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_case->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_case->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_case->bugs;
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is list of bugs for the given test case
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result is list of bugs for the given test case
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub add_component
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_case_id, $component_id) = @_;
|
||||
my $self =shift;
|
||||
my ($test_case_id, $component_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testcase, " . $test_case_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_case->add_component($component_id);
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return 0;
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub remove_component
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_case_id, $component_id) = @_;
|
||||
my $self =shift;
|
||||
my ($test_case_id, $component_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testcase, " . $test_case_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_case->remove_component($component_id);
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return 0;
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub get_components
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_case_id) = @_;
|
||||
my $self =shift;
|
||||
my ($test_case_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testcase, " . $test_case_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_case->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_case->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_case->components();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result list of components otherwise an exception will be thrown
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result list of components otherwise an exception will be thrown
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub add_tag
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_case_id, $tag_name) = @_;
|
||||
my $self =shift;
|
||||
my ($test_case_id, $tag_name) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testcase, " . $test_case_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
|
||||
#Create new tag or retrieve id of existing tag
|
||||
my $test_tag = new Bugzilla::Testopia::TestTag({tag_name=>$tag_name});
|
||||
my $tag_id = $test_tag->store;
|
||||
}
|
||||
|
||||
#Create new tag or retrieve id of existing tag
|
||||
my $test_tag = new Bugzilla::Testopia::TestTag({tag_name=>$tag_name});
|
||||
my $tag_id = $test_tag->store;
|
||||
|
||||
my $result = $test_case->add_tag($tag_id);
|
||||
|
||||
@@ -392,32 +392,32 @@ sub add_tag
|
||||
die "Tag, " . $tag_name . ", already exists for Testcase, " . $test_case_id;
|
||||
}
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub remove_tag
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_case_id, $tag_name) = @_;
|
||||
my $self =shift;
|
||||
my ($test_case_id, $tag_name) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testcase, " . $test_case_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $test_tag = Bugzilla::Testopia::TestTag->check_name($tag_name);
|
||||
if (not defined $test_tag)
|
||||
@@ -428,59 +428,59 @@ sub remove_tag
|
||||
|
||||
my $result = $test_case->remove_tag($test_tag->id);
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return 0;
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub get_tags
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_case_id) = @_;
|
||||
my $self =shift;
|
||||
my ($test_case_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testcase, " . $test_case_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_case->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_case->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_case->tags;
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result list of tags otherwise an exception will be thrown
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result list of tags otherwise an exception will be thrown
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub lookup_status_id_by_name
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($name) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $result = Bugzilla::Testopia::TestCase::lookup_status_by_name($name);
|
||||
my $result = Bugzilla::Testopia::TestCase::lookup_status_by_name($name);
|
||||
|
||||
$self->logout;
|
||||
$self->logout;
|
||||
|
||||
# Result is test case status id for the given test case status name
|
||||
return $result;
|
||||
# Result is test case status id for the given test case status name
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub lookup_status_name_by_id
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($id) = @_;
|
||||
|
||||
$self->login;
|
||||
@@ -489,35 +489,35 @@ sub lookup_status_name_by_id
|
||||
|
||||
my $result = $test_case->lookup_status($id);
|
||||
|
||||
$self->logout;
|
||||
$self->logout;
|
||||
|
||||
if (!defined $result)
|
||||
{
|
||||
$result = 0;
|
||||
};
|
||||
|
||||
# Result is test case status name for the given test case status id
|
||||
return $result;
|
||||
|
||||
# Result is test case status name for the given test case status id
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub lookup_category_id_by_name
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($name) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $result = Bugzilla::Testopia::TestCase::lookup_category_by_name($name);
|
||||
my $result = Bugzilla::Testopia::TestCase::lookup_category_by_name($name);
|
||||
|
||||
$self->logout;
|
||||
$self->logout;
|
||||
|
||||
# Result is test case category id for the given test case category name
|
||||
return $result;
|
||||
# Result is test case category id for the given test case category name
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub lookup_category_name_by_id
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($id) = @_;
|
||||
|
||||
$self->login;
|
||||
@@ -526,35 +526,35 @@ sub lookup_category_name_by_id
|
||||
|
||||
my $result = $test_case->lookup_category($id);
|
||||
|
||||
$self->logout;
|
||||
$self->logout;
|
||||
|
||||
if (!defined $result)
|
||||
{
|
||||
$result = 0;
|
||||
};
|
||||
|
||||
# Result is test case category name for the given test case category id
|
||||
return $result;
|
||||
|
||||
# Result is test case category name for the given test case category id
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub lookup_priority_id_by_name
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($name) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $result = Bugzilla::Testopia::TestCase::lookup_priority_by_value($name);
|
||||
my $result = Bugzilla::Testopia::TestCase::lookup_priority_by_value($name);
|
||||
|
||||
$self->logout;
|
||||
$self->logout;
|
||||
|
||||
# Result is test case priority id for the given test case priority name
|
||||
return $result;
|
||||
# Result is test case priority id for the given test case priority name
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub lookup_priority_name_by_id
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($id) = @_;
|
||||
|
||||
$self->login;
|
||||
@@ -563,83 +563,83 @@ sub lookup_priority_name_by_id
|
||||
|
||||
my $result = $test_case->lookup_priority($id);
|
||||
|
||||
$self->logout;
|
||||
$self->logout;
|
||||
|
||||
if (!defined $result)
|
||||
{
|
||||
$result = 0;
|
||||
};
|
||||
|
||||
# Result is test case priority name for the given test case priority id
|
||||
return $result;
|
||||
|
||||
# Result is test case priority name for the given test case priority id
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub link_plan
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_case_id, $test_plan_id) = @_;
|
||||
my $self =shift;
|
||||
my ($test_case_id, $test_plan_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testcase, " . $test_case_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
$test_case->link_plan($test_plan_id);
|
||||
|
||||
my $result = $test_case->plans;
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is list of plans for test case on success, otherwise an exception will be thrown
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result is list of plans for test case on success, otherwise an exception will be thrown
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub unlink_plan
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_case_id, $test_plan_id) = @_;
|
||||
my $self =shift;
|
||||
my ($test_case_id, $test_plan_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
my $test_case = new Bugzilla::Testopia::TestCase($test_case_id);
|
||||
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testcase, " . $test_case_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_case->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $rtn_code = $test_case->unlink_plan($test_plan_id);
|
||||
|
||||
if ($rtn_code == 0)
|
||||
{
|
||||
$self->logout;
|
||||
$self->logout;
|
||||
die "User Can Not Unlink Plan, " . $test_plan_id;
|
||||
}
|
||||
|
||||
my $result = $test_case->plans;
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is list of plans for test case on success, otherwise an exception will be thrown
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result is list of plans for test case on success, otherwise an exception will be thrown
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -37,18 +37,18 @@ sub _list
|
||||
|
||||
foreach (keys(%$query))
|
||||
{
|
||||
$cgi->param($_, $$query{$_});
|
||||
$cgi->param($_, $$query{$_});
|
||||
}
|
||||
|
||||
|
||||
my $search = Bugzilla::Testopia::Search->new($cgi);
|
||||
|
||||
# Result is an array of test case run hash maps
|
||||
return Bugzilla::Testopia::Table->new('case_run',
|
||||
'tr_xmlrpc.cgi',
|
||||
$cgi,
|
||||
undef,
|
||||
$search->query()
|
||||
)->list();
|
||||
# Result is an array of test case run hash maps
|
||||
return Bugzilla::Testopia::Table->new('case_run',
|
||||
'tr_xmlrpc.cgi',
|
||||
$cgi,
|
||||
undef,
|
||||
$search->query()
|
||||
)->list();
|
||||
}
|
||||
|
||||
sub get
|
||||
@@ -61,17 +61,17 @@ sub get
|
||||
#Result is a test case run hash map
|
||||
my $test_case_run = new Bugzilla::Testopia::TestCaseRun($test_case_run_id);
|
||||
|
||||
if (not defined $test_case_run)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case_run)
|
||||
{
|
||||
$self->logout;
|
||||
die "TestcaseRun, " . $test_case_run_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_case_run->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_case_run->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
$self->logout;
|
||||
|
||||
@@ -88,24 +88,24 @@ sub get_bugs
|
||||
|
||||
my $test_case_run = new Bugzilla::Testopia::TestCaseRun($test_case_run_id);
|
||||
|
||||
if (not defined $test_case_run)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case_run)
|
||||
{
|
||||
$self->logout;
|
||||
die "TestcaseRun, " . $test_case_run_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_case_run->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_case_run->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_case_run->bugs;
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is list of bugs for the given test case run
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result is list of bugs for the given test case run
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub list
|
||||
@@ -115,34 +115,34 @@ sub list
|
||||
|
||||
$self->login;
|
||||
|
||||
my $list = _list($query);
|
||||
|
||||
my $list = _list($query);
|
||||
|
||||
$self->logout;
|
||||
|
||||
return $list;
|
||||
return $list;
|
||||
}
|
||||
|
||||
sub create
|
||||
{
|
||||
my $self =shift;
|
||||
my ($new_values) = @_;
|
||||
my $self =shift;
|
||||
my ($new_values) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_case_run = new Bugzilla::Testopia::TestCaseRun($new_values);
|
||||
|
||||
my $result = $test_case_run->store();
|
||||
|
||||
$self->logout;
|
||||
my $test_case_run = new Bugzilla::Testopia::TestCaseRun($new_values);
|
||||
|
||||
my $result = $test_case_run->store();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is new test case run id
|
||||
return $result;
|
||||
# Result is new test case run id
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub update
|
||||
{
|
||||
my $self =shift;
|
||||
my ($run_id, $case_id, $build_id, $environment_id, $new_values) = @_;
|
||||
my $self =shift;
|
||||
my ($run_id, $case_id, $build_id, $environment_id, $new_values) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
@@ -152,21 +152,21 @@ sub update
|
||||
$environment_id
|
||||
);
|
||||
|
||||
if (not defined $test_case_run)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_case_run)
|
||||
{
|
||||
$self->logout;
|
||||
die "TestCaseRun for build_id = " . $build_id .
|
||||
", case_id = " . $case_id .
|
||||
", environment_id = " . $environment_id .
|
||||
", run_id = " . $run_id .
|
||||
", not found";
|
||||
}
|
||||
}
|
||||
|
||||
if (not $test_case_run->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
if (not $test_case_run->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
# Check to see what has changed then use set methods
|
||||
# The order is important. We need to check if the build or environment has
|
||||
@@ -202,37 +202,37 @@ sub update
|
||||
$$test_case_run{assignee} = $$test_case_run{assignee}->id();
|
||||
}
|
||||
|
||||
$self->logout;
|
||||
$self->logout;
|
||||
|
||||
#Remove attributes we do not want to publish
|
||||
delete $$test_case_run{bugs};
|
||||
delete $$test_case_run{build};
|
||||
delete $$test_case_run{case};
|
||||
delete $$test_case_run{environment};
|
||||
delete $$test_case_run{run};
|
||||
|
||||
# Result is modified test case run on success, otherwise an exception will be thrown
|
||||
return $test_case_run;
|
||||
#Remove attributes we do not want to publish
|
||||
delete $$test_case_run{bugs};
|
||||
delete $$test_case_run{build};
|
||||
delete $$test_case_run{case};
|
||||
delete $$test_case_run{environment};
|
||||
delete $$test_case_run{run};
|
||||
|
||||
# Result is modified test case run on success, otherwise an exception will be thrown
|
||||
return $test_case_run;
|
||||
}
|
||||
|
||||
sub lookup_status_id_by_name
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($name) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $result = Bugzilla::Testopia::TestCaseRun::lookup_status_by_name($name);
|
||||
my $result = Bugzilla::Testopia::TestCaseRun::lookup_status_by_name($name);
|
||||
|
||||
$self->logout;
|
||||
$self->logout;
|
||||
|
||||
# Result is test case run status id for the given test case run status name
|
||||
return $result;
|
||||
# Result is test case run status id for the given test case run status name
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub lookup_status_name_by_id
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($id) = @_;
|
||||
|
||||
$self->login;
|
||||
@@ -241,15 +241,15 @@ sub lookup_status_name_by_id
|
||||
|
||||
my $result = $test_case_run->lookup_status($id);
|
||||
|
||||
$self->logout;
|
||||
$self->logout;
|
||||
|
||||
if (!defined $result)
|
||||
{
|
||||
$result = 0;
|
||||
};
|
||||
|
||||
# Result is test case run status name for the given test case run status id
|
||||
return $result;
|
||||
|
||||
# Result is test case run status name for the given test case run status id
|
||||
return $result;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
@@ -38,18 +38,18 @@ sub _list
|
||||
|
||||
foreach (keys(%$query))
|
||||
{
|
||||
$cgi->param($_, $$query{$_});
|
||||
$cgi->param($_, $$query{$_});
|
||||
}
|
||||
|
||||
|
||||
my $search = Bugzilla::Testopia::Search->new($cgi);
|
||||
|
||||
# Result is an array of test plan hash maps
|
||||
return Bugzilla::Testopia::Table->new('plan',
|
||||
'tr_xmlrpc.cgi',
|
||||
$cgi,
|
||||
undef,
|
||||
$search->query()
|
||||
)->list();
|
||||
# Result is an array of test plan hash maps
|
||||
return Bugzilla::Testopia::Table->new('plan',
|
||||
'tr_xmlrpc.cgi',
|
||||
$cgi,
|
||||
undef,
|
||||
$search->query()
|
||||
)->list();
|
||||
}
|
||||
|
||||
sub get
|
||||
@@ -59,20 +59,20 @@ sub get
|
||||
|
||||
$self->login;
|
||||
|
||||
#Result is a test plan hash map
|
||||
#Result is a test plan hash map
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($test_plan_id);
|
||||
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testplan, " . $test_plan_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_plan->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_plan->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
$self->logout;
|
||||
|
||||
@@ -86,50 +86,50 @@ sub list
|
||||
|
||||
$self->login;
|
||||
|
||||
my $list = _list($query);
|
||||
|
||||
my $list = _list($query);
|
||||
|
||||
$self->logout;
|
||||
|
||||
return $list;
|
||||
return $list;
|
||||
}
|
||||
|
||||
sub create
|
||||
{
|
||||
my $self =shift;
|
||||
my ($new_values) = @_;
|
||||
my $self =shift;
|
||||
my ($new_values) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($new_values);
|
||||
|
||||
my $result = $test_plan->store();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is new test plan id
|
||||
return $result;
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($new_values);
|
||||
|
||||
my $result = $test_plan->store();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is new test plan id
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub update
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_plan_id, $new_values) = @_;
|
||||
my $self =shift;
|
||||
my ($test_plan_id, $new_values) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($test_plan_id);
|
||||
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($test_plan_id);
|
||||
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testplan, " . $test_plan_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_plan->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_plan->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
$test_plan->set_name(trim($new_values->{'name'}));
|
||||
$test_plan->set_product_id($new_values->{'product_id'});
|
||||
@@ -138,161 +138,161 @@ sub update
|
||||
$test_plan->set_isactive($new_values->{'isactive'});
|
||||
|
||||
$test_plan->update();
|
||||
|
||||
$self->logout;
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is modified test plan, otherwise an exception will be thrown
|
||||
return $test_plan;
|
||||
# Result is modified test plan, otherwise an exception will be thrown
|
||||
return $test_plan;
|
||||
}
|
||||
|
||||
sub get_test_cases
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($test_plan_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($test_plan_id);
|
||||
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testplan, " . $test_plan_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_plan->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_plan->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_plan->test_cases();
|
||||
|
||||
$self->logout;
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is list of test cases for the given test plan
|
||||
return $result;
|
||||
# Result is list of test cases for the given test plan
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub get_test_runs
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($test_plan_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($test_plan_id);
|
||||
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testplan, " . $test_plan_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_plan->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_plan->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_plan->test_runs();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is list of test runs for the given test plan
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result is list of test runs for the given test plan
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub get_categories
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($test_plan_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($test_plan_id);
|
||||
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testplan, " . $test_plan_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_plan->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_plan->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_plan->product->categories();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is list of categories for the given test plan
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result is list of categories for the given test plan
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub get_components
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($test_plan_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($test_plan_id);
|
||||
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testplan, " . $test_plan_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_plan->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_plan->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_plan->product->components;
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is list of components for the given test plan
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result is list of components for the given test plan
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub get_builds
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($test_plan_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($test_plan_id);
|
||||
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testplan, " . $test_plan_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_plan->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_plan->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_plan->product->builds();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is list of builds for the given test plan
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result is list of builds for the given test plan
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub lookup_type_name_by_id
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($id) = @_;
|
||||
|
||||
$self->login;
|
||||
@@ -301,15 +301,15 @@ sub lookup_type_name_by_id
|
||||
|
||||
my $result = $test_plan->lookup_type($id);
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is test plan type name for the given test plan type id
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result is test plan type name for the given test plan type id
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub lookup_type_id_by_name
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($name) = @_;
|
||||
|
||||
$self->login;
|
||||
@@ -318,41 +318,41 @@ sub lookup_type_id_by_name
|
||||
|
||||
my $result = $test_plan->lookup_type_by_name($name);
|
||||
|
||||
$self->logout;
|
||||
$self->logout;
|
||||
|
||||
if (!defined $result)
|
||||
{
|
||||
$result = 0;
|
||||
};
|
||||
|
||||
# Result is test plan type id for the given test plan type name
|
||||
return $result;
|
||||
|
||||
# Result is test plan type id for the given test plan type name
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub add_tag
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_plan_id, $tag_name) = @_;
|
||||
my $self =shift;
|
||||
my ($test_plan_id, $tag_name) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($test_plan_id);
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($test_plan_id);
|
||||
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testplan, " . $test_plan_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_plan->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_plan->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
|
||||
#Create new tag or retrieve id of existing tag
|
||||
my $test_tag = new Bugzilla::Testopia::TestTag({tag_name=>$tag_name});
|
||||
my $tag_id = $test_tag->store;
|
||||
}
|
||||
|
||||
#Create new tag or retrieve id of existing tag
|
||||
my $test_tag = new Bugzilla::Testopia::TestTag({tag_name=>$tag_name});
|
||||
my $tag_id = $test_tag->store;
|
||||
|
||||
my $result = $test_plan->add_tag($tag_id);
|
||||
|
||||
@@ -362,32 +362,32 @@ sub add_tag
|
||||
die "Tag, " . $tag_name . ", already exists for Testplan, " . $test_plan_id;
|
||||
}
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub remove_tag
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_plan_id, $tag_name) = @_;
|
||||
my $self =shift;
|
||||
my ($test_plan_id, $tag_name) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($test_plan_id);
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($test_plan_id);
|
||||
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testplan, " . $test_plan_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_plan->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_plan->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $test_tag = Bugzilla::Testopia::TestTag->check_name($tag_name);
|
||||
if (not defined $test_tag)
|
||||
@@ -398,39 +398,39 @@ sub remove_tag
|
||||
|
||||
my $result = $test_plan->remove_tag($test_tag->id);
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return 0;
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub get_tags
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_plan_id) = @_;
|
||||
my $self =shift;
|
||||
my ($test_plan_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($test_plan_id);
|
||||
my $test_plan = new Bugzilla::Testopia::TestPlan($test_plan_id);
|
||||
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_plan)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testplan, " . $test_plan_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_plan->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_plan->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_plan->tags;
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result list of tags otherwise an exception will be thrown
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result list of tags otherwise an exception will be thrown
|
||||
return $result;
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -38,18 +38,18 @@ sub _list
|
||||
|
||||
foreach (keys(%$query))
|
||||
{
|
||||
$cgi->param($_, $$query{$_});
|
||||
$cgi->param($_, $$query{$_});
|
||||
}
|
||||
|
||||
|
||||
my $search = Bugzilla::Testopia::Search->new($cgi);
|
||||
|
||||
# Result is an array of test run hash maps
|
||||
return Bugzilla::Testopia::Table->new('run',
|
||||
'tr_xmlrpc.cgi',
|
||||
$cgi,
|
||||
undef,
|
||||
$search->query()
|
||||
)->list();
|
||||
# Result is an array of test run hash maps
|
||||
return Bugzilla::Testopia::Table->new('run',
|
||||
'tr_xmlrpc.cgi',
|
||||
$cgi,
|
||||
undef,
|
||||
$search->query()
|
||||
)->list();
|
||||
}
|
||||
|
||||
sub get
|
||||
@@ -59,20 +59,20 @@ sub get
|
||||
|
||||
$self->login;
|
||||
|
||||
#Result is a test run hash map
|
||||
#Result is a test run hash map
|
||||
my $test_run = new Bugzilla::Testopia::TestRun($test_run_id);
|
||||
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testrun, " . $test_run_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_run->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_run->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
$self->logout;
|
||||
|
||||
@@ -86,166 +86,166 @@ sub list
|
||||
|
||||
$self->login;
|
||||
|
||||
my $list = _list($query);
|
||||
|
||||
my $list = _list($query);
|
||||
|
||||
$self->logout;
|
||||
|
||||
return $list;
|
||||
return $list;
|
||||
}
|
||||
|
||||
sub create
|
||||
{
|
||||
my $self =shift;
|
||||
my ($new_values) = @_;
|
||||
my $self =shift;
|
||||
my ($new_values) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_run = new Bugzilla::Testopia::TestRun($new_values);
|
||||
|
||||
my $result = $test_run->store();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is new test run id
|
||||
return $result
|
||||
my $test_run = new Bugzilla::Testopia::TestRun($new_values);
|
||||
|
||||
my $result = $test_run->store();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is new test run id
|
||||
return $result
|
||||
}
|
||||
|
||||
sub update
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_run_id, $new_values) = @_;
|
||||
my $self =shift;
|
||||
my ($test_run_id, $new_values) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_run = new Bugzilla::Testopia::TestRun($test_run_id);
|
||||
my $test_run = new Bugzilla::Testopia::TestRun($test_run_id);
|
||||
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testrun, " . $test_run_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_run->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_run->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_run->update($new_values);
|
||||
my $result = $test_run->update($new_values);
|
||||
|
||||
$test_run = new Bugzilla::Testopia::TestRun($test_run_id);
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is modified test run on success, otherwise an exception will be thrown
|
||||
return $test_run;
|
||||
$test_run = new Bugzilla::Testopia::TestRun($test_run_id);
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is modified test run on success, otherwise an exception will be thrown
|
||||
return $test_run;
|
||||
}
|
||||
|
||||
sub get_test_cases
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($test_run_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_run = new Bugzilla::Testopia::TestRun($test_run_id);
|
||||
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testrun, " . $test_run_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_run->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_run->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_run->cases();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is list of test cases for the given test run
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result is list of test cases for the given test run
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub get_test_case_runs
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($test_run_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_run = new Bugzilla::Testopia::TestRun($test_run_id);
|
||||
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testrun, " . $test_run_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_run->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_run->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_run->caseruns();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is list of test case runs for the given test run
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result is list of test case runs for the given test run
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub get_test_plan
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($test_run_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_run = new Bugzilla::Testopia::TestRun($test_run_id);
|
||||
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testrun, " . $test_run_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_run->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_run->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_run->plan();
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result is test plan for the given test run
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result is test plan for the given test run
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub lookup_environment_id_by_name
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($name) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $result = Bugzilla::Testopia::TestRun::lookup_environment_by_name($name);
|
||||
my $result = Bugzilla::Testopia::TestRun::lookup_environment_by_name($name);
|
||||
|
||||
$self->logout;
|
||||
$self->logout;
|
||||
|
||||
# Result is test run environment id for the given test run environment name
|
||||
return $result;
|
||||
# Result is test run environment id for the given test run environment name
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub lookup_environment_name_by_id
|
||||
{
|
||||
my $self =shift;
|
||||
my $self =shift;
|
||||
my ($id) = @_;
|
||||
|
||||
$self->login;
|
||||
@@ -254,41 +254,41 @@ sub lookup_environment_name_by_id
|
||||
|
||||
my $result = $test_run->lookup_environment($id);
|
||||
|
||||
$self->logout;
|
||||
$self->logout;
|
||||
|
||||
if (!defined $result)
|
||||
{
|
||||
$result = 0;
|
||||
};
|
||||
|
||||
# Result is test run environment name for the given test run environment id
|
||||
return $result;
|
||||
|
||||
# Result is test run environment name for the given test run environment id
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub add_tag
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_run_id, $tag_name) = @_;
|
||||
my $self =shift;
|
||||
my ($test_run_id, $tag_name) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_run = new Bugzilla::Testopia::TestRun($test_run_id);
|
||||
my $test_run = new Bugzilla::Testopia::TestRun($test_run_id);
|
||||
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testrun, " . $test_run_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_run->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_run->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
|
||||
#Create new tag or retrieve id of existing tag
|
||||
my $test_tag = new Bugzilla::Testopia::TestTag({tag_name=>$tag_name});
|
||||
my $tag_id = $test_tag->store;
|
||||
}
|
||||
|
||||
#Create new tag or retrieve id of existing tag
|
||||
my $test_tag = new Bugzilla::Testopia::TestTag({tag_name=>$tag_name});
|
||||
my $tag_id = $test_tag->store;
|
||||
|
||||
my $result = $test_run->add_tag($tag_id);
|
||||
|
||||
@@ -298,32 +298,32 @@ sub add_tag
|
||||
die "Tag, " . $tag_name . ", already exists for Testrun, " . $test_run_id;
|
||||
}
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub remove_tag
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_run_id, $tag_name) = @_;
|
||||
my $self =shift;
|
||||
my ($test_run_id, $tag_name) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_run = new Bugzilla::Testopia::TestRun($test_run_id);
|
||||
my $test_run = new Bugzilla::Testopia::TestRun($test_run_id);
|
||||
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testrun, " . $test_run_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_run->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_run->canedit)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $test_tag = Bugzilla::Testopia::TestTag->check_name($tag_name);
|
||||
if (not defined $test_tag)
|
||||
@@ -334,39 +334,39 @@ sub remove_tag
|
||||
|
||||
my $result = $test_run->remove_tag($test_tag->id);
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return 0;
|
||||
$self->logout;
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub get_tags
|
||||
{
|
||||
my $self =shift;
|
||||
my ($test_run_id) = @_;
|
||||
my $self =shift;
|
||||
my ($test_run_id) = @_;
|
||||
|
||||
$self->login;
|
||||
|
||||
my $test_run = new Bugzilla::Testopia::TestRun($test_run_id);
|
||||
my $test_run = new Bugzilla::Testopia::TestRun($test_run_id);
|
||||
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
if (not defined $test_run)
|
||||
{
|
||||
$self->logout;
|
||||
die "Testrun, " . $test_run_id . ", not found";
|
||||
}
|
||||
|
||||
if (not $test_run->canview)
|
||||
{
|
||||
$self->logout;
|
||||
}
|
||||
|
||||
if (not $test_run->canview)
|
||||
{
|
||||
$self->logout;
|
||||
die "User Not Authorized";
|
||||
}
|
||||
}
|
||||
|
||||
my $result = $test_run->tags;
|
||||
|
||||
$self->logout;
|
||||
|
||||
# Result list of tags otherwise an exception will be thrown
|
||||
return $result;
|
||||
$self->logout;
|
||||
|
||||
# Result list of tags otherwise an exception will be thrown
|
||||
return $result;
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -8,14 +8,14 @@
|
||||
}
|
||||
|
||||
#header li.tr_find {
|
||||
position:absolute;
|
||||
top:0px;
|
||||
right:10px;
|
||||
position:absolute;
|
||||
top:0px;
|
||||
right:10px;
|
||||
}
|
||||
#header li.tr_saved_search {
|
||||
position:absolute;
|
||||
top:2px;
|
||||
right:185px;
|
||||
right:185px;
|
||||
}
|
||||
|
||||
#header .testopia_btn {
|
||||
@@ -27,15 +27,15 @@
|
||||
}
|
||||
|
||||
#footer li.tr_find {
|
||||
position:absolute;
|
||||
top:2px;
|
||||
right:10px;
|
||||
position:absolute;
|
||||
top:2px;
|
||||
right:10px;
|
||||
}
|
||||
|
||||
#footer li.tr_saved_search {
|
||||
position:absolute;
|
||||
top:4px;
|
||||
right:185px;
|
||||
right:185px;
|
||||
}
|
||||
#footer .tr_btn {
|
||||
background-color: #808285;
|
||||
|
||||
@@ -1,2 +1,21 @@
|
||||
[%# 1.0@bugzilla.org %]
|
||||
[%# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is the Bugzilla Testopia System.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Greg Hendricks.
|
||||
# Portions created by Greg Hendricks are Copyright (C) 2006
|
||||
# Novell. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Greg Hendricks <ghendricks@novell.com>
|
||||
#%]
|
||||
<a href="http://www.mozilla.org/projects/testopia"><span>Testopia</span></a>
|
||||
<span>Version 1.0 BETA</span>
|
||||
<span>Version 1.3</span>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<td align="left"><a href="tr_show_case.cgi?case_id=[% caserun.case.id FILTER none %]" title="[% caserun.case.summary FILTER html %]">[% caserun.case.id FILTER html %]</a></td>
|
||||
<td align="right"><input name="sortkey_[% index %]" id="sortkey_[% index %]" value="[% caserun.sortkey FILTER html %]" size="5">
|
||||
[% IF caserun.canedit %]
|
||||
<input type="button" value="Change" onclick="chSortKey([% index %], [% caserun.id FILTER none %], document.getElementById('sortkey_[% index %]').value),chNote([% index %], [% caserun.id FILTER none %], document.getElementById('notes[% index %]').value);"></td>
|
||||
<input type="button" value="Change" onclick="chSortKey([% index %], [% caserun.id FILTER none %], document.getElementById('sortkey_[% index %]').value);"></td>
|
||||
[% END %]
|
||||
<td>
|
||||
[% caserun.build.name FILTER html %]
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
[%# 1.0@bugzilla.org %]
|
||||
[%# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is the Bugzilla Testopia System.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Greg Hendricks.
|
||||
# Portions created by Greg Hendricks are Copyright (C) 2006
|
||||
# Novell. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Greg Hendricks <ghendricks@novell.com>
|
||||
#%]
|
||||
|
||||
[% FILTER null;
|
||||
USE gd = GD.Image(100,40);
|
||||
USE gdc = GD.Constants;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!ELEMENT testopia (testplan, testcase*, testenvironment*, category*, build*)>
|
||||
<!ATTLIST testopia
|
||||
version CDATA #REQUIRED
|
||||
version CDATA #REQUIRED
|
||||
>
|
||||
<!ELEMENT action (#PCDATA)>
|
||||
<!ELEMENT alias (#PCDATA)>
|
||||
@@ -12,31 +12,31 @@
|
||||
<!ELEMENT automated (#PCDATA)>
|
||||
<!ELEMENT blocks (#PCDATA)>
|
||||
<!ATTLIST blocks
|
||||
type (Database_id|Database_description|Xml_description) #REQUIRED
|
||||
type (Database_id|Database_description|Xml_description) #REQUIRED
|
||||
>
|
||||
<!ELEMENT breakdown (#PCDATA)>
|
||||
<!ELEMENT bugs (#PCDATA)>
|
||||
<!ELEMENT build (name, milestone, description?)>
|
||||
<!ATTLIST build
|
||||
product CDATA #REQUIRED
|
||||
product CDATA #REQUIRED
|
||||
>
|
||||
<!ELEMENT buildname (#PCDATA)>
|
||||
<!ELEMENT category (name, description?)>
|
||||
<!ATTLIST category
|
||||
product CDATA #REQUIRED
|
||||
product CDATA #REQUIRED
|
||||
>
|
||||
<!ELEMENT categoryname (#PCDATA)>
|
||||
<!ELEMENT cclist (#PCDATA)>
|
||||
<!ELEMENT closedate (#PCDATA)>
|
||||
<!ELEMENT component (#PCDATA)>
|
||||
<!ATTLIST component
|
||||
product CDATA #REQUIRED
|
||||
product CDATA #REQUIRED
|
||||
>
|
||||
<!ELEMENT data (#PCDATA)>
|
||||
<!ELEMENT defaulttester (#PCDATA)>
|
||||
<!ELEMENT dependson (#PCDATA)>
|
||||
<!ATTLIST dependson
|
||||
type (Database_id|Database_description|Xml_description) #REQUIRED
|
||||
type (Database_id|Database_description|Xml_description) #REQUIRED
|
||||
>
|
||||
<!ELEMENT description (#PCDATA)>
|
||||
<!ELEMENT document (#PCDATA)>
|
||||
@@ -64,26 +64,26 @@
|
||||
<!ELEMENT tag (#PCDATA)>
|
||||
<!ELEMENT testcase (summary, testplan_reference+, alias?, requirement?, defaulttester, categoryname?, script?, arguments*, component*, tag*, attachment*, dependson*, blocks*, setup?, breakdown?, action, expectedresults?)>
|
||||
<!ATTLIST testcase
|
||||
author CDATA #REQUIRED
|
||||
priority (P0|P1|P2|P3|P4|p5) "P5"
|
||||
automated (Manual|Automatic) "Manual"
|
||||
status (PROPOSED|CONFIRMED|DISABLED) "CONFIRMED"
|
||||
author CDATA #REQUIRED
|
||||
priority (P0|P1|P2|P3|P4|p5) "P5"
|
||||
automated (Manual|Automatic) "Manual"
|
||||
status (PROPOSED|CONFIRMED|DISABLED) "CONFIRMED"
|
||||
>
|
||||
<!ELEMENT testedby (#PCDATA)>
|
||||
<!ELEMENT testcase_reference (#PCDATA)>
|
||||
<!ATTLIST testcase_reference
|
||||
type (Database_id|Database_description|Xml_description) #REQUIRED
|
||||
type (Database_id|Database_description|Xml_description) #REQUIRED
|
||||
>
|
||||
<!ELEMENT testenvironment (name, os, platform)>
|
||||
<!ELEMENT testplan (name, product, productversion, build*, category*, tag*, attachment*, document?)>
|
||||
<!ATTLIST testplan
|
||||
author CDATA #REQUIRED
|
||||
type (Acceptance|Function|Installation|Integration|Interoperability|Performance|Product|System|Unit) #REQUIRED
|
||||
archived (True|False) "False"
|
||||
author CDATA #REQUIRED
|
||||
type (Acceptance|Function|Installation|Integration|Interoperability|Performance|Product|System|Unit) #REQUIRED
|
||||
archived (True|False) "False"
|
||||
>
|
||||
<!ELEMENT testplan_reference (#PCDATA)>
|
||||
<!ATTLIST testplan_reference
|
||||
type (Database_id|Database_description|Xml_description) #REQUIRED
|
||||
type (Database_id|Database_description|Xml_description) #REQUIRED
|
||||
>
|
||||
<!ELEMENT testrun (summary, manager, testplan_reference, product, productversion, environment, buildname, status?, startdate?, stopdate?, cclist*, tag*, testrunlog*)>
|
||||
<!ELEMENT testrunlog (testcase_reference, buildname, assignedto, testedby, closedate, status?, note?, bugs*)>
|
||||
|
||||
@@ -122,209 +122,209 @@
|
||||
|
||||
2004-01-18 Ed Fuentetaja <efuentetaja@acm.org>
|
||||
|
||||
* test cases can be marked as public, so anybody can run them
|
||||
* test cases can be marked as public, so anybody can run them
|
||||
|
||||
* more than one tester can be assigned to a test case, but it only needs to be run once
|
||||
* more than one tester can be assigned to a test case, but it only needs to be run once
|
||||
|
||||
* improvements on the UI and usability of the most common pages
|
||||
* improvements on the UI and usability of the most common pages
|
||||
|
||||
* cleaned up and removed duplications in the code. A future use of templates is now closer
|
||||
* cleaned up and removed duplications in the code. A future use of templates is now closer
|
||||
|
||||
2003-11-21 Ed Fuentetaja <efuentetaja@acm.org>
|
||||
|
||||
* patch : updated to work with Bugzilla 2.17.6
|
||||
* patch : updated to work with Bugzilla 2.17.6
|
||||
|
||||
* tr_buglist_to_plan : fixed bug: still using the products field
|
||||
* tr_buglist_to_plan : fixed bug: still using the products field
|
||||
|
||||
2003-11-15 Ed Fuentetaja <efuentetaja@acm.org>
|
||||
|
||||
* doc : updated documentation.
|
||||
* doc : updated documentation.
|
||||
|
||||
* (all) : version migrated to make it work with Bugzilla 2.17.4
|
||||
* (all) : version migrated to make it work with Bugzilla 2.17.4
|
||||
|
||||
|
||||
2002-09-27 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* doc : updated documentation.
|
||||
* doc : updated documentation.
|
||||
|
||||
* edittestplans.cgi (InitTestCaseLog): Placed version info in header (version 0.2).
|
||||
* edittestplans.cgi (InitTestCaseLog): Placed version info in header (version 0.2).
|
||||
|
||||
2002-09-06 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* buglist_to_plan_query.cgi: Added a feature to turn buglist into test plan. This way you can use
|
||||
Testopia as "supervising tool" for verifing set of bugs.
|
||||
* buglist_to_plan_query.cgi: Added a feature to turn buglist into test plan. This way you can use
|
||||
Testopia as "supervising tool" for verifing set of bugs.
|
||||
|
||||
2002-06-17 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* testrun_testers.cgi : Added a form to reassign test-cases "by bug owner". This is intended
|
||||
to work together with test tests created out of lists of bugs (see 2002-06-10 buglist_to_plan.cgi
|
||||
note). If a test case has "show_bug.cgi" is summary, it can be reassigned to tester, which is
|
||||
bug reporter.
|
||||
* testrun_testers.cgi : Added a form to reassign test-cases "by bug owner". This is intended
|
||||
to work together with test tests created out of lists of bugs (see 2002-06-10 buglist_to_plan.cgi
|
||||
note). If a test case has "show_bug.cgi" is summary, it can be reassigned to tester, which is
|
||||
bug reporter.
|
||||
|
||||
2002-06-12 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* testruns.cgi : Removed hyperlinks to 0-items bug lists. Replaced plain user mail address with
|
||||
"mailto" tag in tables.
|
||||
* testruns.cgi : Removed hyperlinks to 0-items bug lists. Replaced plain user mail address with
|
||||
"mailto" tag in tables.
|
||||
|
||||
* tr_caselogform.cgi (DoRunNotifications): Case id is put to mail subject, user name to main body.
|
||||
* tr_caselogform.cgi (DoRunNotifications): Case id is put to mail subject, user name to main body.
|
||||
|
||||
2002-06-10 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* tr_query.cgi : $jscript must be parameter 5 to PutHeader.
|
||||
* tr_query.cgi : $jscript must be parameter 5 to PutHeader.
|
||||
|
||||
* tr_testcaseform.cgi : Added a function for copying a test case to another test plan.
|
||||
* tr_testcaseform.cgi : Added a function for copying a test case to another test plan.
|
||||
|
||||
* testruns.cgi : Added hyperlink to "Update test cases" page.
|
||||
* testruns.cgi : Added hyperlink to "Update test cases" page.
|
||||
|
||||
* testplan_form.cgi : Added hyperlink to "Clone test plan" page.
|
||||
* testplan_form.cgi : Added hyperlink to "Clone test plan" page.
|
||||
|
||||
* buglist_to_plan.cgi : Status of new test case is "confirmed". Added handling of %description%
|
||||
in test case "action". It is expanded to bug's description.
|
||||
* buglist_to_plan.cgi : Status of new test case is "confirmed". Added handling of %description%
|
||||
in test case "action". It is expanded to bug's description.
|
||||
|
||||
* testrun_update.cgi : Added a feature for updating test run. "Updating" means creating
|
||||
test case log entries for all test cases, which are in parent test-plan, but have to log
|
||||
entries in test run (i.e. were added after test run were created)
|
||||
* testrun_update.cgi : Added a feature for updating test run. "Updating" means creating
|
||||
test case log entries for all test cases, which are in parent test-plan, but have to log
|
||||
entries in test run (i.e. were added after test run were created)
|
||||
|
||||
* clone_testplan.cgi : Added a feature for makeing a copy of test plan. Various "copy options"
|
||||
available.
|
||||
* clone_testplan.cgi : Added a feature for makeing a copy of test plan. Various "copy options"
|
||||
available.
|
||||
|
||||
* buglist_to_plan.cgi : Added a feature to create test cases out of bug list. I started to use
|
||||
Testopia as "to-do container" for the things related to testing. I often have a situation, when
|
||||
I wanted testers to test if a list of bug is fixed in current release.
|
||||
Using this module, you can add "test-cases" out of buglist. For each bug in the list, a test-case
|
||||
is created for selected plan. A test-case is just a note "check bug ###". But this forms a list
|
||||
of to-do items, which I can trace. The text of a note is configurable through.
|
||||
bug-to-test-case-summary, bug-to-test-case-action and bug-to-test-case-effect parameters. You can
|
||||
use %id% symbol to include hyperlink to bug page.
|
||||
|
||||
* buglist_to_plan.cgi : Added a feature to create test cases out of bug list. I started to use
|
||||
Testopia as "to-do container" for the things related to testing. I often have a situation, when
|
||||
I wanted testers to test if a list of bug is fixed in current release.
|
||||
Using this module, you can add "test-cases" out of buglist. For each bug in the list, a test-case
|
||||
is created for selected plan. A test-case is just a note "check bug ###". But this forms a list
|
||||
of to-do items, which I can trace. The text of a note is configurable through.
|
||||
bug-to-test-case-summary, bug-to-test-case-action and bug-to-test-case-effect parameters. You can
|
||||
use %id% symbol to include hyperlink to bug page.
|
||||
|
||||
|
||||
2002-05-23 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* tr_testcaseform.cgi: Improved checking for IE version in javascript.
|
||||
* tr_testcaseform.cgi: Improved checking for IE version in javascript.
|
||||
|
||||
2002-04-17 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* tr_import.pl : Fixed handling of situation when "Component" keyword was placed after "Add group".
|
||||
* tr_import.pl : Fixed handling of situation when "Component" keyword was placed after "Add group".
|
||||
|
||||
2002-04-02 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* tr_caselogform.cgi: Added the way to delete test case log entry (not adviced, but sometimes
|
||||
convenient).
|
||||
* tr_caselogform.cgi: Added the way to delete test case log entry (not adviced, but sometimes
|
||||
convenient).
|
||||
|
||||
* caselogform.pl: Added "Delete" button to test case log entry form.
|
||||
* caselogform.pl: Added "Delete" button to test case log entry form.
|
||||
|
||||
2002-03-27 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* testrun_notif.cgi: Added interface for notifications setup.
|
||||
* testrun_notif.cgi: Added interface for notifications setup.
|
||||
|
||||
* btpm_util.pl: Added "constants" for e-mail notification masks.
|
||||
Added SendEmail procedure.
|
||||
* btpm_util.pl: Added "constants" for e-mail notification masks.
|
||||
Added SendEmail procedure.
|
||||
|
||||
* tr_caselogform.cgi: Added mechanism for email notifications. Notifications are set up separately for
|
||||
each test-run. The testrun manager can receive the notifications when:
|
||||
- test-run completes (no 'idle' case log entries left)
|
||||
- test-run completes for tester
|
||||
- test-run completes for component
|
||||
- test case log entry is marked as failed
|
||||
* tr_caselogform.cgi: Added mechanism for email notifications. Notifications are set up separately for
|
||||
each test-run. The testrun manager can receive the notifications when:
|
||||
- test-run completes (no 'idle' case log entries left)
|
||||
- test-run completes for tester
|
||||
- test-run completes for component
|
||||
- test case log entry is marked as failed
|
||||
|
||||
* testruns.cgi: Added link to notifications configuration.
|
||||
* testruns.cgi: Added link to notifications configuration.
|
||||
|
||||
2002-03-25 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* btpm_util.pl: Defined global $::users_select_limit - it is used to defined maximum number of users
|
||||
displayed in user-selection pop-ups.
|
||||
Added some utility functions.
|
||||
* btpm_util.pl: Defined global $::users_select_limit - it is used to defined maximum number of users
|
||||
displayed in user-selection pop-ups.
|
||||
Added some utility functions.
|
||||
|
||||
* doc/ref_param.html: Describe new options.
|
||||
* doc/ref_param.html: Describe new options.
|
||||
|
||||
* doc/install.html : Described new options (new-case-action-template and new-case-effect-template).
|
||||
Described Bugzilla bug-fix for GenerateCode procedure.
|
||||
* doc/install.html : Described new options (new-case-action-template and new-case-effect-template).
|
||||
Described Bugzilla bug-fix for GenerateCode procedure.
|
||||
|
||||
* tr_caselogform.cgi : Test case can now be re-assigned to another tester. Only test-plan editor or
|
||||
test run manager can do it.
|
||||
Added "Just mark as failed" option when marking the log entry as failed.
|
||||
* tr_caselogform.cgi : Test case can now be re-assigned to another tester. Only test-plan editor or
|
||||
test run manager can do it.
|
||||
Added "Just mark as failed" option when marking the log entry as failed.
|
||||
|
||||
* testruns.cgi: New fields can be set: notes and manager.
|
||||
* testruns.cgi: New fields can be set: notes and manager.
|
||||
|
||||
* testrun_testers.cgi : Testers and test cases can now be reassigned when test is running
|
||||
(Finally!!! - I really missed it)
|
||||
* testrun_testers.cgi : Testers and test cases can now be reassigned when test is running
|
||||
(Finally!!! - I really missed it)
|
||||
|
||||
* testrun_reports.cgi: Added some new charts and bug-fixed the old ones.
|
||||
* testrun_reports.cgi: Added some new charts and bug-fixed the old ones.
|
||||
|
||||
* edittestplans.cgi (RunTest): New field (manager) for test run is set to test-plan editor, when
|
||||
test run is created.
|
||||
* edittestplans.cgi (RunTest): New field (manager) for test run is set to test-plan editor, when
|
||||
test run is created.
|
||||
|
||||
* caselogform.pl: IsManager function is now used to verify case-access rights;
|
||||
"Reassign" button added.
|
||||
* caselogform.pl: IsManager function is now used to verify case-access rights;
|
||||
"Reassign" button added.
|
||||
|
||||
* testman.sql: Added columns to test_runs table:
|
||||
- manager (person managing given test run)
|
||||
- notes (notes for test run)
|
||||
- notifications (e-mail notifications mask)
|
||||
* testman.sql: Added columns to test_runs table:
|
||||
- manager (person managing given test run)
|
||||
- notes (notes for test run)
|
||||
- notifications (e-mail notifications mask)
|
||||
|
||||
2002-03-18 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* edittestplans.cgi (InitTestCaseLog): Missed some SQL-quotes when creating new test plan.
|
||||
* edittestplans.cgi (InitTestCaseLog): Missed some SQL-quotes when creating new test plan.
|
||||
|
||||
2002-03-11 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* edittesters.cgi (PrintTestersAssignForm): Number of test cases defined is put to table header for each component.
|
||||
It makes it easier to balance number of test cases assigned for testers.
|
||||
* edittesters.cgi (PrintTestersAssignForm): Number of test cases defined is put to table header for each component.
|
||||
It makes it easier to balance number of test cases assigned for testers.
|
||||
|
||||
2002-03-08 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* btpm_util.pl : Added some utility functions needed by other modules.
|
||||
* btpm_util.pl : Added some utility functions needed by other modules.
|
||||
|
||||
* testrun_reports.cgi : Added bug-statistics reports for test run. You can get the numbers of bugs detected during
|
||||
selected test run for each tester. Charts are also available.
|
||||
* testrun_reports.cgi : Added bug-statistics reports for test run. You can get the numbers of bugs detected during
|
||||
selected test run for each tester. Charts are also available.
|
||||
|
||||
* tr_testcaseform.cgi : After pressing "back" before saving values in test case form once again,
|
||||
I added "change-notification" for this form. A picture is displayed next to "summary", "action" and
|
||||
"effect" when fields need save. Must use some Java Script here, but I hope it will work with various
|
||||
browsers (checked for IE5, NS4, NS6). Anyway - the feature seems worth some risk for me.
|
||||
* tr_testcaseform.cgi : After pressing "back" before saving values in test case form once again,
|
||||
I added "change-notification" for this form. A picture is displayed next to "summary", "action" and
|
||||
"effect" when fields need save. Must use some Java Script here, but I hope it will work with various
|
||||
browsers (checked for IE5, NS4, NS6). Anyway - the feature seems worth some risk for me.
|
||||
|
||||
* tr_edittestcases.cgi : Only privileged user can remove unused versions of test cases.
|
||||
(NewTestCaseForm): Template values for case action and effect are used when creating new case.
|
||||
* tr_edittestcases.cgi : Only privileged user can remove unused versions of test cases.
|
||||
(NewTestCaseForm): Template values for case action and effect are used when creating new case.
|
||||
|
||||
* tr_editgroups.cgi : Improved support for group templates. Template can be deleted.
|
||||
* tr_editgroups.cgi : Improved support for group templates. Template can be deleted.
|
||||
|
||||
* testruns.cgi (PrintPlanHeader): The form displays version of test document used for this run, not current version.
|
||||
(PrintTestersComponents): '%' was prefixed in wrong way...
|
||||
(PrintTestersComponents): Added hyper-link to Reports page.
|
||||
(PrintTestersComponents): PrintTestPlan function is used to display test plan document in unified form.
|
||||
* testruns.cgi (PrintPlanHeader): The form displays version of test document used for this run, not current version.
|
||||
(PrintTestersComponents): '%' was prefixed in wrong way...
|
||||
(PrintTestersComponents): Added hyper-link to Reports page.
|
||||
(PrintTestersComponents): PrintTestPlan function is used to display test plan document in unified form.
|
||||
|
||||
* testplan_versions.cgi : PrintTestPlan function is used to display test plan document in unified form.
|
||||
* testplan_versions.cgi : PrintTestPlan function is used to display test plan document in unified form.
|
||||
|
||||
* testplan_form.cgi : PrintTestPlan function is used to display test plan document in unified form.
|
||||
* testplan_form.cgi : PrintTestPlan function is used to display test plan document in unified form.
|
||||
|
||||
2002-03-05 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* tr_editgroups.cgi : Functional group templates can be created out of existing groups. "Delete template" function added
|
||||
as well.
|
||||
* tr_editgroups.cgi : Functional group templates can be created out of existing groups. "Delete template" function added
|
||||
as well.
|
||||
|
||||
2002-03-04 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* tr_query.cgi (StringSearch): Added "Find case id #" function.
|
||||
* tr_query.cgi (StringSearch): Added "Find case id #" function.
|
||||
|
||||
* tr_edittestcases.cgi : Added a function to delete all unreferenced test case versions.
|
||||
* tr_edittestcases.cgi : Added a function to delete all unreferenced test case versions.
|
||||
|
||||
* testruns.cgi : Bugfix - only one test run was printed (aaarrrghh...) because of SendSql in UserInGroup sub.
|
||||
* testruns.cgi : Bugfix - only one test run was printed (aaarrrghh...) because of SendSql in UserInGroup sub.
|
||||
|
||||
* doc/dbschema.html: Added database schema chart.
|
||||
* doc/dbschema.html: Added database schema chart.
|
||||
|
||||
2002-03-01 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* edittesters.cgi (PrintTestersAssignForm): Added next column, which prints number of currently assigned test cases for
|
||||
each tester.
|
||||
* edittesters.cgi (PrintTestersAssignForm): Added next column, which prints number of currently assigned test cases for
|
||||
each tester.
|
||||
|
||||
2002-02-26 Maciej Maczynski <macmac@xdsnet.pl>
|
||||
|
||||
* tr_export.cgi : Added two additional export options: preceed case with "product>component>group" text,
|
||||
and generate reference to case page.
|
||||
* tr_export.cgi : Added two additional export options: preceed case with "product>component>group" text,
|
||||
and generate reference to case page.
|
||||
|
||||
* tr_edittags.cgi (TagsForm): Tags are sorted by name.
|
||||
* tr_edittags.cgi (TagsForm): Tags are sorted by name.
|
||||
|
||||
* tr_testcaseform.cgi : Changed quoting of summary, action and effect.
|
||||
* tr_testcaseform.cgi : Changed quoting of summary, action and effect.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
body {
|
||||
font-family: arial,sans-serif;
|
||||
font-family: arial,sans-serif;
|
||||
}
|
||||
.print_table_header {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
border-bottom: 1px solid #000;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
||||
.print_table_row_header {
|
||||
font-weight: bold;
|
||||
text-align: right;
|
||||
padding-right: 5px;
|
||||
border-right: 1px solid #000;
|
||||
font-weight: bold;
|
||||
text-align: right;
|
||||
padding-right: 5px;
|
||||
border-right: 1px solid #000;
|
||||
}
|
||||
.print_table_bold {
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
}
|
||||
.print_table_body {
|
||||
text-align: left;
|
||||
padding-left: 15px;
|
||||
text-align: left;
|
||||
padding-left: 15px;
|
||||
}
|
||||
.print_table_data {
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
}
|
||||
.print_table {
|
||||
border-left: 1px solid #000000;
|
||||
border-top: 1px solid #000000;
|
||||
border-right: 1px solid #000000;
|
||||
border-bottom: 1px solid #000000;
|
||||
border-left: 1px solid #000000;
|
||||
border-top: 1px solid #000000;
|
||||
border-right: 1px solid #000000;
|
||||
border-bottom: 1px solid #000000;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<!ELEMENT environment (category+)>
|
||||
<!ATTLIST environment
|
||||
name CDATA #REQUIRED>
|
||||
name CDATA #REQUIRED>
|
||||
|
||||
<!ELEMENT category (element+)>
|
||||
<!ATTLIST category
|
||||
name CDATA #REQUIRED>
|
||||
name CDATA #REQUIRED>
|
||||
|
||||
<!ELEMENT element (property|element)*>
|
||||
<!ATTLIST element
|
||||
name CDATA #REQUIRED>
|
||||
name CDATA #REQUIRED>
|
||||
|
||||
<!ELEMENT property #PCDATA>
|
||||
<!ATTLIST property
|
||||
name CDATA #REQUIRED>
|
||||
name CDATA #REQUIRED>
|
||||
|
||||
@@ -5,26 +5,26 @@ dojo.require("dojo.dom.*");
|
||||
dojo.require("dojo.event.*");
|
||||
function DocumentManager(/*string*/ prefix, /*string*/action, /*array of strings*/otherListeners, /*bool*/ directEdit) {
|
||||
if (prefix.length > 0) {
|
||||
this.prefix = prefix
|
||||
if ( arguments.length > 1 ) {
|
||||
this.action = action;
|
||||
} else {
|
||||
this.action = "Commit";
|
||||
}
|
||||
if ( arguments.length > 2 ) {
|
||||
this.others = otherListeners;
|
||||
} else {
|
||||
this.others = [];
|
||||
}
|
||||
if ( arguments.length > 3 ) {
|
||||
this.directEdit = directEdit;
|
||||
} else {
|
||||
this.directEdit = false;
|
||||
}
|
||||
this.div;
|
||||
this.widget;
|
||||
this.helpPar;
|
||||
dojo.addOnLoad( dojo.lang.hitch(this, "handleLoad" ) );
|
||||
this.prefix = prefix
|
||||
if ( arguments.length > 1 ) {
|
||||
this.action = action;
|
||||
} else {
|
||||
this.action = "Commit";
|
||||
}
|
||||
if ( arguments.length > 2 ) {
|
||||
this.others = otherListeners;
|
||||
} else {
|
||||
this.others = [];
|
||||
}
|
||||
if ( arguments.length > 3 ) {
|
||||
this.directEdit = directEdit;
|
||||
} else {
|
||||
this.directEdit = false;
|
||||
}
|
||||
this.div;
|
||||
this.widget;
|
||||
this.helpPar;
|
||||
dojo.addOnLoad( dojo.lang.hitch(this, "handleLoad" ) );
|
||||
}
|
||||
}
|
||||
new DocumentManager("");
|
||||
@@ -42,20 +42,20 @@ DocumentManager.prototype.handleLoad = function() {
|
||||
this.helpPar.setAttribute("style", "text-align: right;cursor: default");
|
||||
dojo.dom.insertAfter(this.helpPar, this.div);
|
||||
if ( this.directEdit ) {
|
||||
return this.gotoEditMode();
|
||||
return this.gotoEditMode();
|
||||
} else {
|
||||
var l = document.createElement("a");
|
||||
l.setAttribute("title", "Click here to edit, or double-click document text.");
|
||||
l.setAttribute("style", "cursor: pointer; color: blue");
|
||||
var t = document.createTextNode("Edit Document");
|
||||
l.appendChild(t);
|
||||
this.helpPar.appendChild(l);
|
||||
dojo.event.connect(l, "onclick", this, "gotoEditMode");
|
||||
dojo.event.connect(this.div, "ondblclick", this, "gotoEditMode");
|
||||
for (i = 0; i < this.others.length; ++i) {
|
||||
var n = document.getElementById(this.others[i]);
|
||||
dojo.event.connect(n, "ondblclick", this, "gotoEditMode");
|
||||
}
|
||||
var l = document.createElement("a");
|
||||
l.setAttribute("title", "Click here to edit, or double-click document text.");
|
||||
l.setAttribute("style", "cursor: pointer; color: blue");
|
||||
var t = document.createTextNode("Edit Document");
|
||||
l.appendChild(t);
|
||||
this.helpPar.appendChild(l);
|
||||
dojo.event.connect(l, "onclick", this, "gotoEditMode");
|
||||
dojo.event.connect(this.div, "ondblclick", this, "gotoEditMode");
|
||||
for (i = 0; i < this.others.length; ++i) {
|
||||
var n = document.getElementById(this.others[i]);
|
||||
dojo.event.connect(n, "ondblclick", this, "gotoEditMode");
|
||||
}
|
||||
}
|
||||
}
|
||||
DocumentManager.prototype.handleSubmit = function (evt) {
|
||||
@@ -65,30 +65,30 @@ DocumentManager.prototype.handleSubmit = function (evt) {
|
||||
el.setAttribute("type", "hidden");
|
||||
var value;
|
||||
if (this.widget) {
|
||||
value = this.widget.getEditorContent();
|
||||
value = this.widget.getEditorContent();
|
||||
} else {
|
||||
value = "";
|
||||
for (i = 0; i < this.div.childNodes.length; ++i) {
|
||||
value = value + dojo.dom.innerXML(this.div.childNodes[i]);
|
||||
}
|
||||
value = "";
|
||||
for (i = 0; i < this.div.childNodes.length; ++i) {
|
||||
value = value + dojo.dom.innerXML(this.div.childNodes[i]);
|
||||
}
|
||||
}
|
||||
el.setAttribute("value", value);
|
||||
dojo.dom.insertAfter(el, this.div);
|
||||
}
|
||||
DocumentManager.prototype.gotoEditMode = function(evt) {
|
||||
if (this.widget) {
|
||||
return;
|
||||
return;
|
||||
} else {
|
||||
this.div.style.border = "1px solid #000";
|
||||
this.div.style.padding = "0px 0px 10px 0px";
|
||||
dojo.dom.removeChildren(this.helpPar);
|
||||
var b = document.createElement("input");
|
||||
b.setAttribute("type", "SUBMIT");
|
||||
b.setAttribute("name", "action");
|
||||
b.setAttribute("id", "action");
|
||||
b.setAttribute("class", "tr_button");
|
||||
b.setAttribute("value", this.action);
|
||||
this.helpPar.appendChild(b);
|
||||
this.widget = dojo.widget.createWidget("Editor2", {saveName: this.prefix, minHeight: "3em"}, this.div);
|
||||
dojo.dom.removeChildren(this.helpPar);
|
||||
var b = document.createElement("input");
|
||||
b.setAttribute("type", "SUBMIT");
|
||||
b.setAttribute("name", "action");
|
||||
b.setAttribute("id", "action");
|
||||
b.setAttribute("class", "tr_button");
|
||||
b.setAttribute("value", this.action);
|
||||
this.helpPar.appendChild(b);
|
||||
this.widget = dojo.widget.createWidget("Editor2", {saveName: this.prefix, minHeight: "3em"}, this.div);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,205 +45,207 @@ function validBugid(bugid) {
|
||||
}
|
||||
|
||||
function fillrow(data, idx){
|
||||
//document.write(data);
|
||||
if (data.substring(0,5) == 'Error'){
|
||||
displayMsg('pp'+idx, 2, data);
|
||||
return;
|
||||
}
|
||||
if (data.substring(0,9) == '<!DOCTYPE'){
|
||||
var doc = document.open("text/html","replace");
|
||||
doc.write(data);
|
||||
doc.close();
|
||||
return;
|
||||
}
|
||||
//document.write(data);
|
||||
if (data.substring(0,5) == 'Error'){
|
||||
displayMsg('pp'+idx, 2, data);
|
||||
return;
|
||||
}
|
||||
if (data.substring(0,9) == '<!DOCTYPE'){
|
||||
var doc = document.open("text/html","replace");
|
||||
doc.write(data);
|
||||
doc.close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
function getNote(idx,cid){
|
||||
disableAllButtons(true);
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, action: 'get_notes'},
|
||||
load: function(type, data, evt){
|
||||
disableAllButtons(true);
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, action: 'get_notes'},
|
||||
load: function(type, data, evt){
|
||||
dojo.byId('old_notes' + idx).innerHTML = data;
|
||||
},
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
},
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
}
|
||||
//chBld Updates the caserun build
|
||||
function chBld(idx, bid, sid, cid){
|
||||
disableAllButtons(true);
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, build_id: bid, action: 'update_build'},
|
||||
load: function(type, data, evt){
|
||||
fillrow(data, idx);
|
||||
var fields = data.split("|~+");
|
||||
dojo.widget.manager.getWidgetById('head_caserun_'+idx).setContent(fields[0]);
|
||||
document.getElementById('body_caserun_'+idx).innerHTML = fields[1];
|
||||
document.getElementById('ra'+idx).style.display='block';
|
||||
document.getElementById('id'+idx).src='testopia/img/td.gif';
|
||||
displayMsg('pp'+ idx, 1, MSG_TESTLOG_UPDATED);
|
||||
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
|
||||
disableAllButtons(false);
|
||||
disableAllButtons(true);
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, build_id: bid, action: 'update_build'},
|
||||
load: function(type, data, evt){
|
||||
fillrow(data, idx);
|
||||
var fields = data.split("|~+");
|
||||
dojo.widget.manager.getWidgetById('head_caserun_'+idx).setContent(fields[0]);
|
||||
document.getElementById('body_caserun_'+idx).innerHTML = fields[1];
|
||||
document.getElementById('ra'+idx).style.display='block';
|
||||
document.getElementById('id'+idx).src='testopia/img/td.gif';
|
||||
displayMsg('pp'+ idx, 1, MSG_TESTLOG_UPDATED);
|
||||
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
|
||||
disableAllButtons(false);
|
||||
getNote(idx,cid);
|
||||
},
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
},
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
}
|
||||
//chEnv Updates the caserun environment
|
||||
function chEnv(idx, eid, sid, cid, oldid){
|
||||
if (oldid == eid || !eid)
|
||||
return;
|
||||
disableAllButtons(true);
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, caserun_env: eid, action: 'update_environment'},
|
||||
load: function(type, data, evt){
|
||||
fillrow(data, idx);
|
||||
var fields = data.split("|~+");
|
||||
dojo.widget.manager.getWidgetById('head_caserun_'+idx).setContent(fields[0]);
|
||||
document.getElementById('body_caserun_'+idx).innerHTML = fields[1];
|
||||
document.getElementById('ra'+idx).style.display='block';
|
||||
document.getElementById('id'+idx).src='testopia/img/td.gif';
|
||||
displayMsg('pp'+ idx, 1, MSG_TESTLOG_UPDATED);
|
||||
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
|
||||
disableAllButtons(false);
|
||||
if (oldid == eid || !eid)
|
||||
return;
|
||||
disableAllButtons(true);
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, caserun_env: eid, action: 'update_environment'},
|
||||
load: function(type, data, evt){
|
||||
fillrow(data, idx);
|
||||
var fields = data.split("|~+");
|
||||
dojo.widget.manager.getWidgetById('head_caserun_'+idx).setContent(fields[0]);
|
||||
document.getElementById('body_caserun_'+idx).innerHTML = fields[1];
|
||||
document.getElementById('ra'+idx).style.display='block';
|
||||
document.getElementById('id'+idx).src='testopia/img/td.gif';
|
||||
displayMsg('pp'+ idx, 1, MSG_TESTLOG_UPDATED);
|
||||
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
|
||||
disableAllButtons(false);
|
||||
getNote(idx,cid);
|
||||
},
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
},
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
}
|
||||
//chStat updates the status
|
||||
function chStat(idx, sid, cid, osid){
|
||||
if (osid == sid)
|
||||
return;
|
||||
return;
|
||||
displayMsg('pp'+idx, 3, MSG_WAIT.blink());
|
||||
disableAllButtons(true);
|
||||
var upbug = dojo.byId('up_bugs' + idx).checked == true ? 1 : 0;
|
||||
var stNotes = document.getElementById('notes'+idx).value;
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, status_id: sid, update_bug: upbug, note: stNotes, action: 'update_status'},
|
||||
load: function(type, data, evt){
|
||||
fillrow(data, idx);
|
||||
var fields = data.split("|~+");
|
||||
dojo.widget.manager.getWidgetById('percent_bar').setContent(fields[0]);
|
||||
dojo.widget.manager.getWidgetById('head_caserun_'+idx).setContent(fields[1]);
|
||||
document.getElementById('body_caserun_'+idx).innerHTML = fields[2];
|
||||
disableAllButtons(true);
|
||||
var upbug = dojo.byId('up_bugs' + idx).checked == true ? 1 : 0;
|
||||
var stNotes = document.getElementById('notes'+idx).value;
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, status_id: sid, update_bug: upbug, note: stNotes, action: 'update_status'},
|
||||
load: function(type, data, evt){
|
||||
fillrow(data, idx);
|
||||
var fields = data.split("|~+");
|
||||
dojo.widget.manager.getWidgetById('percent_bar').setContent(fields[0]);
|
||||
dojo.widget.manager.getWidgetById('head_caserun_'+idx).setContent(fields[1]);
|
||||
document.getElementById('body_caserun_'+idx).innerHTML = fields[2];
|
||||
|
||||
try{
|
||||
var deps = fields[4];
|
||||
ids = deps.split(",");
|
||||
for (var i=0; i<ids.length; i++){
|
||||
if (status == 'FAILED')
|
||||
document.getElementById('xs'+ids[i]).src="testopia/img/BLOCKED_small.gif";
|
||||
else
|
||||
document.getElementById('xs'+ids[i]).src="testopia/img/IDLE_small.gif";
|
||||
}
|
||||
}
|
||||
catch (e){}
|
||||
displayMsg('pp'+ idx, 1, MSG_TESTLOG_UPDATED);
|
||||
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
|
||||
disableAllButtons(false);
|
||||
try{
|
||||
var deps = fields[4];
|
||||
ids = deps.split(",");
|
||||
for (var i=0; i<ids.length; i++){
|
||||
if (status == 'FAILED')
|
||||
document.getElementById('xs'+ids[i]).src="testopia/img/BLOCKED_small.gif";
|
||||
else
|
||||
document.getElementById('xs'+ids[i]).src="testopia/img/IDLE_small.gif";
|
||||
}
|
||||
}
|
||||
catch (e){}
|
||||
displayMsg('pp'+ idx, 1, MSG_TESTLOG_UPDATED);
|
||||
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
|
||||
disableAllButtons(false);
|
||||
getNote(idx,cid);
|
||||
},
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
},
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
|
||||
}
|
||||
//chNote updates the notes
|
||||
function chNote(idx, cid, note){
|
||||
displayMsg('pp'+idx, 3, MSG_WAIT.blink());
|
||||
disableAllButtons(true);
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, note: note, action: 'update_note'},
|
||||
load: function(type, data, evt){ fillrow(data, idx);
|
||||
fillrow(data, idx);
|
||||
var fields = data.split("|~+");
|
||||
dojo.widget.manager.getWidgetById('head_caserun_'+idx).setContent(fields[0]);
|
||||
document.getElementById('body_caserun_'+idx).innerHTML = fields[1];
|
||||
document.getElementById('ra'+idx).style.display='block';
|
||||
document.getElementById('id'+idx).src='testopia/img/td.gif';
|
||||
displayMsg('pp'+ idx, 1, MSG_TESTLOG_UPDATED);
|
||||
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
|
||||
disableAllButtons(false);
|
||||
getNote(idx,cid);
|
||||
},
|
||||
sync: true,
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
disableAllButtons(true);
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, note: note, action: 'update_note'},
|
||||
load: function(type, data, evt){ fillrow(data, idx);
|
||||
fillrow(data, idx);
|
||||
var fields = data.split("|~+");
|
||||
dojo.widget.manager.getWidgetById('head_caserun_'+idx).setContent(fields[0]);
|
||||
document.getElementById('body_caserun_'+idx).innerHTML = fields[1];
|
||||
document.getElementById('ra'+idx).style.display='block';
|
||||
document.getElementById('id'+idx).src='testopia/img/td.gif';
|
||||
displayMsg('pp'+ idx, 1, MSG_TESTLOG_UPDATED);
|
||||
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
|
||||
disableAllButtons(false);
|
||||
getNote(idx,cid);
|
||||
},
|
||||
sync: true,
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
|
||||
}
|
||||
//chOwn updates the Assignee
|
||||
function chOwn(idx, cid, owner){
|
||||
displayMsg('pp'+idx, 3, MSG_WAIT.blink());
|
||||
disableAllButtons(true);
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, assignee: owner, action: 'update_assignee'},
|
||||
load: function(type, data, evt){ fillrow(data, idx);
|
||||
if (data.substring(0,5) == 'Error'){
|
||||
displayMsg('pp'+ idx, 2, data);
|
||||
return;
|
||||
}
|
||||
document.getElementById('own'+idx).innerHTML = owner;
|
||||
displayMsg('pp'+ idx, 1, MSG_TESTLOG_UPDATED);
|
||||
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
|
||||
disableAllButtons(false);
|
||||
disableAllButtons(true);
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, assignee: owner, action: 'update_assignee'},
|
||||
load: function(type, data, evt){ fillrow(data, idx);
|
||||
if (data.substring(0,5) == 'Error'){
|
||||
displayMsg('pp'+ idx, 2, data);
|
||||
return;
|
||||
}
|
||||
document.getElementById('own'+idx).innerHTML = owner;
|
||||
displayMsg('pp'+ idx, 1, MSG_TESTLOG_UPDATED);
|
||||
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
|
||||
disableAllButtons(false);
|
||||
getNote(idx,cid);
|
||||
},
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
},
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
|
||||
}
|
||||
//chSortKey
|
||||
function chSortKey(idx, cid, svalue){
|
||||
displayMsg('pp'+idx, 3, MSG_WAIT.blink());
|
||||
disableAllButtons(true);
|
||||
disableAllButtons(true);
|
||||
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, sortkey: svalue, action: 'update_sortkey'},
|
||||
load: function(type, data, evt){ fillrow(data, idx);
|
||||
if (data.substring(0,5) == 'Error'){
|
||||
displayMsg('pp'+ idx, 2, data);
|
||||
return;
|
||||
}
|
||||
displayMsg('pp'+ idx, 1, MSG_TESTLOG_UPDATED);
|
||||
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
|
||||
disableAllButtons(false);
|
||||
},
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, sortkey: svalue, action: 'update_sortkey'},
|
||||
load: function(type, data, evt){ fillrow(data, idx);
|
||||
if (data.substring(0,5) == 'Error'){
|
||||
displayMsg('pp'+ idx, 2, data);
|
||||
return;
|
||||
}
|
||||
document.getElementById('ra'+idx).style.display='block';
|
||||
document.getElementById('id'+idx).src='testopia/img/td.gif';
|
||||
displayMsg('pp'+ idx, 1, MSG_TESTLOG_UPDATED);
|
||||
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
|
||||
disableAllButtons(false);
|
||||
},
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
|
||||
}
|
||||
//Attach bugs
|
||||
function attch(idx, cid, bugs){
|
||||
displayMsg('pp'+idx, 3, MSG_WAIT.blink());
|
||||
disableAllButtons(true);
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, bugs: bugs, action: 'attach_bug'},
|
||||
load: function(type, data, evt){
|
||||
document.getElementById('bgl'+idx).innerHTML = data;
|
||||
if (data.match("Invalid")){
|
||||
displayMsg('pp'+ idx, 2, "Invalid Bug");
|
||||
}
|
||||
else{
|
||||
displayMsg('pp'+ idx, 1, MSG_BUG_ATTACHED);
|
||||
}
|
||||
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
|
||||
disableAllButtons(false);
|
||||
},
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
disableAllButtons(true);
|
||||
dojo.io.bind({
|
||||
url: "tr_show_caserun.cgi",
|
||||
content: { caserun_id: cid, index: idx, bugs: bugs, action: 'attach_bug'},
|
||||
load: function(type, data, evt){
|
||||
document.getElementById('bgl'+idx).innerHTML = data;
|
||||
if (data.match("Invalid")){
|
||||
displayMsg('pp'+ idx, 2, "Invalid Bug");
|
||||
}
|
||||
else{
|
||||
displayMsg('pp'+ idx, 1, MSG_BUG_ATTACHED);
|
||||
}
|
||||
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
|
||||
disableAllButtons(false);
|
||||
},
|
||||
error: function(type, error){ alert(error.message);},
|
||||
mimetype: "text/plain"
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ function addTag(id, type){
|
||||
function removeTag(tagid, id, type){
|
||||
var q = 'action=removetag&id=' + id + '&tagid=' + tagid + '&type=' + type;
|
||||
makeCall(q);
|
||||
|
||||
|
||||
}
|
||||
|
||||
function tagAttached() {
|
||||
|
||||
@@ -3,8 +3,8 @@ Index: checksetup.pl
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v
|
||||
retrieving revision 1.469
|
||||
diff -u -r1.469 checksetup.pl
|
||||
--- checksetup.pl 12 Jan 2006 07:03:46 -0000 1.469
|
||||
+++ checksetup.pl 27 Mar 2007 20:34:34 -0000
|
||||
--- checksetup.pl 12 Jan 2006 07:03:46 -0000 1.469
|
||||
+++ checksetup.pl 27 Mar 2007 20:34:34 -0000
|
||||
@@ -313,7 +313,7 @@
|
||||
},
|
||||
{
|
||||
@@ -39,8 +39,8 @@ Index: enter_bug.cgi
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/enter_bug.cgi,v
|
||||
retrieving revision 1.126
|
||||
diff -u -r1.126 enter_bug.cgi
|
||||
--- enter_bug.cgi 5 Jan 2006 14:54:52 -0000 1.126
|
||||
+++ enter_bug.cgi 27 Mar 2007 20:34:34 -0000
|
||||
--- enter_bug.cgi 5 Jan 2006 14:54:52 -0000 1.126
|
||||
+++ enter_bug.cgi 27 Mar 2007 20:34:34 -0000
|
||||
@@ -590,6 +590,8 @@
|
||||
|
||||
$vars->{'default'} = \%default;
|
||||
@@ -55,8 +55,8 @@ Index: Bugzilla.pm
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla.pm,v
|
||||
retrieving revision 1.29
|
||||
diff -u -r1.29 Bugzilla.pm
|
||||
--- Bugzilla.pm 7 Feb 2006 22:46:28 -0000 1.29
|
||||
+++ Bugzilla.pm 27 Mar 2007 20:34:34 -0000
|
||||
--- Bugzilla.pm 7 Feb 2006 22:46:28 -0000 1.29
|
||||
+++ Bugzilla.pm 27 Mar 2007 20:34:34 -0000
|
||||
@@ -46,6 +46,7 @@
|
||||
use constant SHUTDOWNHTML_EXEMPT => [
|
||||
'editparams.cgi',
|
||||
@@ -70,8 +70,8 @@ Index: post_bug.cgi
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/post_bug.cgi,v
|
||||
retrieving revision 1.135
|
||||
diff -u -r1.135 post_bug.cgi
|
||||
--- post_bug.cgi 8 Jan 2006 19:56:03 -0000 1.135
|
||||
+++ post_bug.cgi 27 Mar 2007 20:34:34 -0000
|
||||
--- post_bug.cgi 8 Jan 2006 19:56:03 -0000 1.135
|
||||
+++ post_bug.cgi 27 Mar 2007 20:34:34 -0000
|
||||
@@ -33,6 +33,8 @@
|
||||
use Bugzilla::Bug;
|
||||
use Bugzilla::User;
|
||||
@@ -104,8 +104,8 @@ Index: editusers.cgi
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/editusers.cgi,v
|
||||
retrieving revision 1.113
|
||||
diff -u -r1.113 editusers.cgi
|
||||
--- editusers.cgi 3 Jan 2006 08:40:45 -0000 1.113
|
||||
+++ editusers.cgi 27 Mar 2007 20:34:34 -0000
|
||||
--- editusers.cgi 3 Jan 2006 08:40:45 -0000 1.113
|
||||
+++ editusers.cgi 27 Mar 2007 20:34:34 -0000
|
||||
@@ -185,6 +185,8 @@
|
||||
# Lock tables during the check+creation session.
|
||||
$dbh->bz_lock_tables('profiles WRITE',
|
||||
@@ -129,8 +129,8 @@ Index: Bugzilla/User.pm
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/User.pm,v
|
||||
retrieving revision 1.101.2.3
|
||||
diff -u -r1.101.2.3 User.pm
|
||||
--- Bugzilla/User.pm 14 Mar 2006 07:45:54 -0000 1.101.2.3
|
||||
+++ Bugzilla/User.pm 27 Mar 2007 20:34:34 -0000
|
||||
--- Bugzilla/User.pm 14 Mar 2006 07:45:54 -0000 1.101.2.3
|
||||
+++ Bugzilla/User.pm 27 Mar 2007 20:34:34 -0000
|
||||
@@ -236,6 +236,16 @@
|
||||
return $self->{queries};
|
||||
}
|
||||
@@ -225,8 +225,8 @@ Index: Bugzilla/Template.pm
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v
|
||||
retrieving revision 1.41
|
||||
diff -u -r1.41 Template.pm
|
||||
--- Bugzilla/Template.pm 22 Jan 2006 21:37:37 -0000 1.41
|
||||
+++ Bugzilla/Template.pm 27 Mar 2007 20:34:34 -0000
|
||||
--- Bugzilla/Template.pm 22 Jan 2006 21:37:37 -0000 1.41
|
||||
+++ Bugzilla/Template.pm 27 Mar 2007 20:34:34 -0000
|
||||
@@ -499,6 +499,14 @@
|
||||
return $var;
|
||||
},
|
||||
@@ -247,8 +247,8 @@ Index: Bugzilla/DB/Schema/Mysql.pm
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Mysql.pm,v
|
||||
retrieving revision 1.12
|
||||
diff -u -r1.12 Mysql.pm
|
||||
--- Bugzilla/DB/Schema/Mysql.pm 18 Dec 2005 18:53:00 -0000 1.12
|
||||
+++ Bugzilla/DB/Schema/Mysql.pm 27 Mar 2007 20:34:34 -0000
|
||||
--- Bugzilla/DB/Schema/Mysql.pm 18 Dec 2005 18:53:00 -0000 1.12
|
||||
+++ Bugzilla/DB/Schema/Mysql.pm 27 Mar 2007 20:34:34 -0000
|
||||
@@ -103,9 +103,10 @@
|
||||
INT3 => 'mediumint',
|
||||
INT4 => 'integer',
|
||||
@@ -268,8 +268,8 @@ Index: Bugzilla/DB/Schema/Pg.pm
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Pg.pm,v
|
||||
retrieving revision 1.9
|
||||
diff -u -r1.9 Pg.pm
|
||||
--- Bugzilla/DB/Schema/Pg.pm 15 Jun 2005 03:54:59 -0000 1.9
|
||||
+++ Bugzilla/DB/Schema/Pg.pm 27 Mar 2007 20:34:34 -0000
|
||||
--- Bugzilla/DB/Schema/Pg.pm 15 Jun 2005 03:54:59 -0000 1.9
|
||||
+++ Bugzilla/DB/Schema/Pg.pm 27 Mar 2007 20:34:34 -0000
|
||||
@@ -69,6 +69,7 @@
|
||||
INT3 => 'integer',
|
||||
INT4 => 'integer',
|
||||
@@ -283,8 +283,8 @@ Index: Bugzilla/DB/Schema.pm
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm,v
|
||||
retrieving revision 1.45
|
||||
diff -u -r1.45 Schema.pm
|
||||
--- Bugzilla/DB/Schema.pm 6 Jan 2006 14:38:42 -0000 1.45
|
||||
+++ Bugzilla/DB/Schema.pm 27 Mar 2007 20:34:34 -0000
|
||||
--- Bugzilla/DB/Schema.pm 6 Jan 2006 14:38:42 -0000 1.45
|
||||
+++ Bugzilla/DB/Schema.pm 27 Mar 2007 20:34:34 -0000
|
||||
@@ -1040,6 +1040,557 @@
|
||||
],
|
||||
},
|
||||
@@ -847,8 +847,8 @@ Index: createaccount.cgi
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/createaccount.cgi,v
|
||||
retrieving revision 1.46
|
||||
diff -u -r1.46 createaccount.cgi
|
||||
--- createaccount.cgi 20 Dec 2005 22:16:07 -0000 1.46
|
||||
+++ createaccount.cgi 12 Jun 2007 16:31:57 -0000
|
||||
--- createaccount.cgi 20 Dec 2005 22:16:07 -0000 1.46
|
||||
+++ createaccount.cgi 12 Jun 2007 16:31:57 -0000
|
||||
@@ -69,8 +69,8 @@
|
||||
|
||||
$vars->{'login'} = $login;
|
||||
|
||||
@@ -3,8 +3,8 @@ Index: editusers.cgi
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/editusers.cgi,v
|
||||
retrieving revision 1.113.2.1
|
||||
diff -u -r1.113.2.1 editusers.cgi
|
||||
--- editusers.cgi 14 Oct 2006 22:05:54 -0000 1.113.2.1
|
||||
+++ editusers.cgi 11 May 2007 18:52:16 -0000
|
||||
--- editusers.cgi 14 Oct 2006 22:05:54 -0000 1.113.2.1
|
||||
+++ editusers.cgi 11 May 2007 18:52:16 -0000
|
||||
@@ -190,6 +190,8 @@
|
||||
# Lock tables during the check+creation session.
|
||||
$dbh->bz_lock_tables('profiles WRITE',
|
||||
@@ -28,8 +28,8 @@ Index: checksetup.pl
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v
|
||||
retrieving revision 1.469.2.15
|
||||
diff -u -r1.469.2.15 checksetup.pl
|
||||
--- checksetup.pl 14 Oct 2006 20:30:53 -0000 1.469.2.15
|
||||
+++ checksetup.pl 27 Mar 2007 20:27:05 -0000
|
||||
--- checksetup.pl 14 Oct 2006 20:30:53 -0000 1.469.2.15
|
||||
+++ checksetup.pl 27 Mar 2007 20:27:05 -0000
|
||||
@@ -313,7 +313,7 @@
|
||||
},
|
||||
{
|
||||
@@ -64,8 +64,8 @@ Index: enter_bug.cgi
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/enter_bug.cgi,v
|
||||
retrieving revision 1.126.2.2
|
||||
diff -u -r1.126.2.2 enter_bug.cgi
|
||||
--- enter_bug.cgi 21 Aug 2006 19:26:06 -0000 1.126.2.2
|
||||
+++ enter_bug.cgi 27 Mar 2007 20:27:05 -0000
|
||||
--- enter_bug.cgi 21 Aug 2006 19:26:06 -0000 1.126.2.2
|
||||
+++ enter_bug.cgi 27 Mar 2007 20:27:05 -0000
|
||||
@@ -591,6 +591,8 @@
|
||||
|
||||
$vars->{'default'} = \%default;
|
||||
@@ -80,8 +80,8 @@ Index: post_bug.cgi
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/post_bug.cgi,v
|
||||
retrieving revision 1.135.2.3
|
||||
diff -u -r1.135.2.3 post_bug.cgi
|
||||
--- post_bug.cgi 4 Jul 2006 09:51:56 -0000 1.135.2.3
|
||||
+++ post_bug.cgi 27 Mar 2007 20:27:05 -0000
|
||||
--- post_bug.cgi 4 Jul 2006 09:51:56 -0000 1.135.2.3
|
||||
+++ post_bug.cgi 27 Mar 2007 20:27:05 -0000
|
||||
@@ -33,6 +33,8 @@
|
||||
use Bugzilla::Bug;
|
||||
use Bugzilla::User;
|
||||
@@ -114,8 +114,8 @@ Index: Bugzilla.pm
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla.pm,v
|
||||
retrieving revision 1.29.2.2
|
||||
diff -u -r1.29.2.2 Bugzilla.pm
|
||||
--- Bugzilla.pm 8 Aug 2006 20:53:40 -0000 1.29.2.2
|
||||
+++ Bugzilla.pm 27 Mar 2007 20:27:04 -0000
|
||||
--- Bugzilla.pm 8 Aug 2006 20:53:40 -0000 1.29.2.2
|
||||
+++ Bugzilla.pm 27 Mar 2007 20:27:04 -0000
|
||||
@@ -46,6 +46,7 @@
|
||||
use constant SHUTDOWNHTML_EXEMPT => [
|
||||
'editparams.cgi',
|
||||
@@ -129,8 +129,8 @@ Index: Bugzilla/Template.pm
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v
|
||||
retrieving revision 1.41.2.3
|
||||
diff -u -r1.41.2.3 Template.pm
|
||||
--- Bugzilla/Template.pm 14 Oct 2006 20:30:54 -0000 1.41.2.3
|
||||
+++ Bugzilla/Template.pm 27 Mar 2007 20:27:05 -0000
|
||||
--- Bugzilla/Template.pm 14 Oct 2006 20:30:54 -0000 1.41.2.3
|
||||
+++ Bugzilla/Template.pm 27 Mar 2007 20:27:05 -0000
|
||||
@@ -499,6 +499,14 @@
|
||||
return $var;
|
||||
},
|
||||
@@ -151,8 +151,8 @@ Index: Bugzilla/User.pm
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/User.pm,v
|
||||
retrieving revision 1.101.2.5
|
||||
diff -u -r1.101.2.5 User.pm
|
||||
--- Bugzilla/User.pm 14 Oct 2006 21:07:19 -0000 1.101.2.5
|
||||
+++ Bugzilla/User.pm 27 Mar 2007 20:27:05 -0000
|
||||
--- Bugzilla/User.pm 14 Oct 2006 21:07:19 -0000 1.101.2.5
|
||||
+++ Bugzilla/User.pm 27 Mar 2007 20:27:05 -0000
|
||||
@@ -236,6 +236,16 @@
|
||||
return $self->{queries};
|
||||
}
|
||||
@@ -247,8 +247,8 @@ Index: Bugzilla/DB/Schema.pm
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm,v
|
||||
retrieving revision 1.45.2.2
|
||||
diff -u -r1.45.2.2 Schema.pm
|
||||
--- Bugzilla/DB/Schema.pm 19 Jun 2006 18:17:38 -0000 1.45.2.2
|
||||
+++ Bugzilla/DB/Schema.pm 27 Mar 2007 20:27:05 -0000
|
||||
--- Bugzilla/DB/Schema.pm 19 Jun 2006 18:17:38 -0000 1.45.2.2
|
||||
+++ Bugzilla/DB/Schema.pm 27 Mar 2007 20:27:05 -0000
|
||||
@@ -1040,6 +1040,557 @@
|
||||
],
|
||||
},
|
||||
@@ -812,8 +812,8 @@ Index: Bugzilla/DB/Schema/Mysql.pm
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Mysql.pm,v
|
||||
retrieving revision 1.12.2.1
|
||||
diff -u -r1.12.2.1 Mysql.pm
|
||||
--- Bugzilla/DB/Schema/Mysql.pm 19 Jun 2006 14:57:14 -0000 1.12.2.1
|
||||
+++ Bugzilla/DB/Schema/Mysql.pm 27 Mar 2007 20:27:05 -0000
|
||||
--- Bugzilla/DB/Schema/Mysql.pm 19 Jun 2006 14:57:14 -0000 1.12.2.1
|
||||
+++ Bugzilla/DB/Schema/Mysql.pm 27 Mar 2007 20:27:05 -0000
|
||||
@@ -103,9 +103,10 @@
|
||||
INT3 => 'mediumint',
|
||||
INT4 => 'integer',
|
||||
@@ -842,8 +842,8 @@ Index: Bugzilla/DB/Schema/Pg.pm
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Pg.pm,v
|
||||
retrieving revision 1.9
|
||||
diff -u -r1.9 Pg.pm
|
||||
--- Bugzilla/DB/Schema/Pg.pm 15 Jun 2005 03:54:59 -0000 1.9
|
||||
+++ Bugzilla/DB/Schema/Pg.pm 27 Mar 2007 20:27:05 -0000
|
||||
--- Bugzilla/DB/Schema/Pg.pm 15 Jun 2005 03:54:59 -0000 1.9
|
||||
+++ Bugzilla/DB/Schema/Pg.pm 27 Mar 2007 20:27:05 -0000
|
||||
@@ -69,6 +69,7 @@
|
||||
INT3 => 'integer',
|
||||
INT4 => 'integer',
|
||||
@@ -857,8 +857,8 @@ Index: createaccount.cgi
|
||||
RCS file: /cvsroot/mozilla/webtools/bugzilla/createaccount.cgi,v
|
||||
retrieving revision 1.46
|
||||
diff -u -r1.46 createaccount.cgi
|
||||
--- createaccount.cgi 20 Dec 2005 22:16:07 -0000 1.46
|
||||
+++ createaccount.cgi 12 Jun 2007 16:31:57 -0000
|
||||
--- createaccount.cgi 20 Dec 2005 22:16:07 -0000 1.46
|
||||
+++ createaccount.cgi 12 Jun 2007 16:31:57 -0000
|
||||
@@ -69,8 +69,8 @@
|
||||
|
||||
$vars->{'login'} = $login;
|
||||
|
||||
@@ -85,18 +85,18 @@ sub error {
|
||||
#
|
||||
sub map_TCDB_users
|
||||
{
|
||||
my ($tcdb_user) = @_;
|
||||
if ( -r "tcdbUsers" )
|
||||
{
|
||||
open(TCDBUSERS, "tcdbUsers") || error("Cannot open tcdbUsers");
|
||||
while (<TCDBUSERS>)
|
||||
{
|
||||
chop;
|
||||
my ($email_addr,$user_id) = split(/ /);
|
||||
$tcdb_user->{$user_id} = $email_addr;
|
||||
}
|
||||
close(TCDBUSERS);
|
||||
}
|
||||
my ($tcdb_user) = @_;
|
||||
if ( -r "tcdbUsers" )
|
||||
{
|
||||
open(TCDBUSERS, "tcdbUsers") || error("Cannot open tcdbUsers");
|
||||
while (<TCDBUSERS>)
|
||||
{
|
||||
chop;
|
||||
my ($email_addr,$user_id) = split(/ /);
|
||||
$tcdb_user->{$user_id} = $email_addr;
|
||||
}
|
||||
close(TCDBUSERS);
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
@@ -104,16 +104,16 @@ sub map_TCDB_users
|
||||
#
|
||||
sub peek(*)
|
||||
{
|
||||
my $fh = shift;
|
||||
|
||||
# Get current position in file.
|
||||
my $position = tell $fh;
|
||||
# Read next character.
|
||||
read(CSVINPUT, my $next_char, 1);
|
||||
# Restore position in file.
|
||||
seek(CSVINPUT,$position,0);
|
||||
|
||||
return $next_char;
|
||||
my $fh = shift;
|
||||
|
||||
# Get current position in file.
|
||||
my $position = tell $fh;
|
||||
# Read next character.
|
||||
read(CSVINPUT, my $next_char, 1);
|
||||
# Restore position in file.
|
||||
seek(CSVINPUT,$position,0);
|
||||
|
||||
return $next_char;
|
||||
}
|
||||
|
||||
#
|
||||
@@ -128,25 +128,25 @@ sub peek(*)
|
||||
#
|
||||
sub print_fields
|
||||
{
|
||||
my ($file_descriptor,$fields_ref,$testcasenamefield,$tcdb_format) = @_;
|
||||
my ($file_descriptor,$fields_ref,$testcasenamefield,$tcdb_format) = @_;
|
||||
|
||||
my $index = 0;
|
||||
while ( $index < @$fields_ref )
|
||||
{
|
||||
$fields_ref->[$index] =~ s/"$//g if ( $index == ( @$fields_ref -1 ) );
|
||||
$fields_ref->[$index] =~ s/\\"/"/g;
|
||||
$fields_ref->[$index] =~ s/"/""/g;
|
||||
if ( $tcdb_format && ( $index == $testcasenamefield ) )
|
||||
{
|
||||
$fields_ref->[$index] =~ s/__\d\d\d\d\d\d\d//g;
|
||||
$fields_ref->[$index] =~ s/__\d\d\d\d\d\d//g;
|
||||
$fields_ref->[$index] =~ s/__\d\d\d\d\d//g;
|
||||
}
|
||||
print $file_descriptor "\"$fields_ref->[$index]\"";
|
||||
print $file_descriptor "," if ( $index != ( @$fields_ref -1 ) );
|
||||
$index += 1;
|
||||
}
|
||||
print $file_descriptor "\n";
|
||||
my $index = 0;
|
||||
while ( $index < @$fields_ref )
|
||||
{
|
||||
$fields_ref->[$index] =~ s/"$//g if ( $index == ( @$fields_ref -1 ) );
|
||||
$fields_ref->[$index] =~ s/\\"/"/g;
|
||||
$fields_ref->[$index] =~ s/"/""/g;
|
||||
if ( $tcdb_format && ( $index == $testcasenamefield ) )
|
||||
{
|
||||
$fields_ref->[$index] =~ s/__\d\d\d\d\d\d\d//g;
|
||||
$fields_ref->[$index] =~ s/__\d\d\d\d\d\d//g;
|
||||
$fields_ref->[$index] =~ s/__\d\d\d\d\d//g;
|
||||
}
|
||||
print $file_descriptor "\"$fields_ref->[$index]\"";
|
||||
print $file_descriptor "," if ( $index != ( @$fields_ref -1 ) );
|
||||
$index += 1;
|
||||
}
|
||||
print $file_descriptor "\n";
|
||||
}
|
||||
|
||||
#
|
||||
@@ -157,270 +157,270 @@ sub print_fields
|
||||
# The Test Case Data Base (TCDB) CSV files also need to be processed to clean up format errors.
|
||||
#
|
||||
# The TCDB CSV errors are:
|
||||
# 1) Does not escape " used in a field with "". May use \" instead of "" but not always.
|
||||
# 2) Runs the CSV across multiple lines.
|
||||
# 3) In some cases a line may be missing the last field.
|
||||
# 1) Does not escape " used in a field with "". May use \" instead of "" but not always.
|
||||
# 2) Runs the CSV across multiple lines.
|
||||
# 3) In some cases a line may be missing the last field.
|
||||
#
|
||||
sub remove_field_list
|
||||
{
|
||||
my ($input_filename,$work_filename,$tcdb_format) = @_;
|
||||
my $field_list = "";
|
||||
my @field_buffer;
|
||||
my @fields;
|
||||
my $fields_index = 0;
|
||||
my $in_quote_field = 0;
|
||||
my $line = "";
|
||||
my $line_count = 0;
|
||||
my $number_of_fields = 0;
|
||||
my $parse_line = "";
|
||||
my $testcasenamefield = "";
|
||||
my ($input_filename,$work_filename,$tcdb_format) = @_;
|
||||
my $field_list = "";
|
||||
my @field_buffer;
|
||||
my @fields;
|
||||
my $fields_index = 0;
|
||||
my $in_quote_field = 0;
|
||||
my $line = "";
|
||||
my $line_count = 0;
|
||||
my $number_of_fields = 0;
|
||||
my $parse_line = "";
|
||||
my $testcasenamefield = "";
|
||||
|
||||
open(CSVINPUT, $input_filename) or error("Cannot open file $input_filename");
|
||||
open(CSVWORK, ">", $work_filename) or error("Cannot open file $work_filename");
|
||||
open(CSVINPUT, $input_filename) or error("Cannot open file $input_filename");
|
||||
open(CSVWORK, ">", $work_filename) or error("Cannot open file $work_filename");
|
||||
|
||||
while (<CSVINPUT>)
|
||||
{
|
||||
chop;
|
||||
while (<CSVINPUT>)
|
||||
{
|
||||
chop;
|
||||
|
||||
s/\r//g;
|
||||
#
|
||||
# Map extended characters into HTML entities.
|
||||
#
|
||||
s/\342\200\223/-/g;
|
||||
s/\342\200\224/—/g;
|
||||
s/\342\200\230/‘/g;
|
||||
s/\342\200\231/’/g;
|
||||
s/\342\200\234/“/g;
|
||||
s/\342\200\235/”/g;
|
||||
s/\342\200\246/…/g;
|
||||
s/\302\240/ /g;
|
||||
s/\302\251/©/g;
|
||||
s/\031/'/g;
|
||||
s/\221/&8216;/g; # left single quotation mark
|
||||
s/\222/&8217;/g; # right single quotation mark
|
||||
s/\223/&8220;/g; # left double quotation mark
|
||||
s/\224/&8221;/g; # right double quotation mark
|
||||
s/\226/-/g;
|
||||
s/\337/ß/g; # beta
|
||||
s/\341/à/g; # small letter a with acute accent
|
||||
s/\342/á/g; # small letter a with grave accent
|
||||
s/\344/ä/g; # small letter a with tilde
|
||||
s/\346/å/g; # small letter a with umlaut
|
||||
s/\347/æ/g; # small ae
|
||||
s/\350/ç/g; # small letter c cedilla
|
||||
s/\351/è/g; # small letter e with acute accent
|
||||
s/\364/ô/g; # small letter o with circumflex
|
||||
|
||||
$line_count += 1;
|
||||
if ( $line_count == 1 )
|
||||
{
|
||||
$field_list = $_;
|
||||
$number_of_fields = $field_list;
|
||||
$number_of_fields =~ s/[^,]//g;
|
||||
# Counting the number of commas so number of fields is one more.
|
||||
$number_of_fields = (length $number_of_fields) + 1;
|
||||
# Returned $field_list needs to be lower case, all spaces, " and \ removed.
|
||||
$field_list = lc $field_list;
|
||||
$field_list =~ s/[\s"\/]//g;
|
||||
my $index = 0;
|
||||
# Find the field that contains the Test Case name.
|
||||
foreach my $field ( split(/,/,$field_list) )
|
||||
{
|
||||
if ( $field eq "testcasename" )
|
||||
{
|
||||
$testcasenamefield = $index ;
|
||||
last;
|
||||
}
|
||||
$index++;
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
if ( ! $tcdb_format )
|
||||
{
|
||||
print CSVWORK $_ . "\n";
|
||||
next;
|
||||
}
|
||||
|
||||
# Missing or empty environment in TCDB has this value in the environment field. Set it to
|
||||
# null and hope it was not in the middle of a field.
|
||||
s/"\$EMPTYENV"/""/;
|
||||
|
||||
# TCDB CSV options that are not handled correctly:
|
||||
# If a field contains some thing like:
|
||||
# '2. Click "Roles and Tasks " , "Storage" , click "Volumes" and''
|
||||
# the "," will be seen as field seperator and not as part of the field.
|
||||
s/\r//g;
|
||||
#
|
||||
# Map extended characters into HTML entities.
|
||||
#
|
||||
s/\342\200\223/-/g;
|
||||
s/\342\200\224/—/g;
|
||||
s/\342\200\230/‘/g;
|
||||
s/\342\200\231/’/g;
|
||||
s/\342\200\234/“/g;
|
||||
s/\342\200\235/”/g;
|
||||
s/\342\200\246/…/g;
|
||||
s/\302\240/ /g;
|
||||
s/\302\251/©/g;
|
||||
s/\031/'/g;
|
||||
s/\221/&8216;/g; # left single quotation mark
|
||||
s/\222/&8217;/g; # right single quotation mark
|
||||
s/\223/&8220;/g; # left double quotation mark
|
||||
s/\224/&8221;/g; # right double quotation mark
|
||||
s/\226/-/g;
|
||||
s/\337/ß/g; # beta
|
||||
s/\341/à/g; # small letter a with acute accent
|
||||
s/\342/á/g; # small letter a with grave accent
|
||||
s/\344/ä/g; # small letter a with tilde
|
||||
s/\346/å/g; # small letter a with umlaut
|
||||
s/\347/æ/g; # small ae
|
||||
s/\350/ç/g; # small letter c cedilla
|
||||
s/\351/è/g; # small letter e with acute accent
|
||||
s/\364/ô/g; # small letter o with circumflex
|
||||
|
||||
$line_count += 1;
|
||||
if ( $line_count == 1 )
|
||||
{
|
||||
$field_list = $_;
|
||||
$number_of_fields = $field_list;
|
||||
$number_of_fields =~ s/[^,]//g;
|
||||
# Counting the number of commas so number of fields is one more.
|
||||
$number_of_fields = (length $number_of_fields) + 1;
|
||||
# Returned $field_list needs to be lower case, all spaces, " and \ removed.
|
||||
$field_list = lc $field_list;
|
||||
$field_list =~ s/[\s"\/]//g;
|
||||
my $index = 0;
|
||||
# Find the field that contains the Test Case name.
|
||||
foreach my $field ( split(/,/,$field_list) )
|
||||
{
|
||||
if ( $field eq "testcasename" )
|
||||
{
|
||||
$testcasenamefield = $index ;
|
||||
last;
|
||||
}
|
||||
$index++;
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
if ( ! $tcdb_format )
|
||||
{
|
||||
print CSVWORK $_ . "\n";
|
||||
next;
|
||||
}
|
||||
|
||||
# Missing or empty environment in TCDB has this value in the environment field. Set it to
|
||||
# null and hope it was not in the middle of a field.
|
||||
s/"\$EMPTYENV"/""/;
|
||||
|
||||
# TCDB CSV options that are not handled correctly:
|
||||
# If a field contains some thing like:
|
||||
# '2. Click "Roles and Tasks " , "Storage" , click "Volumes" and''
|
||||
# the "," will be seen as field seperator and not as part of the field.
|
||||
|
||||
# Add the current line onto the line to parse.
|
||||
$parse_line .= $_;
|
||||
# Add the current line onto the line to parse.
|
||||
$parse_line .= $_;
|
||||
|
||||
# The end of the TCDB CSV line will be a double quote at the end of the line. Keep combining
|
||||
# lines until we have a double quote at the end of the line and try to parse the line.
|
||||
if ( ! ($parse_line =~ /.+\n*"$/) )
|
||||
{
|
||||
$parse_line .= "\\n";
|
||||
next;
|
||||
}
|
||||
# The end of the TCDB CSV line will be a double quote at the end of the line. Keep combining
|
||||
# lines until we have a double quote at the end of the line and try to parse the line.
|
||||
if ( ! ($parse_line =~ /.+\n*"$/) )
|
||||
{
|
||||
$parse_line .= "\\n";
|
||||
next;
|
||||
}
|
||||
|
||||
# At this point $parse_line will hopefully contain the full CSV line. It may not though since
|
||||
# we could have found a double quote at the end of the line used in field that spans multiple
|
||||
# lines. Parse it below and if we have not found all the fields we will loop back and read
|
||||
# more lines until the next double quote at the end of the line is found.
|
||||
# At this point $parse_line will hopefully contain the full CSV line. It may not though since
|
||||
# we could have found a double quote at the end of the line used in field that spans multiple
|
||||
# lines. Parse it below and if we have not found all the fields we will loop back and read
|
||||
# more lines until the next double quote at the end of the line is found.
|
||||
|
||||
$in_quote_field = 0;
|
||||
my $index = 0;
|
||||
@fields = ();
|
||||
@field_buffer = ();
|
||||
my @chars = split(//,$parse_line);
|
||||
while ( $index <= $#chars )
|
||||
{
|
||||
my $char = $chars[$index];
|
||||
if ( $char eq "\"" )
|
||||
{
|
||||
# Following check is for character sequence \". Look at last character in the current
|
||||
# field_buffer and if it is a \ this " is not the end of the field.
|
||||
if ( $#field_buffer>=0 && $field_buffer[$#field_buffer] eq "\\" )
|
||||
{
|
||||
push (@field_buffer,$char);
|
||||
}
|
||||
elsif ( ! $in_quote_field )
|
||||
{
|
||||
$in_quote_field = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
# If this double quote is followed by a comma double quote ',"' it would be the end of the field
|
||||
# otherwise it should included in the field. Need to ignore white space when searching for the
|
||||
# next two characters.
|
||||
# The TCDB never breaks a line at field separators (have not seen it yet anyway) so the code does
|
||||
# not need to worry about finding a comma at the end of the line and checking for a double quote at
|
||||
# the beginning of the next line.
|
||||
my $comma_index = $index+1;
|
||||
while ( $comma_index<=$#chars )
|
||||
{
|
||||
last if ( $chars[$comma_index] =~ m/\S/ );
|
||||
$comma_index++;
|
||||
}
|
||||
my $double_quote_index = $comma_index+1;
|
||||
while ( $double_quote_index<=$#chars )
|
||||
{
|
||||
last if ( $chars[$double_quote_index] =~ m/\S/ && $chars[$double_quote_index] ne ',' );
|
||||
$double_quote_index++;
|
||||
}
|
||||
# Is the next non-white space character a comma followed by a double quote? If yes then we
|
||||
# have reached the end of the field.
|
||||
if ( ( $comma_index <= $#chars && $chars[$comma_index] eq "," ) &&
|
||||
( $double_quote_index <= $#chars && $chars[$double_quote_index] eq "\"" ) )
|
||||
{
|
||||
push (@fields,join("",@field_buffer));
|
||||
@field_buffer = ();
|
||||
# Skip past the comma.
|
||||
$index++;
|
||||
$in_quote_field = 0;
|
||||
}
|
||||
# This quote is at end of the line. Assume it's the last double quote on the CSV line.
|
||||
elsif ( $index == $#chars )
|
||||
{
|
||||
push (@fields,join("",@field_buffer));
|
||||
@field_buffer = ();
|
||||
$in_quote_field = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
push (@field_buffer,$char);
|
||||
}
|
||||
$in_quote_field = 0;
|
||||
my $index = 0;
|
||||
@fields = ();
|
||||
@field_buffer = ();
|
||||
my @chars = split(//,$parse_line);
|
||||
while ( $index <= $#chars )
|
||||
{
|
||||
my $char = $chars[$index];
|
||||
if ( $char eq "\"" )
|
||||
{
|
||||
# Following check is for character sequence \". Look at last character in the current
|
||||
# field_buffer and if it is a \ this " is not the end of the field.
|
||||
if ( $#field_buffer>=0 && $field_buffer[$#field_buffer] eq "\\" )
|
||||
{
|
||||
push (@field_buffer,$char);
|
||||
}
|
||||
elsif ( ! $in_quote_field )
|
||||
{
|
||||
$in_quote_field = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
# If this double quote is followed by a comma double quote ',"' it would be the end of the field
|
||||
# otherwise it should included in the field. Need to ignore white space when searching for the
|
||||
# next two characters.
|
||||
# The TCDB never breaks a line at field separators (have not seen it yet anyway) so the code does
|
||||
# not need to worry about finding a comma at the end of the line and checking for a double quote at
|
||||
# the beginning of the next line.
|
||||
my $comma_index = $index+1;
|
||||
while ( $comma_index<=$#chars )
|
||||
{
|
||||
last if ( $chars[$comma_index] =~ m/\S/ );
|
||||
$comma_index++;
|
||||
}
|
||||
my $double_quote_index = $comma_index+1;
|
||||
while ( $double_quote_index<=$#chars )
|
||||
{
|
||||
last if ( $chars[$double_quote_index] =~ m/\S/ && $chars[$double_quote_index] ne ',' );
|
||||
$double_quote_index++;
|
||||
}
|
||||
# Is the next non-white space character a comma followed by a double quote? If yes then we
|
||||
# have reached the end of the field.
|
||||
if ( ( $comma_index <= $#chars && $chars[$comma_index] eq "," ) &&
|
||||
( $double_quote_index <= $#chars && $chars[$double_quote_index] eq "\"" ) )
|
||||
{
|
||||
push (@fields,join("",@field_buffer));
|
||||
@field_buffer = ();
|
||||
# Skip past the comma.
|
||||
$index++;
|
||||
$in_quote_field = 0;
|
||||
}
|
||||
# This quote is at end of the line. Assume it's the last double quote on the CSV line.
|
||||
elsif ( $index == $#chars )
|
||||
{
|
||||
push (@fields,join("",@field_buffer));
|
||||
@field_buffer = ();
|
||||
$in_quote_field = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
push (@field_buffer,$char);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#
|
||||
# This check is for empty fields, i.e. "field1",,"field2".
|
||||
#
|
||||
elsif ( $char eq "," && ! $in_quote_field )
|
||||
{
|
||||
push (@fields,"");
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $in_quote_field )
|
||||
{
|
||||
push (@field_buffer,$char);
|
||||
}
|
||||
else
|
||||
{
|
||||
# Only allow white space between fields.
|
||||
error("Found unexpected character $char after phrase '" .
|
||||
join("",@field_buffer) .
|
||||
"' on line $line_count in file $input_filename") if ( $char =~ '\S');
|
||||
}
|
||||
}
|
||||
$index++;
|
||||
}
|
||||
|
||||
my $next_char = peek(*CSVINPUT);
|
||||
my $looks_like_end_of_csv_line = $next_char eq "\"" || $next_char eq "";
|
||||
|
||||
# Do we have all the fields we need?
|
||||
if ( ($#fields == ($number_of_fields-1)) && (! $in_quote_field) && $looks_like_end_of_csv_line )
|
||||
{
|
||||
print_fields(\*CSVWORK,\@fields,$testcasenamefield,$tcdb_format);
|
||||
$parse_line = "";
|
||||
@fields = ();
|
||||
}
|
||||
# Is this the TCDB export error? We have one less field than needed and the next line begins with a
|
||||
# double quote.
|
||||
elsif ( ($#fields == ($number_of_fields-2)) && (! $in_quote_field ) && $looks_like_end_of_csv_line )
|
||||
{
|
||||
if ( $_ =~ m/^"/ )
|
||||
{
|
||||
# Pull double quote of the end of the last field.
|
||||
$fields[$#fields] =~ s/"$//;
|
||||
# Create the missing field. Need to insert a double quote since print_fields expects a double
|
||||
# quote at end of last field.
|
||||
push (@fields,"\"");
|
||||
print_fields(\*CSVWORK,\@fields,$testcasenamefield,$tcdb_format);
|
||||
$parse_line = "";
|
||||
@fields = ();
|
||||
}
|
||||
}
|
||||
elsif ( $#fields >= $number_of_fields )
|
||||
{
|
||||
error("Read too many lines. Parse line '$parse_line' at line $line_count in file $input_filename");
|
||||
}
|
||||
else
|
||||
# Not enough fields yet. Need to append a \n to the $parse_line buffer and starting reading
|
||||
# until we find another double quote at the end of the line.
|
||||
{
|
||||
$parse_line .= "\\n";
|
||||
}
|
||||
}
|
||||
# When End of File is read the parse_line is suppose to be empty.
|
||||
error("Reached end of file while parsing '$parse_line'") if ( $parse_line ne "" );
|
||||
close(CSVINPUT);
|
||||
close(CSVWORK);
|
||||
error("Did not find the last double quote in file") if ( $in_quote_field );
|
||||
}
|
||||
}
|
||||
#
|
||||
# This check is for empty fields, i.e. "field1",,"field2".
|
||||
#
|
||||
elsif ( $char eq "," && ! $in_quote_field )
|
||||
{
|
||||
push (@fields,"");
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $in_quote_field )
|
||||
{
|
||||
push (@field_buffer,$char);
|
||||
}
|
||||
else
|
||||
{
|
||||
# Only allow white space between fields.
|
||||
error("Found unexpected character $char after phrase '" .
|
||||
join("",@field_buffer) .
|
||||
"' on line $line_count in file $input_filename") if ( $char =~ '\S');
|
||||
}
|
||||
}
|
||||
$index++;
|
||||
}
|
||||
|
||||
my $next_char = peek(*CSVINPUT);
|
||||
my $looks_like_end_of_csv_line = $next_char eq "\"" || $next_char eq "";
|
||||
|
||||
# Do we have all the fields we need?
|
||||
if ( ($#fields == ($number_of_fields-1)) && (! $in_quote_field) && $looks_like_end_of_csv_line )
|
||||
{
|
||||
print_fields(\*CSVWORK,\@fields,$testcasenamefield,$tcdb_format);
|
||||
$parse_line = "";
|
||||
@fields = ();
|
||||
}
|
||||
# Is this the TCDB export error? We have one less field than needed and the next line begins with a
|
||||
# double quote.
|
||||
elsif ( ($#fields == ($number_of_fields-2)) && (! $in_quote_field ) && $looks_like_end_of_csv_line )
|
||||
{
|
||||
if ( $_ =~ m/^"/ )
|
||||
{
|
||||
# Pull double quote of the end of the last field.
|
||||
$fields[$#fields] =~ s/"$//;
|
||||
# Create the missing field. Need to insert a double quote since print_fields expects a double
|
||||
# quote at end of last field.
|
||||
push (@fields,"\"");
|
||||
print_fields(\*CSVWORK,\@fields,$testcasenamefield,$tcdb_format);
|
||||
$parse_line = "";
|
||||
@fields = ();
|
||||
}
|
||||
}
|
||||
elsif ( $#fields >= $number_of_fields )
|
||||
{
|
||||
error("Read too many lines. Parse line '$parse_line' at line $line_count in file $input_filename");
|
||||
}
|
||||
else
|
||||
# Not enough fields yet. Need to append a \n to the $parse_line buffer and starting reading
|
||||
# until we find another double quote at the end of the line.
|
||||
{
|
||||
$parse_line .= "\\n";
|
||||
}
|
||||
}
|
||||
# When End of File is read the parse_line is suppose to be empty.
|
||||
error("Reached end of file while parsing '$parse_line'") if ( $parse_line ne "" );
|
||||
close(CSVINPUT);
|
||||
close(CSVWORK);
|
||||
error("Did not find the last double quote in file") if ( $in_quote_field );
|
||||
|
||||
#
|
||||
# Sort the corrected CSV to remove duplicate records.
|
||||
#
|
||||
if ( $tcdb )
|
||||
{
|
||||
my @args = ( "sort -u -o " . $work_filename . " " . $work_filename );
|
||||
system(@args) == 0 or error("Could not sort $work_filename");
|
||||
}
|
||||
|
||||
return $field_list;
|
||||
#
|
||||
# Sort the corrected CSV to remove duplicate records.
|
||||
#
|
||||
if ( $tcdb )
|
||||
{
|
||||
my @args = ( "-u -o " . $work_filename . " " . $work_filename );
|
||||
system("sort", @args) == 0 or error("Could not sort $work_filename");
|
||||
}
|
||||
|
||||
return $field_list;
|
||||
}
|
||||
|
||||
#
|
||||
# Remove the leading and trailing white space characters. Remove commas at end of line.
|
||||
#
|
||||
sub remove_white_space {
|
||||
my ($line) = @_;
|
||||
$line =~ s/^\s+//g;
|
||||
$line =~ s/\s+$//g;
|
||||
$line =~ s/,$//g;
|
||||
my ($line) = @_;
|
||||
$line =~ s/^\s+//g;
|
||||
$line =~ s/\s+$//g;
|
||||
$line =~ s/,$//g;
|
||||
|
||||
return $line;
|
||||
return $line;
|
||||
}
|
||||
|
||||
#
|
||||
@@ -430,15 +430,15 @@ sub remove_white_space {
|
||||
# Some new lines have been showing up as \\n in exports.
|
||||
#
|
||||
sub fix_entities {
|
||||
my ($line) = @_;
|
||||
$line =~ s/\\n/\n/g;
|
||||
$line =~ s/\&/&/g;
|
||||
$line =~ s/\</</g;
|
||||
$line =~ s/\>/>/g;
|
||||
$line =~ s/\'/'/g;
|
||||
$line =~ s/\"/"/g;
|
||||
my ($line) = @_;
|
||||
$line =~ s/\\n/\n/g;
|
||||
$line =~ s/\&/&/g;
|
||||
$line =~ s/\</</g;
|
||||
$line =~ s/\>/>/g;
|
||||
$line =~ s/\'/'/g;
|
||||
$line =~ s/\"/"/g;
|
||||
|
||||
return $line;
|
||||
return $line;
|
||||
}
|
||||
|
||||
GetOptions("debug" => \$debug, "tcdb" => \$tcdb, "help|usage|?" => \$usage);
|
||||
@@ -524,12 +524,12 @@ $field_list =~ s/,$//;
|
||||
my %fields;
|
||||
foreach my $field ( split(/,/,$field_list) )
|
||||
{
|
||||
$fields{$field} = "";
|
||||
$fields{$field} = "";
|
||||
}
|
||||
|
||||
my $csv = Class::CSV->parse(
|
||||
filename => $csv_work_filename,
|
||||
fields => [ split(/,/,$field_list) ]
|
||||
filename => $csv_work_filename,
|
||||
fields => [ split(/,/,$field_list) ]
|
||||
);
|
||||
|
||||
print XMLOUTPUT "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n";
|
||||
@@ -538,7 +538,7 @@ my $testopia_dtd = "testopia.dtd";
|
||||
open(DTDINPUT,$testopia_dtd) || die "Cannot open $testopia_dtd\n";
|
||||
while (<DTDINPUT>)
|
||||
{
|
||||
print XMLOUTPUT $_;
|
||||
print XMLOUTPUT $_;
|
||||
}
|
||||
close(DTDINPUT);
|
||||
print XMLOUTPUT "]>\n";
|
||||
@@ -546,150 +546,150 @@ print XMLOUTPUT "<testopia version=\"1.1\">\n";
|
||||
|
||||
if ( $TEST_PLAN_AUTHOR ne "Change TEST_PLAN_AUTHOR in import.pl user\@novell.com" )
|
||||
{
|
||||
print XMLOUTPUT " <testplan author=\"" . $TEST_PLAN_AUTHOR . "\" type=\"System\" archived=\"False\">\n";
|
||||
print XMLOUTPUT " <name>" . TEST_PLAN_NAME . "</name>\n";
|
||||
print XMLOUTPUT " <product>" . TEST_PLAN_PRODUCT . "</product>\n";
|
||||
print XMLOUTPUT " <productversion>" . TEST_PLAN_PRODUCT_VERSION . "</productversion>\n";
|
||||
print XMLOUTPUT " <document>" . TEST_PLAN_DOCUMENT . "</document>\n";
|
||||
print XMLOUTPUT " </testplan>\n";
|
||||
print XMLOUTPUT " <testplan author=\"" . $TEST_PLAN_AUTHOR . "\" type=\"System\" archived=\"False\">\n";
|
||||
print XMLOUTPUT " <name>" . TEST_PLAN_NAME . "</name>\n";
|
||||
print XMLOUTPUT " <product>" . TEST_PLAN_PRODUCT . "</product>\n";
|
||||
print XMLOUTPUT " <productversion>" . TEST_PLAN_PRODUCT_VERSION . "</productversion>\n";
|
||||
print XMLOUTPUT " <document>" . TEST_PLAN_DOCUMENT . "</document>\n";
|
||||
print XMLOUTPUT " </testplan>\n";
|
||||
}
|
||||
|
||||
my $line_count = 0;
|
||||
foreach my $line (@{$csv->lines()}) {
|
||||
$line_count += 1;
|
||||
print XMLOUTPUT " <testcase ";
|
||||
|
||||
error("No owner for Test Case at line $line_count in $csv_work_filename") if ( ! defined($fields{'owner'}) );
|
||||
my $owner = $line->owner();
|
||||
$owner = $tcdb_user{$line->owner()} if ( $tcdb );
|
||||
error("Could not find owner for Test Case at line $line_count in $csv_work_filename") if ( $owner eq "" );
|
||||
|
||||
print XMLOUTPUT "author=\"" . fix_entities($owner) . "\" ";
|
||||
if ( defined($fields{'priority'}) )
|
||||
{
|
||||
my $priority = fix_entities($line->priority());
|
||||
$priority =~ s/ .*//g;
|
||||
$priority = uc $priority;
|
||||
$priority = "P5" if ( $priority eq "" );
|
||||
$priority = "P" . $priority if ( ! ( $priority =~ m/^P.*/ ) );
|
||||
print XMLOUTPUT "priority=\"" . fix_entities($priority) . "\" ";
|
||||
}
|
||||
print XMLOUTPUT "automated=\"Manual\" ";
|
||||
print XMLOUTPUT "status=\"CONFIRMED\">\n";
|
||||
print XMLOUTPUT " <testplan_reference type=\"" . TEST_PLAN_NAME_TYPE . "\">" . TEST_PLAN_NAME . "</testplan_reference>\n";
|
||||
my $summary;
|
||||
if ( defined($fields{'testcasename'}) )
|
||||
{
|
||||
$summary = fix_entities($line->testcasename());
|
||||
}
|
||||
elsif ( defined($fields{'description'}) )
|
||||
{
|
||||
$summary = fix_entities($line->description());
|
||||
}
|
||||
if ( defined($fields{'environment'}) )
|
||||
{
|
||||
my $environment = $line->environment();
|
||||
$summary .= " - " . fix_entities($environment) if ( $environment ne "" );
|
||||
}
|
||||
error("No summary for Test Case at line $line_count in $csv_work_filename") if ( $summary eq "" );
|
||||
print XMLOUTPUT " <summary>" . $summary . "</summary>\n";
|
||||
print XMLOUTPUT " <defaulttester>" . fix_entities($owner) . "</defaulttester>\n";
|
||||
if ( $tcdb && defined($fields{'folder'}) )
|
||||
{
|
||||
my @folder = split(/\\/,$line->folder());
|
||||
print XMLOUTPUT " <tag>" . fix_entities($folder[4]) . "</tag>\n" if ( defined( $folder[4] ) );
|
||||
if ( defined($fields{'category'}) )
|
||||
{
|
||||
print XMLOUTPUT " <tag>" . fix_entities($folder[5]) . "</tag>\n" if ( defined( $folder[5] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
print XMLOUTPUT " <categoryname>" . fix_entities($folder[5]) . "</categoryname>\n" if ( defined( $folder[5] ) );
|
||||
}
|
||||
my $fieldstart = 6;
|
||||
while ( defined $folder[$fieldstart] )
|
||||
{
|
||||
print XMLOUTPUT " <tag>" . fix_entities($folder[$fieldstart]) . "</tag>\n";
|
||||
$fieldstart += 1;
|
||||
}
|
||||
}
|
||||
if ( defined($fields{'attributes'}) )
|
||||
{
|
||||
my @attributes = split(/,/,$line->attributes());
|
||||
foreach my $attribute (@attributes)
|
||||
{
|
||||
print XMLOUTPUT " <tag>" . fix_entities(remove_white_space($attribute)) . "</tag>\n";
|
||||
}
|
||||
}
|
||||
if ( defined($fields{'environment'}) )
|
||||
{
|
||||
my @environments = split(/,/,$line->environment());
|
||||
$line_count += 1;
|
||||
print XMLOUTPUT " <testcase ";
|
||||
|
||||
error("No owner for Test Case at line $line_count in $csv_work_filename") if ( ! defined($fields{'owner'}) );
|
||||
my $owner = $line->owner();
|
||||
$owner = $tcdb_user{$line->owner()} if ( $tcdb );
|
||||
error("Could not find owner for Test Case at line $line_count in $csv_work_filename") if ( $owner eq "" );
|
||||
|
||||
print XMLOUTPUT "author=\"" . fix_entities($owner) . "\" ";
|
||||
if ( defined($fields{'priority'}) )
|
||||
{
|
||||
my $priority = fix_entities($line->priority());
|
||||
$priority =~ s/ .*//g;
|
||||
$priority = uc $priority;
|
||||
$priority = "P5" if ( $priority eq "" );
|
||||
$priority = "P" . $priority if ( ! ( $priority =~ m/^P.*/ ) );
|
||||
print XMLOUTPUT "priority=\"" . fix_entities($priority) . "\" ";
|
||||
}
|
||||
print XMLOUTPUT "automated=\"Manual\" ";
|
||||
print XMLOUTPUT "status=\"CONFIRMED\">\n";
|
||||
print XMLOUTPUT " <testplan_reference type=\"" . TEST_PLAN_NAME_TYPE . "\">" . TEST_PLAN_NAME . "</testplan_reference>\n";
|
||||
my $summary;
|
||||
if ( defined($fields{'testcasename'}) )
|
||||
{
|
||||
$summary = fix_entities($line->testcasename());
|
||||
}
|
||||
elsif ( defined($fields{'description'}) )
|
||||
{
|
||||
$summary = fix_entities($line->description());
|
||||
}
|
||||
if ( defined($fields{'environment'}) )
|
||||
{
|
||||
my $environment = $line->environment();
|
||||
$summary .= " - " . fix_entities($environment) if ( $environment ne "" );
|
||||
}
|
||||
error("No summary for Test Case at line $line_count in $csv_work_filename") if ( $summary eq "" );
|
||||
print XMLOUTPUT " <summary>" . $summary . "</summary>\n";
|
||||
print XMLOUTPUT " <defaulttester>" . fix_entities($owner) . "</defaulttester>\n";
|
||||
if ( $tcdb && defined($fields{'folder'}) )
|
||||
{
|
||||
my @folder = split(/\\/,$line->folder());
|
||||
print XMLOUTPUT " <tag>" . fix_entities($folder[4]) . "</tag>\n" if ( defined( $folder[4] ) );
|
||||
if ( defined($fields{'category'}) )
|
||||
{
|
||||
print XMLOUTPUT " <tag>" . fix_entities($folder[5]) . "</tag>\n" if ( defined( $folder[5] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
print XMLOUTPUT " <categoryname>" . fix_entities($folder[5]) . "</categoryname>\n" if ( defined( $folder[5] ) );
|
||||
}
|
||||
my $fieldstart = 6;
|
||||
while ( defined $folder[$fieldstart] )
|
||||
{
|
||||
print XMLOUTPUT " <tag>" . fix_entities($folder[$fieldstart]) . "</tag>\n";
|
||||
$fieldstart += 1;
|
||||
}
|
||||
}
|
||||
if ( defined($fields{'attributes'}) )
|
||||
{
|
||||
my @attributes = split(/,/,$line->attributes());
|
||||
foreach my $attribute (@attributes)
|
||||
{
|
||||
print XMLOUTPUT " <tag>" . fix_entities(remove_white_space($attribute)) . "</tag>\n";
|
||||
}
|
||||
}
|
||||
if ( defined($fields{'environment'}) )
|
||||
{
|
||||
my @environments = split(/,/,$line->environment());
|
||||
|
||||
foreach my $environment (@environments)
|
||||
{
|
||||
print XMLOUTPUT " <tag>" . fix_entities(remove_white_space($environment)) . "</tag>\n";
|
||||
}
|
||||
}
|
||||
if ( defined($fields{'component'}) && ( $line->component() ne "") )
|
||||
{
|
||||
print XMLOUTPUT " <component product=\"" . TEST_PLAN_PRODUCT . "\">" . fix_entities(remove_white_space($line->component())) . "</component>\n";
|
||||
}
|
||||
if ( defined($fields{'category'}) && ( $line->category() ne "") )
|
||||
{
|
||||
print XMLOUTPUT " <categoryname>" . fix_entities(remove_white_space($line->category())) . "</categoryname>\n";
|
||||
}
|
||||
if ( defined($fields{'setupsteps'}) && ( $line->setupsteps() ne "") )
|
||||
{
|
||||
print XMLOUTPUT " <setup>";
|
||||
print XMLOUTPUT "[TCDB Setup Steps]\n" if ( $tcdb );
|
||||
print XMLOUTPUT fix_entities($line->setupsteps());
|
||||
print XMLOUTPUT "</setup>\n";
|
||||
}
|
||||
if ( defined($fields{'cleanupsteps'}) && ( $line->cleanupsteps() ne "") )
|
||||
{
|
||||
print XMLOUTPUT " <breakdown>";
|
||||
print XMLOUTPUT "[TCDB Cleanup Steps]\n" if ( $tcdb );
|
||||
print XMLOUTPUT fix_entities($line->cleanupsteps());
|
||||
print XMLOUTPUT "</breakdown>\n";
|
||||
}
|
||||
print XMLOUTPUT " <action>";
|
||||
if ( $tcdb )
|
||||
{
|
||||
if ( defined($fields{'testcasename'}) && ( $line->testcasename() ne "") )
|
||||
{
|
||||
print XMLOUTPUT "[TCDB Test Case Name]\n";
|
||||
print XMLOUTPUT fix_entities($line->testcasename());
|
||||
}
|
||||
if ( defined($fields{'description'}) && ( $line->description() ne "") )
|
||||
{
|
||||
print XMLOUTPUT "\n\n[TCDB Description]\n";
|
||||
print XMLOUTPUT fix_entities($line->description());
|
||||
}
|
||||
if ( defined($fields{'longdescription'}) && ( $line->longdescription() ne "") )
|
||||
{
|
||||
print XMLOUTPUT "\n\n[TCDB Long Description]\n";
|
||||
print XMLOUTPUT fix_entities($line->longdescription());
|
||||
}
|
||||
if ( defined($fields{'resdetails'}) && ( $line->resdetails() ne "") )
|
||||
{
|
||||
print XMLOUTPUT "\n\n[TCDB Resolution Details]\n";
|
||||
print XMLOUTPUT fix_entities($line->resdetails());
|
||||
}
|
||||
}
|
||||
if ( defined($fields{'steps'}) && ( $line->steps() ne "") )
|
||||
{
|
||||
print XMLOUTPUT "\n\n[TCDB Steps]\n" if ( $tcdb );
|
||||
print XMLOUTPUT fix_entities($line->steps());
|
||||
}
|
||||
print XMLOUTPUT "</action>\n";
|
||||
if ( defined($fields{'passfaildefinition'}) && ( $line->passfaildefinition() ne "") )
|
||||
{
|
||||
print XMLOUTPUT " <expectedresults>";
|
||||
print XMLOUTPUT "[TCDB Pass Fail Definition]\n" if ( $tcdb );
|
||||
print XMLOUTPUT fix_entities($line->passfaildefinition());
|
||||
print XMLOUTPUT "</expectedresults>\n";
|
||||
}
|
||||
print XMLOUTPUT " </testcase>\n";
|
||||
foreach my $environment (@environments)
|
||||
{
|
||||
print XMLOUTPUT " <tag>" . fix_entities(remove_white_space($environment)) . "</tag>\n";
|
||||
}
|
||||
}
|
||||
if ( defined($fields{'component'}) && ( $line->component() ne "") )
|
||||
{
|
||||
print XMLOUTPUT " <component product=\"" . TEST_PLAN_PRODUCT . "\">" . fix_entities(remove_white_space($line->component())) . "</component>\n";
|
||||
}
|
||||
if ( defined($fields{'category'}) && ( $line->category() ne "") )
|
||||
{
|
||||
print XMLOUTPUT " <categoryname>" . fix_entities(remove_white_space($line->category())) . "</categoryname>\n";
|
||||
}
|
||||
if ( defined($fields{'setupsteps'}) && ( $line->setupsteps() ne "") )
|
||||
{
|
||||
print XMLOUTPUT " <setup>";
|
||||
print XMLOUTPUT "[TCDB Setup Steps]\n" if ( $tcdb );
|
||||
print XMLOUTPUT fix_entities($line->setupsteps());
|
||||
print XMLOUTPUT "</setup>\n";
|
||||
}
|
||||
if ( defined($fields{'cleanupsteps'}) && ( $line->cleanupsteps() ne "") )
|
||||
{
|
||||
print XMLOUTPUT " <breakdown>";
|
||||
print XMLOUTPUT "[TCDB Cleanup Steps]\n" if ( $tcdb );
|
||||
print XMLOUTPUT fix_entities($line->cleanupsteps());
|
||||
print XMLOUTPUT "</breakdown>\n";
|
||||
}
|
||||
print XMLOUTPUT " <action>";
|
||||
if ( $tcdb )
|
||||
{
|
||||
if ( defined($fields{'testcasename'}) && ( $line->testcasename() ne "") )
|
||||
{
|
||||
print XMLOUTPUT "[TCDB Test Case Name]\n";
|
||||
print XMLOUTPUT fix_entities($line->testcasename());
|
||||
}
|
||||
if ( defined($fields{'description'}) && ( $line->description() ne "") )
|
||||
{
|
||||
print XMLOUTPUT "\n\n[TCDB Description]\n";
|
||||
print XMLOUTPUT fix_entities($line->description());
|
||||
}
|
||||
if ( defined($fields{'longdescription'}) && ( $line->longdescription() ne "") )
|
||||
{
|
||||
print XMLOUTPUT "\n\n[TCDB Long Description]\n";
|
||||
print XMLOUTPUT fix_entities($line->longdescription());
|
||||
}
|
||||
if ( defined($fields{'resdetails'}) && ( $line->resdetails() ne "") )
|
||||
{
|
||||
print XMLOUTPUT "\n\n[TCDB Resolution Details]\n";
|
||||
print XMLOUTPUT fix_entities($line->resdetails());
|
||||
}
|
||||
}
|
||||
if ( defined($fields{'steps'}) && ( $line->steps() ne "") )
|
||||
{
|
||||
print XMLOUTPUT "\n\n[TCDB Steps]\n" if ( $tcdb );
|
||||
print XMLOUTPUT fix_entities($line->steps());
|
||||
}
|
||||
print XMLOUTPUT "</action>\n";
|
||||
if ( defined($fields{'passfaildefinition'}) && ( $line->passfaildefinition() ne "") )
|
||||
{
|
||||
print XMLOUTPUT " <expectedresults>";
|
||||
print XMLOUTPUT "[TCDB Pass Fail Definition]\n" if ( $tcdb );
|
||||
print XMLOUTPUT fix_entities($line->passfaildefinition());
|
||||
print XMLOUTPUT "</expectedresults>\n";
|
||||
}
|
||||
print XMLOUTPUT " </testcase>\n";
|
||||
}
|
||||
print XMLOUTPUT "</testopia>\n";
|
||||
|
||||
|
||||
@@ -83,17 +83,17 @@ my $xml;
|
||||
my $filename;
|
||||
if ( $#ARGV == -1 )
|
||||
{
|
||||
# Read STDIN in slurp mode. VERY dangerous, but we live on the wild side ;-)
|
||||
local($/);
|
||||
$xml = <>;
|
||||
# Read STDIN in slurp mode. VERY dangerous, but we live on the wild side ;-)
|
||||
local($/);
|
||||
$xml = <>;
|
||||
}
|
||||
elsif ( $#ARGV == 0 )
|
||||
{
|
||||
$filename = $ARGV[0];
|
||||
$filename = $ARGV[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
pod2usage(0);
|
||||
pod2usage(0);
|
||||
}
|
||||
|
||||
Debug("Parsing tree", DEBUG_LEVEL);
|
||||
|
||||
@@ -438,22 +438,22 @@ if ($serverpush && !$cgi->param('debug')) {
|
||||
print $cgi->multipart_start;
|
||||
}
|
||||
else {
|
||||
my @time = localtime(time());
|
||||
my $date = sprintf "%04d-%02d-%02d", 1900+$time[5],$time[4]+1,$time[3];
|
||||
my $filename = "testcases-$date.$format->{extension}";
|
||||
|
||||
my $disp = "inline";
|
||||
# We set CSV files to be downloaded, as they are designed for importing
|
||||
my @time = localtime(time());
|
||||
my $date = sprintf "%04d-%02d-%02d", 1900+$time[5],$time[4]+1,$time[3];
|
||||
my $filename = "testcases-$date.$format->{extension}";
|
||||
|
||||
my $disp = "inline";
|
||||
# We set CSV files to be downloaded, as they are designed for importing
|
||||
# into other programs.
|
||||
if ( $format->{'extension'} eq "csv" || $format->{'extension'} eq "xml" )
|
||||
{
|
||||
$disp = "attachment";
|
||||
$vars->{'displaycolumns'} = \@Bugzilla::Testopia::Constants::TESTCASE_EXPORT;
|
||||
$disp = "attachment";
|
||||
$vars->{'displaycolumns'} = \@Bugzilla::Testopia::Constants::TESTCASE_EXPORT;
|
||||
}
|
||||
|
||||
# Suggest a name for the bug list if the user wants to save it as a file.
|
||||
print $cgi->header(-type => $contenttype,
|
||||
-content_disposition => "$disp; filename=$filename");
|
||||
-content_disposition => "$disp; filename=$filename");
|
||||
}
|
||||
|
||||
$template->process($format->{'template'}, $vars)
|
||||
|
||||
@@ -174,7 +174,7 @@ elsif ($action eq 'get_categories'){
|
||||
my $cats_ref = $cat->get_element_categories_by_product($prod_id);
|
||||
|
||||
foreach my $e (@{$cats_ref}){
|
||||
$ret .= $e->id.'||'.$e->name.'|||';
|
||||
$ret .= $e->id.'||'.$e->name.'|||';
|
||||
}
|
||||
}
|
||||
chop($ret);
|
||||
@@ -230,13 +230,13 @@ elsif ($action eq 'get_valid_exp'){
|
||||
my $prop = Bugzilla::Testopia::Environment::Property->new($prop_id);
|
||||
my $exp = $prop->validexp;
|
||||
|
||||
my @exps = split /\|/, $exp;
|
||||
foreach my $exp (@exps){
|
||||
$ret .=$exp.'|||';
|
||||
}
|
||||
my @exps = split /\|/, $exp;
|
||||
foreach my $exp (@exps){
|
||||
$ret .=$exp.'|||';
|
||||
}
|
||||
}
|
||||
chop($ret);
|
||||
print $ret;
|
||||
chop($ret);
|
||||
print $ret;
|
||||
}
|
||||
elsif ($action eq 'save_query'){
|
||||
;
|
||||
|
||||
@@ -50,9 +50,9 @@ local our $cgi = Bugzilla->cgi;
|
||||
my $case_id = trim(Bugzilla->cgi->param('case_id')) || '';
|
||||
|
||||
unless ($case_id){
|
||||
print $cgi->header();
|
||||
$template->process("testopia/case/choose.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
print $cgi->header();
|
||||
$template->process("testopia/case/choose.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
exit;
|
||||
}
|
||||
validate_test_id($case_id, 'case');
|
||||
@@ -65,8 +65,8 @@ my $disp = "inline";
|
||||
# into other programs.
|
||||
if ( $format->{'extension'} eq "csv" || $format->{'extension'} eq "xml" )
|
||||
{
|
||||
$disp = "attachment";
|
||||
$vars->{'displaycolumns'} = \@Bugzilla::Testopia::Constants::TESTCASE_EXPORT;
|
||||
$disp = "attachment";
|
||||
$vars->{'displaycolumns'} = \@Bugzilla::Testopia::Constants::TESTCASE_EXPORT;
|
||||
}
|
||||
|
||||
# Suggest a name for the file if the user wants to save it as a file.
|
||||
@@ -74,7 +74,7 @@ my @time = localtime(time());
|
||||
my $date = sprintf "%04d-%02d-%02d", 1900+$time[5],$time[4]+1,$time[3];
|
||||
my $filename = "testcase-$case_id-$date.$format->{extension}";
|
||||
print $cgi->header(-type => $format->{'ctype'},
|
||||
-content_disposition => "$disp; filename=$filename");
|
||||
-content_disposition => "$disp; filename=$filename");
|
||||
|
||||
$vars->{'action'} = "Commit";
|
||||
$vars->{'form_action'} = "tr_show_case.cgi";
|
||||
@@ -103,7 +103,7 @@ elsif ($action eq 'do_clone'){
|
||||
}
|
||||
if ($cgi->param('existing')){
|
||||
foreach my $p (@{$case->plans}){
|
||||
$planseen{$p->id} = 1;
|
||||
$planseen{$p->id} = 1;
|
||||
}
|
||||
}
|
||||
my $author = $cgi->param('keepauthor') ? $case->author->id : Bugzilla->user->id;
|
||||
@@ -457,6 +457,6 @@ sub display {
|
||||
$vars->{'case'} = $case;
|
||||
$vars->{'table'} = $table;
|
||||
$vars->{'user'} = Bugzilla->user;
|
||||
$template->process($format->{'template'}, $vars) ||
|
||||
ThrowTemplateError($template->error());
|
||||
$template->process($format->{'template'}, $vars) ||
|
||||
ThrowTemplateError($template->error());
|
||||
}
|
||||
|
||||
@@ -248,17 +248,17 @@ else {
|
||||
|
||||
|
||||
sub display {
|
||||
detaint_natural($env_id);
|
||||
detaint_natural($env_id);
|
||||
validate_test_id($env_id, 'environment');
|
||||
my $env = Bugzilla::Testopia::Environment->new($env_id);
|
||||
|
||||
if(!defined($env)){
|
||||
my $env = Bugzilla::Testopia::Environment->new({'environment_id' => 0});
|
||||
$vars->{'environment'} = $env;
|
||||
$vars->{'action'} = 'do_add';
|
||||
$template->process("testopia/environment/add.html.tmpl", $vars)
|
||||
|| print $template->error();
|
||||
exit;
|
||||
my $env = Bugzilla::Testopia::Environment->new({'environment_id' => 0});
|
||||
$vars->{'environment'} = $env;
|
||||
$vars->{'action'} = 'do_add';
|
||||
$template->process("testopia/environment/add.html.tmpl", $vars)
|
||||
|| print $template->error();
|
||||
exit;
|
||||
}
|
||||
ThrowUserError("testopia-read-only", {'object' => $env}) unless $env->canview;
|
||||
my $category = Bugzilla::Testopia::Environment::Category->new({'id' => 0});
|
||||
|
||||
@@ -436,24 +436,24 @@ sub display {
|
||||
$vars->{'plan'} = $plan;
|
||||
|
||||
my $format = $template->get_format("testopia/plan/show", scalar $cgi->param('format'), scalar $cgi->param('ctype'));
|
||||
my $disp = "inline";
|
||||
# We set CSV files to be downloaded, as they are designed for importing
|
||||
my $disp = "inline";
|
||||
# We set CSV files to be downloaded, as they are designed for importing
|
||||
# into other programs.
|
||||
if ( $format->{'extension'} eq "csv" || $format->{'extension'} eq "xml" )
|
||||
{
|
||||
$disp = "attachment";
|
||||
$vars->{'displaycolumns'} = \@Bugzilla::Testopia::Constants::TESTCASE_EXPORT;
|
||||
$disp = "attachment";
|
||||
$vars->{'displaycolumns'} = \@Bugzilla::Testopia::Constants::TESTCASE_EXPORT;
|
||||
}
|
||||
|
||||
# Suggest a name for the file if the user wants to save it as a file.
|
||||
|
||||
# Suggest a name for the file if the user wants to save it as a file.
|
||||
my @time = localtime(time());
|
||||
my $date = sprintf "%04d-%02d-%02d", 1900+$time[5],$time[4]+1,$time[3];
|
||||
my $filename = "testcases-$date.$format->{extension}";
|
||||
my $filename = "testcases-$date.$format->{extension}";
|
||||
print $cgi->header(-type => $format->{'ctype'},
|
||||
-content_disposition => "$disp; filename=$filename")
|
||||
unless ($action eq 'do_clone');
|
||||
|
||||
$vars->{'percentage'} = \&percentage;
|
||||
-content_disposition => "$disp; filename=$filename")
|
||||
unless ($action eq 'do_clone');
|
||||
|
||||
$vars->{'percentage'} = \&percentage;
|
||||
$template->process($format->{'template'}, $vars) ||
|
||||
ThrowTemplateError($template->error());
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/perl
|
||||
#!/usr/bin/perl -wT
|
||||
####!/usr/bin/perl -d:ptkdb -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user