TPTP 4.4.0 Testing Tools Project
Internal API Specification

org.eclipse.tptp.test.auto.gui.internal.macro
Class ObjectMine

java.lang.Object
  extended byorg.eclipse.tptp.test.auto.gui.internal.macro.ObjectMine
All Implemented Interfaces:
IObjectMine

public class ObjectMine
extends java.lang.Object
implements IObjectMine

A concrete implementation of IObjectMine.


Nested Class Summary
static class ObjectMine.IDCollisionException
           
static class ObjectMine.UIObjectNotFound
           
 
Constructor Summary
ObjectMine(org.eclipse.hyades.models.common.facades.behavioral.ITestSuite testSuite, XMLDefaultHandler defaultXMLHandler)
           
 
Method Summary
 void addInclude(IObjectMine objectMine)
          Includes another object mine as part of this mine.
 boolean equals(java.lang.Object o)
           
 IUIObject getActiveObject()
          Returns the active object of this object mine.
 IUIObject[] getChildren()
          Returns the direct children of the root object that this object mine points to
 java.util.List getIncludes()
          Returns the external object mines that have been added to this object mine
 IObjectMine getOutputSource()
          Returns the output of this object mine
 org.eclipse.hyades.models.common.facades.behavioral.ITestSuite getOwner()
          The test suite that owns this object mine.
 IUIObject getRoot()
          Returns the roo object
 java.lang.String getUniqueReferenceId()
          Returns the next available unique reference id that can be used.
 IUIObject lookupUIObject(IUIObject parent, java.lang.String referenceId)
          Looks up the UI object with the reference id passed in.
 IUIObject lookupUIObject(IUIObject parent, java.lang.String contextId, java.lang.String objectId)
          Looks up the UI object based on the context id and the object id that is passed in.
 IUIObject registerObject(IUIObject uiObject)
          Registers uiObject under the parent object passed in.
 IUIObject registerObject(IUIObject parent, org.w3c.dom.Node objectNode)
          Register the object embedded in the node passed in.
 java.lang.String serializeHeaderToString()
          Serializes only the header of this object mine to a string representation that can be stored and retrieved for later use.
 java.lang.String serializeObjetsToString()
          Serializes only the objects of this object mine to a string representation that can be stored and retrieved for later use.
 java.lang.String serializeToString()
          Serializes this object mine to a string representation that can be stored and retrieved for later use.
 void setActiveObject(IUIObject activeObject)
          Sets the active object of this object mine.
 void setOutputSource(IObjectMine objectMine)
          Set the output source to the object mine that is passed in.
 void setOwner(org.eclipse.hyades.models.common.facades.behavioral.ITestSuite testSuite)
          Sets the owner of this test suite.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectMine

public ObjectMine(org.eclipse.hyades.models.common.facades.behavioral.ITestSuite testSuite,
                  XMLDefaultHandler defaultXMLHandler)
Method Detail

addInclude

public void addInclude(IObjectMine objectMine)
Description copied from interface: IObjectMine
Includes another object mine as part of this mine. The lookup method for an object is required to walk through the registered objects of this object mine and the registered objects of included object mines.

Specified by:
addInclude in interface IObjectMine
Parameters:
objectMine - The object mine to include

lookupUIObject

public IUIObject lookupUIObject(IUIObject parent,
                                java.lang.String referenceId)
Description copied from interface: IObjectMine
Looks up the UI object with the reference id passed in. null should be returned if the objct can't be found. Time complexity = T(h) = h (where h is the height of the object mine tree)

Specified by:
lookupUIObject in interface IObjectMine
Parameters:
parent - The parent of the object
referenceId - The reference id of the object
Returns:
The object with the reference id passed in; or null if none is found.

lookupUIObject

public IUIObject lookupUIObject(IUIObject parent,
                                java.lang.String contextId,
                                java.lang.String objectId)
Description copied from interface: IObjectMine
Looks up the UI object based on the context id and the object id that is passed in. This lookup operation is more expensive than lookup(parent, referenceId). The latter should be used where possible. Time complexity = T(h, n) = h + n (where h is the height of the object mine tree and n is the number of nodes owned by the parent node)

Specified by:
lookupUIObject in interface IObjectMine
Parameters:
parent - The parent of the object
contextId - The context id of the object
objectId - The object id of the object
Returns:
The object with the matching context and object id; or null if none is found.

getChildren

public IUIObject[] getChildren()
Description copied from interface: IObjectMine
Returns the direct children of the root object that this object mine points to

Specified by:
getChildren in interface IObjectMine
Returns:
The children of the root object

getRoot

public IUIObject getRoot()
Description copied from interface: IObjectMine
Returns the roo object

Specified by:
getRoot in interface IObjectMine
Returns:
The root object

registerObject

