You are hereAria User Guide / Section III: In Depth / Compilation, Build and Test
Compilation, Build and Test
Compile, build and test
Java applications must be compiled prior to executing and Aria applications are no exception to this rule. Aria uses Java code for response methods of all sorts so almost all Aria applications will require some compilation. Fortunately this is rarely a complicated process.
Testing is an important consideration for any application, compiled or not and Aria includes easy to use tools to assist in testing.
Debugging
Aria is delivered in two builds, one with debugging information and tracing switched on and the other with debugging switched off.
In the debug version, the logging level can be configured via the LogLevel parameter. The console trace provides much useful information about the loading of resources and access to the data model.
The log level can be set to several levels
|
SILENT = -1 |
No logging is used |
|
NORMAL = 0 |
Little or no logging is used. Errors are echoed to the console |
|
DEBUG = 1 |
Warnings and errors are logged to the console |
|
VERBOSE = 2 |
Extensive error, warning and activity logging |
|
PARANOID = 3 |
Everything possible is logged |
in silent mode almost nothing is logged to the console whereas in paranoid mode everything possible is logged.
When building an application it is normally best to run with a debug version of Aria as it will give most information about possible problems and errors. When an application is run in debug mode additional checks are made along with additional diagnostic messages. When an application is shutdown the Aria framework will then output a summary of the logging information to the console. You should check this information for the presence of any errors or warnings. If there are errors you can then review the console output for more detailed information.
The logging some messages can also be suppressed by adding a
DebugZones.properties
file to the project. The file specifies the named zones where logging is to be enabled or disabled, in which case the messages and warnings associated with the zone are not output. Turning off some logging can be useful when alot of data is output, as is the case when a
VERBOSE
logging mode is used.
Sample DebugZones.properties file
# Turn debug zones on/off at design time TRANSLATION=off RESOURCES=off
Beyond logging
Sometimes logging is not enough to debug an application and in such cases an interactive debugger can be of great benefit. Several commercial and open source development environments are available including JBuilder, NetBeans and Eclipse. In addition we provide an integrated debugger plugin based on Netbeans.
When using any of these debuggers we recommend downloading the Aria source code.
Debugging with NetBeans
NetBeans is a powerful development platform and features a rich debugging facility. Invoking the NetBeans debugger is simply a matter of right clicking on the Aria project of interest in the
Projects
window and choosing the
Debug
option. If your project is the default project you can just click on the debug button on the toolbar or choose the
Debug Main Project
option from the
Run
menu
You may also want to add the source code for the Aria platform to the project to allow you step into the Aria source code. Sometimes this can be useful if you are having problems with event handling code or in situations where the information output to the console is not enough for you to discern the immediate cause of a problem.
Once NetBeans starts debugging the application you get a lot of useful information about the framework. Note in the following example when NetBeans stops at a breakpoint how the window in the bottom right contains much information about inherited (from Page) variables:
The NetBeans environment includes on-line help regarding debugging and using the built-in debugger, please refer to this documentation for further information and instruction on debugging your applications.
Using JBuilder
Aria libraries can be used with commercial IDEs such as JBuilder. Configuring JBuilder for use with Aria is a simple process.
Under the project properties add a new library entry for Aria and point it at the Aria class files and resources.
Then add this library to the list of required libraries in the project. Once the new library has been added to the project choose edit and set the source file path.
Finally setup the runtime configuration in the Project Properties Run tab.
Then you are ready to debug the project using JBuilder. From the Run menu you can set the configuration or you can choose the specific configuration when starting the debug session via the toolbar.
Automating testing
TestPilot is a module included in Aria to allow recording of applet/application sessions. These sessions can then be played back to reproduce the test. The tests can be scripted so that input values can be modified and configured as repeated tests.
Aria applications can also be driven from an OpenOffice or Excel spreadsheet where input variables are loaded from a set of workbook sheets and the output saved (along with the inputs) to another workbook.