|
IBM Rational Functional Tester Version 8.1.1000 IBM Rational Functional Tester API Reference Project Version 2.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.rational.test.ft.object.interfaces.TestObject
public class TestObject
Provides access to
objects in the software under test. A TestObject
contains a reference to an object
in the software under test, either referencing the object directly, or by using a reference to a MappedTestObject
.
The recognition algorithm is the work of the ObjectManager
.
A TestObject
is generally in a process separate from the software under test.
If a method is called on such a
TestObject
and if the object returned by the method can be
recreated in the process of the script, the object
is considered a value class. If the object returned by the method cannot
be recreated in the script process, the script is given
an object that provides remote access to the object in the software under test.
This remote object must be explicitly unregistered.
All the Java primitives and java.lang.String
are value classes. Many other classes, such as java.lang.Rectangle
are
also considered to be values. Most graphical objects, such as java.awt.Component
, are not values. Class is a value class if it has a value manager.
A value manager supports the IManageValueClass
interface, which
contains the methods persistIn
, persistOut
, and compare
.
The method getProperties()
returns a Hashtable
containing all the value properties of a
TestObject
. It does not return properties that are non-value classes. You can find the non-value properties
by calling getNonValueProperties()
. You can use the getProperty
method
to access both value and non-value properties. If you access a non-value property,
the property returns a TestObject
that contains a reference to the (non-value) object in the software under test.
This object gets registered on your behalf, thus keeping a reference to that object in the software under test.
A TestObject
containing a reference is referred to as a registered object reference.
An object in the software under test that has been registered is referred to as a registered object.
Do not use a registered object reference after the object it refers to has been disposed of.
For example, if the reference is to a JButton
in a Frame and the Frame is closed, you should not use the reference
any longer. In fact, the underlying object, that is, the JButton
, may be accessible, but may be in an unreliable state.
Release any references that has been registered on your behalf so that when the playback session terminates, all objects that you have registered get released.
To release a reference, unregister it. When a script terminates, objects are not automatically unregistered.
There are a variety of methods for unregistering an object - see unregister()
, RationalTestScript.unregisterAll
, and
RationalTestScript.unregister(Object[])
.
You can also get an array of TestObjects
that you have registered by calling
RationalTestScript.getRegisteredTestObjects
.
Two intertwined hierarchies of objects are supported: the parent-child hierarchy and the owner-owned hierarchy. An object cannot have both a parent and an owner. For GUI objects, the parent-child hierarchy implies containment of the child's GUI within the parent. The ownership relationship is used for a different hierarchy, for example, the relationship between a dialog box and a top-level window.
Field Summary | |
---|---|
protected com.rational.test.ft.object.TestObjectReference |
ref
|
Constructor Summary | |
---|---|
TestObject()
Deprecated. use ClientTestObject |
|
TestObject(com.rational.test.ft.sys.RegisteredObjectReference ror)
Deprecated. use ClientTestObject |
|
TestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject)
Deprecated. use ClientTestObject |
|
TestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject, TestObject anchor)
Deprecated. use ClientTestObject |
|
TestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject, TestObject anchor, long scriptCommandFlags)
Deprecated. use ClientTestObject |
|
TestObject(TestObject obj)
Deprecated. use ClientTestObject |
|
TestObject(com.rational.test.ft.object.TestObjectReference ref)
Deprecated. use ClientTestObject |
Method Summary | |
---|---|
boolean |
compare(IFtVerificationPoint baseline)
Compares the baseline, that is, expected data to the actual data. |
boolean |
compare(IFtVerificationPoint baseline, double delayBetweenRetries, double maximumTestTime)
Compares the expected result with the actual result. |
boolean |
compareAndLog(IFtVerificationPoint baseline)
Compares the baseline, that is, expected data to the actual data and logs the result to the script log. |
boolean |
compareAndLog(IFtVerificationPoint baseline, boolean compareTrueEqualsPass)
Allows failing verification points to return and log a passing result. |
boolean |
equals(java.lang.Object other)
Returns true if the two objects are equal. |
boolean |
exists()
Returns true if the object exists now, false otherwise. |
TestObject |
find()
Finds the object in the software under test and returns a reference to it. |
TestObject[] |
find(Subitem properties)
Finds all candidates that match given search criteria starting at this TestObject . |
TestObject[] |
find(Subitem properties, boolean mappableOnly)
Finds all candidates that match given search criteria starting at this TestObject . |
java.lang.Object |
findAndInvoke(Subitem properties, java.lang.String methodName)
Finds a TestObject based on find(Subitem) and invokes
the supplied method on the TestObject (invoke(String) ). |
java.lang.Object |
findAndInvoke(Subitem properties, java.lang.String methodName, java.lang.String methodSignature, java.lang.Object[] args, boolean mappableOnly)
Finds a TestObject based on find(Subitem, boolean) and invokes
the supplied method on the TestObject (invoke(String, String, Object[]) ). |
java.lang.Object |
findAndInvokeProxy(Subitem properties, java.lang.String methodName, java.lang.String methodSignature, java.lang.Object[] args, boolean mappableOnly)
Finds a TestObject based on find(Subitem, boolean) and invokes
the supplied method on the TestObject's proxy (invoke(String, String, Object[]) ). |
java.lang.Object |
getActualData(IFtVerificationPoint baseline)
Enables access to the actual, that is, currently active data associated with a verification point. |
TestObject[] |
getChildren()
Returns an array of references to the object's children. |
protected TestObject |
getDescribedObject(CrossDomainContainer describedTestObject)
Used to bind a described object returned by proxy into the corresponding bound TestObject |
protected TestObject[] |
getDescribedObjects(TestObject[] testObject)
Given an array of TestObjects, find any described objects and turn them into bound test objects. |
java.lang.String |
getDescriptiveName()
Returns the descriptive name of the object in software under test. |
DomainTestObject |
getDomain()
Returns the domain for the current object. |
java.lang.Object |
getField(java.lang.String fieldName)
Returns the value of a field of the object in the SUT encapsulated by this TestObject . |
java.lang.Object |
getIndexer(java.lang.String name, java.lang.Object index)
Returns the value of a TestObject's indexer at the given index. |
java.lang.Object |
getIndexer(java.lang.String name, java.lang.Object[] indexes)
Same as getIndexer(String, Object) but used for multidimensional indexers. |
IndexerInfo[] |
getIndexers()
Returns information about the TestObject's indexers, if applicable. |
TestObject[] |
getMappableChildren()
Returns an array of references to the object's mappable children. |
TestObject |
getMappableParent()
Returns a reference to the parent object that appears in the object map. |
com.rational.test.ft.object.map.IObjectMapPropertySet |
getMapProperties()
|
MethodInfo[] |
getMethods()
Returns a an array of MethodInfo objects describing the methods supported by
the object. |
java.lang.String |
getNameInScript()
|
java.util.Hashtable |
getNonValueProperties()
Returns a Hashtable containing names of properties whose values are
not value classes. |
java.lang.String |
getObjectClassName()
Returns the complete class name for the object in the software under test. |
java.lang.String |
getObjectCustomClassName()
Returns the custom class name for the object in the software under test. |
com.rational.test.ft.object.TestObjectReference |
getObjectReference()
Returns the object reference. |
TestObject[] |
getOwnedObjects()
Returns an array of references to the objects owned by this object. |
TestObject |
getOwner()
Returns a reference to the owner object. |
TestObject |
getParent()
Returns a reference to the parent object. |
ProcessTestObject |
getProcess()
Returns a ProcessTestObject for the object in the software under test. |
java.util.Hashtable |
getProperties()
Returns a Hashtable containing properties. |
java.lang.Object |
getProperty(java.lang.String propertyName)
Returns the value of the specified property. |
java.lang.Object |
getPropertyFromMap(java.lang.String propertyName)
Returns a property value from the map. |
java.util.Hashtable |
getRecognitionProperties()
Returns the properties that are useful for recognition. |
int |
getRecognitionPropertyWeight(java.lang.String propertyName)
Returns an indication of how useful this property is for recognition. |
ScriptCommandFlags |
getScriptCommandFlags()
Returns an active state value that reflects the state of the TestObejct at the time of the call. |
java.util.Hashtable |
getStandardProperties()
Returns a complete set of standard properties for the associated TestObject . |
ITestData |
getTestData(java.lang.String testDataType)
Constructs the specified verification data object. |
java.util.Hashtable |
getTestDataTypes()
Returns a Hashtable of data type descriptions of the verification
point data available with the associated object in the software under test. |
TestObject |
getTopMappableParent()
Returns a reference to the topmost mappable parent for an object. |
TestObject |
getTopParent()
Returns a reference to the topmost parent for an object. |
int |
hashCode()
Returns |
java.lang.Object |
invoke(java.lang.String method)
Invokes a method with no arguments on the object in the software under test. |
java.lang.Object |
invoke(java.lang.String method, java.lang.String methodSignature, java.lang.Object[] args)
Invokes a method on the object in the software under test. |
protected java.lang.Object |
invokeProxy(java.lang.String method)
Invokes a method on the object in the software under test. |
protected java.lang.Object |
invokeProxy(java.lang.String method, java.lang.String methodSignature, java.lang.Object[] args)
Invokes a method on the proxy for an object in the software under test. |
boolean |
isMappedObject()
Returns true if the object contains a mapped reference. |
boolean |
isSameObject(TestObject other)
Returns true if the supplied TestObject represents the same
underlying object in the software under test. |
protected boolean |
isScreenTestObject()
Check to see if this TestObject is indeed the Screen. |
boolean |
isTopLevelTestObject()
Check to see if this TestObject is indeed the Top Level Test Object. |
boolean |
performTest(IFtVerificationPoint baseline)
Captures, compares and logs active data available relative to this object instance against the supplied baseline data. |
boolean |
performTest(IFtVerificationPoint baseline, boolean compareTrueEqualsPass)
Captures, compares and logs active data available relative to this object instance against the supplied baseline data. |
boolean |
performTest(IFtVerificationPoint baseline, double delayBetweenRetries, double maximumTestTime)
Captures, compares and logs active data available relative to this object instance against the supplied baseline data. |
boolean |
performTest(IFtVerificationPoint baseline, double delayBetweenRetries, double maximumTestTime, boolean compareTrueEqualsPass)
Captures, compares and logs active data available relative to this object instance against the supplied baseline data. |
void |
setIndexer(java.lang.String name, java.lang.Object[] indexes, java.lang.Object value)
Same as setIndexer(String, Object[], Object) but used for multidimensional indexers. |
void |
setIndexer(java.lang.String name, java.lang.Object index, java.lang.Object value)
Sets the value of a TestObject's indexer. |
void |
setMapProperties(com.rational.test.ft.object.map.IObjectMapPropertySet propSet)
|
void |
setProperty(java.lang.String propertyName, java.lang.Object value)
Sets the specified property to the specified value. |
java.lang.String |
toString()
Returns a string describing the TestObject , not a string
describing the object in the software under test. |
void |
unregister()
Unregisters a TestObject reference. |
ITestData |
updateTestData(java.lang.String testDataType, ITestData testData)
Updates the supplied test data object and returns it. |
void |
waitForExistence()
Waits the default time until an object exists. |
void |
waitForExistence(double maximum_find_object_time, double find_object_wait_between_retry)
Waits until an object exists. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected com.rational.test.ft.object.TestObjectReference ref
Constructor Detail |
---|
public TestObject()
public TestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject)
public TestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject, TestObject anchor)
public TestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject, TestObject anchor, long scriptCommandFlags)
public TestObject(com.rational.test.ft.object.TestObjectReference ref)
public TestObject(TestObject obj)
TestObject
from another. Both are references to the same object.
public TestObject(com.rational.test.ft.sys.RegisteredObjectReference ror)
Method Detail |
---|
public void setMapProperties(com.rational.test.ft.object.map.IObjectMapPropertySet propSet)
public com.rational.test.ft.object.map.IObjectMapPropertySet getMapProperties()
public com.rational.test.ft.object.TestObjectReference getObjectReference()
public java.lang.String toString()
TestObject
, not a string
describing the object in the software under test.
toString
in class java.lang.Object
public int hashCode()
equals
method on the TestObject calls the
remote process to find out if the objects are really
equal. This function doesn't make a remote call but ensures the java rule
which says hashCode should return the same value for those objects if equals return true.
Performance of hash functions on this object will not be good if used
hashCode
in class java.lang.Object
protected boolean isScreenTestObject()
TestObject
is indeed the Screen. By default this
returns false
. This is here for compatibility. Please refer to ScreenTestObject
for the actual implementation for a Screen Test Object.
ScreenTestObject
public boolean equals(java.lang.Object other)
true
if the two objects are equal.
equals
in class java.lang.Object
public java.lang.Object getPropertyFromMap(java.lang.String propertyName)
TestObject
does not contain
a mapped reference, throws RationalTestException
. If the property is
not found, it returns null
. It does not throw PropertyNotFoundException
.
public boolean isMappedObject()
true
if the object contains a mapped reference.
Returns false
for a TestObject
that is returned by
reference from the software under test.
public boolean isSameObject(TestObject other)
true
if the supplied TestObject
represents the same
underlying object in the software under test. This method is different from equals
in that it represents an "==" of the object in the software under test rather than an
"equals" of these objects.
public DomainTestObject getDomain()
public java.lang.String getObjectClassName()
public java.lang.String getObjectCustomClassName()
public java.lang.String getDescriptiveName()
public ProcessTestObject getProcess()
ProcessTestObject
for the object in the software under test.
public TestObject getParent()
TestObject
and support more methods. Therefore, you may want to cast the return value.
The reference to the object should be
released by calling one of the unregister methods.
unregister()
,
RationalTestScript.unregisterAll()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.getRegisteredTestObjects()
public TestObject getMappableParent()
TestObject
and support more methods. Therefore, you may want to cast the return value.
The reference to the object should be
released by calling one of the unregister methods.
unregister()
,
RationalTestScript.unregisterAll()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.getRegisteredTestObjects()
public TestObject[] getChildren()
TestObject
and support more methods. Therefore, you may want to cast the return values.
The references to the objects should be
released by calling one of the unregister methods.
If the object has no children, a 0-length array of TestObjects will be returned.
unregister()
,
RationalTestScript.unregisterAll()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.getRegisteredTestObjects()
public TestObject[] getMappableChildren()
TestObject
and support more methods. Therefore, you may want to cast the return values.
The references to the objects should be
released by calling one of the unregister methods.
If the object has no mappable children, a 0-length array of TestObjects will be returned.
unregister()
,
RationalTestScript.unregisterAll()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.getRegisteredTestObjects()
public TestObject getTopParent()
unregister()
,
RationalTestScript.unregisterAll()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.getRegisteredTestObjects()
public TestObject getTopMappableParent()
unregister()
,
RationalTestScript.unregisterAll()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.getRegisteredTestObjects()
public java.lang.Object getProperty(java.lang.String propertyName)
getProperty
registers the object in the software under test and returns a reference
to the object.
Registered object references are
released by calling one of the unregister methods.
If the property is not defined on the object, a
PropertyNotFoundException
is thrown.
propertyName
- the name of the propertyunregister()
,
RationalTestScript.unregisterAll()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.getRegisteredTestObjects()
public void setProperty(java.lang.String propertyName, java.lang.Object value)
setProperty
whenever possible because it allows you to modify the software under test
in ways that a typical user cannot. If you use this method,
be sure to discuss its use with the developers of the software you
are testing.
A common use for this method is to set the text value of an input or edit control. This may be simpler and more reliable than playing back a sequence of keys to update the control. However, you should be aware that even in this simple use case, there may be problems. For example, the developer may watch the keys going to the control and may have code to prevent certain characters from appearing. By setting the property directly, you may be circumventing the normal error handling.
Most commonly, the value
is
a value class - an object that can be recreated in the process of the software under test.
However, the value
can also be a TestObject
containing a reference to an object
in the software under test, for example, a TestObject
returned by a previous call to getProperty
.
propertyName
- the name of the propertyvalue
- the value used to set the propertypublic java.util.Hashtable getProperties()
Hashtable
containing properties.
Note that this is an extended Hashtable
and can have null
values. The keys are strings that represent property names; they
are never null
. This method does not return
registered object references to objects in the software under test; it only returns
properties that are value classes.
public java.util.Hashtable getStandardProperties()
TestObject
. For HTML objects, standard properties are those properties that exist
regardless of the platform that the TestObject
is running on. Further, the
values for these properties are normalized across platforms.
These properties exist regardless of the browser, operating system, or software
platform version (such as the version of the JDK). These properties are a subset
of the properties returned by getProperties
.
The meaning of a property is specific to the test domain
and the TestObject
. Typically, this is a set of name/value pairs
that describe the TestObject
and its active state. Properties such
as font, colors, and coordinate information are typically associated
with a GUITestObject
. Associated data and state information can also
be returned, depending on the TestObject
.
For Java, getStandardProperties
and getProperties
behave the same.
TestObject
getProperty(String)
,
setProperty(String,Object)
,
getProperties()
,
getNonValueProperties()
public java.util.Hashtable getNonValueProperties()
Hashtable
containing names of properties whose values are
not value classes. These properties are not
returned by getProperties()
. These properties
can be accesssed using getProperty
, which returns a TestObject
containing a registered object reference to the object in the
software under test. Whenever such a property value is
returned, a reference to the object in the software under test is
maintained until the reference is released by calling
unregister()
.
The keys in the Hashtable
are strings representing the
property names. The values in the Hashtable
are the class names
for the property values.
public java.lang.Object getIndexer(java.lang.String name, java.lang.Object index)
TestObject's
indexer at the given index. If the
value has a value class then the value class is returned, otherwise a TestObject is
registered and returned. Information about a TestObject's
indexer properties
can be obtained via getIndexers()
.
name
- the name of the indexerindex
- the index to get the value ofpublic java.lang.Object getIndexer(java.lang.String name, java.lang.Object[] indexes)
getIndexer(String, Object)
but used for multidimensional indexers.
The first element in the array of indexes is used for the first rank
of the indexer, etc.
name
- the name of the indexerindexes
- the indexes to get the value ofpublic IndexerInfo[] getIndexers()
TestObject's
indexers, if applicable.
IndexerInfo
public void setIndexer(java.lang.String name, java.lang.Object index, java.lang.Object value)
TestObject's
indexer.
name
- the name of the indexerindex
- the index to set the value ofvalue
- the value to set the index topublic void setIndexer(java.lang.String name, java.lang.Object[] indexes, java.lang.Object value)
setIndexer(String, Object[], Object)
but used for multidimensional indexers.
The first element in the array of indexes is used for the first rank
of the indexer, etc.
name
- the name of the indexerindexes
- the indexes to set the value ofvalue
- the value to set the index topublic boolean exists()
true
if the object exists now, false
otherwise.
If the TestObject
contains a mapped reference and there are multiple
matching objects (that is, the recognition is ambiguous), exists
returns true
.
This method does not wait for the object to come into existence.
This method does not raise ambiguous recognition events or object-not-found
events.
false
. This method maybe overridden
by a specialized TestObject
.ClientTestObject
public TestObject find()
ClientTestObject
for the functionality.unregister()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.unregisterAll()
,
RationalTestScript.getRegisteredTestObjects()
,
ClientTestObject
public TestObject[] find(Subitem properties)
TestObject
.
Valid values for the property sub-items are:
atProperty
- A name/value pair representing a TestObject
property.
atChild
- Contains one or more properties that must be matched
against the direct child of the starting TestObject
.
atDescendant
- Contains one or more properties that can be matched
against any child of the starting TestObject
.
atList
- Used to specify a sequential list of properties to match against.
AtList valid sub-items are atChild
, atDescendant
, and atProperty
.
The first list item is matched against to get a list of candidates,
and out of those candidates their descendants is matched against for the next
list item, and so on.
TestObject[] foundTOs ;
// Given Notepad's outer window, this will find its text window.
foundTOs = Notepad_Form().find(atDescendant(".class", ".text")) ;
// This will find all the forms in the given browser, and return the forms
// direct children that are buttons with text "Submit"
foundTOs = Browser_htmlBrowser().find(atList(
atDescendant(".class", "Html.FORM"), atChild(".class", "Html.INPUT.submit", ".value", "Submit"))) ;
// This will find all the forms in the given browser, and return all forms
// "INPUT" elements, of any type.
RegularExpression inputRE = new RegularExpression("*INPUT*", false) ;
foundTOs = Browser_htmlBrowser().find(atList(
atDescendant(".class", "Html.FORM"), atChild(".class", inputRE)))
properties
- The property set to match against.unregister()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.unregisterAll()
,
RationalTestScript.getRegisteredTestObjects()
public TestObject[] find(Subitem properties, boolean mappableOnly)
TestObject
.
Valid values for the property sub-items are:
atProperty
- A name/value pair representing a TestObject
property.
atChild
- Contains one or more properties that must be matched
against the direct child of the starting TestObject
.
atDescendant
- Contains one or more properties that can be matched
against any child of the starting TestObject
.
atList
- Used to specify a sequential list of properties to match against.
atList
valid sub-items are atChild
, atDescendant
, and atProperty
.
The first list item is matched against to get a list of candidates,
and out of those candidates their descendants is matched against for the next
list item, and so on.
TestObject[] foundTOs ;
// Given Notepad's outer window, this will find its text window.
foundTOs = Notepad_Form().find(atDescendant(".class", ".text")) ;
// This will find all the forms in the given browser, and return the forms
// direct children that are buttons with text "Submit"
foundTOs = Browser_htmlBrowser().find(atList(
atDescendant(".class", "Html.FORM"), atChild(".class", "Html.INPUT.submit", ".value", "Submit"))) ;
// This will find all the forms in the given browser, and return all forms
// "INPUT" elements, of any type.
RegularExpression inputRE = new RegularExpression("*INPUT*", false) ;
foundTOs = Browser_htmlBrowser().find(atList(
atDescendant(".class", "Html.FORM"), atChild(".class", inputRE))) ;
properties
- The property set to match against.mappableOnly
- Whether to search all children or just mappable childrenClientTestObject
for the functionality.unregister()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.unregisterAll()
,
RationalTestScript.getRegisteredTestObjects()
,
ClientTestObject
public java.lang.Object findAndInvoke(Subitem properties, java.lang.String methodName)
TestObject
based on find(Subitem)
and invokes
the supplied method on the TestObject
(invoke(String)
).
The found TestObject
is automatically unregistered (unregister()
)
during the transaction.
If no candidates are found an ObjectNotFoundException
is thrown.
If more than one candidate is found an AmbiguousRecognitionException
is thrown.
If the specified method does not exist on the found TestObject
a
MethodNotFoundException
is thrown.
properties
- The property set to match againstmethodName
- The method to invoke
find(Subitem)
,
invoke(String)
public java.lang.Object findAndInvoke(Subitem properties, java.lang.String methodName, java.lang.String methodSignature, java.lang.Object[] args, boolean mappableOnly)
TestObject
based on find(Subitem, boolean)
and invokes
the supplied method on the TestObject
(invoke(String, String, Object[])
).
The found TestObject
is automatically unregistered (unregister()
)
during the transaction.
If no candidates are found an ObjectNotFoundException
is thrown.
If more than one candidate is found an AmbiguousRecognitionException
is thrown.
If the specified method does not exist on the found TestObject
a
MethodNotFoundException
is thrown.
properties
- The property set to match againstmethodName
- The method to invokemethodSignature
- The JNI signature of the method to invokeargs
- An array of arguments to pass to the invoked methodmappableOnly
- Boolean indicating whether only mappable children of the
TestObject
should be considered.
ClientTestObject
for the functionality.find(Subitem, boolean)
,
invoke(String, String, Object[])
,
ClientTestObject
public java.lang.Object findAndInvokeProxy(Subitem properties, java.lang.String methodName, java.lang.String methodSignature, java.lang.Object[] args, boolean mappableOnly)
TestObject
based on find(Subitem, boolean)
and invokes
the supplied method on the TestObject's
proxy (invoke(String, String, Object[])
).
The found TestObject
is automatically unregistered (unregister()
)
during the transaction.
If no candidates are found an ObjectNotFoundException
is thrown.
If more than one candidate is found an AmbiguousRecognitionException
is thrown.
If the specified method does not exist on the found TestObject
a
MethodNotFoundException
is thrown.
properties
- The property set to match againstmethodName
- The method to invokemethodSignature
- The JNI signature of the method to invokeargs
- An array of arguments to pass to the invoked methodmappableOnly
- Boolean indicating whether only mappable children of the
TestObject
should be considered.
ClientTestObject
for the functionality.find(Subitem, boolean)
,
invoke(String, String, Object[])
,
ClientTestObject
public java.util.Hashtable getRecognitionProperties()
Hashtable
and has null
values. The keys, which are strings that represent property names, are never null
. This method does not return
references to objects in the software under test; it only returns
properties that are value classes.
public int getRecognitionPropertyWeight(java.lang.String propertyName)
propertyName
- the name of the recognition property to
return a weight value forgetRecognitionProperties()
public java.util.Hashtable getTestDataTypes()
Hashtable
of data type descriptions of the verification
point data available with the associated object in the software under test. The
Hashtable
keys are String
objects that are used as the verification point
type
in the associated test data. The type
is a
simple value that is different from other type values associated
with this object under test. The type
keys map to a verbose
description of the test data. This is reasonable for presentation to a
user.
Hashtable
of type
/description
pairs
used to describe the verification data available from this
proxy.getTestData(String)
,
ITestData
public ITestData getTestData(java.lang.String testDataType)
testDataType
parameter is one of the Hashtable
keys
returned by getTestDataTypes
.
testDataType
- a test data type supplied by
getTestDataTypes
getTestDataTypes()
,
ITestData
public ITestData updateTestData(java.lang.String testDataType, ITestData testData)
testDataType
parameter is one of the Hashtable
keys
returned by getTestDataTypes
.
The testData
is a previously supplied ITestData
object that must be updated to reflect the current state
of the associated TestObject
.
testDataType
- a test data type supplied by
getTestDataTypes
testData
- the test database object that requires
updatinggetTestDataTypes()
,
ITestData
public void waitForExistence(double maximum_find_object_time, double find_object_wait_between_retry)
ObjectNotFoundException
AmbiguousRecognitionException
maximum_find_object_time
- the maximum amount of time (in seconds)
to wait while finding the objectfind_object_wait_between_retry
- the amount of time (in seconds)
to wait between attempts to find the objectClientTestObject
for the functionality.ClientTestObject
public void waitForExistence()
rt.time.maximum_wait_for_existence_time
.
The time to delay between retries is specified by the
option rt.time.wait_for_existence_delay_between_retries
.
ObjectNotFoundException
AmbiguousRecognitionException
public ScriptCommandFlags getScriptCommandFlags()
TestObejct
at the time of the call. The state includes values such as
ENABLED
and SHOWING
and allows the find algorithm to wait until
a required state is achieved.
TestObject
public void unregister()
TestObject
reference.
ClientTestObject
for the functionality.RationalTestScript.unregister(Object[])
,
RationalTestScript.unregisterAll()
,
RationalTestScript.getRegisteredTestObjects()
,
ClientTestObject
public TestObject getOwner()
TestObject
and support more methods. The reference to the object should be
released by calling one of the unregister methods.
getOwnedObjects()
,
getParent()
,
getChildren()
,
getMappableParent()
,
getMappableChildren()
,
unregister()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.unregisterAll()
,
RationalTestScript.getRegisteredTestObjects()
public TestObject[] getOwnedObjects()
TestObject
and can support more methods. The references to the objects should be
released by calling one of the unregister methods.
If the object has no owned objects, a 0-length array of TestObjects will be returned.
getOwner()
,
getParent()
,
getChildren()
,
unregister()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.unregisterAll()
,
RationalTestScript.getRegisteredTestObjects()
public java.lang.Object getField(java.lang.String fieldName)
TestObject
.
fieldName
- The name of the field to retrieve.public MethodInfo[] getMethods()
MethodInfo
objects describing the methods supported by
the object.
Note that many of the methods are property methods. These methods
can be invoked by using the invoke(String, String, Object[])
method.
If the object has no methods, a 0-length array of TestObjects
is returned.
public java.lang.Object invoke(java.lang.String method, java.lang.String methodSignature, java.lang.Object[] args)
invoke
, which allows you to modify the software under test
in ways that a typical user cannot. If you use this method,
be sure to discuss its use with the developers of the software you
are testing.
If the returned object is not a value class, invoke
registers the object and returns a reference to the object in the software under test.
Registered object references are
released by calling one of the unregister methods.
The methodSignature
uses JNI syntax to describe the parameter types and optionally the return value types
for the method. The general syntax has the parameter types in parentheses, followed by
the return type: (parameterTypes)returnType
. Note that the returnType is not a
required part of the signature - it can be omitted. There are specific encodings for
the primitive types, and then a general encoding for class types.
Code | Type |
---|---|
Z | boolean |
B | byte |
C | char |
S | short |
I | int |
J | long |
F | float |
D | double |
V | void |
Lfully-qualified-class; | For example: Ljava.lang.String; |
In addition, arrays are specified by combining the brace character '['
with another type. For example, [I
is an array of integers, [[I
is
an array of arrays of integers and [Ljava.lang.Object;
is an array of Objects.
Another example:
void myMethod(long n, String s, int[] arr)
has the following signature:
(JLjava.lang.String;[I)V
method
- the name of the method to be calledmethodSignature
- the signature of the method to be called (using standard JNI syntax)args
- the arguments to be passed to the methodunregister()
,
RationalTestScript.unregisterAll()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.getRegisteredTestObjects()
public java.lang.Object invoke(java.lang.String method)
invoke
, which allows you to modify the software under test
in ways that a typical user cannot. If you use this method,
be sure to discuss its use with the developers of the software you
are testing.
If the returned object is not a value class, invoke
registers the object and returns a reference to the object in the software under test.
Registered object references are
released by calling one of the unregister methods.
method
- the name of the method to be calledmethodSignature
- the signature of the method to be called (using standard JNI syntax)invoke()
,
unregister()
,
RationalTestScript.unregisterAll()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.getRegisteredTestObjects()
protected java.lang.Object invokeProxy(java.lang.String method, java.lang.String methodSignature, java.lang.Object[] args)
invoke
, which allows you to modify the software under test
in ways that a typical user cannot. If you use this method,
be sure to discuss its use with the developers of the software you
are testing.
If the returned object is not a value class, invoke
registers the object and returns a reference to the object in the software under test.
Registered object references are
released by calling one of the unregister methods.
method
- the name of the method to be calledmethodSignature
- the signature of the method to be called (using standard JNI syntax)args
- the arguments to be passed to the methodinvoke()
,
unregister()
,
RationalTestScript.unregisterAll()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.getRegisteredTestObjects()
protected java.lang.Object invokeProxy(java.lang.String method)
invoke
, which allows you to modify the software under test
in ways that a typical user cannot. If you use this method,
be sure to discuss its use with the developers of the software you
are testing.
If the returned object is not a value class, invoke
registers the object and returns a reference to the object in the software under test.
Registered object references are
released by calling one of the unregister methods.
method
- the name of the method to be calledmethodSignature
- the signature of the method to be called (using standard JNI syntax)invoke()
,
unregister()
,
RationalTestScript.unregisterAll()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.getRegisteredTestObjects()
protected TestObject getDescribedObject(CrossDomainContainer describedTestObject)
describedTestObject
- - CrossDomainContainer identifying the described object
protected TestObject[] getDescribedObjects(TestObject[] testObject)
testObject
- - original set of TestObjects
public boolean performTest(IFtVerificationPoint baseline)
true
value is returned if the passing result is
logged, otherwise false
is returned.performTest(IFtVerificationPoint,boolean)
,
performTest(IFtVerificationPoint,double,double)
,
performTest(IFtVerificationPoint,double,double,boolean)
public boolean performTest(IFtVerificationPoint baseline, boolean compareTrueEqualsPass)
compareTrueEqualsPass
- If true
the expected
and actual data must match to get a passing result. If
false
the expected and actual data must
NOT match to get a passing result.
true
value is returned if the passing result is
logged, false
is returned for a failing result.performTest(IFtVerificationPoint)
,
performTest(IFtVerificationPoint,double,double)
,
performTest(IFtVerificationPoint,double,double,boolean)
public boolean performTest(IFtVerificationPoint baseline, double delayBetweenRetries, double maximumTestTime)
delayBetweenRetries
- the delay in seconds after a failed result
is recaptured and tested again.maximumTestTime
- the maximum time in seconds spent attempting
to receive a passing result. Note that at least
one attempt will be made to return a failed
result, even if this value is a zero or negative
value.
true
value is returned if the passing result is
logged, false
is returned for a failing result.performTest(IFtVerificationPoint)
,
performTest(IFtVerificationPoint,boolean)
,
performTest(IFtVerificationPoint,double,double,boolean)
public boolean performTest(IFtVerificationPoint baseline, double delayBetweenRetries, double maximumTestTime, boolean compareTrueEqualsPass)
delayBetweenRetries
- the delay in seconds after a failed result
is recaptured and tested again.maximumTestTime
- the maximum time in seconds spent attempting
to receive a passing result. Note that at least
one attempt will be made to return a failed
result, even if this value is a zero or negative
value.compareTrueEqualsPass
- If true
the expected
and actual data must match to get a passing result. If
false
the expected and actual data must
NOT match to get a passing result.
true
value is returned if the passing result is
logged, false
is returned for a failing result.performTest(IFtVerificationPoint)
,
performTest(IFtVerificationPoint,boolean)
,
performTest(IFtVerificationPoint,double,double)
public boolean compare(IFtVerificationPoint baseline)
compare(IFtVerificationPoint,double,double)
public boolean compare(IFtVerificationPoint baseline, double delayBetweenRetries, double maximumTestTime)
delayBetweenRetries
- the delay in seconds after a failed result
is recaptured and retestedmaximumTestTime
- the maximum time in seconds spent attempting
to receive a passing result. Note that at least
one attempt will be made to return a failed
result, even if this value is a zero or negative
value.compare(IFtVerificationPoint)
public boolean compareAndLog(IFtVerificationPoint baseline)
compare(com.rational.test.ft.vp.IFtVerificationPoint)
method so that it too automatically logs the result in the script
log.
true
value is returned if the passing result is
logged, false
is returned if a failing result is logged.compareAndLog(IFtVerificationPoint,boolean)
public boolean compareAndLog(IFtVerificationPoint baseline, boolean compareTrueEqualsPass)
compareTrueEqualsPass
- If true
, the expected
and actual data must match to get a passing result. If
false
, the expected and actual data must
NOT match to get a passing result.
true
value is returned if the passing result is
logged, false
is returned if a failing result is logged.compareAndLog(IFtVerificationPoint)
public java.lang.Object getActualData(IFtVerificationPoint baseline)
public java.lang.String getNameInScript()
public boolean isTopLevelTestObject()
TestObject
is indeed the Top Level Test Object. The default
is false
unless a specialized class which happens to be the parent class returns
otherwise, when its true
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |