testopia.API
Class TestPlan

java.lang.Object
  extended by testopia.API.TestPlan

public class TestPlan
extends java.lang.Object

Creates a test plan object, that allows the user to create, change and get test plan values

Author:
anelson

Constructor Summary
TestPlan(java.lang.String userName, java.lang.String password, java.net.URL url, java.lang.Integer planID)
           
 
Method Summary
 java.util.HashMap<java.lang.String,java.lang.Object> getAttributes()
          Gets the attributes of the test plan, planID must not be null
 java.lang.Object[] getBuilds()
           
 java.util.HashMap<java.lang.String,java.lang.Object> getCategories()
           
 java.lang.Object[] getComponents()
           
static java.lang.Object[] getList(java.lang.String userName, java.lang.String password, java.net.URL url, java.util.HashMap<java.lang.String,java.lang.Object> values)
          Returns hashmap(s) of testplans that match the inputed values
 java.lang.Object[] getTestCases()
           
 java.lang.Object[] getTestRuns()
           
 int makeTestPlan(java.lang.String authorID, java.lang.String productID, java.lang.String defaultProductVersion, java.lang.String typeID, java.lang.String name)
           
 void setAuthorID(int authorID)
           
 void setCreationDate(java.lang.String creationDate)
           
 void setDefaultProductVersion(java.lang.String defaultProductVersion)
           
 void setIsActive(boolean isActive)
           
 void setName(java.lang.String name)
           
 void setProductID(int productID)
           
 void setTypeID(int typeID)
           
 void update()
          Updates are not called when the .set is used.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestPlan

public TestPlan(java.lang.String userName,
                java.lang.String password,
                java.net.URL url,
                java.lang.Integer planID)
Parameters:
userName - your bugzilla/testopia userName
password - your password
url - the url of the testopia server
planID - - Integer the planID, you may enter null here if you are creating a test plan
Method Detail

makeTestPlan

public int makeTestPlan(java.lang.String authorID,
                        java.lang.String productID,
                        java.lang.String defaultProductVersion,
                        java.lang.String typeID,
                        java.lang.String name)
Parameters:
authorID - the bugzilla/testopia ID of the author
productID - the bugzilla/testopia ID of the product
defaultProductVersion -
typeID -
name - the name of the test plan
Returns:
the ID of the test plan

update

public void update()
            throws java.lang.Exception
Updates are not called when the .set is used. You must call update after all your sets to push the changes over to testopia.

Throws:
java.lang.Exception - if planID is null (you made the TestPlan with a null planID and have not created a new test plan)

setAuthorID

public void setAuthorID(int authorID)
Parameters:
authorID - int - the bugzilla authorID that the TestPlan will be changed to

setDefaultProductVersion

public void setDefaultProductVersion(java.lang.String defaultProductVersion)
Parameters:
defaultProductVersion - String - the default product version the test plan will be changed to

setCreationDate

public void setCreationDate(java.lang.String creationDate)
Parameters:
creationDate - String - the creation date the test plan will be changed to (Format: yyyy-mm-dd hh:mm:ss)

setIsActive

public void setIsActive(boolean isActive)
Parameters:
isActive - boolean - change if the test plan is active or not

setName

public void setName(java.lang.String name)
Parameters:
name - String - the new name of the test plan

setProductID

public void setProductID(int productID)
Parameters:
productID - int - the new product ID of the test plan

setTypeID

public void setTypeID(int typeID)
Parameters:
typeID - int - the new type of the test plan

getAttributes

public java.util.HashMap<java.lang.String,java.lang.Object> getAttributes()
                                                                   throws java.lang.Exception
Gets the attributes of the test plan, planID must not be null

Returns:
a hashMap of all the values found. Returns null if there is an error and the TestPlan cannot be returned
Throws:
java.lang.Exception

getCategories

public java.util.HashMap<java.lang.String,java.lang.Object> getCategories()
                                                                   throws java.lang.Exception
Returns:
a hashMap of all the values found. Returns null if there is an error and the TestPlan cannot be returned
Throws:
java.lang.Exception

getBuilds

public java.lang.Object[] getBuilds()
                             throws java.lang.Exception
Returns:
an array of objects (Object[]) of all the values found for the builds. Returns null if there is an error and the TestPlan cannot be returned
Throws:
java.lang.Exception

getComponents

public java.lang.Object[] getComponents()
                                 throws java.lang.Exception
Returns:
an array of objects (Object[]) of all the components found. Returns null if there is an error and the TestPlan cannot be returned
Throws:
java.lang.Exception

getList

public static java.lang.Object[] getList(java.lang.String userName,
                                         java.lang.String password,
                                         java.net.URL url,
                                         java.util.HashMap<java.lang.String,java.lang.Object> values)
Returns hashmap(s) of testplans that match the inputed values

Parameters:
userName - your bugzilla/testopia userName
password - your password
url - the url of the testopia server
values - a HashMap with the parameters that will be searched for if you supply the pair "plan_id", 5 then plan_id 5 will be returned. Any combination of testplan attributes can be entered and the result will be all matches that fit the inputed values
Returns:

getTestCases

public java.lang.Object[] getTestCases()
                                throws java.lang.Exception
Returns:
an array of objects (Object[]) of all the testcases found. Returns null if there is an error and the TestPlan cannot be returned
Throws:
java.lang.Exception

getTestRuns

public java.lang.Object[] getTestRuns()
                               throws java.lang.Exception
Returns:
an array of objects (Object[]) of all the test runs found. Returns null if there is an error and the TestPlan cannot be returned
Throws:
java.lang.Exception