Java Doc for ComponentTester.java in  » Testing » abbot-1.0.1 » abbot » tester » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » abbot 1.0.1 » abbot.tester 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   abbot.tester.Robot
      abbot.tester.ComponentTester

All known Subclasses:   abbot.tester.TextComponentTester,  abbot.tester.CheckboxTester,  abbot.tester.ListTester,  abbot.tester.extensions.DummyTester,  abbot.tester.ButtonTester,  abbot.tester.extensions.ArrowButtonTester,  abbot.tester.ChoiceTester,  abbot.tester.ContainerTester,
ComponentTester
public class ComponentTester extends Robot (Code)
Provides basic programmatic operation of a Component and related UI objects such as windows, menus and menu bars throuh action methods. Also provides some useful assertions about properties of a Component .

There are two sets of event-generating methods. The internal, protected methods inherited from abbot.tester.Robot abbot.tester.Robot are for normal programmatic use within derived Tester classes. No event queue synchronization should be performed except when modifying a component for which results are required for the action itself.

The public actionXXX functions are meant to be invoked from a script or directly from a hand-written test. These actions are distinguished by name, number of arguments, and by argument type. The actionX methods will be synchronized with the event dispatch thread when invoked, so you should only do synchronization with waitForIdle when you depend on the results of a particular event prior to sending the next one (e.g. scrolling a table cell into view before selecting it). All public action methods should ensure that the actions they trigger are finished on return, or will be finished before any subsequent actions are requested.

Action methods generally represent user-driven actions such as menu selection, table selection, popup menus, etc. All actions should have the following signature:

public void actionSpinMeRoundLikeARecord(Component c, ...); public void actionPinchMe(Component c, ComponentLocation loc);

It is essential that the argument is of type Component ; if you use a more-derived class, then the actual invocation becomes ambiguous since method parsing doesn't attempt to determine which identically-named method is the most-derived.

The ComponentLocation abstraction allows all derived tester classes to inherit click, popup menu, and drag variants without having to explicitly define new methods for component-specific substructures. The new class need only define the ComponentTester.parseLocation(String) method, which should return a location specific to the component in question.

Assertions are either independent of any component (and should be implemented in this class), or take a component as the first argument, and perform some check on that component. All assertions should have one of the following signatures:

public boolean assertMyself(...);
public boolean assertBorderIsAtrociouslyUgly(Component c, ...);
Note that these assertions do not throw exceptions but rather return a boolean value indicating success or failure. Normally these assertions will be wrapped by an abbot.script.Assert step if you want to cause a test failure, or you can manually throw the proper failure exception if the method returns false.

Property checks may also be implemented in cases where the component "property" might not be readily available or easily comparable, e.g. see abbot.tester.JPopupMenuTester.getMenuLabels(Component) .

public Object getHairpiece(Component c);
public boolean isRighteouslyIndignant(Component c);
Any non-property methods with the property signature, should be added to the ComponentTester.IGNORED_METHODS set, since property-like methods are scanned dynamically to populate the abbot.editor.ScriptEditor editor 's action menus.

Extending ComponentTester

Following are the steps required to implement a Tester object for a custom class.

Method Naming Conventions

Action methods should be named according to the human-centric action that is being performed if at all possible. For example, use actionSelectRow in a List rather than actionSelectIndex. If there's no common usage, or if the usage is too vague or diverse, use the specific terms used in code. For example, JScrollBarTester uses JScrollBarTester.actionScrollUnitUp(Component) actionScrollUnitUp() and JScrollBarTester.actionScrollBlockUp(Component) actionScrollBlockUp() ; since there is no common language usage for these concepts (line and page exist, but are not appropriate if what is scrolled is not text).

When naming a selection method, include the logical substructure target of the selection in the name (e.g. JTableTester.actionSelectCell(ComponentJTableLocation) JTableTester.actionSelectCell()), since some components may have more than one type of selectable item within them.



Field Summary
protected static  SetIGNORED_METHODS
     Add any method names here which should not show up in a dynamically generated list of property methods.


Method Summary
public  voidactionClick(Component comp)
     Click on the center of the component.
public  voidactionClick(Component c, ComponentLocation loc)
     Click on the component at the given location.
public  voidactionClick(Component c, ComponentLocation loc, int buttons)
     Click on the component at the given location with the given modifiers.
public  voidactionClick(Component c, ComponentLocation loc, int buttons, int count)
     Click on the component at the given location, with the given modifiers and click count.
