com.tszadel.qctools4j.clients
Class TestClient

java.lang.Object
  extended by com.tszadel.qctools4j.clients.AbstractClient
      extended by com.tszadel.qctools4j.clients.TestClient

public class TestClient
extends AbstractClient

The client that manages the tests.

Author:
tszadel

Field Summary
static int WITH_STEPS
          Steps have to be added.
 
Fields inherited from class com.tszadel.qctools4j.clients.AbstractClient
connection, NONE, WITH_ATTACHMENTS, WITH_CHILDREN
 
Method Summary
 void deleteTest(Test pTest)
          Delete a test.
 Map<String,FieldDescription> getFieldDescriptions()
          Overrides getFieldDescriptions.
 TestFolder getRootFolder()
          Returns the root test folder with all its children.
 TestFolder getTestFolder(String pFolderPath)
          Fills the folder with all its children (recursively).
 TestFolder getTestFolder(TestFolder pFolder)
          Fills the folder with all its children (recursively).
 List<Test> getTests()
          Returns the list of tests.
 List<Test> getTests(TestFolder pFolder)
          Returns the list of tests from a given folder (without children).
 List<Test> getTests(TestFolder pFolder, int pFlag)
          Returns the list of tests from a given folder.
 boolean isExistingFolder(String pFolder)
          Check if the folder exists.
 boolean isExistingFolder(TestFolder pFolder)
          Check if the folder exists.
 boolean isExistingTest(String pName, String pPath)
          Check if the given test name already exists.
 void saveTest(Test pTest)
          Save a test (with attachments).
 
Methods inherited from class com.tszadel.qctools4j.clients.AbstractClient
canExecuteAction, checkConnection, checkLogin, checkPermission, containsFlag, getEncodedString, loadFields, retrieveAttachments, retrieveCustomFields, storeAttachments, storeFields, toAttachment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WITH_STEPS

public static final int WITH_STEPS
Steps have to be added.

See Also:
Constant Field Values
Method Detail

deleteTest

public void deleteTest(Test pTest)
                throws QcException
Delete a test.

Parameters:
pTest - The test.
Throws:
QcException - QC Error.

getFieldDescriptions

public Map<String,FieldDescription> getFieldDescriptions()
                                                  throws QcException
Overrides getFieldDescriptions. Returns the descriptions of the fields.

Specified by:
getFieldDescriptions in class AbstractClient
Returns:
The description of the fields (key=name of the field, value=description of the field).
Throws:
QcException - Qc Error.
See Also:
AbstractClient.getFieldDescriptions()

getRootFolder

public TestFolder getRootFolder()
                         throws QcException
Returns the root test folder with all its children.

Returns:
The root test folder with all its children.
Throws:
QcException - QC Error.

getTestFolder

public TestFolder getTestFolder(String pFolderPath)
                         throws QcException
Fills the folder with all its children (recursively).

Parameters:
pFolderPath - The test path.
Returns:
The test folder.
Throws:
QcException - QC Error.

getTestFolder

public TestFolder getTestFolder(TestFolder pFolder)
                         throws QcException
Fills the folder with all its children (recursively).

Parameters:
pFolder - The folder.
Returns:
The (same) test folder.
Throws:
QcException - QC Error.

getTests

public List<Test> getTests()
                    throws QcException
Returns the list of tests.

Returns:
The list of tests.
Throws:
QcException - QC Error.

getTests

public List<Test> getTests(TestFolder pFolder)
                    throws QcException
Returns the list of tests from a given folder (without children).

Parameters:
pFolder - The folder.
Returns:
The list of tests.
Throws:
QcException - QC Error.

getTests

public List<Test> getTests(TestFolder pFolder,
                           int pFlag)
                    throws QcException
Returns the list of tests from a given folder.

Parameters:
pFolder - The folder.
pFlag - The flags.
Returns:
The list of tests.
Throws:
QcException - QC Error.

isExistingFolder

public boolean isExistingFolder(String pFolder)
                         throws QcException
Check if the folder exists.

Parameters:
pFolder - The folder.
Returns:
True if the folder exists, false otherwise.
Throws:
QcException - QC Error.

isExistingFolder

public boolean isExistingFolder(TestFolder pFolder)
                         throws QcException
Check if the folder exists.

Parameters:
pFolder - The folder.
Returns:
True if the folder exists, false otherwise.
Throws:
QcException - QC Error.

isExistingTest

public boolean isExistingTest(String pName,
                              String pPath)
                       throws QcException
Check if the given test name already exists.

Parameters:
pName - The name of the test.
pPath - The path of the test.
Returns:
True if it already exists.
Throws:
QcException - QC Error.

saveTest

public void saveTest(Test pTest)
              throws QcException
Save a test (with attachments).

Parameters:
pTest - The test.
Throws:
QcException - QC Error.