home
products
education
support
partners
company

introduction

get started

articles

manual

tutorials

reference docs

case studies

knowledge base

goodies

screenshots

demos

echoes

Carousel zone


SourceForge.net Logo

home

forums

downloads

bugs

mailing list
XUI Zone - manual

number of ratings 0
average rating 0.00

31 Compile, build and test

Java applications must be compiled prior to executing and Carousel applications are no exception to this rule. Carousel uses Java code for response methods of all sorts so almost all Carousel applications will require some compilation. Fortunately this is rarely a complicated process.

Testing is an important consideration for any application, compiled or not and Carousel includes easy to use tools to assist in testing.

Debugging

XUI 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

Code Sample 31-1 - Logging 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 XUI 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 XUI 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.

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 XUI 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 XUI 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 XUI platform to the project to allow you step into the XUI 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 XPage) 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

Carousel libraries can be used with commercial IDEs such as JBuilder. Configuring JBuilder for use with Carousel is a simple process.

Under the project properties add a new library entry for Carousel and point it at the Carousel 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 Carousel 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.

Carousel 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.

comments


If you were logged in you could rate this article or add a comment.