public  voidactionClick(Component comp, int x, int y)
     Click on the component at the given location (mouse button 1).
public  voidactionClick(Component comp, int x, int y, int buttons)
     Click on the component at the given location.
public  voidactionClick(Component comp, int x, int y, int buttons, int count)
     Click on the component at the given location, specifying buttons and the number of clicks.
public  voidactionDelay(int ms)
     Delay the given number of ms.
public  voidactionDrag(Component dragSource, ComponentLocation loc)
     Perform a drag action.
public  voidactionDrag(Component dragSource)
     Perform a drag action.
public  voidactionDrag(Component dragSource, ComponentLocation loc, String buttons)
     Perform a drag action with the given modifiers.
public  voidactionDrag(Component dragSource, ComponentLocation loc, int buttons)
     Perform a drag action with the given modifiers.
public  voidactionDrag(Component dragSource, int sx, int sy)
     Perform a drag action.
public  voidactionDrag(Component dragSource, int sx, int sy, String buttons)
     Perform a drag action.
public  voidactionDragOver(Component target)
     Drag the current dragged object over the given component.
public  voidactionDragOver(Component target, ComponentLocation where)
     Drag the current dragged object over the given target/location.
public  voidactionDrop(Component dropTarget)
     Perform a basic drop action (implicitly causing preceding mouse drag motion).
public  voidactionDrop(Component dropTarget, ComponentLocation loc)
     Perform a basic drop action (implicitly causing preceding mouse drag motion).
public  voidactionDrop(Component dropTarget, int x, int y)
     Perform a basic drop action (implicitly causing preceding mouse drag motion).
public  voidactionFocus(Component comp)
     Set the focus on to the given component.
public  voidactionKeyPress(Component comp, int keyCode)
     Send a key press event for the given virtual key code to the given Component.
public  voidactionKeyPress(int keyCode)
     Generate a key press event for the given virtual key code.
public  voidactionKeyRelease(Component comp, int keyCode)
     Generate a key release event sent to the given component.
public  voidactionKeyRelease(int keyCode)
     Generate a key release event.
public  voidactionKeyString(Component c, String string)
     Send events required to generate the given string on the given component.
public  voidactionKeyString(String string)
     Send events required to generate the given string.
public  voidactionKeyStroke(Component c, int keyCode)
     Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant to the program.
public  voidactionKeyStroke(int keyCode)
     Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant.
public  voidactionKeyStroke(Component c, int keyCode, int modifiers)
     Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant to the program.
public  voidactionKeyStroke(int keyCode, int modifiers)
     Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant to the program.
public  voidactionMouseMove(Component comp, ComponentLocation loc)
     Move the mouse/pointer to the given location.
public  voidactionMousePress(Component comp, ComponentLocation loc)
     Press mouse button 1 at the given location.
public  voidactionMousePress(Component comp, ComponentLocation loc, int mask)
     Press mouse buttons corresponding to the given mask at the given location.
public  voidactionMouseRelease()
     Release any currently held mouse buttons.
public  voidactionSelectAWTMenuItem(Frame menuFrame, String path)
     Selects an AWT menu item ( java.awt.MenuItem ) and returns when the invocation has triggered (though not necessarily completed).
public  voidactionSelectAWTMenuItemByLabel(Frame menuFrame, String path)
    
public  voidactionSelectAWTPopupMenuItem(Component invoker, String path)
     Selects an AWT menu item and returns when the invocation has triggered (though not necessarily completed).
public  voidactionSelectAWTPopupMenuItemByLabel(Component invoker, String path)
    
public  voidactionSelectMenuItem(Component item)
     Select the given menu item.
public  voidactionSelectMenuItem(Component sameWindow, String path)
     Select the given menu item, given its path and a component on the same window.
public  voidactionSelectPopupMenuItem(Component invoker, String path)
     Pop up a menu at the center of the given component and select the given item.
public  voidactionSelectPopupMenuItem(Component invoker, ComponentLocation loc, String path)
     Pop up a menu at the given location on the given component and select the given item.
public  voidactionSelectPopupMenuItem(Component invoker, int x, int y, String path)
     Pop up a menu at the given coordinates on the given component and select the given item.
public  voidactionSetModifiers(int mask, boolean pressed)
     Set the state of the given modifier keys.
public  voidactionShowPopupMenu(Component invoker)
     Pop up a menu in the center of the given component.