public IUIObject registerObject(IUIObject parent,
                                org.w3c.dom.Node objectNode)
                         throws ObjectMine.IDCollisionException,
                                ObjectMine.UIObjectNotFound,
                                org.eclipse.core.runtime.CoreException
Description copied from interface: IObjectMine
Register the object embedded in the node passed in. The parent of the registered object should be set to the parent argument. If the object is already registered, then this method will not have any effects.

Specified by:
registerObject in interface IObjectMine
Parameters:
parent - The parent of the object to be registered
Returns:
The object that gets registered.
Throws:
org.eclipse.core.runtime.CoreException - Wraps any unexpected error
ObjectMine.IDCollisionException
ObjectMine.UIObjectNotFound

registerObject

public IUIObject registerObject(IUIObject uiObject)
                         throws ObjectMine.IDCollisionException,
                                ObjectMine.UIObjectNotFound,
                                org.eclipse.core.runtime.CoreException
Description copied from interface: IObjectMine
Registers uiObject under the parent object passed in. If the object is already registered, then this method will not have any effects.

Specified by:
registerObject in interface IObjectMine
Parameters:
uiObject - The object to be registered
Returns:
The object that gets registered (i.e. uiObject).
Throws:
org.eclipse.core.runtime.CoreException - Wraps any unexpected error
ObjectMine.IDCollisionException
ObjectMine.UIObjectNotFound

setOutputSource

public void setOutputSource(IObjectMine objectMine)
Description copied from interface: IObjectMine
Set the output source to the object mine that is passed in. If the user uses the test suite that is the owner of this mine to record a test case that results in finding a new object, then the object will be contributed to the object mine of the output source, not the owner of this object mine (some exceptions apply - see class comment).

Specified by:
setOutputSource in interface IObjectMine
Parameters:
objectMine - The object mine that will act as the output source for this mine

getOutputSource

public IObjectMine getOutputSource()
Description copied from interface: IObjectMine
Returns the output of this object mine

Specified by:
getOutputSource in interface IObjectMine
Returns:
The output source

getOwner

public org.eclipse.hyades.models.common.facades.behavioral.ITestSuite getOwner()
Description copied from interface: IObjectMine
The test suite that owns this object mine. The owner and the output source can be different.

Specified by:
getOwner in interface IObjectMine
Returns:
The owner

serializeToString

public java.lang.String serializeToString()
Description copied from interface: IObjectMine
Serializes this object mine to a string representation that can be stored and retrieved for later use. This is often the result of serializeHeaderToString() appended to the result of serializeObjetsToString().

Specified by:
serializeToString in interface IObjectMine
Returns:
The string representation of this object mine

serializeHeaderToString

public java.lang.String serializeHeaderToString()
Description copied from interface: IObjectMine
Serializes only the header of this object mine to a string representation that can be stored and retrieved for later use.

Specified by:
serializeHeaderToString in interface IObjectMine
Returns:
The string representation of the header of this object mine
See Also:
IObjectMine.serializeHeaderToString()

serializeObjetsToString

public java.lang.String serializeObjetsToString()
Description copied from interface: IObjectMine
Serializes only the objects of this object mine to a string representation that can be stored and retrieved for later use.

Specified by:
serializeObjetsToString in interface IObjectMine
Returns:
The string representation of the object directly owned by this object mine
See Also:
IObjectMine.serializeObjetsToString()

getActiveObject

public IUIObject getActiveObject()
Description copied from interface: IObjectMine
Returns the active object of this object mine. This is commonly used to determine the active object corresponding to the active shell.

Specified by:
getActiveObject in interface IObjectMine
Returns:
The active object.

setActiveObject

public void setActiveObject(IUIObject activeObject)
Description copied from interface: IObjectMine
Sets the active object of this object mine. This is commonly used to determine the active object corresponding to the active shell.

Specified by:
setActiveObject in interface IObjectMine
Parameters:
activeObject - The active object.

getUniqueReferenceId

public java.lang.String getUniqueReferenceId()
Description copied from interface: IObjectMine
Returns the next available unique reference id that can be used. The id's returned will be an integer even though the type is set to String.

Specified by:
getUniqueReferenceId in interface IObjectMine
Returns:
The next available reference id.

getIncludes

public java.util.List getIncludes()
Description copied from interface: IObjectMine
Returns the external object mines that have been added to this object mine

Specified by:
getIncludes in interface IObjectMine
Returns:
The added external object mines

equals

public boolean equals(java.lang.Object o)

setOwner

public void setOwner(org.eclipse.hyades.models.common.facades.behavioral.ITestSuite testSuite)
Description copied from interface: IObjectMine
Sets the owner of this test suite. The owner and the output source can be different.

Specified by:
setOwner in interface IObjectMine
Parameters:
testSuite - The owner

TPTP 4.4.0 Testing Tools Project
Internal API Specification