com.togethersoft.testing.host
Interface ITestAsset

All Known Subinterfaces:
ITestCollection, ITestResultAsset, ITestStep, ITestSuite

public interface ITestAsset
extends ITestAssetRO

Represents a test asset - collection of tests, test step or test suite.
Test asset can share files/directories for test server.
To provide access to them use addProperty("shared",pathToFileOrDirectory);


Method Summary
 voidaddUserObject(String key, Object val)
          Associates the key with any object.
 ITestAssetROcopy()
          Creates a copy of asset.
 ITestAssetROcut()
          Cuts element from model.
 booleandelete()
          Deletes element from collection.
 URLgetLocation()
          Deprecated.  
 ITestCollectiongetParent()
           
 booleanisReadOnly()
          Deprecated.  
 voidpasteAttachments()
          Callback method which is invoked from ITestCollection.paste(..)
It performs paste of referenced files for test asset ( if any ) .
 voidremoveUserObject(String key, Object val)
           
 voidremoveUserObjects(String key)
          remove all elements with tag name =
 voidsetAttribute(String attributeName, String attributeValue)
           
 voidsetName(String name)
           

Methods inherited from interface com.togethersoft.testing.shared.ITestAssetRO
getCategory

Methods inherited from interface com.togethersoft.testing.shared.IElementRO
getAttribute, getChild, getContent, getName, getRefId, getUserObjects, hasUserObject

Method Detail

addUserObject

public void addUserObject(String key, Object val)
Associates the key with any object. The objetc's class must implement java.io.Serializable
Multiple objects are allowed per one key.

copy

public ITestAssetRO copy()
throws TestHostException
Creates a copy of asset. The copy cannot be used until pasted into collection.

cut

public ITestAssetRO cut()
throws TestHostException
Cuts element from model.
Physical resource is deleted and reference to collection is removed. Reference id of element is preserved.

delete

public boolean delete()
throws TestHostException
Deletes element from collection.
Exception is thrown if element is not member of any collection.

getLocation

public URL getLocation()
Deprecated.

getParent

public ITestCollection getParent()

isReadOnly

public boolean isReadOnly()
Deprecated.

pasteAttachments

public void pasteAttachments()
Callback method which is invoked from ITestCollection.paste(..)
It performs paste of referenced files for test asset ( if any ) .
User should implement this method only if he wants to customize default
paste behavior. Parent collection is alredy set and xml description of asset is already pasted into collection.

For example - when visual test step is copied, visual script is stored as cdata section in copied test asset. pasteAttachments() saves this cdata section to java file.

removeUserObject

public void removeUserObject(String key, Object val)

removeUserObjects

public void removeUserObjects(String key)
remove all elements with tag name =

setAttribute

public void setAttribute(String attributeName, String attributeValue)

setName

public void setName(String name)
throws TestHostException