public  voidactionShowPopupMenu(Component invoker, ComponentLocation loc)
     Pop up a menu in the center of the given component.
public  voidactionShowPopupMenu(Component invoker, int x, int y)
     Pop up a menu at the given location on the given component.
public  voidactionWaitForIdle()
     Wait for an idle AWT event queue.
public  booleanassertComponentShowing(ComponentReference ref)
     Return whether the Component represented by the given ComponentReference is available.
public  booleanassertFrameShowing(Hierarchy h, String id)
     Returns whether a Window corresponding to the given String is showing.
public  booleanassertFrameShowing(String id)
     Returns whether a Window corresponding to the given String is showing.
public  booleanassertImage(Component comp, java.io.File fileImage, boolean ignoreBorder)
     Return whether the component's contents matches the given image.
protected  StringderiveAccessibleTag(AccessibleContext context)
     Derive a tag from the given accessible context if possible, or return null.
public  StringderiveTag(Component comp)
     Determine a component-specific identifier not already defined in other component attributes.
public  Method[]getActions()
     Return a list of all actions defined by this class that don't depend on a component argument.
public  Method[]getAssertMethods()
     Return a list of all assertions defined by this class that don't depend on a component argument.
public  Method[]getComponentActions()
     Return a list of all actions defined by this class that require a component argument.
public  Method[]getComponentAssertMethods()
     Return a list of all assertions defined by this class that require a component argument.
public  ComponentLocationgetLocation(Component c, Point where)
     Return a ComponentLocation for the given Point.
public  Method[]getPropertyMethods()
     Return an array of all property check methods defined by this class.
public static  StringgetTag(Component comp)
     Return a reasonable identifier for the given component.
public  ClassgetTestedClass(Class cls)
     Return the Component class that corresponds to this ComponentTester class.
public static  ComponentTestergetTester(Component comp)
     Return a shared instance of the appropriate ComponentTester for the given Component .

This method is primarily used by the scripting system, since the appropriate ComponentTester for a given Component is not known a priori.

public static  ComponentTestergetTester(Class componentClass)
     Return a shared instance of the corresponding ComponentTester object for the given Component class, chaining up the inheritance tree if no specific tester is found for that class.

The abbot tester package is searched first, followed by the tester extensions package.

This method is primarily used by the scripting system, since the appropriate ComponentTester for a given Component is not known a priori.

protected  booleanisCustom(Class c)
     Returns whether the given class is not a core JRE class.
final public  booleanisExtension()
     Return whether this tester is an extension.
public  ComponentLocationparseLocation(String encoded)
     Parse the String representation of a ComponentLocation into the actual ComponentLocation object.
public static  voidsetTester(Class forClass, ComponentTester tester)
     Establish the given ComponentTester as the one to use for the given class.
public static  StringstripHTML(String str)
     Quick and dirty strip raw text from html, for getting the basic text from html-formatted labels and buttons.
protected  voidwaitAction(String desc, Condition cond)
     Wait for the given condition, throwing an ActionFailedException if it times out.
public  voidwaitForComponentShowing(ComponentReference ref)
     Wait for the Component represented by the given ComponentReference to become available.
public  voidwaitForFrameShowing(Hierarchy h, String identifier)
     Convenience wait for a window to be displayed.
public  voidwaitForFrameShowing(String identifier)
     Convenience wait for a window to be displayed.

Field Detail
IGNORED_METHODS
protected static Set IGNORED_METHODS(Code)
Add any method names here which should not show up in a dynamically generated list of property methods.





Method Detail
actionClick
public void actionClick(Component comp)(Code)
Click on the center of the component.



actionClick
public void actionClick(Component c, ComponentLocation loc)(Code)
Click on the component at the given location.



actionClick
public void actionClick(Component c, ComponentLocation loc, int buttons)(Code)
Click on the component at the given location with the given modifiers.



actionClick
public void actionClick(Component c, ComponentLocation loc, int buttons, int count)(Code)
Click on the component at the given location, with the given modifiers and click count.



actionClick
public void actionClick(Component comp, int x, int y)(Code)
Click on the component at the given location (mouse button 1).



actionClick
public void actionClick(Component comp, int x, int y, int buttons)(Code)
Click on the component at the given location. The buttons mask should be the InputEvent masks for the desired button, e.g. InputEvent.BUTTON1_MASK . ComponentTester also defines AWTConstants.POPUP_MASK and AWTConstants.TERTIARY_MASK for platform-independent masks for those buttons. Key modifiers other than InputEvent.ALT_MASK and InputEvent.META_MASK may also be used as a convenience.



