public class PropChooser extends java.lang.Object implements ComponentChooser, Outputable
String[] methods = {"getClientProperty"}; Object[][] params = {{"classname"}}; Class[][] classes = {{Object.class}}; Object[] results = {"javax.swing.JCheckBox"}; JCheckBox box = JCheckBoxOperator.findJCheckBox(frm0, new PropChooser(methods, params, classes, results));Or:
String[] methods = {"getText"}; Object[] results = {"Open"}; JButtonOperator box = new JButtonOperator(containerOperator, new PropChooser(fields, results));
Modifier and Type | Field and Description |
---|---|
protected java.lang.Class[][] |
classes
Classes of parameters.
|
protected java.lang.Object[][] |
params
Methods parameters.
|
protected java.lang.String[] |
propNames
Names of methods to check.
|
protected java.lang.Object[] |
results
Expected results of methods.
|
Constructor and Description |
---|
PropChooser(java.lang.String[] propNames,
java.lang.Object[] results)
Constructs a PropChooser object for checking of methods
with no parameters.
|
PropChooser(java.lang.String[] propNames,
java.lang.Object[][] params,
java.lang.Class[][] classes,
java.lang.Object[] results)
Constructs a PropChooser object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkComponent(java.awt.Component comp)
Check if the component argument meets the search criteria.
|
protected boolean |
checkProperty(java.lang.Object value,
java.lang.Object etalon)
Method to check one method result with an etalon.
|
java.lang.String |
getDescription()
Returns searched component description.
|
TestOut |
getOutput()
Returns print output streams or writers.
|
void |
setOutput(TestOut output)
Defines print output streams or writers.
|
protected java.lang.String[] propNames
protected java.lang.Object[][] params
protected java.lang.Class[][] classes
protected java.lang.Object[] results
public PropChooser(java.lang.String[] propNames, java.lang.Object[][] params, java.lang.Class[][] classes, java.lang.Object[] results)
propNames
- Names of methods/fieldsparams
- Parameters values for methods. classes
- Parameters classes.results
- Objects to compare method/field values to. public PropChooser(java.lang.String[] propNames, java.lang.Object[] results)
propNames
- Names of methods/fieldsresults
- Objects to compare method/field values to.public void setOutput(TestOut output)
Outputable
setOutput
in interface Outputable
output
- Identify the streams or writers used for print output.Outputable.getOutput()
public TestOut getOutput()
Outputable
getOutput
in interface Outputable
Outputable.setOutput(org.netbeans.jemmy.TestOut)
public boolean checkComponent(java.awt.Component comp)
ComponentChooser
checkComponent
in interface ComponentChooser
comp
- Component to check.true
when the component conforms to
the search criteria; false
otherwise.public java.lang.String getDescription()
ComponentChooser
getDescription
in interface ComponentChooser
protected boolean checkProperty(java.lang.Object value, java.lang.Object etalon)
value
- Method/field valueetalon
- Object to compare to.