The first step to implementing your accessibility plug-in is to create Identifiers for each type of GEF component that you wish to make accessible for Jubula tests. An Identifier is a Java class that implements org.eclipse.jubula.rc.rcp.gef.identifier.IEditPartIdentifier and provides Jubula with additional and/or more precise information about a specific org.eclipse.gef.EditPart. The granularity of your Identifier classes will depend on the class hierarchy of the EditParts in the AUT . For example, if many of the EditParts share a common superclass, then you can write a single Identifier for that superclass that will be able to provide accessibility for all EditParts that inherit from that superclass. See 4.3.3.3 for a sample implementation.
The next step is to create an Adapter Factory. This extension will provide Jubula with information regarding which Identifier to use for each Edit Part.
- Open the plugin.xml file for your accessibility plug-in and select the 'Extension' tab (4.1).
Figure 4.1: Plug-in Editor with Extensions tab selected
|
- Add an instance of the org.eclipse.core.runtime.adapters extension.
- Add a 'factory' to the new extension for each type of GEF component for which you wish to provide accessibility. Each factory must provide adapters from the GEF component that implements org.eclipse.gef.EditPart to org.eclipse.jubula.rc.rcp.gef.identifier.IEditPartIdentifier (4.2).
Figure 4.2: Plug-in Editor with defined Adapter Factory
|
- Once you have defined your Adapter Factory, you will need to implement it. Your Adapter Factory, which must implement org.eclipse.core.runtime.IAdapaterFactory, provides appropriate instances of your created Identifiers for a given Edit Part. See 4.3.3.3 for a sample implementation.
- Once you have created your Identifiers and Adapter Factories, you can export your plug-in and copy it to the 'plugins' directory of your AUT (4.3).
![\includegraphics[height=2cm]{lightbulb}](img2.jpg) |
When starting your AUT after adding or replacing your accessibility plug-in, it is recommended that the AUT be started with the -clean parameter. |
Figure 4.3: Exporting the Project to a Plug-in
|
Copyright BREDEX GmbH 2012. Made available under the Eclipse Public License v1.0.