actionClick
public void actionClick(Component comp, int x, int y, int buttons, int count)(Code)
Click on the component at the given location, specifying buttons and the number of clicks. The buttons mask should be the InputEvent mask for the desired button, e.g. InputEvent.BUTTON1_MASK . ComponentTester also defines AWTConstants.POPUP_MASK and AWTConstants.TERTIARY_MASK for platform-independent masks for those buttons. Key modifiers other than InputEvent.ALT_MASK and InputEvent.META_MASK may also be used as a convenience.



actionDelay
public void actionDelay(int ms)(Code)
Delay the given number of ms.



actionDrag
public void actionDrag(Component dragSource, ComponentLocation loc)(Code)
Perform a drag action. Derived classes may provide more specific identifiers for what is being dragged simply by deriving a new class from ComponentLocation which identifies the appropriate substructure. For instance, a JTreeLocation might encapsulate the expansion control location for the path [root, node A, child B].



actionDrag
public void actionDrag(Component dragSource)(Code)
Perform a drag action. Grabs the center of the given component.



actionDrag
public void actionDrag(Component dragSource, ComponentLocation loc, String buttons)(Code)
Perform a drag action with the given modifiers.
Parameters:
  dragSource - source of the drag
Parameters:
  loc - identifies where on the given Component to begin thedrag.
Parameters:
  buttons - a String representation of key modifiers,e.g. "ALT|SHIFT", based on the InputEvent.ALT_MASK InputEvent_MASK fields.ComponentTester.actionDrag(Component,ComponentLocation,int) integer modifier mask



actionDrag
public void actionDrag(Component dragSource, ComponentLocation loc, int buttons)(Code)
Perform a drag action with the given modifiers.
Parameters:
  dragSource - source of the drag
Parameters:
  loc - identifies where on the given Component to begin thedrag.
Parameters:
  buttons - one or more of the InputEvent.BUTTON1_MASK InputEvent BUTTONN_MASK fields.



actionDrag
public void actionDrag(Component dragSource, int sx, int sy)(Code)
Perform a drag action. Grabs at the given explicit location.



actionDrag
public void actionDrag(Component dragSource, int sx, int sy, String buttons)(Code)
Perform a drag action. Grabs at the given location with the given modifiers.
Parameters:
  dragSource - source of the drag
Parameters:
  sx - X coordinate
Parameters:
  sy - Y coordinate
Parameters:
  buttons - a String representation of key modifiers,e.g. "ALT|SHIFT", based on the InputEvent.ALT_MASK InputEvent_MASK fields.ComponentTester.actionDrag(Component,ComponentLocation,int) ComponentLocation/integer modifier mask



actionDragOver
public void actionDragOver(Component target)(Code)
Drag the current dragged object over the given component.



actionDragOver
public void actionDragOver(Component target, ComponentLocation where)(Code)
Drag the current dragged object over the given target/location.



actionDrop
public void actionDrop(Component dropTarget)(Code)
Perform a basic drop action (implicitly causing preceding mouse drag motion). Drops in the center of the component.



actionDrop
public void actionDrop(Component dropTarget, ComponentLocation loc)(Code)
Perform a basic drop action (implicitly causing preceding mouse drag motion).



actionDrop
public void actionDrop(Component dropTarget, int x, int y)(Code)
Perform a basic drop action (implicitly causing preceding mouse drag motion). The modifiers represents the set of active modifiers when the drop is made.



actionFocus
public void actionFocus(Component comp)(Code)
Set the focus on to the given component.



actionKeyPress
public void actionKeyPress(Component comp, int keyCode)(Code)
Send a key press event for the given virtual key code to the given Component.



actionKeyPress
public void actionKeyPress(int keyCode)(Code)
Generate a key press event for the given virtual key code.



actionKeyRelease
public void actionKeyRelease(Component comp, int keyCode)(Code)
Generate a key release event sent to the given component.



actionKeyRelease
public void actionKeyRelease(int keyCode)(Code)
Generate a key release event.



actionKeyString
public void actionKeyString(Component c, String string)(Code)
Send events required to generate the given string on the given component. This version is preferred over ComponentTester.actionKeyString(String) .



actionKeyString
public void actionKeyString(String string)(Code)
Send events required to generate the given string.



