Avignon Developer Cookbook

Setting Up

Required Components

The avignon.properties File

Unimplemented Features

If your customer wishes to use the database manipulation tags, you'll need to implement three methods in the com.nolacom.testing.avignon.handlers.database.DatabaseConnection class.

Running Tests

The class com.nolacom.testing.avignon.ScriptedTests is a standard JUnit TestCase that can be run on its own or added to a TestSuite.

Writing Tag Handlers

Avignon tag handlers must be named the same as the tag they implement with the word "Handler" suffixed to it. They must implement the AvignonTagHandler interface and have access to the AvignonTestState information. They are essentially event handlers that get a "start" event when the tag is first encountered in the script and an "end" event when the tag is closed in the script. They must be placed in one of the classpathes specified by the HandlerPath property.

The AvignonTagHandler Interface

All Avignon tag handlers must implement this interface. It defines the events that can occur for a tag. The start event gets two parameters, the application state (as an instance of an AvignonTestState) and any attributes that are specified with the tag. The end event gets only the application state.

The AvignonTestState Class

Contains information about the current state of the application being tested, the stack of tags that surround the tag being executed and any error information generated by the tests. The following methods are of interest when writing handlers:

Error Handling

HTML Application Control

Java Application Control

Test Tag Browsing

Helper Classes

There are a couple of classes that help with testing Java applications: