About Basic-testcases

It is recommended to read chapter 11 OpenOffice.org Basic and Dialogs in the Developer's Guide before going further.

As stated on the Automated product source code QA page, the Basic tests are executed using the Runner.

An additional parameter is needed to indicate that a Basic test has to be executed:

    -TestBase basic_fat
or short on commandline
    -tb basic_fat

See the General User Guide for a more detailed parameter list.

The interaction between Java and Basic is performed using the so-called Basic Bridge that consist of two parts:

  1. Some Java classes on the Runner side.
  2. The BasicBridge.sxw document with Basic scripts on the Office side.

These two parts can communicate using a simple protocol: It is possible to send commands from Java to Basic and to get results back from Basic to Java.

The communication between Runner and Basic tests is shown here.

To perform Basic tests two classes are used: BasicTestCase, an extension of TestCase, and BasicIfcTest. Both take the part of the TestCase and the _XInterfaceTest implementations used in the Java testcases. (see About Java-testcases).

For the communication between Java and Basic, the BasicHandler is used. BasicHandler has its own factory called BasicHandlerProvider, which inserts it into the MultiServiceFactory of the Office. The Basic scripts in BasicBridge.sxw can create an instance from the MultiServiceFactory directly and call methods there, thus enabling the information flow from Basic to Java.

To provide passing of information in the other direction, Basic listeners are used. BasicHandler implements the XContainer UNO interface. This allows the registering of a listener, which enables Java to call functions for it.
One thing that is left is establishing the initial connection between Java and Basic (the instance of BasicHandler should be obtained in the BasicBridge.sxw and a listener should be registered). For this, BasicBridge.sxw has an OnLoad() event that starts execution of an initialization function directly after loading.

Overview picture, showing the communication between Java and Basic.


Further documentation

Name

Description

A deeper look at the Java<->Basic Communication Protocol

The communication between Java and Basic needs a special interaction handler.

Test Structure

The syntax for Basic tests.


Last modified: $Date: 2004/03/10 15:58:39 $