com.togethersoft.testing.host
Interface ITestHost


public interface ITestHost

Interface which provides general services for managing test assets


Method Summary
 voidaddTestHostListener(ITestHostListener listener)
          Deprecated.  
 IAssertioncreateAsserion(String assertionType)
          Creates new assertion if given type.
 ITestAssetReferencecreateReference(ITestAssetRO asset)
          Creates a new reference to be pasted into some target.
 ITargetcreateTarget()
          Creates new suite target
 ITestCollectioncreateTestCollection(String name)
          Create test collection.
 ITestResultAssetcreateTestResult(String name)
          Create test result.
 IElementROfind(String refid)
          finds test element with specified reference id .
 IElementROfind(ITestCollection collection, String refid)
          Deprecated.  
 String[]findResults(String refId)
           
 ICategory[]getAssertionCategories()
          Returns an array of known assertion categories
 ICategory[]getAssetCategories()
          Returns an array of known asset categories
 IEnvironmentgetEnvironment()
          Deprecated.  
 IProgressMonitorgetProgress()
          Deprecated.  
 IResourcegetResource(URL location)
          Returns resource at given URL
 ITestCollectiongetResultCollection()
          Returns ITestCollection containing test results.
 ICategory[]getTaskCategories()
          Returns an array of task categories
 TaskDefinitiongetTaskDefinition(ICategory cat)
          Returns a task definition for given category
 ITestAssetFactorygetTestAssetFactory(ICategory cat)
          Used to get asset factory of registered ICategory cat
 ITestProjectgetTestProject()
           
 booleanisInitialized()
          Deprecated.  
 voidregisterAsset(ICategory cat, Class factoryClass)
           
 voidregisterTask(ICategory cat, TaskDefinition taskDef)
          Registration of a task for a Suite (ant project).
 voidremoveTestHostListener(ITestHostListener listener)
          Deprecated.  
 booleanrun(ITestAsset asset, ITestResultAsset result)
           
 voidrunInCommandThread(Runnable runnable, String name, boolean wait)
          Runs given command in command thread
 booleanrunSuite(ITestSuite suite, ITestResultAsset result, String[] target)
           

Method Detail

addTestHostListener

public void addTestHostListener(ITestHostListener listener)
Deprecated.

createAsserion

public IAssertion createAsserion(String assertionType)
throws TestHostException
Creates new assertion if given type.
Assertion task must be registered with registerTask( ICategory cat, TaskDefinition taskDef )

createReference

public ITestAssetReference createReference(ITestAssetRO asset)
throws TestHostException
Creates a new reference to be pasted into some target.

createTarget

public ITarget createTarget()
Creates new suite target

createTestCollection

public ITestCollection createTestCollection(String name)
throws TestHostException
Create test collection. It should be pasted later to other collection.
You can modify collection before pasting.

createTestResult

public ITestResultAsset createTestResult(String name)
throws TestHostException
Create test result. It should be pasted later to test collection.
You can modify result before pasting.

find

public IElementRO find(String refid)
finds test element with specified reference id .

find

public IElementRO find(ITestCollection collection, String refid)
Deprecated.

findResults

public String[] findResults(String refId)
Returns: array of rsult ref ids, sorted by date, last result - at index 0.

getAssertionCategories

public ICategory[] getAssertionCategories()
Returns an array of known assertion categories

getAssetCategories

public ICategory[] getAssetCategories()
Returns an array of known asset categories

getEnvironment

public IEnvironment getEnvironment()
Deprecated.

getProgress

public IProgressMonitor getProgress()
Deprecated.

getResource

public IResource getResource(URL location)
Returns resource at given URL

getResultCollection

public ITestCollection getResultCollection()
Returns ITestCollection containing test results.

getTaskCategories

public ICategory[] getTaskCategories()
Returns an array of task categories

getTaskDefinition

public TaskDefinition getTaskDefinition(ICategory cat)
Returns a task definition for given category

getTestAssetFactory

public ITestAssetFactory getTestAssetFactory(ICategory cat)
Used to get asset factory of registered ICategory cat

getTestProject

public ITestProject getTestProject()
Returns: ITestProject - framework project - a set of roots

isInitialized

public boolean isInitialized()
Deprecated.

registerAsset

public void registerAsset(ICategory cat, Class factoryClass)
Parameters:
cat - new category
factoryClass - class of test asset factory ( should implement ITestAssetFactory)
register new test asset (step/suite) with specified category

registerTask

public void registerTask(ICategory cat, TaskDefinition taskDef)
Registration of a task for a Suite (ant project).
Using this method should be registered all assertion and step running tasks.
See Also:
com.togethersoft.testing.shared.ITestCategories.TASK_ASSERTION, ITestCategories#TASK_STEP_RUNNER

Example:

removeTestHostListener

public void removeTestHostListener(ITestHostListener listener)
Deprecated.

run

public boolean run(ITestAsset asset, ITestResultAsset result)
throws TestHostException
Parameters:
asset - existing and generated test asset (step/suite)
result - new ( or existing) test result.
Runs a test asset (step/suite). IServerResultListener should be attached to result if notifications about testing progress are required.

runInCommandThread

public void runInCommandThread(Runnable runnable, String name, boolean wait)
Runs given command in command thread

runSuite

public boolean runSuite(ITestSuite suite, ITestResultAsset result, String[] target)
throws TestHostException
Parameters:
suite - existing and generated test suite
result - new ( or existing) test result.
target - array of targets names. If target.length == 0 then default target will be run.
Runs a test suite with specified set of targets . IServerResultListener should be attached to result if notifications about testing progress are required.