Jemmy Module
Overview
Jemmy is a Java UI testing library.
Tests are java programs.
Jemmy represents the most natural way to test Java UI - perform the testing right from the Java code.
Jemmy is a Java library which provides clear and straightforward API to access Java UI.
Tests are then just java programs, which use the API. Having the tests in Java allows
to use all the flexibility of high level language to capture test logic and
also do any other operations needed to be done from test. Some info could be found here.
Swing and AWT support.
Jemmy itself provides all the API necessary to write tests in terms of Java UI components
(Swing and AWT). All the Java UI components are covered to the extent it makes sense for
UI testing.
Stability.
Jemmy itself performs a lot of synchronizations with event thread (such as making sure that UI events
reached component) and component's state (such as that typed text has actually accepted by text component)
before proceeding with next test action.
On top of that some public API is available to test developer to ensure more synchronization,
if necessary.
Check EventQueue usage for more info.
Extendability.
Jemmy, as it is a Java library, is easily extendable to support any application specific component.
Such components typically exist in any
real world applications: different kinds of compound components built from Java UI components,
some components created from scratch, whole dialogs or frames.
Helper API.
Besides API for reproducing user actions, Jemmy provides some API for other UI testing
activities: UI queue synchronizations, failure analysis, image comparison, creation of live
presentations.
Reproduction modes.
Jemmy test could be performed in different reproduction modes. The most straightforward one uses
java.awt.Robot class, which is designed specifically for purpose of Java UI testing. Other modes
are supported because they give better control over the event queue, and so, better test stability.
"Make common things easy, rare things possible"
This is the main design principle of Jemmy. Everything which is related to actual UI action reproducing is
really simple (check the tutorial and samples).
There are a lot of other API related to how exactly the reproducion performed. This part is fairly complicated:
Operators Environment, for example.
Jemmy is not a ...
- test harness
Meaning it is not a tool for test execution. Any harness which is able to execute tests written
in Java (such as JUnit, for example) could be used to execute tests.
- record-replay tool
nor it will ever be. There could be recording tools which generate tests which use jemmy. It is
not a priority (see this: "Test recording or test coding").
Note: Jemmy really is a NetBeansTM independent
module, you can use it separately as well as together with the NetBeans
IDE. There is a library - Jellytools
which is built on top of Jemmy and provides support for NetBeans specific
GUI components.
How to get it?
You can
download one of the Jemmy builds. Builds are distributed in
two forms: jar archives contain classes only, zip archives contain
everything (classes, sources, generated javadoc). Or you can
build it.
How to use it?
Check out the documentation page.