Examples you can use
This proxy sample explains how to extend a proxy to add more properties, set up a simple value class and value manager, and extend the recording behavior of Rational® Functional Tester.
Extended Capabilities : Adding more properties
This
proxy sample extends the proxy methods public java.util.Hashtable
getProperties()
and public Object getProperty(String propertyName)
to
add a new property simpleValue
.
Set up a simple value class and value manager
This proxy sample returns
a user-defined data type (value class and value manager) as a return value
for the property simpleValue
.
Extend the record capability
This proxy sample extends the public void processSingleMouseEvent(IMouseActionInfo
action)
method to extend the recording behavior so that single clicks
are recorded as doubleclick()
methods and double-clicks are
recorded as click()
methods.
Deploy the binary files
Copy the ButtonOverrideProxy.jar
and ButtonOverrideProxy.rftcust
files to the customization directory and then restart Rational® Functional Tester to
test the sample application-under-test (AUT).
Verify the added property and value class
You can
test the java.awt.Button
and javx.swt.JButton
controls,
provided as part of the AWTButtonApp
and JButtonApp
AUTs.
- Before you deploy the proxies, run
testObject().getProperty("simpleValue")
. This throws the error message,simpleValue is not a valid property.
- After you deploy the proxies, run
testObject().getProperty("simpleValue")
. This returns the value,FuBar
.
Verify the recording behavior
- Before you deploy the proxies, the java.awt.Button records single-clicks
as
button.click()
and double-clicks asbutton.doubleClick()
. - After you deploy the proxies, the java.awt.Button records single-clicks
as
button.doubleClick()
and double-clicks asbutton.Click()
. Theclick()
anddoubleClick()
methods are swapped.