actionKeyStroke
public void actionKeyStroke(Component c, int keyCode)(Code)
Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant to the program. Sends a key down/up, with no modifiers. The focus is changed to the target component.



actionKeyStroke
public void actionKeyStroke(int keyCode)(Code)
Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant. Sends a key press and key release, with no modifiers. Note that this method does not affect the current focus.



actionKeyStroke
public void actionKeyStroke(Component c, int keyCode, int modifiers)(Code)
Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant to the program. Sends a key down/up, with the given modifiers, which should be the InputEvent field name modifier masks optionally ORed together with "|". The focus is changed to the target component.




actionKeyStroke
public void actionKeyStroke(int keyCode, int modifiers)(Code)
Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant to the program. Sends a key down/up, with the given modifiers, which should be the InputEvent field name modifier masks optionally ORed together with "|". Note that this does not affect the current focus.




actionMouseMove
public void actionMouseMove(Component comp, ComponentLocation loc)(Code)
Move the mouse/pointer to the given location.



actionMousePress
public void actionMousePress(Component comp, ComponentLocation loc)(Code)
Press mouse button 1 at the given location.



actionMousePress
public void actionMousePress(Component comp, ComponentLocation loc, int mask)(Code)
Press mouse buttons corresponding to the given mask at the given location.



actionMouseRelease
public void actionMouseRelease()(Code)
Release any currently held mouse buttons.



actionSelectAWTMenuItem
public void actionSelectAWTMenuItem(Frame menuFrame, String path)(Code)
Selects an AWT menu item ( java.awt.MenuItem ) and returns when the invocation has triggered (though not necessarily completed).
Parameters:
  menuFrame -
Parameters:
  path - either a unique label or the menu path.
See Also:   Robot.selectAWTMenuItem(FrameString)



actionSelectAWTMenuItemByLabel
public void actionSelectAWTMenuItemByLabel(Frame menuFrame, String path)(Code)
ComponentTester.actionSelectAWTMenuItem(Frame,String)



actionSelectAWTPopupMenuItem
public void actionSelectAWTPopupMenuItem(Component invoker, String path)(Code)
Selects an AWT menu item and returns when the invocation has triggered (though not necessarily completed).
See Also:   Robot.selectAWTPopupMenuItem(ComponentString)



actionSelectAWTPopupMenuItemByLabel
public void actionSelectAWTPopupMenuItemByLabel(Component invoker, String path)(Code)
ComponentTester.actionSelectAWTPopupMenuItem(Component,String)



actionSelectMenuItem
public void actionSelectMenuItem(Component item)(Code)
Select the given menu item.



actionSelectMenuItem
public void actionSelectMenuItem(Component sameWindow, String path)(Code)
Select the given menu item, given its path and a component on the same window.



actionSelectPopupMenuItem
public void actionSelectPopupMenuItem(Component invoker, String path)(Code)
Pop up a menu at the center of the given component and select the given item.



actionSelectPopupMenuItem
public void actionSelectPopupMenuItem(Component invoker, ComponentLocation loc, String path)(Code)
Pop up a menu at the given location on the given component and select the given item.



actionSelectPopupMenuItem
public void actionSelectPopupMenuItem(Component invoker, int x, int y, String path)(Code)
Pop up a menu at the given coordinates on the given component and select the given item.



actionSetModifiers
public void actionSetModifiers(int mask, boolean pressed)(Code)
Set the state of the given modifier keys.



actionShowPopupMenu
public void actionShowPopupMenu(Component invoker)(Code)
Pop up a menu in the center of the given component.



actionShowPopupMenu
public void actionShowPopupMenu(Component invoker, ComponentLocation loc)(Code)
Pop up a menu in the center of the given component.



actionShowPopupMenu
public void actionShowPopupMenu(Component invoker, int x, int y)(Code)
Pop up a menu at the given location on the given component.



actionWaitForIdle
public void actionWaitForIdle()(Code)
Wait for an idle AWT event queue. Will return when there are no more events on the event queue.



assertComponentShowing
public boolean assertComponentShowing(ComponentReference ref)(Code)
Return whether the Component represented by the given ComponentReference is available.



assertFrameShowing
public boolean assertFrameShowing(Hierarchy h, String id)(Code)
Returns whether a Window corresponding to the given String is showing. The string may be a plain String or regular expression and may match either the window title (for Frames or Dialogs) or the value of Component.getName .



