Testopia:Documentation:XMLRPC:TestPlan: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
(Replacing page with 'see http://landfill.bugzilla.org/testopia2/docs/html/api/Bugzilla/WebService/Testopia/TestPlan.html')
 
Line 1: Line 1:
__NOEDITSECTION__
see http://landfill.bugzilla.org/testopia2/docs/html/api/Bugzilla/WebService/Testopia/TestPlan.html
Back to [[Testopia:Documentation:XMLRPC |Testopia XML-RPC API]]
 
==TestPlan==
 
===Description===
The test plan is the glue of Testopia. Virtually all other objects associate to a plan.
 
===Hiearchy===
Bugzilla::WebService::Testopia::TestPlan
 
===Attributes===
 
{| border=1 cellpadding=4
| '''Attribute''' || '''Data Type''' || '''Comments''' || '''Create''' || '''Read''' || '''Update'''
|-
| author_id || integer || || Required || X ||
|-
| default_product_version || string || || Required || X || X
|-
| creation_date || string || Format: yyyy-mm-dd hh:mm:ss || || X ||
|-
| isactive || integer || || Optional || X || X
|-
| name || string || || Required || X || X
|-
| plan_id || integer || || || X ||
|-
| product_id || integer || || Required || X || X
|-
| type_id || integer || || Required || X || X
|-
|}
 
 
===Methods===
 
----
====get - Get A TestPlan by ID====
----
 
=====Usage=====
TestPlan.get
 
=====Parameters=====
{| border=1 cellpadding=4
| '''Parameter''' || '''Data Type''' || '''Comments'''
|-
| plan_id || integer || Must be greater than 0.
|-
|}
 
=====Result=====
A hash map of key/value pairs for the attributes listed above or a hash map containing values for the keys, "faultCode" and "faultString".
 
=====Example=====
<b>Java</b>
ArrayList<Object> params = new ArrayList<Object>();
params.add(plan_id);
Object[] result = (Object[]) client.execute("TestPlan.get", params);
 
<b>Perl</b>
my $plan_id = 1;
my $result = $proxy->call("TestPlan.get", $plan_id);
 
----
 
====list - Get A List of TestPlans Based on A Query====
----
 
=====Usage=====
TestPlan.list
 
=====Parameters=====
{| border=1 cellpadding=4
| '''Parameter''' || '''Data Type''' || '''Comments'''
|-
| query || hashmap || Can not be null.  See [[Bugzilla_XML-RPC_API_Query_Examples |Query Examples]].
|-
|}
 
 
=====Result=====
An array of TestPlan hash maps or a hash map containing values for the keys, "faultCode" and "faultString".
 
=====Example=====
<b>Perl</b>
my $result = $proxy->call("TestPlan.list", {"author_id" => 1, "product_id" => 1});
 
 
----
====create - Create A New TestPlan====
----
 
=====Usage=====
TestPlan.create
 
=====Parameters=====
{| border=1 cellpadding=4
| '''Parameter''' || '''Data Type''' || '''Comments'''
|-
| new_values || hashmap || See required attributes list<sup>1</sup> below.
|-
|}
 
<sup>1</sup> Required attributes: author_id, product_id, default_product_version, type_id, and name.
 
 
=====Result=====
An integer value representing the new plan_id or a hash map containing values for the keys, "faultCode" and "faultString".
 
=====Example=====
<b>Perl</b>
my $result = $proxy->call("TestPlan.create", {name => "New Plan", product_id => 1, author_id => 2, type_id => 2, default_product_version => "1.0"});
 
----
====update - Update An Existing TestPlan====
----
 
=====Usage=====
TestPlan.update
 
=====Parameters=====
{| border=1 cellpadding=4
| '''Parameter''' || '''Data Type''' || '''Comments'''
|-
| plan_id || integer ||
|-
| new_values || hashmap || plan_id, author_id, and creation_date can not be modified.
|-
|}
 
 
=====Result=====
The modified TestPlan on success or a hash map containing values for the keys, "faultCode" and "faultString".
 
=====Example=====
<b>Perl</b>
my $plan_id = 2;
my $result = $proxy->call("TestPlan.update", $plan_id, {name => "Updated Plan Name", isactive => 1});
 
----
====get_categories - Get A List of Categories For An Existing Test Plan====
----
 
=====Usage=====
TestPlan.get_categories
 
=====Parameters=====
{| border=1 cellpadding=4
| '''Parameter''' || '''Data Type''' || '''Comments'''
|-
| plan_id || integer ||
|-
|}
 
 
=====Result=====
An array of Category objects on success or a hash map containing values for the keys, "faultCode" and "faultString".
 
=====Example=====
<b>Perl</b>
my $plan_id = 2;
my $result = $proxy->call("TestPlan.get_categories", $plan_id);
 
 
----
====get_builds - Get A List of Builds For An Existing Test Plan====
----
 
=====Usage=====
TestPlan.get_builds
 
=====Parameters=====
{| border=1 cellpadding=4
| '''Parameter''' || '''Data Type''' || '''Comments'''
|-
| plan_id || integer ||
|-
|}
 
 
=====Result=====
An array of Build objects on success or a hash map containing values for the keys, "faultCode" and "faultString".
 
=====Example=====
<b>Java</b>
ArrayList<Object> params = new ArrayList<Object>();
params.add(PlanID);
Object[] result = (Object[]) client.execute("TestPlan.get_builds", params);
 
<b>Perl</b>
my $plan_id = 2;
my $result = $proxy->call("TestPlan.get_builds", $plan_id);
 
 
----
====get_components - Get A List of Components For An Existing Test Plan====
----
 
=====Usage=====
TestPlan.get_components
 
=====Parameters=====
{| border=1 cellpadding=4
| '''Parameter''' || '''Data Type''' || '''Comments'''
|-
| plan_id || integer ||
|-
|}
 
 
=====Result=====
An array of Component objects on success or a hash map containing values for the keys, "faultCode" and "faultString".
 
=====Example=====
<b>Java</b>
ArrayList<Object> params = new ArrayList<Object>();
params.add(plan_id);
Object[] result = (Object[]) client.execute("TestPlan.get_components", params);
 
<b>Perl</b>
my $plan_id = 2;
my $result = $proxy->call("TestPlan.get_components", $plan_id);
 
 
----
====get_test_cases - Get A List of Test Cases For An Existing Test Plan====
----
 
=====Usage=====
TestPlan.get_test_cases
 
=====Parameters=====
{| border=1 cellpadding=4
| '''Parameter''' || '''Data Type''' || '''Comments'''
|-
| plan_id || integer ||
|-
|}
 
 
=====Result=====
An array of TestCase objects on success or a hash map containing values for the keys, "faultCode" and "faultString".
 
=====Example=====
<b>Perl</b>
my $plan_id = 2;
my $result = $proxy->call("TestPlan.get_test_cases", $plan_id);
 
 
----
====get_test_runs - Get A List of Test Runs For An Existing Test Plan====
----
 
=====Usage=====
TestPlan.get_test_runs
 
=====Parameters=====
{| border=1 cellpadding=4
| '''Parameter''' || '''Data Type''' || '''Comments'''
|-
| plan_id || integer ||
|-
|}
 
 
=====Result=====
An array of TestRun objects on success or a hash map containing values for the keys, "faultCode" and "faultString".
 
=====Example=====
<b>Perl</b>
my $plan_id = 2;
my $result = $proxy->call("TestPlan.get_test_runs", $plan_id);
 
----
====add_tag - Add a tag to the given TestPlan====
----
 
=====Usage=====
TestPlan.add_tag
 
=====Parameters=====
{| border=1 cellpadding=4
| '''Parameter''' || '''Data Type''' || '''Comments'''
|-
| plan_id || integer ||
|-
| tag_name || string || Creates tag if it does not exist
|-
|}
 
 
=====Result=====
The integer , 0, on success or a hash map containing values for the keys, "faultCode" and "faultString".
 
=====Example=====
<b>Java</b>
ArrayList<Object> params = new ArrayList<Object>();
params.add(testPlan_id);
params.add(tag_name);
Integer result = (Integer)client.execute("TestPlan.add_tag", params);
 
<b>Perl</b>
my $plan_id = 2;
my $tag_name = "New Tag Name";
my $result = $proxy->call("TestPlan.add_tag", $plan_id, $tag_name);
 
----
====remove_tag - Remove a tag from the given TestPlan====
----
 
=====Usage=====
TestPlan.remove_tag
 
=====Parameters=====
{| border=1 cellpadding=4
| '''Parameter''' || '''Data Type''' || '''Comments'''
|-
| plan_id || integer ||
|-
| tag_name || string ||
|-
|}
 
 
=====Result=====
The integer , 0, on success or a hash map containing values for the keys, "faultCode" and "faultString".
 
=====Example=====
<b>Perl</b>
my $plan_id = 2;
my $tag_name = "Tag Name";
my $result = $proxy->call("TestPlan.remove_tag", $plan_id, $tag_name);
 
----
====get_tags - Get a list of tags for the given TestPlan====
----
 
=====Usage=====
TestPlan.get_tags
 
=====Parameters=====
{| border=1 cellpadding=4
| '''Parameter''' || '''Data Type''' || '''Comments'''
|-
| plan_id || integer ||
|-
|}
 
 
=====Result=====
An array of Tag hash maps or a hash map containing values for the keys, "faultCode" and "faultString".
 
=====Example=====
<b>Perl</b>
my $plan_id = 2;
my $result = $proxy->call("TestPlan.get_tags", $plan_id);
 
----
====lookup_type_id_by_name - Lookup A TestPlan Type ID By Its Name====
----
 
=====Usage=====
TestPlan.lookup_type_id_by_name
 
=====Parameters=====
{| border=1 cellpadding=4
| '''Parameter''' || '''Data Type''' || '''Comments'''
|-
| name || string || Cannot be null or empty string
|-
|}
 
 
=====Result=====
The TestPlan type id for the respective name or 0 if an error occurs.
 
=====Example=====
<b>Perl</b>
my $type_name = "Unit";
my $result = $proxy->call('TestPlan.lookup_type_id_by_name', $type_name);
 
----
====lookup_type_name_by_id - Lookup A TestPlan Type Name By Its ID====
----
 
=====Usage=====
TestPlan.lookup_type_name_by_id
 
=====Parameters=====
{| border=1 cellpadding=4
| '''Parameter''' || '''Data Type''' || '''Comments'''
|-
| id || integer || Cannot be 0
|-
|}
 
 
=====Result=====
The TestPlan type name for the respective id or empty string if an error occurs.
 
=====Example=====
<b>Perl</b>
my $type_id = 1;
my $result = $proxy->call('TestPlan.lookup_type_name_by_id', $type_id);
 
 
 
<br>Back to the [[Testopia |Testopia Main Page]]

Latest revision as of 17:08, 23 June 2008