The lisaextensions file is where you define the extension points for DevTest.
One or more custom extensions (filters, assertions, test steps, and reports, for example) are declared in a file whose extension is .lisaextensions. The name must be unique relative to any other lisaextensions files in the same environment. For example, there could be two lisaextensions files with the names library-A.lisaextensions and library-B.lisaextensions.
The lisaextensions file must be included in a JAR with the classes that do the custom extension implementation. The JAR must be placed in the DevTest classpath. At the time of startup, DevTest looks for all files with the extension .lisaextensions and tries to read the custom extension points from them.
Note: Using the typemap.properties file to define extensions is supported only for backward compatibility.
All custom extensions in must provide a controller, viewer (frequently called an editor), and an implementation. These are often three different classes. Often, DevTest provides defaults for the controller and the viewer that you can use to avoid having to write your own. You can create custom versions if these defaults are not suitable for your needs.
Use of the lisaextensions file
The custom element is registered in the lisaextensions file. This subsection shows how that is accomplished. For DevTest to connect a given implementation to its authoring-time controller and editor, the lisaextensions file is used.
Implementation Objects
Here is an example of the portion of the contents of a lisaextensions file for custom assertions:
asserts=com.mycompany.lisa.AssertFileStartsWith
The class name on the right side of the equal sign represents the location of the classes that implement the appropriate node logic. If more than one assertion is defined, all corresponding classes are mentioned in the same line, separated by commas, as in:
asserts=com.mycompany.lisa.AssertFileStartsWith,com.mycompany.lisa.AnotherAssert
Controller and Editor Objects
DevTest performs a lookup on each element that is declared as an implementation object to get the controller and the editor to associate with that implementation. For example, the assertion in the previous example has the following extra entry in the lisaextensions file:
com.mycompany.lisa.AssertFileStartsWith=com.itko.lisa.editor.DefaultAssertController,com.itko.lisa.editor.DefaultAssertEditor
The format of this properties file entry is
implementation_class_name=controller_class_name,editor_class_name
In this example, the default controller and editor are used. The defaults are adequate for most cases. However, you can encounter situations in which custom controllers or, more frequently, custom editors must be provided. A lisaextensions file is the place to declare the classes corresponding to them.
Copyright © 2014 CA Technologies.
All rights reserved.
|
|