assertFrameShowing
public boolean assertFrameShowing(String id)(Code)
Returns whether a Window corresponding to the given String is showing. The string may be a plain String or regular expression and may match either the window title (for Frames or Dialogs) or the value of Component.getName . ComponentTester.assertFrameShowing(Hierarchy,String)



assertImage
public boolean assertImage(Component comp, java.io.File fileImage, boolean ignoreBorder)(Code)
Return whether the component's contents matches the given image.



deriveAccessibleTag
protected String deriveAccessibleTag(AccessibleContext context)(Code)
Derive a tag from the given accessible context if possible, or return null.



deriveTag
public String deriveTag(Component comp)(Code)
Determine a component-specific identifier not already defined in other component attributes. This method should be defined to something unique for custom UI components.



getActions
public Method[] getActions()(Code)
Return a list of all actions defined by this class that don't depend on a component argument.



getAssertMethods
public Method[] getAssertMethods()(Code)
Return a list of all assertions defined by this class that don't depend on a component argument.



getComponentActions
public Method[] getComponentActions()(Code)
Return a list of all actions defined by this class that require a component argument.



getComponentAssertMethods
public Method[] getComponentAssertMethods()(Code)
Return a list of all assertions defined by this class that require a component argument.



getLocation
public ComponentLocation getLocation(Component c, Point where)(Code)
Return a ComponentLocation for the given Point. Derived classes may provide something more suitable than an (x, y) coordinate. A javax.swing.JTree , for example, might provide a JTreeLocation indicating a path or row in the tree.



getPropertyMethods
public Method[] getPropertyMethods()(Code)
Return an array of all property check methods defined by this class. The first argument must be a Component.



getTag
public static String getTag(Component comp)(Code)
Return a reasonable identifier for the given component. Note that this should not duplicate information provided by existing attributes such as title, label, or text. This functionality is provided to assist in identification of non-standard GUI components only.



getTestedClass
public Class getTestedClass(Class cls)(Code)
Return the Component class that corresponds to this ComponentTester class. For example, JComponentTester.getTestedClass(JLabel.class) would return JComponent.class.



getTester
public static ComponentTester getTester(Component comp)(Code)
Return a shared instance of the appropriate ComponentTester for the given Component .

This method is primarily used by the scripting system, since the appropriate ComponentTester for a given Component is not known a priori. Coded unit tests should generally just create an instance of the desired type of ComponentTester for local use.




getTester
public static ComponentTester getTester(Class componentClass)(Code)
Return a shared instance of the corresponding ComponentTester object for the given Component class, chaining up the inheritance tree if no specific tester is found for that class.

The abbot tester package is searched first, followed by the tester extensions package.

This method is primarily used by the scripting system, since the appropriate ComponentTester for a given Component is not known a priori. Coded unit tests should generally just create an instance of the desired type of ComponentTester for local use.




isCustom
protected boolean isCustom(Class c)(Code)
Returns whether the given class is not a core JRE class.



isExtension
final public boolean isExtension()(Code)
Return whether this tester is an extension.



parseLocation
public ComponentLocation parseLocation(String encoded)(Code)
Parse the String representation of a ComponentLocation into the actual ComponentLocation object.



setTester
public static void setTester(Class forClass, ComponentTester tester)(Code)
Establish the given ComponentTester as the one to use for the given class. This may be used to override the default tester for a given core class. Note that this will only work with components loaded by the framework class loader, not those loaded by the class loader for the code under test.



stripHTML
public static String stripHTML(String str)(Code)
Quick and dirty strip raw text from html, for getting the basic text from html-formatted labels and buttons. Behavior is undefined for badly formatted html.



waitAction
protected void waitAction(String desc, Condition cond) throws ActionFailedException(Code)
Wait for the given condition, throwing an ActionFailedException if it times out.



waitForComponentShowing
public void waitForComponentShowing(ComponentReference ref)(Code)
Wait for the Component represented by the given ComponentReference to become available. The timeout is affected by abbot.robot.component_delay, which defaults to 30s.



waitForFrameShowing
public void waitForFrameShowing(Hierarchy h, String identifier)(Code)
Convenience wait for a window to be displayed. The given string may be a plain String or regular expression and may match either the window title (for Frames and Dialogs) or the value of Component.getName . This method is provided as a convenience for hand-coded tests, since scripts will use a wait step instead.

The property abbot.robot.component_delay affects the default timeout.




waitForFrameShowing
public void waitForFrameShowing(String identifier)(Code)
Convenience wait for a window to be displayed. The given string may be a plain String or regular expression and may match either the window title (for Frames and Dialogs) or the value of Component.getName . This method is provided as a convenience for hand-coded tests, since scripts will use a wait step instead.

The property abbot.robot.component_delay affects the default timeout. ComponentTester.waitForFrameShowing(Hierarchy,String)




Fields inherited from abbot.tester.Robot
public static int EM_AWT(Code)(Java Doc)
public static int EM_ROBOT(Code)(Java Doc)
protected static long IDLE_TIMEOUT(Code)(Java Doc)
final public static String MOUSELESS_MODIFIER(Code)(Java Doc)
final public static int MOUSELESS_MODIFIER_MASK(Code)(Java Doc)
public static int componentDelay(Code)(Java Doc)
public static int defaultDelay(Code)(Java Doc)
protected static int popupDelay(Code)(Java Doc)

Methods inherited from abbot.tester.Robot
public void activate(Window win)(Code)(Java Doc)
public static boolean canMoveWindows()(Code)(Java Doc)
public static boolean canResizeWindows()(Code)(Java Doc)
public BufferedImage capture(Rectangle bounds)(Code)(Java Doc)
public BufferedImage capture(Component comp)(Code)(Java Doc)
public BufferedImage capture(Component comp, boolean ignoreBorder)(Code)(Java Doc)
final public void click(Component comp)(Code)(Java Doc)
final public void click(Component comp, int mask)(Code)(Java Doc)
final public void click(Component comp, int x, int y)(Code)(Java Doc)
final public void click(Component comp, int x, int y, int mask)(Code)(Java Doc)
public void click(Component comp, int x, int y, int mask, int count)(Code)(Java Doc)
public void close(Window w)(Code)(Java Doc)
public void deiconify(Frame frame)(Code)(Java Doc)
public void delay(int ms)(Code)(Java Doc)
protected static String descriptiveClassName(Class cls)(Code)(Java Doc)
public void drag(Component src, int sx, int sy)(Code)(Java Doc)
public void drag(Component src, int sx, int sy, int buttons)(Code)(Java Doc)
public void dragOver(Component dst, int x, int y)(Code)(Java Doc)
public void drop(Component target, int x, int y)(Code)(Java Doc)
public Component findFocusOwner()(Code)(Java Doc)
protected void fireAccessibleAction(Component context, AccessibleAction action, String name)(Code)(Java Doc)
public void focus(Component comp)(Code)(Java Doc)
public void focus(Component comp, boolean wait)(Code)(Java Doc)
public static int getAutoDelay()(Code)(Java Doc)
public static String getBorderTitle(Component c)(Code)(Java Doc)
public static Class getCanonicalClass(Class refClass)(Code)(Java Doc)
protected Point getCloseLocation(Container c)(Code)(Java Doc)
public static String getDescriptiveName(Component c)(Code)(Java Doc)
public static String getEventID(AWTEvent event)(Code)(Java Doc)
public static int getEventID(Class cls, String id)(Code)(Java Doc)
public static int getEventMode()(Code)(Java Doc)
public static String getEventModeDescription()(Code)(Java Doc)
public static int getEventPostDelay()(Code)(Java Doc)
protected EventQueue getEventQueue(Component c)(Code)(Java Doc)
public static String getIconName(Component c)(Code)(Java Doc)
protected Point getIconifyLocation(Container c)(Code)(Java Doc)
public static int getIndex(Container parent, Component comp)(Code)(Java Doc)
public static String getLabel(Component c)(Code)(Java Doc)
protected Point getMaximizeLocation(Container c)(Code)(Java Doc)
protected Point getMoveLocation(Container c)(Code)(Java Doc)
public static String getName(Component c)(Code)(Java Doc)
public static int getPreferredRobotAutoDelay()(Code)(Java Doc)
protected Point getResizeLocation(Container c)(Code)(Java Doc)
public static java.awt.Robot getRobot()(Code)(Java Doc)
public static InputState getState()(Code)(Java Doc)
public static String getText(Component c)(Code)(Java Doc)
public static String getTitle(Component c)(Code)(Java Doc)
public void iconify(Frame frame)(Code)(Java Doc)
public void invokeAction(Runnable action)(Code)(Java Doc)
public void invokeAction(Component c, Runnable action)(Code)(Java Doc)
public void invokeAndWait(Component c, Runnable action)(Code)(Java Doc)
public void invokeAndWait(Runnable action)(Code)(Java Doc)
public void invokeLater(Component context, Runnable action)(Code)(Java Doc)
public void invokeLater(Runnable action)(Code)(Java Doc)
protected boolean isReadyForInput(Component c)(Code)(Java Doc)
protected void jitter(Component comp, int x, int y)(Code)(Java Doc)
protected void jitter(int x, int y)(Code)(Java Doc)
public void key(int keycode)(Code)(Java Doc)
public void key(int keycode, int modifiers)(Code)(Java Doc)
public void keyPress(int keycode)(Code)(Java Doc)
public void keyRelease(int keycode)(Code)(Java Doc)
public void keyString(String str)(Code)(Java Doc)
public void keyStroke(char ch)(Code)(Java Doc)
public void maximize(Frame frame)(Code)(Java Doc)
public void mouseMove(Component comp)(Code)(Java Doc)
public void mouseMove(Component comp, int x, int y)(Code)(Java Doc)
public void mousePress(int buttons)(Code)(Java Doc)
public void mousePress(Component comp)(Code)(Java Doc)
public void mousePress(Component comp, int mask)(Code)(Java Doc)
public void mousePress(Component comp, int x, int y)(Code)(Java Doc)
public void mousePress(Component comp, int x, int y, int mask)(Code)(Java Doc)
public void mouseRelease()(Code)(Java Doc)
public void mouseRelease(int buttons)(Code)(Java Doc)
public void move(Container comp, int newx, int newy)(Code)(Java Doc)
public void moveBy(Container comp, int dx, int dy)(Code)(Java Doc)
public void normalize(Frame frame)(Code)(Java Doc)
protected void postEvent(Component comp, AWTEvent ev)(Code)(Java Doc)
protected boolean postInvocationEvent(EventQueue eq, Toolkit toolkit, long timeout)(Code)(Java Doc)
protected boolean queueBlocked()(Code)(Java Doc)
public void reset()(Code)(Java Doc)
public void resize(Container comp, int width, int height)(Code)(Java Doc)
public void resizeBy(Container comp, int dx, int dy)(Code)(Java Doc)
public Color sample(int x, int y)(Code)(Java Doc)
public Color sample(Component c, int x, int y)(Code)(Java Doc)
public Color sample(Component c, ComponentLocation loc)(Code)(Java Doc)
public void selectAWTMenuItem(Frame frame, String path)(Code)(Java Doc)
public void selectAWTMenuItem(MenuComponent item)(Code)(Java Doc)
public void selectAWTMenuItemByLabel(Frame frame, String path)(Code)(Java Doc)
public void selectAWTPopupMenuItem(Component invoker, String path)(Code)(Java Doc)
public void selectAWTPopupMenuItem(MenuComponent item)(Code)(Java Doc)
public void selectAWTPopupMenuItemByLabel(Component invoker, String path)(Code)(Java Doc)
public void selectMenuItem(Component sameWindow, String path)(Code)(Java Doc)
public void selectMenuItem(Component item)(Code)(Java Doc)
public void selectPopupMenuItem(Component invoker, ComponentLocation loc, String path)(Code)(Java Doc)
public void sendEvent(AWTEvent event)(Code)(Java Doc)
public static void setAutoDelay(int ms)(Code)(Java Doc)
public static void setEventMode(int mode)(Code)(Java Doc)
public static void setEventPostDelay(int delay)(Code)(Java Doc)
public void setModifiers(int modifiers, boolean press)(Code)(Java Doc)
public Component showPopupMenu(Component invoker)(Code)(Java Doc)
public Component showPopupMenu(Component invoker, int x, int y)(Code)(Java Doc)
public static String simpleClassName(Class cls)(Code)(Java Doc)
public void sleep()(Code)(Java Doc)
public static String toHierarchyPath(Component c)(Code)(Java Doc)
public static String toString(Component comp)(Code)(Java Doc)
public static String toString(Object obj)(Code)(Java Doc)
public static String toString(AWTEvent event)(Code)(Java Doc)
final protected static boolean useScreenMenuBar()(Code)(Java Doc)
protected boolean userMovable(Component comp)(Code)(Java Doc)
protected boolean userResizable(Component comp)(Code)(Java Doc)
public void wait(Condition condition)(Code)(Java Doc)
public void wait(Condition condition, long timeout)(Code)(Java Doc)
public void wait(Condition condition, long timeout, int interval)(Code)(Java Doc)
public void waitForIdle()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.